* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --sea: #1b75bb;
  --sea-deep: #145d96;
  --navy: #10395c;
  --navy-2: #0d2f4d;
  --panel: rgba(13, 47, 77, 0.95);
  --panel-light: rgba(255, 255, 255, 0.08);
  --gold: #f4c542;
  --text: #eef4f8;
  --muted: #9db8cc;
  --red: #e74c3c;
  --green: #27ae60;
}

html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: linear-gradient(180deg, #1b75bb, #1668a8);
  color: var(--text);
  user-select: none;
}

.hidden { display: none !important; }
.screen { position: fixed; inset: 0; }

/* ============ HOME / LOBBY ============ */
#screen-home, #screen-lobby { display: flex; align-items: center; justify-content: center; overflow-y: auto; }
.home-card {
  background: var(--panel);
  border-radius: 16px;
  padding: 32px 36px;
  width: min(430px, 94vw);
  display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
  text-align: center;
  margin: 20px 0;
}
.logo { font-size: 34px; letter-spacing: 1px; }
.logo-sub { display: block; font-size: 14px; color: var(--gold); font-weight: 600; letter-spacing: 3px; text-transform: uppercase; }
.txt {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 16px;
  outline: none;
  width: 100%;
}
.txt:focus { border-color: var(--gold); }
.code-input { text-transform: uppercase; letter-spacing: 8px; font-weight: 700; text-align: center; }
.join-row { display: flex; gap: 10px; }
.btn {
  border: none; border-radius: 8px; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--text);
  background: rgba(255,255,255,.12);
  padding: 10px 16px;
  transition: transform .08s, background .15s, box-shadow .15s;
}
.btn:hover:not(:disabled) { background: rgba(255,255,255,.22); }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .35; cursor: default; }
.btn-primary { background: linear-gradient(180deg, #f5b942, #e09b28); color: #3a2506; }
.btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffc95a, #efa832); }
.btn-secondary { background: rgba(255,255,255,.14); }
.btn-big { padding: 14px; font-size: 17px; }
.err { color: #ff8f80; font-size: 14px; min-height: 18px; }
.hint { color: var(--muted); font-size: 13px; }
.room-code { color: var(--gold); letter-spacing: 6px; font-weight: 800; }
.lan-info { font-size: 13px; color: var(--muted); line-height: 1.6; background: rgba(0,0,0,.25); border-radius: 8px; padding: 8px; }
.lan-info b { color: var(--gold); user-select: text; }
.lobby-players { display: flex; flex-direction: column; gap: 8px; }
.lobby-player {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-light); border-radius: 8px; padding: 10px 12px; font-size: 15px;
}
.lobby-player .dot { width: 16px; height: 16px; border-radius: 50%; flex: none; }
.lobby-player .who { flex: 1; text-align: left; }
.lobby-player .tag { font-size: 11px; color: var(--muted); }
.lobby-player .kick { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; }
.lobby-player .kick:hover { color: var(--red); }
.lobby-settings { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--muted); background: rgba(0,0,0,.18); border-radius: 10px; padding: 12px 14px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.setting-row label { font-weight: 600; }
.sel { width: auto; padding: 6px 10px; font-size: 14px; }
.setting-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--gold); }
.mode-toggle { display: flex; gap: 6px; }
.mode-btn {
  border: 2px solid rgba(255,255,255,.2); background: rgba(255,255,255,.08); color: var(--muted);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.mode-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(244,197,66,.12); }
.mode-btn:disabled { opacity: .5; cursor: default; }
.lobby-actions { display: flex; gap: 10px; }
.lobby-actions .btn-primary { flex: 1; }

/* ============ GAME TOP BARS ============ */
#top-hud {
  position: fixed; left: 8px; right: 8px; top: 8px; z-index: 22;
  display: flex; align-items: flex-start; gap: 8px;
}
#top-left { display: flex; gap: 6px; flex: none; }
.round-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer; font-size: 20px;
  background: var(--panel); color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
}
.round-btn:hover { background: var(--navy); }

