/* Grok Gate Runner - one-screen desk layout, modest glow.
   Beats desk.css / futuristic.css (body.fx main { width: min(1080px, ...) }) so the stage can use the full viewport. */
html, body.gm-body { height: 100%; overflow: hidden; margin: 0; }
body.gm-body { height: 100vh; height: 100dvh; color: #e8fff0; font-family: Inter, system-ui, sans-serif; }
body.fx.gm-body main.gm-main, .gm-body main.gm-main { max-width: none !important; width: 100% !important; margin: 0 !important; padding: 0 !important; box-sizing: border-box; }
.gm-app { position: relative; z-index: 1; box-sizing: border-box; height: 100%; max-width: none; margin: 0; padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.gm-top { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; flex: 0 0 auto; position: relative; z-index: 40; padding: 6px 12px 4px; }
.gm-back { font-weight: 600; text-decoration: none; white-space: nowrap; color: #e6fff0; }
.gm-title { margin: 0; font-family: Chango, Georgia, serif; font-weight: 400; font-size: clamp(1.15rem, 2.2vw, 1.7rem); line-height: 1.1; white-space: nowrap; color: #f2fff6; text-shadow: 0 0 14px rgba(61,255,138,.32); }
.gm-title-s { margin-left: .45rem; font-size: .72em; opacity: .85; font-family: Inter, sans-serif; font-weight: 600; }
.gm-choices-wrap { position: relative; margin-left: auto; }
.gm-choices-btn, .gm-scores-btn { font: 600 .88rem Inter, sans-serif; padding: 5px 12px; border-radius: 999px; border: 1px solid rgba(110,255,160,.4); background: rgba(8,28,16,.55); color: #e8fff0; cursor: pointer; }
.gm-choices { position: absolute; right: 0; top: calc(100% + 6px); width: min(340px, 86vw); max-height: min(70dvh, 560px); overflow: auto; padding: 10px 12px 14px; border-radius: 14px; background: rgba(6,18,12,.94); border: 1px solid rgba(110,255,160,.35); box-shadow: 0 12px 32px rgba(0,0,0,.4); z-index: 50; }
.gm-ch-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.gm-ch-item { display: block; width: 100%; text-align: left; background: transparent; border: 0; color: #e8fff0; font: 600 .9rem Inter, sans-serif; padding: 7px 6px; border-radius: 8px; cursor: pointer; }
.gm-ch-item:hover, .gm-ch-item:focus { background: rgba(61,255,138,.12); }
.gm-ch-label { margin: 8px 0 4px; font: 600 .72rem Inter, sans-serif; color: #9bd4b0; text-transform: uppercase; letter-spacing: .04em; }
.gm-seg { display: flex; gap: 3px; flex-wrap: wrap; }
.gm-seg button { font: 600 .78rem Inter, sans-serif; padding: 4px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.06); color: #dff7ea; cursor: pointer; }
.gm-seg button.on, .gm-btn.on { border-color: rgba(61,204,122,.7); background: rgba(61,204,122,.22); }
.gm-x { background: transparent; border: 0; color: #e8fff0; font-size: 1.2rem; cursor: pointer; }
.gm-links { display: flex; gap: 10px; align-items: center; }
.gm-links a { color: #c8f0d8; text-decoration: none; font-weight: 600; font-size: .88rem; }
.gm-main { flex: 1 1 auto; min-height: 0; min-width: 0; display: grid; grid-template-columns: minmax(190px, 230px) minmax(0, 1fr) minmax(210px, 260px); grid-template-areas: "left center right"; gap: 8px; }
.gr-chatcol .gm-main { grid-template-columns: minmax(180px, 210px) minmax(0, 1fr) minmax(200px, 240px) minmax(260px, 300px); grid-template-areas: "left center right chat"; }
.gm-left { grid-area: left; min-width: 0; min-height: 0; }
.gm-center { grid-area: center; }
.gm-right { grid-area: right; min-width: 0; min-height: 0; }
.gm-chatcol { grid-area: chat; }
.gm-left .gm-modes { display: none; } /* Worlds/Garage/Upgrades already live in the stage menu and Choices */
.gm-panel { background: rgba(6,20,14,.62); border: 1px solid rgba(110,255,160,.22); border-radius: 14px; padding: 10px 12px; overflow: auto; min-height: 0; }
.gm-status { font: 600 .88rem Inter, sans-serif; min-height: 2.4em; color: #d8f6e4; }
.gm-row { display: flex; gap: 6px; }
.gm-row input { flex: 1; min-width: 0; padding: 6px 8px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(0,0,0,.35); color: #e8fff0; }
.gm-btn { font: 600 .88rem Inter, sans-serif; padding: 7px 12px; border-radius: 10px; border: 1px solid rgba(110,255,160,.4); background: rgba(20,60,36,.7); color: #e8fff0; cursor: pointer; text-decoration: none; display: inline-block; }
.gm-btn.hot { background: rgba(40,140,80,.85); border-color: rgba(110,255,160,.7); }
.gm-btn.ghost { background: rgba(255,255,255,.06); }
.gm-btn:disabled { opacity: .45; cursor: default; }
.gm-mini { background: transparent; border: 0; color: #9bd4b0; cursor: pointer; font: 600 .75rem Inter, sans-serif; }
.gm-modes, .gm-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.gr-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; margin: 8px 0; font: 600 .8rem Inter, sans-serif; }
.gr-stats div { background: rgba(0,0,0,.25); border-radius: 8px; padding: 5px 8px; }
.gr-stats span { display: block; color: #8fc8a4; font-size: .7rem; font-weight: 600; }
.gr-stats b { color: #f2fff6; }
.gm-small, .gm-muted { font: 500 .78rem Inter, sans-serif; color: #9bd4b0; }
.gm-keys { margin-top: 8px; line-height: 1.45; }
.gm-center { min-width: 0; min-height: 0; display: flex; }
.gm-stage { position: relative; flex: 1; min-height: 0; border-radius: 14px; overflow: hidden; border: 1px solid rgba(110,255,160,.28); background: #08140e; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gm-hud { position: absolute; inset: 0; pointer-events: none; }
.gm-hud-tl, .gm-hud-tr { position: absolute; top: 8px; display: flex; gap: 8px; align-items: center; font: 700 .9rem Inter, sans-serif; text-shadow: 0 1px 4px #000; }
.gm-hud-tl { left: 10px; } .gm-hud-tr { right: 10px; }
.gr-count { position: absolute; left: 50%; top: 18%; transform: translate(-50%,-50%); font: 400 clamp(2.2rem, 7vw, 4.2rem) Chango, Georgia, serif; color: #f2fff6; text-shadow: 0 2px 0 #0a2012, 0 0 16px rgba(61,204,122,.35); letter-spacing: 1px; pointer-events: none; }
.gr-float { position: absolute; left: 50%; font: 800 1.1rem Inter, sans-serif; color: #5dffa0; text-shadow: 0 1px 3px #000; animation: grUp .8s ease-out forwards; pointer-events: none; }
@keyframes grUp { to { transform: translate(-50%,-50px); opacity: 0; } }
.gr-tip { position: absolute; left: 50%; top: 28%; transform: translateX(-50%); padding: 6px 12px; border-radius: 10px; background: rgba(6,18,12,.75); border: 1px solid rgba(110,255,160,.3); font: 600 .85rem Inter, sans-serif; }
.gr-fin { position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%); width: min(420px, 90%); text-align: center; }
.gr-fin b { display: block; font-family: Chango, Georgia, serif; font-weight: 400; }
.gr-bar { height: 10px; border-radius: 99px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.15); overflow: hidden; margin-top: 4px; }
.gr-bar i { display: block; height: 100%; background: linear-gradient(90deg,#3dcc7a,#c9a24a); width: 0; }
.gr-ctrl { position: absolute; right: 8px; bottom: 8px; display: flex; gap: 6px; pointer-events: auto; }
.gr-ctrl button, .gr-abi button { pointer-events: auto; font: 700 .84rem Inter, sans-serif; padding: 7px 10px; border-radius: 10px; border: 1px solid rgba(110,255,160,.4); background: rgba(6,18,12,.72); color: #e8fff0; cursor: pointer; }
.gr-abi { position: absolute; left: 8px; bottom: 8px; display: flex; gap: 6px; pointer-events: auto; }
.gr-padind { position: absolute; left: 10px; bottom: 50px; font: 600 .75rem Inter, sans-serif; color: #9bd4b0; background: rgba(6,18,12,.7); padding: 3px 8px; border-radius: 8px; }
.gm-menu { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(4,12,8,.55); overflow: auto; z-index: 8; box-sizing: border-box; }
.gm-menu[hidden], .gm-hud[hidden], .gm-load[hidden], .gr-tip[hidden], .gr-fin[hidden], .gr-padind[hidden] { display: none !important; }
.gm-card { width: min(720px, 100%); max-height: 100%; overflow: auto; box-sizing: border-box; background: rgba(6,18,12,.92); border: 1px solid rgba(110,255,160,.35); border-radius: 16px; padding: 16px 18px 18px; box-shadow: 0 12px 36px rgba(0,0,0,.4); }
.gm-card h2 { margin: 0 0 6px; font-family: Chango, Georgia, serif; font-weight: 400; font-size: 1.45rem; color: #f2fff6; text-shadow: 0 0 12px rgba(61,255,138,.28); }
.gm-card h3 { margin: 12px 0 6px; font: 700 .95rem Inter, sans-serif; color: #c8f0d8; }
.gm-card p { margin: 0 0 8px; color: #d8f6e4; }
.gm-res { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.gm-res div { background: rgba(0,0,0,.28); border-radius: 10px; padding: 6px 10px; }
.gm-res b { display: block; font-size: 1.05rem; }
.gr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.gr-cell { text-align: left; padding: 8px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.05); color: inherit; cursor: pointer; font: 600 .82rem Inter, sans-serif; }
.gr-cell.on { border-color: rgba(61,204,122,.7); background: rgba(61,204,122,.16); }
.gr-cell:disabled { opacity: .5; cursor: default; }
.gr-cell small { display: block; color: #9bd4b0; font-weight: 500; }
.gr-stars { color: #c9a24a; letter-spacing: 1px; }
.fc-garage { width: min(900px, 100%); }
.fc-gtop { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fc-prev { width: 100%; height: auto; border-radius: 12px; background: #0a1810; border: 1px solid rgba(110,255,160,.25); display: block; }
.fc-sw, .fc-ups, .fc-wrapbox { display: flex; flex-wrap: wrap; gap: 5px; }
.fc-bind { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; margin: 4px 0; }
.fc-key { min-width: 88px; }
.gm-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.gm-tab { font: 600 .78rem Inter, sans-serif; padding: 4px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: transparent; color: #dff7ea; cursor: pointer; }
.gm-tab.on { background: rgba(61,204,122,.22); border-color: rgba(61,204,122,.6); }
.gm-board { font: 500 .82rem Inter, sans-serif; }
.gm-board table { width: 100%; border-collapse: collapse; }
.gm-board td, .gm-board th { padding: 3px 4px; text-align: left; }
.gm-load { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(4,12,8,.72); font-family: Chango, Georgia, serif; z-index: 9; }
.gm-chatcol { display: none; min-width: 0; min-height: 0; overflow: hidden; border-radius: 14px; border: 1px solid rgba(110,255,160,.22); background: rgba(6,20,14,.55); }
.gr-chatcol .gm-chatcol { display: flex; flex-direction: column; }
.gm-chatcol > #gg-chat { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.gr-touch { position: absolute; inset: 0; pointer-events: auto; touch-action: none; }
.gm-fpsline { margin-top: 8px; }

/* Too narrow for three columns: scores go under the board and stretch to the right. Chat stays a popup. */
@media (max-width: 1280px) {
  .gm-main, .gr-chatcol .gm-main { grid-template-columns: minmax(180px, 210px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(110px, 26%); grid-template-areas: "left center" "right right"; }
  .gm-chatcol { display: none !important; }
  .gm-right { display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 34%); grid-template-rows: auto minmax(0, 1fr); gap: 0 14px; }
  .gm-right .gm-tabs { grid-column: 1; }
  .gm-right .gm-board { grid-column: 1; overflow: auto; min-height: 0; }
  .gm-right > p { grid-column: 2; grid-row: 1 / span 2; margin: 0; align-self: start; }
}
@media (max-height: 560px) {
  .gm-keys { display: none; }
  .gm-title { font-size: 1.05rem; }
  .gm-title-s { display: none; }
  .gm-status { min-height: 0; }
  .gm-main, .gr-chatcol .gm-main { grid-template-rows: minmax(0, 1fr) minmax(84px, 22%); }
}
@media (max-width: 760px) {
  .gm-main, .gr-chatcol .gm-main { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) minmax(120px, 32%); grid-template-areas: "center center" "left right"; gap: 6px; }
  .gm-app { padding: 4px 6px 6px; gap: 4px; }
  .gm-top { flex-wrap: nowrap; gap: 6px; padding: 0; }
  .gm-hide-s { display: none; }
  .gm-title { font-size: 1rem; }
  .gm-links a { display: none; }
  .gm-chatcol { display: none !important; }
  .gm-right { display: block; }
  .gm-right > p { display: none; }
  .fc-gtop { grid-template-columns: 1fr; }
  .gr-count { top: 16%; font-size: 2.2rem; }
  .gm-keys { display: none; }
}
@media (max-width: 760px) and (orientation: portrait) {
  .gm-chatcol { display: none !important; }
}

#hGun { font: 700 .82rem Inter, sans-serif; color: #ffe080; min-height: 1em; }
