[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); }
