/* ===========================================================================
   Rink Rats — styles for game.html only. Loaded after style.css so it can
   lean on the site's own variables (--red, --gold, --dark, --border …).
   =========================================================================== */

.game-shell {
  scroll-margin-top: 84px;
  max-width: 1040px;
  margin: 0 auto;
  background: var(--dark);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

/* ----------------------------------------------------------- scoreboard --- */
.scoreboard {
  display: flex;
  align-items: stretch;
  background: #121214;
  border-bottom: 2px solid var(--gold);
  font-family: 'Barlow Condensed', sans-serif;
  color: #fff;
}
.sb-team {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  min-width: 0;
}
.sb-home { justify-content: flex-start; }
.sb-away { justify-content: flex-end; }
.sb-abbr {
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.sb-home .sb-abbr { color: var(--red2); }
.sb-away .sb-abbr { color: #9fb0c8; }
.sb-score {
  font-weight: 900;
  font-size: 2.1rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sb-mid {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 20px;
  border-left: 1px solid #2a2a2e;
  border-right: 1px solid #2a2a2e;
  background: #0d0d0f;
}
.sb-clock {
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--gold2);
  font-variant-numeric: tabular-nums;
}
.sb-period {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #8a8a94;
  margin-top: 3px;
}

/* ----------------------------------------------------------------- rink --- */
.rink-wrap { position: relative; background: #0e0e10; line-height: 0; }
#rinkCanvas {
  display: block;
  margin: 0 auto;
  width: 100%;
  height: auto;
  touch-action: none;          /* the canvas owns its gestures */
  cursor: default;
}

.game-banner {
  position: absolute;
  left: 50%;
  top: 14px;
  transform: translate(-50%, -14px);
  background: rgba(14, 14, 16, 0.9);
  border: 1px solid var(--gold);
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 7px 18px;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  line-height: 1.2;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-banner.show { opacity: 1; transform: translate(-50%, 0); }

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 12, 0.76);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 16px;
}
.game-overlay.show { opacity: 1; pointer-events: auto; }
.go-card { text-align: center; line-height: 1.5; max-width: 420px; }
.go-card h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 900;
  font-size: clamp(1.4rem, 4.5vw, 2.1rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  margin: 0 0 6px;
}
.go-card p {
  color: #c6c6cf;
  font-size: 0.9rem;
  margin: 0 0 16px;
  line-height: 1.6;
}

/* --------------------------------------------------------------- status --- */
.game-status {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 9px 16px;
  background: #121214;
  border-top: 1px solid #2a2a2e;
  font-family: 'Barlow', sans-serif;
  font-size: 0.78rem;
}
.gs-label { color: #71717c; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.66rem; font-weight: 700; }
.gs-you { color: var(--gold2); font-weight: 700; letter-spacing: 0.03em; }
.gs-note { color: #71717c; margin-left: auto; display: none; }
.game-status { scroll-margin-top: 84px; }

/* ------------------------------------------------------- touch controls --- */
.touch-pad {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px 18px;
  background: #0d0d0f;
  border-top: 1px solid #2a2a2e;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.stick-base {
  position: relative;
  width: 108px;
  height: 108px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, #26262c 0%, #17171b 70%);
  border: 2px solid #35353d;
  touch-action: none;
}
.stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: linear-gradient(180deg, #d93333, #a51f1f);
  border: 2px solid #e8e2d5;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.pad-buttons { display: flex; gap: 12px; flex: 0 0 auto; }
.pad-btn {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 2px solid #3a3a44;
  background: #1d1d22;
  color: #fff;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  touch-action: none;
  transition: transform 0.06s ease, background 0.06s ease;
}
.pad-shoot { background: #a51f1f; border-color: #d93333; }
.pad-pass { background: #1f4a8f; border-color: #3a74c8; }
.pad-btn.held { transform: scale(0.93); filter: brightness(1.25); }

/* --------------------------------------------------------------- how to --- */
.howto-grid {
  max-width: 1000px;
  margin: 26px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.howto-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: 4px;
  padding: 18px 20px;
}
.howto-card:nth-child(2) { border-top-color: var(--gold); }
.howto-card:nth-child(3) { border-top-color: var(--dark); }
.howto-card h4 {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
  color: var(--dark);
}
.howto-card ul { list-style: none; margin: 0; padding: 0; }
.howto-card li {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.6;
  padding: 5px 0 5px 14px;
  position: relative;
}
.howto-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}
.howto-card li b { color: var(--text); font-weight: 700; }

.game-fineprint {
  max-width: 1000px;
  margin: 22px auto 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
}
.game-fineprint a { color: var(--red); font-weight: 600; }

/* ------------------------------------------------------------ responsive --- */
@media (hover: none) and (pointer: coarse) {
  .touch-pad { display: flex; }
  .gs-note { display: inline; }
}
@media (max-width: 900px) {
  .game-shell { border-radius: 4px; }
}
@media (max-width: 560px) {
  .sb-score { font-size: 1.6rem; }
  .sb-clock { font-size: 1.2rem; }
  .sb-team { padding: 8px 12px; gap: 8px; }
  .sb-mid { padding: 6px 13px; }
  .sb-abbr { font-size: 0.8rem; letter-spacing: 0.1em; }
  .touch-pad { padding: 12px 12px 16px; gap: 10px; }
  .stick-base { width: 96px; height: 96px; }
  .pad-btn { width: 68px; height: 68px; font-size: 0.74rem; }
  .pad-buttons { gap: 9px; }
  .game-status { padding: 7px 12px; }
  .gs-note { margin-left: 0; flex-basis: 100%; font-size: 0.7rem; }
}

/* Landscape on a short screen: keep the whole thing on one screen. */
@media (max-height: 520px) and (orientation: landscape) {
  .page-hero, .howto-grid, .game-fineprint { display: none; }
  /* Give the rink the header's band back - there is no room to spare here. */
  header { position: static; }
  .game-status { display: none; }
  /* The sticky-header offset is dead weight once the header scrolls away. */
  .game-shell { scroll-margin-top: 6px; position: relative; }

  /* There is no vertical room to stack anything here, so the scoreboard and
     the controls float over the ice and the rink gets the whole screen. */
  .scoreboard {
    position: absolute;
    z-index: 3;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    background: rgba(10, 10, 12, 0.72);
    border-bottom: 1px solid rgba(196, 143, 26, 0.7);
    border-radius: 0 0 4px 4px;
    pointer-events: none;
  }
  .sb-team { padding: 4px 12px; gap: 7px; }
  .sb-mid { padding: 3px 12px; background: transparent; }
  .sb-score { font-size: 1.25rem; }
  .sb-clock { font-size: 1rem; }
  .sb-period { font-size: 0.6rem; margin-top: 1px; }
  .sb-abbr { font-size: 0.72rem; }

  .touch-pad {
    position: absolute;
    z-index: 3;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 14px 12px;
    background: none;
    border-top: 0;
    align-items: flex-end;
    pointer-events: none;
  }
  .stick-base, .pad-buttons { pointer-events: auto; }
  .stick-base { width: 84px; height: 84px; opacity: 0.86; }
  .stick-knob { width: 38px; height: 38px; margin: -19px 0 0 -19px; }
  .pad-btn { width: 60px; height: 60px; font-size: 0.7rem; opacity: 0.9; }
}

@media (prefers-reduced-motion: reduce) {
  .game-banner, .game-overlay, .pad-btn { transition: none; }
}

/* shots-on-goal readout in the status strip */
.gs-sog { color: #9a9aa6; letter-spacing: 0.04em; }