#bank-panel {
  margin: 0 auto; flex: 0 1 auto; min-width: 0;
  background: var(--panel); border-radius: 12px; padding: 7px 10px;
  display: flex; gap: 6px; align-items: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
#bank-panel .bank-icon { font-size: 22px; margin-right: 2px; }
.bank-card {
  width: 38px; height: 50px; border-radius: 6px; position: relative; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  border: 1.5px solid rgba(255,255,255,.5);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.3), inset 0 -2px 0 rgba(0,0,0,.2);
}
.bank-card .cnt {
  position: absolute; top: -7px; right: -7px; background: #fff; color: #1b3a55;
  font-size: 11px; font-weight: 800; border-radius: 999px; min-width: 20px; height: 18px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}

#awards-panel { display: flex; gap: 6px; flex: none; }
.award-box {
  background: var(--panel); border-radius: 10px; padding: 5px 8px; text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.35); font-size: 12px; min-width: 56px;
}
.award-box .aicon { font-size: 17px; display: block; }
.award-box .aname { color: var(--muted); font-size: 9.5px; }
.award-box .aholder { font-weight: 800; font-size: 11px; display: block; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ PLAYERS ROW ============ */
#players-panel {
  position: fixed; left: 50%; transform: translateX(-50%); top: 68px; z-index: 20;
  display: flex; gap: 10px; max-width: 96vw; overflow-x: auto; padding: 2px 4px 6px;
}
.player-card {
  min-width: 168px; border-radius: 10px; overflow: hidden;
  background: var(--panel); box-shadow: 0 6px 16px rgba(0,0,0,.35);
  flex: none;
}
.player-card .phead {
  display: flex; align-items: center; gap: 7px; padding: 5px 9px;
  font-weight: 700; font-size: 14px; color: #fff;
}
.player-card .phead .vpbadge {
  background: rgba(0,0,0,.35); border: 2px solid #fff; color: #fff;
  min-width: 26px; height: 26px; border-radius: 50%; font-size: 14px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.player-card .phead .pname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.player-card .phead .off { font-size: 11px; }
.player-card .pbody { padding: 5px 9px 7px; display: flex; flex-direction: column; gap: 4px; }
.player-card .prow { display: flex; gap: 9px; font-size: 12px; color: var(--text); align-items: center; }
.player-card .stat { display: flex; align-items: center; gap: 3px; }
.player-card .stat small { color: var(--muted); }
.player-card .stat.award { color: var(--gold); font-weight: 800; }
.player-card .pieces { font-weight: 700; }
.player-card .action-strip {
  background: #2b8fd6; color: #fff; font-weight: 700; font-size: 13px;
  padding: 5px 9px; text-align: center; letter-spacing: .3px;
}
.player-card .action-strip .timer { font-variant-numeric: tabular-nums; margin-left: 6px; }
.player-card .action-strip .timer.low { color: #ffd0c9; }
.player-card.current { outline: 3px solid var(--gold); box-shadow: 0 0 20px rgba(244,197,66,.5); }
.player-card .gain-anchor { position: relative; }

/* floating +resource chips */
.gain-chip {
  position: fixed; z-index: 60; pointer-events: none;
  background: rgba(255,255,255,.95); color: #1b3a55; font-weight: 800; font-size: 15px;
  border-radius: 999px; padding: 3px 10px; box-shadow: 0 3px 10px rgba(0,0,0,.35);
  animation: chipUp 1.6s ease-out forwards;
}
.gain-chip.loss { background: rgba(231, 76, 60, .95); color: #fff; }
@keyframes chipUp {
  0% { opacity: 0; transform: translateY(6px) scale(.7); }
  15% { opacity: 1; transform: translateY(0) scale(1.05); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-34px) scale(.95); }
}

/* ============ BOARD ============ */
#board-wrap { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#board { width: 100%; height: 100%; max-width: 1000px; }

.hex-ring { stroke-linejoin: round; }
.hex-base { stroke-linejoin: round; }
.hex-tile { stroke-linejoin: round; transition: filter .25s; }
.hex-group.robber-target { cursor: pointer; }
.hex-group.robber-target .hex-tile:hover { filter: brightness(1.22); }
.hex-group.producing .hex-tile { animation: hexGlow 1.8s ease; }
@keyframes hexGlow {
  0%, 100% { filter: brightness(1); }
  20%, 60% { filter: brightness(1.45) saturate(1.2); }
}
.hex-group.producing .token-rect { animation: tokenPop 1.8s ease; }
@keyframes tokenPop {
  0%, 100% { transform: scale(1); }
  20% { transform: scale(1.35); }
  40% { transform: scale(1.15); }
  60% { transform: scale(1.3); }
}
.tile-art, .hex-num { pointer-events: none; }
.token-g { transform-box: fill-box; transform-origin: center; }
.token-rect { fill: #f8f3e3; stroke: #d9cba4; stroke-width: 1.5; }
.token-text { font-weight: 800; fill: #1e5c34; text-anchor: middle; }
.token-text.hot { fill: #d8231d; }
.token-pips { fill: #1e5c34; }
.token-pips.hot { fill: #d8231d; }
.robber { fill: #8e97a4; stroke: #5d6570; stroke-width: 2; pointer-events: none; }
.robber-g.hop { animation: robberHop .6s ease; transform-box: fill-box; transform-origin: center; }
@keyframes robberHop {
  0% { transform: translateY(-26px) scale(1.25); opacity: .4; }
  60% { transform: translateY(3px) scale(.95); opacity: 1; }
  100% { transform: translateY(0) scale(1); }
}
.port-group text { font-weight: 800; text-anchor: middle; }

.road-outline { stroke: rgba(20, 20, 20, .55); stroke-linecap: round; }
.road { stroke-linecap: round; }
.building { stroke: rgba(20,20,20,.55); stroke-width: 2; }
.piece-pop { animation: piecePop .5s cubic-bezier(.2, 1.6, .4, 1); transform-box: fill-box; transform-origin: center; }
@keyframes piecePop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

/* placement targets: colonist-style translucent sand circles */
.spot-group { cursor: pointer; }
.spot-hit { fill: transparent; }
.spot {
  fill: rgba(226, 205, 141, .5); stroke: rgba(180, 155, 85, .85); stroke-width: 2.5; pointer-events: none;
  animation: pulse 1.3s ease-in-out infinite;
}
.spot-group:hover .spot { fill: rgba(244,197,66,.85); animation: none; }
.edge-group { cursor: pointer; }
.edge-hit { stroke: transparent; stroke-width: 40; stroke-linecap: round; }
.edge-spot { stroke: rgba(226, 205, 141, .75); stroke-width: 12; stroke-linecap: round; pointer-events: none; animation: pulse 1.3s ease-in-out infinite; }
.edge-group:hover .edge-spot { stroke: rgba(244,197,66,.95); animation: none; }
@keyframes pulse { 0%, 100% { opacity: .95; } 50% { opacity: .5; } }

/* ============ SIDE PANEL ============ */
#side-panel {
  position: fixed; right: 10px; top: 170px; bottom: 130px; width: 280px; z-index: 18;
  background: var(--panel); border-radius: 12px; display: flex; flex-direction: column;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.side-tabs { display: flex; border-bottom: 1px solid rgba(255,255,255,.1); }
.side-tab {
  flex: 1; background: none; border: none; color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 10px 0; cursor: pointer; position: relative;
}
.side-tab.active { color: var(--gold); border-bottom: 2px solid var(--gold); }
.badge {
  position: absolute; top: 4px; right: 8px; background: var(--red); border-radius: 999px;
  font-size: 10px; min-width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center;
  color: #fff; padding: 0 4px;
}
.tab-body { flex: 1; overflow-y: auto; padding: 8px 10px; font-size: 13px; display: flex; flex-direction: column; }
#tab-log .entry { padding: 3px 2px; line-height: 1.45; border-bottom: 1px solid rgba(255,255,255,.04); }
#tab-chat { padding: 0; }
#chat-messages { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.chat-msg b { font-weight: 700; }
.chat-input-row { display: flex; gap: 6px; padding: 8px; border-top: 1px solid rgba(255,255,255,.1); }
.chat-input-row .txt { padding: 8px 10px; font-size: 13px; }
.chat-input-row .btn { padding: 8px 12px; }
#side-toggle {
  display: none; position: fixed; right: 10px; bottom: 170px; z-index: 21;
  background: var(--panel); border: none; border-radius: 50%; width: 46px; height: 46px;
  font-size: 20px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.35); color: var(--text);
}
#tab-stats .bar-row { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
#tab-stats .bar-label { width: 20px; text-align: right; color: var(--muted); font-size: 12px; }
#tab-stats .bar { height: 14px; background: var(--gold); border-radius: 3px; min-width: 2px; }
#tab-stats .bar.hot { background: var(--red); }
#tab-stats .bar-count { font-size: 11px; color: var(--muted); }

/* ============ BOTTOM BAR ============ */
#bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; align-items: flex-end; gap: 14px;
  padding: 10px 14px 12px;
  background: linear-gradient(180deg, transparent, rgba(8, 30, 50, .9) 35%);
  pointer-events: none;
}
#bottom-bar > * { pointer-events: auto; }
#hand-cards { display: flex; gap: 6px; align-items: flex-end; min-height: 78px; }
.rescard {
  width: 54px; height: 76px; border-radius: 9px; position: relative;
  display: flex; align-items: center; justify-content: center; font-size: 27px;
  box-shadow: 0 4px 12px rgba(0,0,0,.45), inset 0 2px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.2);
  border: 2px solid #f6ecd2;
  transition: transform .1s;
}
.rescard::after {
  content: ''; position: absolute; inset: 5px; border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,.35); pointer-events: none;
}
.rescard:hover { transform: translateY(-6px); }
.rescard .cnt {
  position: absolute; top: -8px; right: -8px; background: #fff; color: #222;
  font-size: 13px; font-weight: 800; border-radius: 999px; min-width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(0,0,0,.4);
  padding: 0 4px;
}
.rescard.bump { animation: cardBump .45s ease; }
@keyframes cardBump {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-10px) scale(1.12); }
  100% { transform: translateY(0) scale(1); }
}
#dev-cards { display: flex; gap: 6px; align-items: flex-end; }
.devcard {
  width: 54px; height: 76px; border-radius: 9px; cursor: pointer; position: relative;
  background: linear-gradient(160deg, #8a63b8, #4a3268);
  border: 2px solid #f6ecd2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: 0 4px 12px rgba(0,0,0,.45);
  transition: transform .1s;
}
.devcard:hover { transform: translateY(-6px); }
.devcard small { font-size: 8.5px; text-align: center; line-height: 1.1; margin-top: 2px; color: #e8ddf5; }
.devcard.unplayable { filter: grayscale(.6) brightness(.75); cursor: default; }
.devcard .cnt {
  position: absolute; top: -8px; right: -8px; background: #fff; color: #222;
  font-size: 13px; font-weight: 800; border-radius: 999px; min-width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

#action-bar { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.action-btn {
  font-size: 23px; width: 58px; height: 58px; padding: 0; border-radius: 14px; position: relative;
  background: linear-gradient(180deg, rgba(245, 250, 253, .95), rgba(208, 226, 238, .95));
  border: 2.5px solid #fff; color: #1b3a55;
  box-shadow: 0 4px 12px rgba(0,0,0,.35), inset 0 -3px 0 rgba(0,0,0,.08);
}
.action-btn:hover:not(:disabled) { background: linear-gradient(180deg, #fff, #ddeaf4); }
.action-btn:disabled { opacity: .28; }
#btn-roll { width: auto; padding: 0 18px; font-size: 17px; }
#btn-vote-roll { width: auto; padding: 0 14px; font-size: 15px; }
#btn-end-turn { font-size: 24px; }
.action-btn.armed { outline: 3px solid var(--gold); background: rgba(244,197,66,.3); }
.action-btn[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: 64px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,.85); color: #fff; font-size: 12px; padding: 6px 10px;
  border-radius: 6px; white-space: nowrap; pointer-events: none; z-index: 30;
}
#dice-area { display: flex; align-items: center; gap: 8px; }
.die {
  display: inline-flex; width: 44px; height: 44px; background: #fff; color: #222;
  border-radius: 8px; font-size: 30px; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(0,0,0,.4); margin-right: 4px;
}

#status-strip {
  position: fixed; bottom: 106px; left: 50%; transform: translateX(-50%);
  font-size: 14px; font-weight: 600; color: var(--gold); z-index: 19;
  background: rgba(0,0,0,.45); border-radius: 999px; padding: 6px 16px;
  display: none; white-space: nowrap;
}
#status-strip.show { display: block; }

/* ============ DICE OVERLAY ============ */
#dice-overlay {
  position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 55;
  display: flex; align-items: center; gap: 18px; pointer-events: none;
}
#dice-overlay.out { animation: diceOut .35s ease forwards; }
@keyframes diceOut { to { opacity: 0; transform: translate(-50%, -60%) scale(.8); } }
.big-die {
  width: 86px; height: 86px; background: linear-gradient(150deg, #fff, #e8e8ee);
  border-radius: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.5), inset 0 -4px 0 rgba(0,0,0,.12);
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  padding: 12px; gap: 2px;
}
.big-die.tumble { animation: tumble .12s linear infinite; }
@keyframes tumble {
  0% { transform: rotate(-9deg) translateY(-3px); }
  50% { transform: rotate(8deg) translateY(3px); }
  100% { transform: rotate(-9deg) translateY(-3px); }
}
.big-die .pip { border-radius: 50%; background: #23232d; opacity: 0; margin: auto; width: 14px; height: 14px; }
.big-die .pip.on { opacity: 1; }
#dice-sum {
  position: absolute; left: 50%; top: 110px; transform: translateX(-50%);
  background: #fff; color: #23232d; font-size: 26px; font-weight: 800;
  border-radius: 999px; min-width: 52px; height: 52px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.45); opacity: 0; transition: opacity .2s, transform .2s;
  padding: 0 10px;
}
#dice-sum.show { opacity: 1; transform: translateX(-50%) scale(1.08); }
#dice-sum.hot { background: #d8231d; color: #fff; }

/* flying cards */
.fly-card {
  position: fixed; z-index: 58; width: 44px; height: 62px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  border: 2px solid #f6ecd2; box-shadow: 0 6px 18px rgba(0,0,0,.45);
  pointer-events: none;
  transition: transform .75s cubic-bezier(.35, 0, .3, 1), opacity .75s ease;
}
.fly-card.hiddencard { background: linear-gradient(160deg, #8a63b8, #4a3268); }

/* ============ TRADE OFFERS ============ */
#trade-offers { position: fixed; left: 50%; transform: translateX(-50%); top: 168px; z-index: 25; display: flex; flex-direction: column; gap: 8px; max-width: min(480px, 94vw); }
.offer-card {
  background: var(--panel); border-radius: 12px; padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.45); font-size: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.offer-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.offer-res { display: inline-flex; align-items: center; gap: 2px; background: rgba(255,255,255,.1); padding: 2px 8px; border-radius: 6px; font-weight: 700; }
.offer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.offer-actions .btn { padding: 6px 14px; font-size: 13px; }
.accepted-tag { color: var(--green); font-weight: 700; font-size: 13px; }
.rejected-tag { color: var(--red); font-weight: 700; font-size: 13px; }

/* ============ MODALS ============ */
#modal-backdrop {
  position: fixed; inset: 0; background: rgba(4, 16, 28, .7); z-index: 70;
  display: flex; align-items: center; justify-content: center;
}
.modal {
  background: var(--panel); border-radius: 16px; padding: 24px;
  width: min(460px, 94vw); max-height: 88vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  display: flex; flex-direction: column; gap: 14px;
}
.modal h3 { font-size: 19px; text-align: center; }
.modal .sub { color: var(--muted); font-size: 13px; text-align: center; }
.res-picker { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.res-tile {
  width: 64px; border-radius: 10px; padding: 8px 0 6px; text-align: center; cursor: pointer;
  border: 2px solid rgba(255,255,255,.25); font-size: 24px; position: relative;
  transition: transform .08s;
}
.res-tile:hover { transform: scale(1.06); }
.res-tile .n { display: block; font-size: 15px; font-weight: 800; margin-top: 2px; }
.res-tile.dim { opacity: .35; cursor: default; }
.stepper-row { display: flex; align-items: center; gap: 8px; justify-content: center; }
.stepper { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.stepper .val {
  width: 52px; height: 52px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 21px; border: 2px solid rgba(255,255,255,.25); position: relative;
}
.stepper .val .n { position: absolute; bottom: -7px; right: -7px; background: #fff; color: #222; font-size: 12px; font-weight: 800; border-radius: 999px; min-width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.stepper .b2 { display: flex; gap: 4px; }
.stepper button {
  width: 24px; height: 22px; font-size: 14px; border-radius: 5px; border: none; cursor: pointer;
  background: rgba(255,255,255,.15); color: var(--text); font-weight: 800;
}
.stepper button:hover { background: rgba(255,255,255,.3); }
.modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.trade-cols { display: flex; gap: 16px; justify-content: center; }
.trade-col { flex: 1; text-align: center; }
.trade-col h4 { font-size: 13px; color: var(--muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 1px; }
.player-pick { display: flex; flex-direction: column; gap: 8px; }
.player-pick .btn { display: flex; align-items: center; gap: 10px; justify-content: flex-start; }
.player-pick .dot { width: 14px; height: 14px; border-radius: 50%; }
.win-trophy { font-size: 64px; text-align: center; }
.win-name { font-size: 24px; font-weight: 800; text-align: center; }
.vp-breakdown { font-size: 14px; color: var(--muted); text-align: center; line-height: 1.7; }
.cost-table { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.cost-table .cost-row { display: flex; justify-content: space-between; background: rgba(255,255,255,.06); border-radius: 8px; padding: 8px 12px; }

#toast {
  position: fixed; bottom: 140px; left: 50%; transform: translateX(-50%);
  background: rgba(200, 50, 40, .95); color: #fff; font-size: 14px; font-weight: 600;
  border-radius: 8px; padding: 10px 18px; z-index: 80; opacity: 0; pointer-events: none;
  transition: opacity .25s;
}
#toast.show { opacity: 1; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1150px) {
  #side-panel { display: none; }
  #side-panel.open { display: flex; left: auto; width: min(320px, 86vw); }
  #side-toggle { display: block; }
}
@media (max-width: 800px) {
  #top-hud { left: 4px; right: 4px; top: 4px; gap: 4px; }
  .round-btn { width: 38px; height: 38px; font-size: 17px; }
  #bank-panel { padding: 5px 7px; gap: 4px; }
  #bank-panel .bank-icon { display: none; }
  .bank-card { width: 30px; height: 42px; font-size: 14px; }
  .bank-card .cnt { font-size: 10px; min-width: 17px; height: 16px; top: -6px; right: -6px; }
  .award-box { padding: 4px 6px; min-width: 44px; }
  .award-box .aicon { font-size: 14px; }
  .award-box .aholder { max-width: 48px; font-size: 10px; }
  #players-panel { top: 66px; left: 6px; right: 6px; transform: none; justify-content: flex-start; }
  .player-card { min-width: 138px; }
  .player-card .phead { font-size: 12px; padding: 4px 7px; }
  .player-card .prow { font-size: 11px; gap: 6px; }
  #board-wrap { top: 145px; bottom: 96px; }
  #bottom-bar { gap: 8px; padding: 8px; flex-wrap: wrap; }
  .rescard, .devcard { width: 44px; height: 62px; font-size: 20px; }
  .action-btn { width: 48px; height: 48px; font-size: 18px; }
  #btn-roll { padding: 0 12px; font-size: 15px; }
  #status-strip { bottom: 112px; font-size: 12px; }
  #side-panel.open { top: 150px; bottom: 160px; }
  #dice-overlay { top: 46%; }
  .big-die { width: 66px; height: 66px; padding: 9px; }
  .big-die .pip { width: 11px; height: 11px; }
}
