/* =============================================================
   ARCADE · game.css
   Shared shell for every game page — minimal layout
   ============================================================= */

.game-page {
  --accent: var(--lime);
  --accent-soft: rgba(201, 255, 61, 0.14);
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* decorative layers kept in markup, removed visually */
.game-bg,
.grain {
  display: none;
}

/* -------------------------------------------------------------
   Header
   ------------------------------------------------------------- */
.game-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem clamp(1.1rem, 4vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 11, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
  transition: color 0.2s var(--ease);
}

.back:hover {
  color: var(--text);
}

.back svg {
  width: 14px;
  height: 14px;
}

.game-nav__title {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}

.game-nav__title strong {
  color: var(--text);
  letter-spacing: 0;
  font-size: 0.82rem;
  text-transform: none;
  font-weight: 500;
}

/* -------------------------------------------------------------
   Layout — single centered column
   ------------------------------------------------------------- */
.game-main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.1rem, 4vw, 2rem)
    clamp(3rem, 7vw, 5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(2rem, 4vw, 3rem);
}

.game-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  order: 1;
}

/* -------------------------------------------------------------
   HUD — plain inline figures
   ------------------------------------------------------------- */
.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: clamp(1rem, 3vw, 2rem);
  width: min(100%, var(--board-w, 100%));
  margin-inline: auto;
}

.hud__item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0;
  border: 0;
  background: none;
  min-width: 0;
}

.hud__k {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
}

.hud__v {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  color: var(--text);
}

.hud__v.is-pop {
  animation: hudPop 0.3s var(--ease-out);
}

@keyframes hudPop {
  0% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-3px);
    color: var(--accent);
  }
  100% {
    transform: translateY(0);
  }
}

/* -------------------------------------------------------------
   Board frame
   ------------------------------------------------------------- */
.board-wrap {
  position: relative;
  width: min(100%, var(--board-w, 100%));
  margin-inline: auto;
  display: grid;
  place-items: center;
}

/* -------------------------------------------------------------
   Overlay (start / pause / end)
   ------------------------------------------------------------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(8, 8, 11, 0.72);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}

.overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.overlay__box {
  width: min(100%, 300px);
  pointer-events: auto;
  text-align: center;
  transform: translateY(8px);
  transition: transform 0.35s var(--ease-out);
}

.overlay.is-open .overlay__box {
  transform: none;
}

.overlay__eyebrow {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.overlay__title {
  margin-top: 0.6rem;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.overlay__desc {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
}

.overlay__score {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.overlay__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.4rem;
}

/* -------------------------------------------------------------
   Side panel — plain sections under the board
   ------------------------------------------------------------- */
.panel {
  order: 2;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 2rem clamp(2rem, 4vw, 3.5rem);
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}

.panel__block {
  border: 0;
  border-radius: 0;
  background: none;
  padding: 0;
}

.panel__title {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
}

.panel__title::before {
  content: none;
}

.panel h3 {
  margin-top: 0.6rem;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text);
}

.panel p {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--muted);
}

.panel ol,
.panel ul {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.panel ol li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
  counter-increment: none;
}

.panel ol li::before {
  content: "—";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--dim);
  font-size: 0.8rem;
}

.panel ul li {
  position: relative;
  padding-left: 0.9rem;
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--muted);
}

.panel ul li::before {
  content: "·";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--dim);
}

.panel b {
  color: var(--text);
  font-weight: 500;
}

.kbd-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.7rem;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 0.35rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: none;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--muted);
}

.panel__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* segmented difficulty / mode switch */
.diff {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.7rem;
}

.diff button {
  flex: 1 1 0;
  padding: 0.4rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: none;
  font-size: 0.72rem;
  color: var(--dim);
  cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease),
    background 0.18s var(--ease);
}

.diff button:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.diff button.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: transparent;
}

/* -------------------------------------------------------------
   Footer
   ------------------------------------------------------------- */
.game-foot {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1.4rem clamp(1.1rem, 4vw, 2rem) 2.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.72rem;
  color: var(--dim);
}

.game-foot a {
  color: var(--dim);
  transition: color 0.2s var(--ease);
}

.game-foot a:hover {
  color: var(--text);
}

/* -------------------------------------------------------------
   Buttons on game pages
   ------------------------------------------------------------- */
.game-page .btn {
  padding: 0.55rem 1.1rem;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 500;
}

.game-page .btn--primary {
  --btn-bg: var(--accent);
  --btn-fg: #08080b;
  --btn-bd: var(--accent);
}

.game-page .btn--primary:hover {
  box-shadow: none;
  opacity: 0.9;
}

.game-page .btn--ghost {
  --btn-bg: transparent;
  --btn-bd: var(--line-strong);
  color: var(--muted);
}

.game-page .btn--ghost:hover {
  background: transparent;
  color: var(--text);
  border-color: var(--text);
}

/* -------------------------------------------------------------
   Responsive
   ------------------------------------------------------------- */
@media (max-width: 640px) {
  .panel {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }

  .game-nav__title span {
    display: none;
  }

  .hud {
    gap: 0.9rem;
  }

  .hud__v {
    font-size: 0.95rem;
  }
}
