/* Groksteroids: one screen, no page scroll. The playfield width (--bw) is set by game.js from the window size. */
html, body.cz-body { height: 100%; overflow: hidden; }
body.cz-body { min-height: 0; height: 100vh; height: 100dvh; }
body.gs-body { background-image: radial-gradient(1px 1px at 12% 20%, rgba(255,255,255,.9), transparent), radial-gradient(1px 1px at 70% 14%, rgba(255,255,255,.7), transparent), radial-gradient(1.5px 1.5px at 42% 74%, rgba(255,255,255,.8), transparent), radial-gradient(1px 1px at 88% 60%, rgba(255,255,255,.7), transparent), radial-gradient(900px 500px at 50% -10%, rgba(80,110,255,.22), transparent 60%), linear-gradient(180deg, #05060f, #0d1030 60%, #090b22); }
.gs-body .cz-title, .gs-body .cz-back { color: #e9fff0; } .gs-body .cz-title span { color: #7dffa8; }
.gs-body main, .cz-main { max-width: none; width: 100%; margin: 0; padding: 0; box-sizing: border-box; }
.cz-app.game-wrap { width: 100%; max-width: 1500px; height: 100%; margin: 0 auto; padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 8px; }
.cz-top { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; flex: 0 0 auto; position: relative; z-index: 30; }
.cz-back { font-weight: 600; text-decoration: none; white-space: nowrap; }
.cz-title { margin: 0; font-family: Chango, Georgia, serif; font-weight: 400; font-size: clamp(1.25rem, 2.6vw, 1.9rem); line-height: 1.1; white-space: nowrap; }
.cz-links { margin-left: auto; }
.cz-links .ggs-btn { min-height: 34px; }
.gg-links.ggs-made { display: none; }
/* Choices: a drop-down that stays open until closed */
.cz-choices-wrap { position: relative; }
.cz-choices-btn { font: inherit; font-weight: 600; cursor: pointer; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--brand); background: #fff; color: var(--brand-deep); }
.cz-choices-btn[aria-expanded=true] { background: #d9f7e3; }
.cz-choices { position: absolute; top: calc(100% + 8px); left: 0; width: 250px; padding: 10px; border-radius: 16px; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(7,42,27,.25); display: flex; flex-direction: column; gap: 4px; max-height: calc(100dvh - 80px); overflow: auto; }
.cz-choices[hidden] { display: none; }
.cz-ch-head { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 6px; font-family: Chango, Georgia, serif; }
.cz-x { font: inherit; font-size: 1.3rem; line-height: 1; border: 0; background: transparent; cursor: pointer; color: var(--ink); }
.cz-ch-item { font: inherit; font-weight: 600; text-align: left; padding: 7px 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--ink); }
.cz-ch-item:hover, .cz-ch-item:focus-visible { background: rgba(25,193,85,.12); border-color: rgba(25,193,85,.4); outline: none; }
.cz-ch-label { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; color: var(--brand-deep); margin: 6px 4px 2px; }
.cz-themes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cz-theme { font: inherit; font-size: .85rem; font-weight: 600; display: flex; align-items: center; gap: 2px; padding: 5px 7px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
.cz-theme i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.cz-theme i:last-of-type { margin-right: 5px; }
.cz-theme.on { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(25,193,85,.35); }
.cz-theme[data-theme=classic] i:first-child { background: #020304; } .cz-theme[data-theme=classic] i:nth-child(2) { background: #eaf6ff; }
.cz-theme[data-theme=neon] i:first-child { background: #0b0322; } .cz-theme[data-theme=neon] i:nth-child(2) { background: #ff4fd8; }
/* layout */
.cz-main { flex: 1 1 auto; min-height: 0; display: grid; gap: 12px; justify-content: center;
  grid-template-columns: 240px var(--bw, 480px) 300px; grid-template-areas: "left center right"; }
.cz-main.narrow { grid-template-columns: 1fr 1fr; grid-template-rows: auto minmax(0, 1fr); grid-template-areas: "center center" "left right"; gap: 8px; }
.cz-left { grid-area: left; } .cz-center { grid-area: center; } .cz-right { grid-area: right; }
.cz-left.panel, .cz-right.panel { min-height: 0; overflow: auto; padding: 12px; border-radius: 16px; overscroll-behavior: contain; scrollbar-width: thin; }
.cz-left.panel { display: flex; flex-direction: column; }
.cz-right.panel { display: flex; flex-direction: column; }
.cz-center { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 0; justify-self: center; }
.cz-bar { width: var(--bw, 480px); height: 34px; flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 0 10px; border-radius: 12px;
  background: rgba(255,255,255,.85); border: 1px solid var(--line); font-weight: 600; overflow: hidden; }
.gs-hud { justify-content: space-between; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gs-hud b { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--brand-deep); }
.gs-lives { display: flex; gap: 3px; min-width: 64px; }
.gs-lives i { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 65% 45%, #1fd7ff 0 28%, #f2f4ff 30%); box-shadow: inset 0 -2px 0 #9aa3c7; display: inline-block; }
.gs-bonus { display: flex; gap: 3px; } .gs-bonus i { width: 12px; height: 12px; transform: rotate(45deg) scale(.8); border-radius: 2px; display: inline-block; }
.gs-maze { color: var(--brand-deep); font-size: .85em; opacity: .8; }
.gs-time { flex: 1 1 auto; height: 12px; border-radius: 6px; background: #d9e6dd; overflow: hidden; }
.gs-time i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #19c155, #7dffa8); border-radius: 6px; }
.gs-time.low i { background: linear-gradient(90deg, #e0452b, #ff9a6a); }
#hLeft { font-family: ui-monospace, Menlo, Consolas, monospace; min-width: 2ch; text-align: right; }
/* playfield */
.gs-wrap { position: relative; width: var(--bw, 480px); height: var(--bh, 416px); flex: 0 0 auto; border-radius: 8px; overflow: hidden;
  box-shadow: 0 14px 40px rgba(7,42,27,.30), 0 0 0 5px #0e3a24; touch-action: none; user-select: none; -webkit-user-select: none; }
#cv { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.gs-over { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 12px; cursor: pointer;
  background: rgba(3, 12, 8, .55); color: #e9fff0; }
.gs-over[hidden] { display: none; }
.gs-over h2 { margin: 0 0 6px; font-family: Chango, Georgia, serif; font-weight: 400; font-size: clamp(1.1rem, calc(var(--bw, 480px) / 14), 2.4rem); color: #7dffa8; text-shadow: 0 3px 0 #0e3a24; }
.gs-over p { margin: 0; font-weight: 600; font-size: clamp(.8rem, calc(var(--bw, 480px) / 34), 1.1rem); }
/* left panel */
.cz-status { font-family: Chango, Georgia, serif; font-size: 1.02rem; line-height: 1.25; padding: 10px 12px; border-radius: 12px; background: linear-gradient(135deg, rgba(25,193,85,.16), rgba(25,193,85,.04)); border: 1px solid rgba(25,193,85,.35); }
.cz-status.over { background: linear-gradient(135deg, #0e3a24, #19c155); color: #fff; }
.cz-left .msg { margin: 6px 2px; font-size: .92rem; min-height: 0; }
.cz-left label.field { margin: 8px 0 2px; font-size: .72rem; }
.cz-left input[type=text] { padding: 6px 10px; border-radius: 10px; min-width: 0; flex: 1 1 auto; }
.gs-row { display: flex; gap: 6px; } .gs-row .btn { padding: 6px 12px; }
.gs-me { padding: 8px 10px; border-radius: 12px; background: #0b2418; color: #d8ffe6; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gs-me b { color: #7dffa8; }
.gs-me[hidden], #regBox[hidden] { display: none; }
.cz-mini { font: inherit; font-size: .82rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--brand); background: #fff; color: var(--brand-deep); cursor: pointer; white-space: nowrap; }
.cz-start { width: 100%; margin-top: 10px; }
.cz-small { font-size: .8rem; margin: 6px 2px; }
/* on-screen hop buttons */
.gs-pad { margin: auto auto 0; padding-top: 10px; display: grid; gap: 6px; grid-template-columns: repeat(3, var(--pk, 58px)); grid-template-rows: repeat(3, var(--pk, 58px));
  grid-template-areas: ". u ." "l p r" ". d ."; touch-action: none; user-select: none; -webkit-user-select: none; }
.gs-pad[hidden] { display: none; }
.gs-k { font: inherit; font-size: calc(var(--pk, 58px) * .42); line-height: 1; border-radius: 16px; border: 1px solid #0e3a24; cursor: pointer; color: #e9fff0;
  background: linear-gradient(180deg, #23a85a, #13723b); box-shadow: 0 4px 0 #0b4223; touch-action: none; -webkit-tap-highlight-color: transparent; }
.gs-k:active, .gs-k.on { transform: translateY(3px); box-shadow: 0 1px 0 #0b4223; background: linear-gradient(180deg, #2fd16a, #19924c); }
.gs-k.u { grid-area: u; } .gs-k.l { grid-area: l; } .gs-k.r { grid-area: r; } .gs-k.d { grid-area: d; }
.gs-k.p { grid-area: p; font-size: calc(var(--pk, 58px) * .28); background: linear-gradient(180deg, #3d5a4a, #22382c); box-shadow: 0 4px 0 #142219; }
/* right panel */
.cz-pane { flex: 1 1 auto; min-height: 0; overflow: auto; scrollbar-width: thin; }
#scoreTabs { margin-bottom: 8px; flex: 0 0 auto; }
.cz-scoreboard table.board { font-size: .9rem; } .cz-scoreboard table.board td, .cz-scoreboard table.board th { padding: 4px 6px; }
#gg-chat.ggc-popup { position: fixed; z-index: 40; }
/* mid-size screens: controls and scores stacked on the left of the playfield */
.cz-main.mid { grid-template-columns: 210px auto; grid-template-rows: minmax(0, auto) minmax(0, 1fr); grid-template-areas: "left center" "right center"; gap: 8px 12px; }
.cz-main.mid .cz-left.panel, .cz-main.mid .cz-right.panel { padding: 8px; }
.cz-main.mid .cz-status { font-size: .85rem; padding: 6px 8px; }
.cz-main.mid .cz-left .cz-small, .cz-main.mid .cz-right > .cz-small { display: none; }
.cz-main.mid .gs-pad { order: -1; margin: 0 auto 6px; padding-top: 0; }
.cz-main.mid .cz-start { margin-top: 6px; padding: 7px 10px; }
/* narrow screens: playfield on top, controls and scores side by side below */
.cz-main.narrow .cz-left.panel, .cz-main.narrow .cz-right.panel { padding: 8px; }
.cz-main.narrow .cz-status { font-size: .85rem; padding: 6px 8px; }
.cz-main.narrow .gs-pad { padding-top: 6px; margin: auto; }
.cz-main.narrow .cz-left .cz-small, .cz-main.narrow .cz-right > .cz-small { display: none; }
.cz-main.narrow .cz-start { margin-top: 6px; padding: 7px 10px; }
.cz-main.narrow .cz-left .msg:empty { display: none; }
@media (max-width: 640px) {
  .cz-title { font-size: 1.1rem; } .cz-links { display: none; } .cz-choices-btn { padding: 5px 10px; font-size: .9rem; }
  .cz-app.game-wrap { padding: 6px; gap: 6px; } .cz-bar { height: 28px; font-size: .85rem; padding: 0 8px; }
}
.cz-main.narrow .gs-pad { order: -1; margin: 0 auto 6px; padding-top: 0; }
@media (max-width: 480px) {
  .cz-top { flex-wrap: nowrap; gap: 8px; } .cz-title { font-size: 1rem; } .cz-back { font-size: .9rem; }
  .cz-choices-btn { padding: 4px 9px; font-size: .85rem; white-space: nowrap; }
  .cz-choices { left: auto; right: 0; }
}

/* the D-pad is always shown */

.gs-pad { gap: 4px; padding: 8px; border-radius: 22px; }
.gs-k { -webkit-touch-callout: none; }

/* Groksteroids flight buttons: 3 columns x 2 rows, Fire spans two */
.gs-pad { grid-template-columns: repeat(3, var(--pk, 64px)); grid-template-rows: repeat(2, var(--pk, 64px)); grid-template-areas: "l t r" "h f f"; }
.gs-k { font: inherit; font-size: calc(var(--pk, 64px) * .36); line-height: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 16px; border: 1px solid #0e3a24; cursor: pointer; color: #e9fff0; background: linear-gradient(180deg, #23a85a, #13723b); box-shadow: 0 4px 0 #0b4223;
  touch-action: none; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; padding: 0; }
.gs-k small { font-size: max(9px, calc(var(--pk, 64px) * .15)); font-weight: 600; opacity: .85; }
.gs-k.on { transform: translateY(3px); box-shadow: 0 1px 0 #0b4223; background: linear-gradient(180deg, #2fd16a, #19924c); }
.gs-k.l { grid-area: l; } .gs-k.t { grid-area: t; } .gs-k.r { grid-area: r; } .gs-k.h { grid-area: h; background: linear-gradient(180deg, #5b3fb0, #36246e); box-shadow: 0 4px 0 #22184a; }
.gs-k.f { grid-area: f; background: linear-gradient(180deg, #e0452b, #a12a17); box-shadow: 0 4px 0 #5e170b; }
.gs-k.f.on { background: linear-gradient(180deg, #ff6a4a, #c23a22); }
.gs-lives i { width: 12px; height: 14px; display: inline-block; background: #eaf6ff; clip-path: polygon(50% 0, 100% 100%, 50% 75%, 0 100%); }
.gs-hy { color: #8a8f99 !important; } .gs-hy.on { color: var(--brand-deep) !important; }
.gs-hp { padding: 2px 10px; margin-left: 4px; }
.gs-wrap { box-shadow: 0 14px 40px rgba(0,0,0,.45), 0 0 0 5px #10142a; }
.cz-main.mid { grid-template-columns: 240px auto; }
