/* ============================================================
   BEAR FISH MEDIA — game page only (/bear-fishing-game)
   Loads after main.css and reuses its tokens.
   ============================================================ */

/* ---------- game hero ---------- */
.game-hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 46px 32px 8px;
  text-align: center;
}
.game-hero .kicker { justify-content: center; }
.game-hero h1 {
  font-family: var(--display);
  font-size: clamp(38px, 6.4vw, 74px);
  line-height: 1.0;
  letter-spacing: 0.004em;
  text-transform: uppercase;
  margin: 14px 0 12px;
}
.game-hero p {
  color: var(--text-2);
  font-size: 17px;
  max-width: 620px;
  margin: 0 auto;
}

/* ---------- stage ---------- */
.game-stage {
  max-width: 1020px;
  margin: 26px auto 0;
  padding: 0 32px;
}
.game-frame {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 1px 0 rgba(20, 31, 39, 0.25), 0 18px 44px rgba(20, 31, 39, 0.16);
}

/* HUD */
.game-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--ink);
  color: #fff;
  border-bottom: 3px solid var(--yellow);
}
.hud-cell {
  padding: 11px 14px;
  text-align: center;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.hud-cell:first-child { border-left: none; }
.hud-cell span {
  display: block;
  font-family: var(--ui);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8A939C;
}
.hud-cell strong {
  display: block;
  font-family: var(--display);
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: 0.01em;
}
.hud-cell.is-score strong { color: var(--yellow); }
.hud-cell.is-time strong { font-variant-numeric: tabular-nums; }
.hud-cell.is-left strong { font-variant-numeric: tabular-nums; }

.game-view { position: relative; }

#game {
  display: block;
  width: 100%;
  aspect-ratio: 960 / 620;
  background: #fff;
  touch-action: none;
  cursor: crosshair;
}
#game:focus-visible { outline: 3px solid var(--yellow); outline-offset: -3px; }

