@import url("./interface.css");

body {
  margin: 0;
  overflow: hidden;
  background: var(--night);
  color: var(--white);
  font: 500 14px/1.4 var(--body-font);
}

#pitch, #pitch canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.shade {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, #091511a3, transparent 23%, transparent 74%, #09151196);
}

.top {
  position: fixed;
  z-index: 2;
  inset: 1.25rem 1.5rem auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  pointer-events: none;
}

.brand { justify-self: start; align-self: center; text-shadow: 0 2px 5px #07100c; }

.live,
#replay-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .65rem;
  border: 1px solid var(--line);
  border-radius: .3rem;
  background: #101d17ed;
  color: var(--white);
  font-size: .73rem;
  font-weight: 750;
  letter-spacing: .07em;
}

.live { justify-self: end; align-self: center; }
.live i {
  width: .4rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--cyan);
}

.board {
  grid-column: 2;
  display: grid;
  grid-template-columns: minmax(5.7rem, 1fr) auto minmax(5.7rem, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: #101d17f5;
  box-shadow: 0 .3rem 1rem #07100c70;
}

.team {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .18rem .7rem .25rem;
  border-top: 3px solid var(--green);
  color: var(--green);
  font-size: .69rem;
  font-weight: 750;
  letter-spacing: .055em;
}
.team:last-child { border-color: var(--orange); color: var(--orange); }
.team b { color: var(--white); font: 700 1.9rem/1.3 var(--display-font); }

#timer {
  display: grid;
  place-items: center;
  min-width: 4.15rem;
  padding: 0 .35rem;
  border-inline: 1px solid var(--line);
  background: #23352a;
  color: var(--white);
  font: 700 1.4rem/1 var(--display-font);
  font-variant-numeric: tabular-nums;
}

#possession {
  grid-column: 2;
  justify-self: center;
  width: .7rem;
  height: .7rem;
  margin-top: .55rem;
  border: 1px solid var(--night);
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px #101b19d9;
}

#possession[data-possession="held"] { background: var(--green); }

#restart-status {
  grid-column: 2;
  justify-self: center;
  width: max-content;
  max-width: min(32rem, calc(100vw - 1.5rem));
  margin-top: .5rem;
  padding: .35rem .7rem;
  border: 1px solid var(--line);
  border-radius: .3rem;
  background: #101d17f5;
  color: var(--accent);
  font-weight: 750;
  text-align: center;
}

#dot {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 2px #10241d80;
  pointer-events: none;
}

#charge {
  position: fixed;
  top: calc(50% + 25px);
  left: 50%;
  width: 10rem;
  transform: translateX(-50%);
  color: var(--white);
  font-size: .7rem;
  font-weight: 750;
  letter-spacing: .08em;
  text-align: center;
  text-shadow: 0 1px 4px #08120d;
  pointer-events: none;
}

#charge div, .stamina-track {
  height: .45rem;
  margin-top: .3rem;
  overflow: hidden;
  border: 1px solid #698274;
  border-radius: .15rem;
  background: #101e17;
}

#power {
  display: block;
  height: 100%;
  transform-origin: left;
  transform: scaleX(0);
  background: var(--accent);
}
#charge.loft #power { background: var(--cyan); }

#stamina-meter {
  position: fixed;
  left: 1.5rem;
  bottom: 1.25rem;
  width: min(11.75rem, 48vw);
  padding: .55rem .65rem;
  border: 1px solid var(--line);
  border-radius: .3rem;
  background: #101d17ed;
  color: var(--white);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .075em;
  pointer-events: none;
}

#stamina-meter > div:first-child { display: flex; justify-content: space-between; }
#stamina-fill { display: block; height: 100%; width: 100%; background: var(--accent); }
#stamina-meter.exhausted { color: var(--orange); }
#stamina-meter.exhausted #stamina-fill { background: var(--orange); }

#receive-pass {
  margin: .4rem 0 0;
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: normal;
}
#receive-pass[data-active="true"] { color: var(--cyan); }

#hint {
  position: fixed;
  right: 1.5rem;
  bottom: 1.25rem;
  padding: .35rem .55rem;
  border-radius: .3rem;
  background: #101d17ed;
  color: var(--white);
  font-size: .73rem;
  pointer-events: none;
}

#replay-label {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  width: max-content;
  transform: translateX(-50%);
  color: var(--cyan);
  pointer-events: none;
}

#banner, #kickoff-countdown {
  position: fixed;
  top: 16%;
  left: 50%;
  padding: .4rem 2rem .65rem;
  transform: translateX(-50%) skewX(-8deg);
  background: var(--accent);
  color: var(--night);
  font: 700 clamp(3.5rem, 10vw, 7.25rem)/1 var(--display-font);
  pointer-events: none;
  animation: goal-enter 320ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes goal-enter {
  from { opacity: 0; transform: translateX(-50%) skewX(-8deg) scale(.8); }
  to { opacity: 1; transform: translateX(-50%) skewX(-8deg) scale(1); }
}

