[hidden] { display: none !important; }
#setupmsg { min-height: 0; margin: 4px 0 0; }
.gk-wrap { width: min(1220px, calc(100% - 24px)); }
.gk-tag { max-width: 46rem; margin: 6px 0 16px; font-size: 1.05rem; }
.setup { margin-bottom: 14px; }
.gk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 960px) { .gk-layout { grid-template-columns: 1fr; } }
.gk-side { display: grid; gap: 14px; }
.gk-side .panel h3 { font-size: 1.1rem; }
.tiny { font-size: .82rem; }
kbd { font: inherit; font-size: .7rem; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.25); border: 1px solid rgba(255,255,255,.5); margin-left: 4px; }
.btn.ghost kbd { background: rgba(25,193,85,.12); border-color: var(--line); }

/* HUD */
.gk-hud { display: grid; grid-template-columns: 90px 120px 1fr; gap: 10px; align-items: end; margin-bottom: 12px; }
@media (max-width: 560px) { .gk-hud { grid-template-columns: 1fr 1fr; } .hud-cell.wide { grid-column: 1 / -1; } }
.hud-cell .k { display: block; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--brand-deep); font-weight: 600; }
.hud-cell .v { font-family: Chango, Georgia, serif; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.nw-bar { position: relative; height: 16px; border-radius: 999px; background: #e3f4e6; border: 1px solid var(--line); overflow: hidden; margin: 4px 0 2px; }
.nw-fill { height: 100%; width: 0; background: linear-gradient(90deg, #19c155, #0e7a36); transition: width .5s; }
.nw-ticks i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(20,73,54,.3); }
.nw-val { font-weight: 600; font-variant-numeric: tabular-nums; font-size: .92rem; }

/* Ring board */
.ring { position: relative; width: min(100%, 760px); margin: 0 auto; aspect-ratio: 1; display: grid; container-type: inline-size;
  grid-template-columns: 1.45fr repeat(9, 1fr) 1.45fr; grid-template-rows: 1.45fr repeat(9, 1fr) 1.45fr;
  background: var(--brand-deep); border-radius: 16px; padding: 5px; gap: 2px; box-shadow: 0 10px 30px rgba(20,73,54,.18); }
.sq { position: relative; background: #f6fff6; border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; align-items: center; text-align: center;
  font-size: clamp(5px, 1.3cqw, 10px); line-height: 1.1; padding: 0 1px 2px; cursor: pointer; min-width: 0; min-height: 0; }
.sq:hover { background: #fff; }
.sq .band { align-self: stretch; height: 22%; min-height: 4px; background: var(--gc, transparent); border-bottom: 1px solid rgba(20,73,54,.25); margin: 0 -1px 2px; display: flex; align-items: center; justify-content: center; gap: 1px; font-size: .9em; }
.sq .nm { font-weight: 600; word-break: break-word; hyphens: auto; }
.sq .em { font-size: 2.2em; line-height: 1; margin-top: 2px; }
.sq .pr { margin-top: auto; opacity: .75; font-size: .92em; }
.sq.corner { justify-content: center; font-size: clamp(6px, 1.5cqw, 11px); }
.sq.corner .em { font-size: 2.6em; }
.sq.own { box-shadow: inset 0 0 0 2px var(--oc); background: color-mix(in srgb, var(--oc) 12%, #fff); }
.sq.mort { filter: grayscale(.85); opacity: .75; }
.sq.mort::after { content: 'M'; position: absolute; right: 2px; top: 22%; font-weight: 700; color: #b3261e; font-size: 1.2em; }
.sq.cur { outline: 3px solid #ffb800; outline-offset: -3px; z-index: 2; animation: pulse 1.2s infinite; }
.sq.sel { outline: 3px dashed var(--brand); outline-offset: -3px; z-index: 2; }
@keyframes pulse { 50% { outline-color: #fff2b3; } }
.sq .ownb { position: absolute; left: 1px; bottom: 1px; font-size: 1.5em; line-height: 1; }
.sq .lvls { position: absolute; right: 1px; bottom: 1px; display: flex; gap: 1px; }
.sq .lvls i { width: .7em; height: .7em; background: #19c155; border: 1px solid #0e7a36; border-radius: 2px; display: block; }
.sq .lvls i.mega { width: auto; height: auto; background: none; border: 0; font-style: normal; font-size: 1.3em; line-height: 1; }
.sq .toks { position: absolute; left: 0; right: 0; top: 30%; display: flex; flex-wrap: wrap; justify-content: center; gap: 0; z-index: 3; pointer-events: none; }
.tok { font-size: clamp(11px, 2.7cqw, 20px); line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.45)); }
.tok.me { animation: hop .6s infinite alternate; }
@keyframes hop { to { transform: translateY(-3px); } }

.ring-center { grid-area: 2 / 2 / 11 / 11; background: radial-gradient(circle at 50% 30%, #f9fff9, #e6f7ea); border-radius: 10px; margin: 4px; padding: 10px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; overflow: hidden; min-width: 0; min-height: 0; }
.ring-center .logo { font-family: Chango, Georgia, serif; font-size: clamp(1.1rem, 5cqw, 2.2rem); letter-spacing: .02em; color: var(--brand-deep); line-height: 1; transform: rotate(-2deg); margin-top: 2px; }
.status-line { text-align: center; font-weight: 600; font-size: clamp(.8rem, 2.2cqw, 1.05rem); margin: 0; min-height: 2.6em; display: flex; align-items: center; justify-content: center; }
.dice-row { display: flex; gap: 14px; }
.die { width: clamp(34px, 7cqw, 52px); aspect-ratio: 1; background: #fff; border-radius: 22%; border: 2px solid var(--brand-deep); box-shadow: 0 3px 0 var(--brand-deep);
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 15%; }
.die i { width: 70%; height: 70%; place-self: center; border-radius: 50%; background: transparent; }
.die i.on { background: var(--ink); }
.die.rolling { animation: shake .12s infinite; }
@keyframes shake { 0% { transform: rotate(-12deg) translateY(-2px); } 50% { transform: rotate(10deg); } 100% { transform: rotate(-4deg) translateY(2px); } }
.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.actions .btn { padding: 8px 14px; font-size: clamp(.8rem, 2cqw, 1rem); }
.sq-info { width: 100%; flex: 1; min-height: 0; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: clamp(.72rem, 1.7cqw, .9rem); }
.sq-info .sih { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 1.1em; }
.sq-info .sw { width: 14px; height: 14px; border-radius: 4px; flex: none; border: 1px solid rgba(0,0,0,.25); }
.sq-info table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.sq-info td { padding: 1px 4px; } .sq-info td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.sq-info tr.hl { background: rgba(25,193,85,.18); font-weight: 600; }

/* players, empire, log */
.plr { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 12px; border: 1px solid transparent; }
.plr.on { border-color: #ffb800; background: #fff8dc; }
.plr.dead { opacity: .5; text-decoration: line-through; }
.plr .pe { font-size: 1.4rem; }
.plr .pn { font-weight: 600; line-height: 1.1; }
.plr .ps { font-size: .8rem; color: rgba(20,73,54,.7); }
.plr .pm { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; line-height: 1.1; font-size: .95rem; }
.plr .pm small { display: block; font-weight: 400; color: rgba(20,73,54,.65); }
.empire { max-height: 300px; overflow: auto; font-size: .88rem; }
.erow { display: grid; grid-template-columns: 12px 1fr auto; gap: 6px; align-items: center; padding: 3px 0; border-bottom: 1px solid var(--line); }
.erow .sw { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.25); }
.erow .eb { display: flex; gap: 3px; }
.erow button { font: inherit; font-size: .78rem; font-weight: 600; padding: 1px 7px; border-radius: 8px; border: 1px solid var(--brand); background: #fff; color: var(--brand-deep); cursor: pointer; }
.erow button:disabled { opacity: .35; cursor: default; }
.erow .lv { color: rgba(20,73,54,.65); font-size: .8rem; }
.log { max-height: 280px; min-height: 120px; overflow: auto; font-size: .86rem; display: flex; flex-direction: column; gap: 2px; padding-right: 4px; }
.log div { padding: 2px 6px; border-left: 3px solid var(--line); }
.log .good { border-color: var(--brand); } .log .bad { border-color: #d92d20; } .log .rent { border-color: #f08c00; } .log .card { border-color: #7a5af8; background: rgba(122,90,248,.06); } .log .sys { border-color: #1c7ed6; } .log .sell { border-color: #999; }

/* modal + launch */
.modal { position: fixed; inset: 0; background: rgba(20,73,54,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal[hidden], .launch[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 20px; padding: 22px 24px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); animation: pop .22s ease-out; }
.modal-card h3 { font-family: Chango, Georgia, serif; font-weight: 400; margin: 0 0 10px; font-size: 1.5rem; }
.modal-card .big { font-size: 1.15rem; margin: 6px 0 12px; }
.modal-card table { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
.modal-card td { padding: 3px 4px; border-bottom: 1px solid var(--line); } .modal-card td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.modal-card tr.tot td { border-top: 2px solid var(--ink); font-size: 1.15rem; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.launch { position: fixed; inset: 0; z-index: 60; background: linear-gradient(#0b1d3a 0%, #3b1d12 70%, #b5431f 100%); display: grid; place-items: center; overflow: hidden; color: #fff; }
.launch .rocket { font-size: 7rem; animation: liftoff 2.4s ease-in forwards; position: absolute; bottom: 8%; }
.launch .launch-text { position: absolute; top: 18%; font-family: Chango, Georgia, serif; font-size: clamp(1.6rem, 6vw, 3rem); text-align: center; }
@keyframes liftoff { 0% { transform: translateY(0) scale(1); } 25% { transform: translateY(0) scale(1.05) rotate(-2deg); } 100% { transform: translateY(-120vh) scale(.6); } }

/* ============ Mars ============ */
.mars-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; margin-bottom: 8px; }
.mars-title { font-family: Chango, Georgia, serif; font-size: 1.4rem; }
.mars-goal { font-size: .9rem; font-weight: 600; color: var(--brand-deep); }
.mars-hud { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-bottom: 8px; }
.chip { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 5px 8px; line-height: 1.15; }
.chip .k { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand-deep); font-weight: 600; display: block; }
.chip .v { font-family: Chango, Georgia, serif; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.chip .d { font-size: .78rem; font-weight: 600; margin-left: 4px; }
.chip .d.up { color: #0e7a36; } .chip .d.dn { color: #d92d20; }
.chip.low { border-color: #d92d20; background: #fff0ee; }
.chip.wide { grid-column: span 2; }
.tbar { position: relative; height: 10px; background: #e3f4e6; border-radius: 999px; overflow: hidden; margin-top: 3px; border: 1px solid var(--line); }
.tbar b { display: block; height: 100%; background: linear-gradient(90deg, #f08c00, #19c155); }
.tbar i { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.mars-event { background: #fff4d6; border: 1px solid #ffb800; border-radius: 12px; padding: 6px 10px; margin-bottom: 8px; font-weight: 600; font-size: .92rem; }
.mars-event div { margin: 1px 0; }
.mars-map { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; padding: 6px; border-radius: 14px; background: #5b2a1a; width: min(100%, 760px); margin: 0 auto; container-type: inline-size; }
.mt { position: relative; aspect-ratio: 1 / .86; border-radius: 8px; background: #c8663a; display: grid; place-items: center; cursor: pointer; overflow: hidden; font-size: clamp(14px, 4.2cqw, 34px); line-height: 1; user-select: none; }
.mt.t-plain { background: linear-gradient(145deg, #cf6d40, #b9552e); }
.mt.t-dune { background: linear-gradient(145deg, #dd8a55, #c9743f); }
.mt.t-crater { background: radial-gradient(circle at 50% 50%, #8e3d22 20%, #b9552e 70%); }
.mt.t-ice { background: linear-gradient(145deg, #cfeeff, #8ccbea); }
.mt.t-ridge { background: linear-gradient(145deg, #8a6b5a, #5e4639); }
.mt.t-base { background: linear-gradient(145deg, #e8e8e8, #b9bfc4); }
.mt .terr { position: absolute; left: 3px; top: 1px; font-size: .5em; opacity: .65; }
.mt .bld { filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.mt .crate { position: absolute; right: 2px; bottom: 0; font-size: .6em; }
.mt .rv { position: absolute; left: 2px; bottom: 0; font-size: .75em; display: flex; gap: 0; }
.mt .rv span { background: #fff; color: var(--ink); border-radius: 6px; padding: 0 3px; font-family: Gluten, serif; font-weight: 600; font-size: .6em; align-self: flex-end; border: 1px solid var(--ink); }
.mt.reach { box-shadow: inset 0 0 0 3px rgba(25,193,85,.95); }
.mt.here { box-shadow: inset 0 0 0 3px #ffb800, 0 0 0 2px #ffb800; z-index: 2; }
.mt.shield::after { content: ''; position: absolute; inset: 0; border: 2px dashed rgba(120,200,255,.8); border-radius: 8px; pointer-events: none; }
.mars-rovers { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 6px; }
.rvbtn { font: inherit; font-weight: 600; cursor: pointer; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
.rvbtn.on { background: rgba(25,193,85,.16); border-color: var(--brand); color: var(--brand-deep); }
.mars-palette { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 6px; margin-bottom: 10px; }
.mars-palette button { font: inherit; text-align: left; cursor: pointer; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--brand); background: #fff; color: var(--ink); line-height: 1.15; }
.mars-palette button b { display: block; font-size: .92rem; }
.mars-palette button small { color: rgba(20,73,54,.7); font-size: .75rem; }
.mars-palette button:disabled { opacity: .45; cursor: default; border-color: var(--line); }
.mars-palette button:not(:disabled):hover { background: rgba(25,193,85,.12); }
.mars-actions { margin-top: 6px; }
.guide { font-size: .86rem; } .guide div { padding: 3px 0; border-bottom: 1px solid var(--line); }

.sq-info.below { display: none; margin-top: 10px; font-size: .9rem; }
@media (max-width: 700px) { .sq-info.below { display: block; } .ring-center .sq-info { display: none; } .ring-center { gap: 6px; padding: 6px; justify-content: center; } .ring-center .logo { font-size: 1.1rem; } }
/* with the shared chat column docked right: slimmer sidebar so the board keeps its full size */
.ggc-side .gk-layout { grid-template-columns: minmax(0, 1fr) clamp(290px, 19vw, 340px); }

/* ===== rtwl.fun one-screen neon theme (layout only; board logic unchanged) ===== */
html:has(body.gk-page), body.gk-page {
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  color-scheme: dark;
}
body.gk-page { min-height: 0; touch-action: manipulation; }
body.gk-page, body.gk-page * { box-sizing: border-box; }
body.gk-page .gk-wrap {
  width: min(1180px, calc(100% - 16px));
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  padding: max(6px, env(safe-area-inset-top)) 0 max(8px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  box-sizing: border-box;
}
.gk-top { display: flex; align-items: center; gap: 10px 14px; flex-shrink: 0; min-height: 0; }
.gk-top .back { margin: 0; flex-shrink: 0; color: var(--fx-neon, #3dff8a); font-size: 0.92rem; }
body.gk-page .gk-top .gg-head { flex: 1 1 auto; min-width: 0; align-items: center; }
body.gk-page .gk-top h1 {
  margin: 0;
  font-size: clamp(1.15rem, 2.2vw + 0.4rem, 1.75rem);
  line-height: 1.1;
  filter: drop-shadow(0 0 12px rgba(25, 193, 85, 0.4));
}
body.gk-page .gg-links a,
body.gk-page .gk-side-btn,
body.gk-page .gk-side-close {
  font-weight: 600;
  color: var(--fx-text, #e6fff0);
  text-decoration: none;
  padding: 4px 12px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--fx-edge, rgba(61, 255, 138, 0.24));
  border-radius: 999px;
  background: rgba(25, 193, 85, 0.08);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}
body.gk-page .gg-links a:hover,
body.gk-page .gg-links a:focus-visible,
body.gk-page .gk-side-btn:hover,
body.gk-page .gk-side-close:hover {
  background: rgba(25, 193, 85, 0.16);
  border-color: var(--fx-neon, #3dff8a);
  outline: none;
}
body.gk-page .gk-side-btn,
body.gk-page .gk-side-close { display: none; }
.gk-side-head { display: none; }
.gk-side-mask { display: none; }
.gk-side-check {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
  border: 0; padding: 0; margin: -1px;
}
body.gk-page .gk-tag {
  flex-shrink: 0; max-width: none; margin: 0;
  font-size: 0.82rem; line-height: 1.3; color: var(--fx-dim, #a6d8bb);
}
body.gk-page .setup { flex-shrink: 0; margin: 0; padding: 8px 12px; }
body.gk-page .setup .row { flex-wrap: nowrap; gap: 8px 10px; align-items: flex-end; }
body.gk-page .setup .row > * { flex: 1 1 0; min-width: 0; }
body.gk-page .setup .row > .btn { flex: 0 0 auto; }
body.gk-page .setup .field { margin-bottom: 0; color: var(--fx-neon, #3dff8a); font-size: 0.72rem; letter-spacing: 0.1em; }
body.gk-page input[type=text],
body.gk-page select {
  margin-top: 3px; padding: 6px 10px; color: var(--fx-text, #e6fff0);
  background: rgba(3, 15, 9, 0.72); border: 1px solid rgba(61, 255, 138, 0.3); border-radius: 12px;
}
body.gk-page input::placeholder { color: #7fae96; }
body.gk-page input:focus,
body.gk-page select:focus { outline: 2px solid var(--fx-neon, #3dff8a); outline-offset: 1px; border-color: var(--fx-neon, #3dff8a); }
body.gk-page .btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; padding: 8px 16px; border-radius: 999px;
  background: linear-gradient(180deg, #3dff8a, #19c155); color: #03140b; box-shadow: 0 0 18px rgba(25, 193, 85, 0.45);
}
body.gk-page .btn:active { transform: translateY(1px); box-shadow: 0 0 10px rgba(25, 193, 85, 0.35); }
body.gk-page .btn.ghost {
  background: rgba(25, 193, 85, 0.08); color: var(--fx-text, #e6fff0); box-shadow: none;
  border: 1px solid var(--fx-edge, rgba(61, 255, 138, 0.24));
}
body.gk-page .btn:disabled { opacity: .5; cursor: default; }
body.gk-page kbd {
  background: rgba(3, 15, 9, 0.55); border: 1px solid var(--fx-edge, rgba(61, 255, 138, 0.24));
  color: var(--fx-text, #e6fff0);
}
body.gk-page .btn.ghost kbd { background: rgba(3, 15, 9, 0.55); border-color: var(--fx-edge, rgba(61, 255, 138, 0.24)); }

body.gk-page .gk-layout {
  flex: 1 1 auto; min-height: 0; align-items: stretch;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 280px);
  gap: 10px;
}
body.gk-page .gk-main {
  display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 8px 12px 10px;
}
body.gk-page #stageEarth,
body.gk-page #stageMars:not([hidden]) {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden;
}
body.gk-page .gk-hud { flex-shrink: 0; margin-bottom: 6px; }
body.gk-page .hud-cell .k { color: var(--fx-neon, #3dff8a); }
body.gk-page .hud-cell .v { color: #fff; font-size: clamp(1.05rem, 2.2vh, 1.45rem); }
body.gk-page .nw-bar { background: rgba(3, 15, 9, 0.72); border-color: var(--fx-edge, rgba(61, 255, 138, 0.24)); }
body.gk-page .nw-fill { background: linear-gradient(90deg, #19c155, #3dff8a); }
body.gk-page .nw-ticks i { background: rgba(61, 255, 138, 0.35); }
body.gk-page .nw-val { color: var(--fx-text, #e6fff0); }

body.gk-page .ring-wrap {
  flex: 1 1 auto; min-height: 0; width: 100%;
  display: grid; place-items: center; container-type: size;
}
body.gk-page .ring {
  width: 100%;
  max-width: 760px;
  max-height: 100%;
  height: auto;
  margin: 0;
  background: #052e18;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 24px rgba(25, 193, 85, 0.28);
}
@supports not (container-type: size) {
  body.gk-page .ring { width: min(100%, 70vw, calc(100dvh - 16rem)); }
}
body.gk-page .sq {
  background: #0a1f14;
  color: var(--fx-text, #e6fff0);
}
body.gk-page .sq:hover { background: #123225; }
body.gk-page .sq .band { border-bottom-color: rgba(61, 255, 138, 0.2); }
body.gk-page .sq.own { background: color-mix(in srgb, var(--oc) 28%, #0a1f14); }
body.gk-page .ring-center {
  background: radial-gradient(circle at 50% 30%, #0d2a18, #04150d);
  color: var(--fx-text, #e6fff0);
}
body.gk-page .ring-center .logo { color: var(--fx-neon, #3dff8a); filter: drop-shadow(0 0 10px rgba(61, 255, 138, 0.4)); }
body.gk-page .status-line { color: #fff; }
body.gk-page .die { background: #e6fff0; border-color: #19c155; box-shadow: 0 3px 0 #0e7a36; }
body.gk-page .die i.on { background: #03140b; }
body.gk-page .sq-info {
  background: rgba(3, 15, 9, 0.72);
  border-color: var(--fx-edge, rgba(61, 255, 138, 0.24));
  color: var(--fx-text, #e6fff0);
}
body.gk-page .sq-info tr.hl { background: rgba(25, 193, 85, 0.22); }
body.gk-page .msg { color: #7dffb0; }
body.gk-page .msg.bad { color: #ffb4ab; }
body.gk-page .muted, body.gk-page .tiny { color: var(--fx-dim, #a6d8bb); }

body.gk-page .gk-side {
  min-height: 0; overflow: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 8px;
}
body.gk-page .gk-side .panel { margin: 0; padding: 10px 12px; }
body.gk-page .gk-side h3 { color: #fff; text-shadow: 0 0 14px rgba(25, 193, 85, 0.35); margin: 0 0 8px; font-size: 1.05rem; }
body.gk-page .plr.on { border-color: #ffb800; background: rgba(255, 184, 0, 0.12); }
body.gk-page .plr .ps, body.gk-page .plr .pm small, body.gk-page .erow .lv { color: var(--fx-dim, #a6d8bb); }
body.gk-page .empire { max-height: none; flex: 1 1 auto; }
body.gk-page .erow { border-bottom-color: var(--fx-edge, rgba(61, 255, 138, 0.24)); }
body.gk-page .erow button {
  background: rgba(3, 15, 9, 0.72); color: var(--fx-text, #e6fff0);
  border-color: var(--fx-neon, #3dff8a);
}
body.gk-page .log { max-height: 160px; min-height: 80px; }
body.gk-page .log div { color: var(--fx-text, #e6fff0); }
body.gk-page .tab { background: rgba(3, 15, 9, 0.55); color: var(--fx-dim, #a6d8bb); border-color: var(--fx-edge, rgba(61, 255, 138, 0.24)); padding: 4px 10px; }
body.gk-page .tab.on { background: rgba(25, 193, 85, 0.16); color: #7dffb0; border-color: var(--fx-neon, #3dff8a); }
body.gk-page .gk-board-table { font-size: 0.9rem; }
body.gk-page .modal { background: rgba(0, 0, 0, 0.62); }
body.gk-page .modal-card {
  background: linear-gradient(160deg, rgba(10, 46, 28, 0.98), rgba(3, 15, 9, 0.98) 55%);
  color: var(--fx-text, #e6fff0);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 30px rgba(25, 193, 85, 0.25);
}
body.gk-page .modal-card h3 { color: #fff; }
body.gk-page .modal-card td { border-bottom-color: var(--fx-edge, rgba(61, 255, 138, 0.24)); }
body.gk-page .modal-card tr.tot td { border-top-color: var(--fx-neon, #3dff8a); }

body.gk-page .chip {
  background: rgba(3, 15, 9, 0.72);
  border-color: var(--fx-edge, rgba(61, 255, 138, 0.24));
  color: var(--fx-text, #e6fff0);
}
body.gk-page .chip .k { color: var(--fx-neon, #3dff8a); }
body.gk-page .chip.low { border-color: #d92d20; background: rgba(217, 45, 32, 0.18); }
body.gk-page .tbar { background: rgba(3, 15, 9, 0.72); border-color: var(--fx-edge, rgba(61, 255, 138, 0.24)); }
body.gk-page .mars-title { color: #fff; }
body.gk-page .mars-goal { color: var(--fx-neon, #3dff8a); }
body.gk-page .mars-event { background: rgba(255, 184, 0, 0.14); border-color: #ffb800; color: var(--fx-text, #e6fff0); }
body.gk-page .rvbtn {
  background: rgba(3, 15, 9, 0.72); color: var(--fx-text, #e6fff0);
  border-color: var(--fx-edge, rgba(61, 255, 138, 0.24));
}
body.gk-page .rvbtn.on { background: rgba(25, 193, 85, 0.16); border-color: var(--fx-neon, #3dff8a); color: #7dffb0; }
body.gk-page .mars-palette button {
  background: rgba(3, 15, 9, 0.72); color: var(--fx-text, #e6fff0); border-color: var(--fx-neon, #3dff8a);
}
body.gk-page .mars-palette button small { color: var(--fx-dim, #a6d8bb); }
body.gk-page .mars-palette button:not(:disabled):hover { background: rgba(25, 193, 85, 0.16); }
body.gk-page .guide div { border-bottom-color: var(--fx-edge, rgba(61, 255, 138, 0.24)); }

@media (min-width: 800px) { body.gk-page .ggc-fab { right: 20px; } }
@media (max-width: 960px) {
  body.gk-page .gk-layout { grid-template-columns: 1fr; }
  body.gk-page .gk-side-btn { display: inline-flex; }
  body.gk-page .gk-side {
    display: none; position: fixed;
    inset: max(10px, env(safe-area-inset-top)) 12px max(10px, env(safe-area-inset-bottom));
    z-index: 90; max-width: 420px; margin: 0 auto; width: calc(100% - 24px);
    background: linear-gradient(160deg, rgba(10, 46, 28, 0.98), rgba(3, 15, 9, 0.98) 55%);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7), 0 0 30px rgba(25, 193, 85, 0.25);
    border-radius: 16px; padding: 12px;
  }
  body.gk-page .gk-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; }
  body.gk-page .gk-side-head h3 { margin: 0; color: #fff; }
  body.gk-page .gk-side-close { display: inline-flex; }
  #gk-show-side:checked ~ .gk-side-mask {
    display: block; position: fixed; inset: 0; z-index: 85; background: rgba(0, 0, 0, 0.62); cursor: pointer;
  }
  #gk-show-side:checked ~ .gk-layout .gk-side { display: flex; }
  #gk-show-side:checked ~ .gk-top .gk-side-btn { border-color: var(--fx-neon, #3dff8a); background: rgba(25, 193, 85, 0.2); }
}
@media (max-width: 640px) {
  .back-full { display: none; }
  body.gk-page .setup .row { flex-wrap: wrap; }
  body.gk-page .setup .row > * { flex: 1 1 calc(50% - 10px); }
  body.gk-page .setup .row > .btn { flex: 1 1 100%; }
  body.gk-page .gk-top { flex-wrap: wrap; gap: 4px 8px; }
  body.gk-page .gk-top .gg-head { display: contents; }
  body.gk-page .gk-top h1 { font-size: 1.12rem; flex: 1 1 auto; min-width: 0; }
  body.gk-page .gk-top .gg-links { width: 100%; justify-content: center; flex-wrap: nowrap; gap: 6px; }
  body.gk-page .gg-links a, body.gk-page .gk-side-btn { min-height: 30px; padding: 3px 10px; font-size: 0.88rem; }
  body.gk-page .gk-wrap { width: calc(100% - 12px); gap: 5px; }
  body.gk-page .gk-tag { display: none; }
}
@media (max-height: 720px) { body.gk-page .gk-tag { display: none; } }
@media (max-height: 520px) {
  body.gk-page .gk-wrap { padding-top: 4px; padding-bottom: 4px; gap: 4px; }
  body.gk-page .setup { padding: 4px 10px; }
  body.gk-page .setup .field { font-size: 0; letter-spacing: 0; }
  body.gk-page .setup input, body.gk-page .setup select { padding: 4px 8px; font-size: 0.88rem; letter-spacing: 0; text-transform: none; }
  body.gk-page .gk-hud { margin-bottom: 2px; }
  body.gk-page .hud-cell .v { font-size: 1rem; }
  body.gk-page .gk-rules, body.gk-page .gk-tag { display: none; }
  body.gk-page .gk-top h1 { font-size: 1.05rem; }
  body.gk-page .gk-main { padding: 4px 8px 6px; }
  body.gk-page .btn { padding: 6px 12px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  body.gk-page .setup .row { flex-wrap: nowrap; }
  body.gk-page .setup .row > * { flex: 1 1 0; }
  body.gk-page .setup .row > .btn { flex: 0 0 auto; }
  body.gk-page .gk-layout { grid-template-columns: minmax(0, 1fr) minmax(180px, 230px); }
  body.gk-page .gk-side {
    display: flex; position: static; inset: auto; max-width: none; margin: 0; width: auto;
    background: transparent; box-shadow: none; border-radius: 0; padding: 0;
  }
  body.gk-page .gk-side-btn, body.gk-page .gk-side-close, body.gk-page .gk-side-head { display: none; }
}
@media (prefers-reduced-motion: reduce) { body.gk-page .btn:active { transform: none; } }

@media (max-width: 700px) {
  body.gk-page .ring-center .logo { display: none; }
  body.gk-page .ring-center { gap: 4px; padding: 4px 6px; overflow: auto; }
  body.gk-page .status-line { min-height: 0; }
}