/* ---------- overlay screens ---------- */
.game-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center;
  gap: 14px;
  padding: 26px;
  text-align: center;
  background: rgba(20, 31, 39, 0.82);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  color: #fff;
  overflow: auto;
  z-index: 3;
}
.game-screen[hidden] { display: none; }
.game-screen h2 {
  font-family: var(--display);
  font-size: clamp(28px, 4.6vw, 46px);
  line-height: 1;
  text-transform: uppercase;
}
.game-screen p { color: #C7D0D8; font-size: 15px; max-width: 460px; }
.game-screen .btn { margin-top: 4px; }
.screen-hint {
  font-family: var(--ui);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8A939C;
}

.game-screen .result-rank {
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--yellow);
}
.game-screen .result-score {
  font-family: var(--display);
  font-size: 60px;
  line-height: 1;
}
.game-screen .result-score small {
  display: block;
  font-family: var(--ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: #8A939C;
}
.result-tally {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 2px 26px;
  margin: 2px 0 4px;
  width: 100%;
  max-width: 430px;
}
.tally-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13.5px;
}
.tally-row dt { color: #A8B2BD; }
.tally-row dd { font-family: var(--ui); font-weight: 600; }
.game-screen .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.game-screen .btn-ghost:hover { color: var(--ink); border-color: var(--yellow); }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- the win ending ---------- */
.game-screen .win-offer {
  font-family: var(--display);
  font-size: clamp(17px, 2.4vw, 23px);
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  max-width: 26ch;
  margin: 2px 0 0;
}
.game-screen .win-offer strong { font-weight: inherit; color: var(--yellow); }

/* ---------- controls + legend ---------- */
.game-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 16px 0 0;
}
.game-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13.5px;
  color: var(--text-2);
}
.game-keys kbd {
  font-family: var(--ui);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  background: var(--gray-1);
  border: 1px solid var(--gray-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 2px 7px;
  margin-right: 5px;
}

.legend {
  max-width: 1020px;
  margin: 30px auto 0;
  padding: 0 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  list-style: none;
}
.legend li {
  background: var(--gray-1);
  border: 1px solid var(--gray-2);
  border-radius: 12px;
  padding: 16px 16px 14px;
}
.legend .swatch {
  width: 34px;
  height: 14px;
  border-radius: 8px 3px 3px 8px;
  margin-bottom: 10px;
}
.legend h3 {
  font-family: var(--ui);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.legend .pts {
  font-family: var(--display);
  font-size: 20px;
  display: block;
  margin-bottom: 5px;
}
.legend p { font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.legend .is-bad .pts { color: #B3261E; }

/* ---------- closing pitch ---------- */
.game-pitch {
  max-width: 1020px;
  margin: 54px auto 0;
  padding: 0 32px 78px;
}
.game-pitch-inner {
  background: var(--ink);
  color: #fff;
  border-radius: 16px;
  padding: 44px 40px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 34px;
  align-items: center;
}
.game-pitch h2 {
  font-family: var(--display);
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.02;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.game-pitch p { color: #C7D0D8; font-size: 15.5px; }
.game-pitch .pitch-cta { display: flex; flex-direction: column; gap: 12px; }
.game-pitch .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.28); }
.game-pitch .btn-ghost:hover { color: var(--ink); }
.game-pitch .pitch-note {
  font-family: var(--ui);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6B7683;
  text-align: center;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .legend { grid-template-columns: repeat(2, 1fr); }
  .game-pitch-inner { grid-template-columns: 1fr; padding: 34px 26px; }
}
@media (max-width: 640px) {
  .game-hero { padding: 32px 20px 4px; }
  .game-stage, .legend, .game-pitch { padding-left: 20px; padding-right: 20px; }
  .game-hud { grid-template-columns: repeat(2, 1fr); }
  .hud-cell:nth-child(3) { border-left: none; }
  .hud-cell strong { font-size: 22px; }
  .result-tally { grid-template-columns: 1fr; }
  .game-screen .result-score { font-size: 46px; }
  #game { aspect-ratio: 4 / 5; }
  .game-screen { gap: 10px; padding: 20px 18px; }
  .game-toolbar { justify-content: center; text-align: center; }
  .game-keys { justify-content: center; }
}

/* The win card is the tallest overlay, so it keeps the score breakdown only on a
   stage deep enough to show it without pushing the buttons out of reach. */
@media (max-width: 900px) {
  #win-tally { display: none; }
}

/* A short stage cannot hold a full result card. These two width bands are where the
   canvas aspect ratio leaves under ~520px of height, so the overlays drop the score
   breakdown and tighten up rather than push the buttons past the bottom edge. */
@media (max-width: 480px), (min-width: 641px) and (max-width: 880px) {
  .game-screen { gap: 8px; padding: 16px; }
  .game-screen .result-tally { display: none; }
  .game-screen #result-note { display: none; }
  .game-screen .result-rank { font-size: clamp(24px, 4.6vw, 36px); }
  .game-screen .result-score { font-size: 36px; }
  .game-screen .win-offer { font-size: 16px; }
}

/* Small phones: shrink the card instead of losing the buttons. The win card also
   drops its personal-best line, which the results card still carries. */
@media (max-width: 360px) {
  .game-screen { gap: 6px; padding: 12px; }
  .game-screen .result-rank { font-size: 26px; }
  .game-screen .result-score { font-size: 30px; }
  .game-screen .win-offer { font-size: 15px; }
  .game-screen .screen-hint { font-size: 11px; }
  .game-screen .result-actions .btn { padding: 11px 16px; font-size: 12px; }
  .win-best-line { display: none; }
}

/* Narrower than any current phone, but the card still has to hold together. */
@media (max-width: 320px) {
  .game-screen { gap: 4px; padding: 10px; }
  .game-screen .result-rank { font-size: 23px; }
  .game-screen .result-score { font-size: 26px; }
}
