/* ---------- game page frame ---------- */
.game-page { padding-bottom: 20px; }
.gm-frame {
  position: relative; display: flex; flex-direction: column;
  width: min(100%, 960px); margin: 8px auto 0;
  background: #0a0d19; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(108,140,255,.08), 0 24px 60px rgba(0,0,0,.45);
}
.gm-bar { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); min-height: 50px; }
.gm-bar h1 { font-size: 16px; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-stat { display: flex; flex-direction: column; align-items: center; line-height: 1.1; min-width: 46px; }
.gm-stat small { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.gm-stat b { font-size: 16px; font-variant-numeric: tabular-nums; }
.gm-status { color: var(--muted); font-size: 14px; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-tools { display: flex; gap: 6px; margin-left: auto; }
.gm-tool { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--surface2); color: var(--text); cursor: pointer; padding: 0; }
.gm-tool:hover { border-color: var(--accent); }
.gm-tool svg { width: 20px; height: 20px; }
.gm-tool .ic-off { display: none; }
.gm-muted .gm-tool .ic-on { display: none; }
.gm-muted .gm-tool .ic-off { display: block; }

.gm-stage {
  position: relative; height: min(72vh, 640px); min-height: 320px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.gm-canvas { display: block; touch-action: none; }

.gm-overlay { position: absolute; inset: 50px 0 0 0; z-index: 20; display: grid; place-items: center; background: rgba(8, 10, 20, .72); backdrop-filter: blur(3px); padding: 16px; }
.gm-overlay[hidden] { display: none; }
.gm-overlay-box { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px; text-align: center; max-width: 380px; box-shadow: 0 20px 50px rgba(0,0,0,.5); }
.gm-overlay-box h2 { margin: 0 0 8px; font-size: 24px; }
.gm-overlay-box p { margin: 0 0 16px; color: var(--muted); white-space: pre-line; }
.gm-overlay-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.gm-obtn { border: 1px solid var(--line); background: var(--surface2); color: var(--text); font: inherit; font-weight: 600; padding: 10px 20px; border-radius: 10px; cursor: pointer; }
.gm-obtn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.gm-obtn:hover { filter: brightness(1.1); }

/* ---------- virtual controls (outside the canvas) ---------- */
.gm-controls { display: none; gap: 10px; padding: 10px; background: var(--surface); border-top: 1px solid var(--line); justify-content: center; flex-wrap: wrap; user-select: none; -webkit-user-select: none; touch-action: none; }
.gm-controls[hidden] { display: none !important; }
html.gm-touch .gm-controls, .gm-controls.gm-always { display: flex; }
.gm-btn { min-width: 62px; height: 58px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); font: 600 20px var(--font); touch-action: none; cursor: pointer; }
.gm-btn.gm-wide { min-width: 110px; font-size: 16px; }
.gm-btn.gm-on { background: var(--accent); border-color: var(--accent); }
.gm-layout-dpad { display: none; grid-template-columns: repeat(3, 62px); grid-template-areas: ". up ." "left down right"; justify-content: center; }
html.gm-touch .gm-layout-dpad, .gm-layout-dpad.gm-always { display: grid; }
.gm-area-up { grid-area: up; } .gm-area-down { grid-area: down; } .gm-area-left { grid-area: left; } .gm-area-right { grid-area: right; }
.gm-layout-split { justify-content: space-between; }

/* ---------- fullscreen / mobile ---------- */
.gm-full { position: fixed; inset: 0; z-index: 100; width: 100%; max-width: none; margin: 0; border-radius: 0; border: 0; }
.gm-full .gm-stage { height: auto; flex: 1; }
body.gm-lock { overflow: hidden; }
@media (max-width: 700px) {
  .game-page .wrap { width: 100%; }
  .gm-frame { border-radius: 0; border-left: 0; border-right: 0; margin-top: 0; }
  .gm-stage { height: calc(100svh - 60px - 50px - 160px); min-height: 300px; }
  html:not(.gm-touch) .gm-stage { height: calc(100svh - 120px); }
  .gm-bar { padding-left: 10px; gap: 8px; }
  .gm-bar h1 { display: none; }
  .game-info { padding-inline: 16px; }
}

/* ---------- info under the game ---------- */
.game-info { display: grid; grid-template-columns: 1fr 300px; gap: 28px; margin-top: 26px; }
.game-info h2 { font-size: 20px; margin: 0 0 8px; }
.game-info p, .game-info li { color: #cfd4e6; }
.game-info ul { padding-left: 20px; }
.related .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
.related .card-short { display: none; }
@media (max-width: 860px) { .game-info { grid-template-columns: 1fr; } .related .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