#nameplates {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

#nameplates span {
  position: absolute;
  inset: 0 auto auto 0;
  transform: translate(-50%, -100%);
  padding: .15rem .4rem;
  border-radius: .2rem;
  background: #f5f2e8e8;
  color: #000;
  font: 700 .85rem/1.2 var(--body-font);
  white-space: nowrap;
}

#menu {
  position: fixed;
  z-index: 1;
  inset: 0;
  display: grid;
  justify-items: center;
  align-items: safe center;
  padding: 5.75rem 1rem 1.5rem;
  overflow: auto;
  background: #08130ec9;
}

.card {
  width: min(31rem, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--panel);
  box-shadow: 0 1.5rem 4.5rem #07110db0;
}

.panel-heading {
  position: relative;
  padding: 1.5rem clamp(1rem, 4vw, 2rem) 1.25rem;
  border-bottom: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  background:
    radial-gradient(circle at 87% 50%, transparent 2.6rem, #92bc9d36 2.65rem 2.7rem, transparent 2.74rem),
    linear-gradient(90deg, transparent calc(87% - .5px), #92bc9d36 calc(87% - .5px) calc(87% + .5px), transparent calc(87% + .5px)),
    linear-gradient(110deg, #16251d 29%, #233d2c 100%);
}

.kicker {
  margin: 0 0 .45rem;
  color: var(--cyan);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font: 700 clamp(2.2rem, 6vw, 3.4rem)/1.06 var(--display-font);
  letter-spacing: -.025em;
  text-transform: uppercase;
}

h1 span { color: var(--accent); }

#description {
  margin: .65rem 0 0;
  color: var(--white);
  line-height: 1.45;
}

.panel-body { padding: 1.15rem clamp(1rem, 4vw, 2rem) 1.4rem; }
#play { width: 100%; min-height: 3.2rem; font: 700 1.1rem/1.15 var(--display-font); letter-spacing: .03em; text-transform: uppercase; }
#notice { margin: .8rem 0 0; color: var(--muted); font-size: .8rem; }
#notice:empty { display: none; }

.match-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .6rem;
  margin-top: .7rem;
}

.player-count { margin: 0 0 .75rem; color: var(--cyan); font-weight: 750; font-size: .82rem; }

#sky-vote,
#bot-vote {
  margin-top: .9rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: #101b15;
}

#sky-vote label { display: block; margin-bottom: .45rem; font-weight: 750; }
.sky-vote-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
.sky-vote-controls select {
  width: 100%;
  min-height: 2.75rem;
  padding: .45rem .65rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--raised);
  color: var(--white);
}
.sky-vote-controls button { min-width: 5rem; }

#sky-vote-status, #bot-vote-status { margin: .45rem 0 0; color: var(--muted); font-size: .8rem; }
#sky-vote-status:empty, #bot-vote-status:empty { display: none; }

#menu:has(#contributions:not([hidden])) .card { width: min(65rem, 100%); }
#menu:has(#contributions:not([hidden])) #notice { display: none; }
#contributions { margin-bottom: 1rem; }
#contributions h2 { margin: 0 0 .65rem; font: 700 1.45rem/1.2 var(--display-font); }
.contribution-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 25rem), 1fr));
  gap: .7rem;
}
.contribution-tables > div {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: #111c16;
}
.contribution-tables table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.contribution-tables caption {
  padding: .55rem .7rem;
  border-top: 3px solid currentColor;
  background: var(--raised);
  font: 700 1.15rem/1.2 var(--display-font);
  text-align: left;
}
.contribution-orange caption { color: var(--orange); }
.contribution-green caption { color: var(--green); }
.contribution-tables th, .contribution-tables td {
  padding: .5rem clamp(.3rem, 1vw, .65rem);
  border-top: 1px solid var(--line);
  font-size: .82rem;
  text-align: right;
}
.contribution-tables thead { color: var(--muted); }
.contribution-tables th:first-child { max-width: 12rem; overflow-wrap: anywhere; text-align: left; }

