/* Game pages: the site bar on top, a Swiss side panel (columns 1–3) and a stage plate (columns 4–12)
   that fills the rest of the viewport. The 3D scene lives only inside the plate; every control stays in the panel. */
.g-page { height: calc(100vh - var(--bar-h) - 1px); height: calc(100dvh - var(--bar-h) - 1px); padding-block: 20px; grid-template-rows: auto minmax(0, 1fr); row-gap: 28px; }
.g-head { grid-column: 1 / span 3; grid-row: 1; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.g-controls { grid-column: 1 / span 3; grid-row: 2; display: flex; flex-direction: column; gap: 24px; min-height: 0; min-width: 0; overflow-y: auto; padding-bottom: 8px; }
.g-stage { grid-column: 4 / -1; grid-row: 1 / span 2; position: relative; outline: none; min-height: 0; overflow: hidden; background: #f1f1f1; user-select: none; -webkit-user-select: none; }
.g-stage.dark { background: #0b0b0b; color: #f2f2f2; }
.g-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }

.g-no { display: flex; gap: 16px; font-size: 15px; }
.g-no b { font-weight: 500; }
.g-title { font-size: clamp(44px, 4.8vw, 84px); font-weight: 300; line-height: .88; letter-spacing: -0.055em; margin-left: -0.04em; }
.g-title.long { font-size: clamp(34px, 3.1vw, 56px); letter-spacing: -0.045em; }
.g-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--gutter); border-top: 1px solid var(--ink); }
.g-stat { padding: 9px 0 10px; border-bottom: 1px solid var(--rule); min-width: 0; }
.g-stat dt { font-size: 13px; color: var(--gray); }
.g-stat dd { margin-top: 4px; font-size: clamp(24px, 2.2vw, 34px); font-weight: 300; line-height: 1; letter-spacing: -0.035em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.g-group { display: flex; flex-direction: column; gap: 10px; }
.g-group > .lbl { font-size: 13px; color: var(--gray); }
.g-actions { display: flex; flex-direction: column; gap: 8px; }
.g-actions .btn { width: 100%; }
.g-links { display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; text-align: left; }
.toggle i { width: 18px; height: 18px; flex: none; box-shadow: inset 0 0 0 1px var(--ink); transition: background-color .15s; }
.toggle[aria-pressed="true"] i { background: var(--ink); box-shadow: inset 0 0 0 1px var(--ink), inset 0 0 0 4px var(--paper); }
.g-range { display: flex; flex-direction: column; gap: 6px; }
.g-range .top { display: flex; justify-content: space-between; font-size: 15px; }
.g-range input { -webkit-appearance: none; appearance: none; width: 100%; height: 24px; background: transparent; margin: 0; }
.g-range input::-webkit-slider-runnable-track { height: 1px; background: var(--ink); }
.g-range input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -7px; background: var(--ink); border-radius: 0; }
.g-range input::-moz-range-track { height: 1px; background: var(--ink); }
.g-range input::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 0; background: var(--ink); }

details.g-help { border-top: 1px solid var(--ink); }
details.g-help summary { list-style: none; display: flex; justify-content: space-between; padding: 10px 0; font-size: 15px; cursor: pointer; }
details.g-help summary::-webkit-details-marker { display: none; }
details.g-help summary::after { content: "+"; }
details.g-help[open] summary::after { content: "−"; }
details.g-help p, details.g-help li { font-size: 14px; line-height: 1.4; color: var(--gray); }
details.g-help p + p, details.g-help ul { margin-top: 8px; }
details.g-help li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px solid var(--rule); }
details.g-help li span:first-child { color: var(--ink); }

/* overlays and labels inside the stage */
.g-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; z-index: 3; }
.g-overlay.dim { background: rgba(241, 241, 241, .55); }
.g-stage.dark .g-overlay.dim { background: rgba(11, 11, 11, .55); }
.g-card { width: min(380px, 100%); background: var(--paper); color: var(--ink); box-shadow: 0 0 0 1px var(--ink); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.g-card h2 { font-size: clamp(34px, 3.4vw, 48px); font-weight: 300; line-height: .95; letter-spacing: -0.045em; }
.g-card .big { font-size: clamp(44px, 4.6vw, 68px); font-weight: 300; line-height: 1; letter-spacing: -0.05em; }
.g-card .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.g-card .meta { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; color: var(--gray); }
.g-card .badge { align-self: flex-start; background: var(--signal); color: #fff; font-size: 13px; padding: 4px 8px; }
.g-ach { display: flex; flex-direction: column; border-top: 1px solid var(--ink); }
.g-ach li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.g-ach li > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.g-ach-ico { flex: none; width: 40px; height: 40px; color: var(--ink); }
.g-ach b { font-weight: 400; font-size: 18px; letter-spacing: -0.015em; }
.g-tag { position: absolute; left: 16px; top: 14px; z-index: 2; font-size: 13px; line-height: 1.3; color: var(--gray); pointer-events: none; }
.g-stage.dark .g-tag { color: #8a8a8a; }
.g-tag b { font-weight: 400; color: var(--ink); }
.g-stage.dark .g-tag b { color: #f2f2f2; }
.g-hint { position: absolute; left: 16px; bottom: 12px; z-index: 2; font-size: 13px; color: var(--gray); pointer-events: none; }
.g-banner { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); z-index: 2; background: var(--ink); color: var(--paper); padding: 8px 14px; font-size: 15px; white-space: nowrap; pointer-events: none; }
.g-banner[data-tone="signal"] { background: var(--signal); }

@media (max-width: 1080px) {
  .g-head, .g-controls { grid-column: 1 / span 4; }
  .g-stage { grid-column: 5 / -1; }
}
@media (max-width: 760px) {
  .g-page { height: auto; grid-template-rows: none; row-gap: 18px; padding-block: 16px 8px; }
  .g-head, .g-controls, .g-stage { grid-column: 1 / -1; grid-row: auto; }
  .g-head { order: 1; } .g-stage { order: 2; } .t-touch { order: 3; } .g-controls { order: 4; }
  .g-head { gap: 10px; }
  .g-title { font-size: 52px; }
  .g-title.long { font-size: 40px; }
  .g-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .g-stat dd { font-size: 22px; }
  .g-stage { height: min(var(--stage-h, 92vw), 70vh); margin-inline: calc(var(--margin) * -1); }
  .g-controls { overflow: visible; }
}