body:has(#menu:not([hidden])) :is(#stamina-meter, #restart-status, #possession, #charge) { visibility: hidden; }
body:has(#queue-player-count:not([hidden])) .board { visibility: hidden; }

@media (max-width: 39rem) {
  .top { inset: .75rem .6rem auto; }
  .brand > span:last-child { display: none; }
  .live { padding: .45rem; }
  .live > span { display: none; }
  .board { grid-template-columns: minmax(4rem, 1fr) auto minmax(4rem, 1fr); }
  .team { padding-inline: .4rem; gap: .35rem; font-size: .62rem; }
  .team b { font-size: 1.55rem; }
  #timer { min-width: 3.4rem; font-size: 1.2rem; }
  #stamina-meter { left: .65rem; bottom: .75rem; }
  #hint { right: .65rem; bottom: .75rem; max-width: 44vw; }
}

@media (prefers-reduced-motion: reduce) {
  #banner, #kickoff-countdown { animation: none; }
}

.performance-hud {
  position: fixed;
  top: 4.8rem;
  left: 1.5rem;
  z-index: 9;
  padding: .4rem .6rem;
  border: 1px solid #ffffff20;
  border-radius: .35rem;
  background: #091b14b8;
  color: #e8f4e9;
  font: 600 .75rem/1.6 var(--body-font);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
@media (max-width: 600px) { .performance-hud { left: .75rem; top: 4.5rem; } }

.tutorial-coach{position:fixed;z-index:10;right:1rem;top:5.5rem;width:min(350px,calc(100vw - 2rem));padding:1.2rem;border:1px solid #617d52;border-top:3px solid #d5fc61;border-radius:.65rem;background:#10251deb;box-shadow:0 12px 40px #0005;color:#edf5ea;pointer-events:none}.tutorial-coach>div{font-size:.7rem;letter-spacing:.12em;color:#d5fc61;font-weight:800}.tutorial-coach h2{font-size:1.6rem;line-height:1.1;margin:.75rem 0}.tutorial-coach p{font-size:.95rem;line-height:1.5}.tutorial-coach small{display:block;color:#abc2b5;font-size:.7rem;line-height:1.7}.tutorial-coach progress{width:100%;height:6px;accent-color:#d5fc61;margin-top:.7rem}.tutorial-coach a{pointer-events:auto;display:inline-block;margin-top:.65rem;color:#d5fc61;font-size:.8rem}.tutorial-coach.lesson-success{border-color:#9ef4bd}.tutorial-finished{top:50%;left:50%;right:auto;transform:translate(-50%,-50%);width:min(460px,calc(100vw - 2rem));pointer-events:auto}.tutorial-finished a{margin-right:.5rem}@media(max-height:560px){.tutorial-coach{top:4rem;padding:.75rem;width:280px}.tutorial-coach h2{font-size:1.2rem}.tutorial-coach p{font-size:.8rem;margin:.5rem 0}}

body.tutorial-complete #menu{display:none!important}.tutorial-finished{z-index:30;box-shadow:0 0 0 100vmax #07110dcc,0 25px 90px #0008;padding:2rem;border-top:4px solid #e3fa64;text-align:center}.tutorial-finished h2{color:#e3fa64;font-size:2rem}.tutorial-finished .ui-button{display:flex;width:100%;min-height:3rem;margin:.75rem 0 0;color:#f4f7ef}.tutorial-finished .ui-button:first-of-type{background:#e3fa64;color:#14211b;border-color:#e3fa64}.lesson-success h2{color:#e3fa64}.lesson-success h2:before{content:'✓ ';}.lesson-success{animation:lesson-pop .3s ease-out}@keyframes lesson-pop{from{transform:translateY(8px);opacity:.6}to{transform:translateY(0);opacity:1}}@media(prefers-reduced-motion:reduce){.lesson-success{animation:none}}

/* Long private-team names must not collide with the logo or match label. */
.board .team { min-width: 0; }
.board .team > span { max-width: clamp(4rem, 8vw, 8rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-height: 560px) {
  #menu { padding-top: 4.75rem; padding-bottom: .75rem; }
  .panel-heading { padding: .85rem 1.2rem; }
  .panel-body { padding: .8rem 1.2rem; }
  #menu h1 { font-size: 2rem; }
  .tutorial-finished { max-height: calc(100svh - 1.5rem); overflow-y: auto; padding: 1.25rem; }
}

#rematch-vote { padding: 14px; margin: 12px 0; border: 1px solid #82e5bc55; border-radius: 12px; background: #142d2b; }
#rematch-vote p { margin: 0 0 12px; color: #e4fff4; }
#rematch-vote button { margin: 4px; padding: 10px 18px; border: 1px solid #82e5bc77; border-radius: 8px; background: #264b40; color: #fff; cursor: pointer; font: inherit; }
#rematch-vote button:first-of-type { background: #a4f5ce; color: #10251e; font-weight: 700; }

#replay-label {
  flex-direction: column;
  gap: .35rem;
  max-width: calc(100vw - 2rem);
  text-align: center;
  padding: .8rem 1.4rem;
}
.replay-scorer, .replay-assist {
  font-family: var(--display-font);
  font-weight: 700;
  line-height: 1.12;
  text-transform: none;
  letter-spacing: .02em;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 8px #07100c;
}
.replay-scorer { font-size: clamp(1.5rem, 4vw, 2.8rem); color: var(--accent); }
.replay-assist { font-size: clamp(1.2rem, 3vw, 2rem); color: var(--white); }
.replay-caption { margin-top: .3rem; font-size: .75rem; }
