/* ASTERVIA v0.2 — estilos */
:root {
  color-scheme: dark;
  --bg: #060a14;
  --panel: #0c1322;
  --panel-2: #101a2d;
  --line: rgba(160, 180, 210, 0.14);
  --line-strong: rgba(190, 210, 240, 0.28);
  --text: #e8eef8;
  --muted: #8796ad;
  --dim: #5d6b82;
  --accent: #8fb8f0;

  --red: #d9464b;
  --yellow: #e0aa12;
  --blue: #3d82ea;
  --green: #2fb463;
  --anomaly: #8a5cd6;

  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.c-red { --fc: var(--red); }
.c-yellow { --fc: var(--yellow); }
.c-blue { --fc: var(--blue); }
.c-green { --fc: var(--green); }
.c-anomaly { --fc: var(--anomaly); }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(61, 130, 234, 0.07), transparent 60%),
    var(--bg);
}
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app-shell { padding: 14px 18px 24px; max-width: 1760px; margin: 0 auto; }

/* ---------- topo ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 2px 2px 12px; }
.brand { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.brand-logo { height: 22px; width: auto; display: block; align-self: center; }
.eyebrow, .kicker { color: var(--muted); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.test-toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; cursor: pointer; }
.test-toggle input { accent-color: var(--accent); }
.ghost-btn { background: transparent; border: 1px solid var(--line-strong); border-radius: 10px; padding: 8px 13px; color: #c8d3e4; font-size: 13px; }
.ghost-btn:hover { background: rgba(255,255,255,.04); }

/* ---------- layout ---------- */
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.board-panel, .hud-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.board-panel { padding: 10px; min-width: 0; }

.board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px 8px; flex-wrap: wrap; }
.board-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 11.5px; }
.board-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-anomaly { background: var(--anomaly); }
.lg-start { border: 2px solid #e8eef8; border-radius: 4px; }
.lg-ship { height: 0; width: 16px; border-top: 2px dashed #c8d3e4; border-radius: 0; }
.lg-cross { border: 1.5px dashed #c8d3e4; border-radius: 50%; }
.lg-shield { border: 2px solid #e8eef8; border-radius: 50%; background: #1b2740; }

.zoom-controls { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; overflow: hidden; }
.icon-btn { background: transparent; border: 0; width: 34px; height: 30px; font-size: 16px; color: #c8d3e4; }
.icon-btn.wide { width: 58px; font-size: 12px; font-variant-numeric: tabular-nums; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.icon-btn:hover:not(:disabled) { background: rgba(255,255,255,.05); }
.icon-btn:disabled { color: var(--dim); }

.board-viewport { overflow: hidden; border-radius: 10px; display: block; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.board-viewport.zoomed { overflow: auto; }
.board-viewport.zoomed { cursor: grab; }
.board-viewport.panning { cursor: grabbing; user-select: none; }
.board { display: block; margin: 0 auto; flex: none; touch-action: manipulation; user-select: none; -webkit-user-select: none; }

/* ---------- SVG: tabuleiro ---------- */
.board-frame { fill: #0a1120; stroke: rgba(160,180,210,.10); }

.cell .cell-bg { fill: color-mix(in srgb, var(--fc) 74%, #0a1120); stroke: rgba(255,255,255,.16); stroke-width: 1; }
.cell.k-final .cell-bg { fill: color-mix(in srgb, var(--fc) 46%, #0a1120); stroke: color-mix(in srgb, var(--fc) 70%, white); stroke-width: 1.2; }
.cell.c-anomaly .cell-bg { fill: #4a2d85; stroke: #a98ae6; }
.anomaly-glyph { fill: #e3d6ff; transform: translateY(-4px); }
.cell-id {
  fill: #fff; font-size: 12px; font-weight: 700; text-anchor: middle; font-variant-numeric: tabular-nums;
  paint-order: stroke; stroke: rgba(0,0,0,.45); stroke-width: 2.4px; pointer-events: none;
}
.cell.c-anomaly .cell-id { font-size: 10px; }
.start-ring { fill: none; stroke: #f2f6fc; stroke-width: 2; }
.crossed-ring { fill: none; stroke: rgba(240,245,252,.75); stroke-width: 1.4; stroke-dasharray: 3 3; pointer-events: none; }
.cell.is-entry .cell-bg { stroke: #fff; stroke-width: 2; }
.cell.has-movable .cell-bg { stroke: #fff; stroke-width: 2; }

.gate { stroke: var(--fc); stroke-width: 10; stroke-linecap: round; opacity: .55; }
.rail { stroke: var(--fc); stroke-width: 4; opacity: .28; }

.ship-line { stroke: var(--fc); stroke-width: 2; stroke-dasharray: 6 6; opacity: .7; }
.ship-marker path { fill: var(--fc); stroke: rgba(0,0,0,.4); stroke-width: 1; }

.planet-body { stroke: rgba(190, 215, 250, .35); stroke-width: 1; }

.dest .dest-bg { fill: color-mix(in srgb, var(--fc) 32%, #0a1120); stroke: var(--fc); stroke-width: 2; }
.dest-id { fill: rgba(255,255,255,.75); font-size: 11px; font-weight: 700; text-anchor: middle; pointer-events: none; }
.dest-chip rect { fill: #0a1120; stroke: var(--fc); stroke-width: 1.2; }
.dest-chip text { fill: #e8eef8; font-size: 11px; font-weight: 700; text-anchor: middle; font-variant-numeric: tabular-nums; }
.dest-chip.inactive, .base.inactive { opacity: .35; }

.base .base-bg { fill: color-mix(in srgb, var(--fc) 10%, #0b1424); stroke: color-mix(in srgb, var(--fc) 55%, transparent); stroke-width: 1.2; }
.base.active .base-bg { stroke: var(--fc); stroke-width: 2.4; fill: color-mix(in srgb, var(--fc) 18%, #0b1424); }
.base-title { fill: var(--fc); font-size: 11.5px; font-weight: 800; letter-spacing: .1em; }
.base-player { fill: #dfe7f3; font-size: 11.5px; font-weight: 600; }
.base-slot { fill: rgba(0,0,0,.3); stroke: rgba(255,255,255,.12); stroke-dasharray: 3 3; }
.start-link { stroke: var(--fc); stroke-width: 3; stroke-linecap: round; opacity: .8; }

.pawn .pawn-body { fill: var(--fc); stroke: #f4f7fb; stroke-width: 2; }
.pawn .pawn-label { fill: #fff; font-weight: 800; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: rgba(0,0,0,.35); stroke-width: 2px; }
.pawn .pawn-shield { fill: none; stroke: rgba(244,247,251,.9); stroke-width: 1.2; }
.pawn .pawn-hit { fill: transparent; }
.pawn.movable { cursor: pointer; }
.pawn .pawn-halo { fill: none; stroke: #fff; stroke-width: 2.4; opacity: .85; animation: halo 1.1s ease-in-out infinite alternate; }
.pawn.selected .pawn-halo { stroke: var(--accent); }
.pawn.movable:hover .pawn-body, .pawn.movable:focus .pawn-body { stroke: var(--accent); stroke-width: 3; }
.pawn:focus { outline: none; }
.pawn.saved .pawn-body { stroke-width: 1.4; }
@keyframes halo { from { opacity: .35; } to { opacity: 1; } }
.stack-more circle { fill: #0a1120; stroke: #fff; stroke-width: 1; }
.stack-more text { fill: #fff; font-size: 8px; font-weight: 800; text-anchor: middle; }

.preview-target { fill: none; stroke: var(--fc); stroke-width: 2.5; stroke-dasharray: 5 4; animation: dash 1s linear infinite; pointer-events: none; }
@keyframes dash { to { stroke-dashoffset: -18; } }

/* ---------- HUD ---------- */
.hud { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.hud-card { padding: 14px; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-title h2 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.badge { font-size: 11px; color: #c9d6ea; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; font-variant-numeric: tabular-nums; }
.badge.muted { color: var(--muted); }

.turn-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.active-faction { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 24px; font-weight: 800; }
.faction-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--fc, #3a475c); display: inline-block; flex: none; }
.turn-card { border-color: color-mix(in srgb, var(--turn, transparent) 40%, var(--line)); }
html[data-turn="red"] .turn-card { --turn: var(--red); }
html[data-turn="yellow"] .turn-card { --turn: var(--yellow); }
html[data-turn="blue"] .turn-card { --turn: var(--blue); }
html[data-turn="green"] .turn-card { --turn: var(--green); }

.dice-row { display: grid; grid-template-columns: 72px 1fr; gap: 12px; margin-top: 12px; }
.dice { width: 72px; height: 72px; border-radius: 16px; display: grid; place-items: center; background: #eef2f8; color: #0b1222; font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; }
.dice.rolling { animation: diceShake .36s ease-out; }
@keyframes diceShake { 0%{transform:rotate(0) scale(1)} 30%{transform:rotate(-9deg) scale(1.06)} 60%{transform:rotate(7deg) scale(.97)} 100%{transform:rotate(0) scale(1)} }
.dice-controls { display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.primary-btn { border: 0; border-radius: 11px; background: #2f6fd6; color: #fff; font-weight: 700; padding: 12px 14px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.primary-btn:hover:not(:disabled) { background: #3a7be3; }
.primary-btn:disabled { opacity: .4; }
kbd { font: 11px ui-monospace, monospace; background: rgba(255,255,255,.16); border-radius: 4px; padding: 1px 5px; }
.forced-roll { border: 1px solid var(--line-strong); border-radius: 9px; background: var(--panel-2); padding: 6px 8px; font-size: 13px; }
.turn-hint { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.45; }

.move-options { margin-top: 10px; display: grid; gap: 6px; }
.move-btn { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px; background: rgba(143,184,240,.07); border: 1px solid rgba(143,184,240,.18); min-height: 44px; }
.move-btn:hover, .move-btn.selected { background: rgba(143,184,240,.14); border-color: rgba(143,184,240,.4); }
.move-btn strong { display: block; font-size: 13px; }
.move-btn small { color: var(--muted); font-size: 12px; }
.move-role { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--line-strong); font-weight: 800; font-size: 12px; flex: none; }

.players-panel { display: grid; gap: 8px; }
.player-row { border-radius: 11px; padding: 9px 10px; background: rgba(255,255,255,.02); border: 1px solid var(--line); }
.player-row.active { border-color: color-mix(in srgb, var(--fc) 60%, transparent); background: color-mix(in srgb, var(--fc) 7%, transparent); }
.player-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.player-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; }
.player-stats { display: flex; gap: 10px; color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.player-pawns { margin-top: 7px; display: flex; gap: 5px; flex-wrap: wrap; }
.role-chip { display: inline-flex; gap: 5px; align-items: center; font-size: 11px; padding: 2px 8px 2px 3px; border-radius: 999px; background: rgba(255,255,255,.04); color: var(--muted); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.role-chip b { width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--fc) 65%, #0a1120); color: #fff; font-size: 10px; }
.role-chip.s-saved { color: #cdeedd; }
.role-chip.s-base b { background: #2a3448; }

.resource-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.feature { font-size: 12px; color: var(--dim); border: 1px dashed var(--line); border-radius: 9px; padding: 8px 9px; }
.text-btn { background: none; border: 0; color: var(--muted); font-size: 11.5px; }
.event-log { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.log-entry { font-size: 12px; line-height: 1.45; color: #9fb0c8; border-left: 2px solid var(--line-strong); padding-left: 8px; }
.log-entry strong { color: #e1eaf7; }

/* ---------- toast e diálogos ---------- */
.toast {
  position: fixed; left: 50%; top: 14px; transform: translate(-50%, -16px); opacity: 0; pointer-events: none;
  background: #111b2f; border: 1px solid var(--line-strong); border-left: 4px solid var(--fc, var(--accent));
  border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; z-index: 90;
  transition: opacity .2s ease, transform .2s ease; max-width: min(420px, 92vw);
}
.toast span { color: var(--muted); font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: 18px; background: rgba(2,4,10,.78); backdrop-filter: blur(6px); }
.modal.open { display: grid; }
.modal-card { width: min(640px, 96vw); border-radius: 18px; padding: 22px; background: var(--panel); border: 1px solid var(--line-strong); }
.modal-card h2 { margin: 6px 0 6px; font-size: 26px; }
.setup-copy, .message-card p { color: var(--muted); line-height: 1.55; margin: 0 0 4px; }
.faction-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.faction-choice { position: relative; display: block; }
.faction-choice input { position: absolute; opacity: 0; pointer-events: none; }
.faction-choice-body { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; background: rgba(255,255,255,.02); min-height: 56px; }
.faction-choice input:focus-visible + .faction-choice-body { outline: 2px solid var(--accent); outline-offset: 2px; }
.faction-choice input:checked + .faction-choice-body { border-color: var(--fc); background: color-mix(in srgb, var(--fc) 9%, transparent); }
.faction-choice input:not(:checked) + .faction-choice-body { opacity: .55; }
.swatch { width: 14px; height: 14px; border-radius: 4px; background: var(--fc); flex: none; }
.faction-choice strong { display: block; font-size: 14px; }
.faction-choice small { color: var(--muted); font-size: 12px; }
.setup-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.setup-warning { color: var(--muted); font-size: 12px; }
.message-card { max-width: 440px; }
.message-card .primary-btn { margin-top: 14px; width: 100%; }

/* ---------- responsivo ---------- */
@media (max-width: 1100px) {
  .game-layout { grid-template-columns: 1fr; }
  .hud { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .turn-card { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .app-shell { padding: 8px 8px 20px; }
  .topbar { padding-bottom: 8px; }
  .brand-logo { height: 16px; }
  .brand .eyebrow { display: none; }
  .board-panel { padding: 6px; }
  .board-legend { font-size: 10.5px; gap: 4px 10px; }
  .game-layout { gap: 10px; }
  .hud { display: contents; }
  .faction-picker { grid-template-columns: 1fr; }
  .turn-card { position: sticky; bottom: 6px; z-index: 20; box-shadow: 0 -10px 30px rgba(0,0,0,.5); padding: 10px 12px; }
  .dice-row { grid-template-columns: 56px 1fr; margin-top: 8px; }
  .dice { width: 56px; height: 56px; font-size: 28px; border-radius: 13px; }
  .turn-hint { margin-top: 6px; font-size: 12px; }
  kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pawn .pawn-halo, .preview-target, .dice.rolling { animation: none; }
}

/* ================= v0.3: telas ================= */
.screen { display: none; }
body[data-screen="home"] #screenHome,
body[data-screen="join"] #screenJoin,
body[data-screen="lobby"] #screenLobby,
body[data-screen="game"] #screenGame { display: block; }
.screen-center { min-height: 100vh; min-height: 100dvh; padding: 24px 16px; }
body[data-screen="home"] #screenHome, body[data-screen="join"] #screenJoin, body[data-screen="lobby"] #screenLobby { display: grid; place-items: center; }

.home-card { width: min(460px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px 24px; }
#screenHome .home-card { text-align: center; padding: 40px 28px 28px; background: transparent; border-color: transparent; }
.home-logo { width: min(340px, 82%); height: auto; display: block; margin: 0 auto; }
.home-tag { color: var(--muted); letter-spacing: .18em; text-transform: uppercase; font-size: 11.5px; margin: 16px 0 36px; }
.home-actions { display: grid; gap: 10px; }
.big { min-height: 52px; font-size: 16px; width: 100%; }
.home-note { color: var(--dim); font-size: 12px; margin-top: 28px; }

.form-card h2, .lobby-card h2 { margin: 4px 0 18px; font-size: 24px; }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field span { font-size: 13px; color: #c8d3e4; font-weight: 600; }
.field input { background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 12px; font-size: 16px; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.field small { color: var(--muted); font-size: 12px; }
.form-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.form-actions .primary-btn { flex: 1; }

.lobby-card { width: min(560px, 100%); }
.lobby-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lobby-head h2 { margin-bottom: 6px; word-break: break-all; }
.conn-pill { font-size: 11.5px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 10px; white-space: nowrap; }
.conn-pill.on { color: #bfe9cf; border-color: rgba(47,180,99,.5); }
.lobby-status { color: #c8d3e4; margin: 4px 0 16px; font-size: 14px; }
.lobby-seats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seat { position: relative; display: flex; gap: 10px; align-items: center; text-align: left; border: 1px dashed var(--line-strong); border-radius: 12px; padding: 12px; min-height: 64px; background: transparent; }
.seat:not(:disabled):hover { border-color: var(--fc); background: color-mix(in srgb, var(--fc) 6%, transparent); }
.seat.taken { border-style: solid; border-color: color-mix(in srgb, var(--fc) 55%, transparent); background: color-mix(in srgb, var(--fc) 8%, transparent); cursor: default; }
.seat.mine { border-color: var(--fc); box-shadow: inset 0 0 0 1px var(--fc); }
.seat strong { display: block; font-size: 14px; }
.seat small { color: var(--muted); font-size: 12.5px; }
.seat.taken small { color: #e8eef8; }
.seat:disabled:not(.taken) { opacity: .7; }
.seat .dot { position: absolute; top: 10px; right: 10px; }
.seat-extra { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #5d6b82; display: inline-block; flex: none; }
.dot.on { background: #2fb463; }
.lobby-hint { color: var(--dim); font-size: 12px; margin: 10px 0 18px; }
.lobby-foot { display: grid; gap: 14px; }
.lobby-buttons { display: flex; justify-content: space-between; gap: 10px; }
.lobby-buttons .primary-btn { flex: 1; }
.lobby-help { margin-top: 18px; color: var(--muted); font-size: 13px; line-height: 1.5; border-top: 1px solid var(--line); padding-top: 12px; }
.lobby-help summary { cursor: pointer; color: #c8d3e4; }

/* ================= v0.3: HUD por jogador ================= */
.badge.warn { color: #ffd98a; border-color: rgba(224,170,18,.4); }
.me-line { display: flex; align-items: center; gap: 10px; }
.me-line .faction-dot { width: 14px; height: 14px; }
.me-name { font-size: 20px; font-weight: 800; line-height: 1.1; }
.me-faction { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.turn-card.my-turn { border-color: var(--fc); box-shadow: 0 0 0 1px color-mix(in srgb, var(--fc) 40%, transparent); }
.dice-wrap { display: grid; gap: 4px; justify-items: center; }
.dice-by { font-size: 10.5px; color: var(--muted); text-align: center; max-width: 80px; line-height: 1.2; }
.turn-line { font-size: 13.5px; color: #c8d3e4; }
.turn-line b { font-weight: 800; }
.forced-roll[hidden] { display: none !important; }
.forced-roll { display: block; }
.move-role { background: color-mix(in srgb, var(--fc) 70%, #0a1120); color: #fff; border-color: transparent; }

.power { border: 1px solid color-mix(in srgb, var(--fc) 35%, var(--line)); border-radius: 11px; padding: 10px 11px; background: color-mix(in srgb, var(--fc) 6%, transparent); margin-bottom: 10px; }
.power-head { display: flex; justify-content: space-between; align-items: center; }
.power-kicker { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--fc); font-weight: 700; }
.power strong { display: block; margin-top: 3px; font-size: 14px; }
.power p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.soon { font-size: 10px; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px; margin-left: 4px; white-space: nowrap; }
.crew { display: grid; gap: 6px; }
.crew-row { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 10px; background: rgba(255,255,255,.02); border: 1px solid var(--line); }
.crew-role { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--fc); color: #fff; font-weight: 800; font-size: 13px; flex: none; border: 2px solid #f4f7fb; }
.crew-row.s-base .crew-role { background: #2a3448; border-color: #5d6b82; }
.crew-main { min-width: 0; flex: 1; }
.crew-top { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.crew-status { color: var(--muted); font-size: 12px; text-align: right; }
.crew-row.s-saved .crew-status { color: #9fe0b8; }
.crew-ability { color: var(--muted); font-size: 12px; margin-top: 1px; }
.player-nick { color: #c8d3e4; font-weight: 600; font-size: 12px; margin-left: 2px; }
.player-name .dot { margin-left: 4px; }

.t-red { color: #ff7a7e; } .t-yellow { color: #f2c94c; } .t-blue { color: #7fb0ff; } .t-green { color: #5fd690; } .t-anomaly { color: #c4a6ff; }
.t-name { color: #c8d3e4; font-weight: 500; }
.t-id { color: var(--dim); font-size: 11px; }
.t-warn { color: #ffb36b; }
.log-entry b { color: inherit; }
.log-entry.e-capture, .log-entry.e-victory { border-left-color: rgba(255,255,255,.45); }
.log-entry.e-join, .log-entry.e-leave, .log-entry.e-rejoin, .log-entry.e-host, .log-entry.e-note { color: var(--dim); font-style: italic; }
.toast span b { font-weight: 700; }

@media (max-width: 680px) {
  .lobby-seats { grid-template-columns: 1fr 1fr; }
  .me-name { font-size: 17px; }
  .turn-card .move-options { max-height: 30vh; overflow: auto; }
}

/* ================= v0.4: três colunas ================= */
.game-layout { grid-template-columns: minmax(250px, 460px) calc(var(--board-size, 680px) + 22px) minmax(290px, 460px); grid-template-areas: "left board right"; justify-content: center; }
.side-left { grid-area: left; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.board-panel { grid-area: board; }
.hud { grid-area: right; }
.log-card .event-log { max-height: 340px; }
.side-left .log-card { flex: 1; }

@media (max-width: 1100px) {
  .game-layout { grid-template-columns: 1fr; grid-template-areas: "board" "right" "left"; }
  .side-left { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
}
@media (max-width: 680px) {
  .game-layout { display: flex; flex-direction: column; }
  .side-left, .hud { display: contents; }
  .board-panel { order: 0; } #turnCard { order: 1; } #myCard { order: 3; } .score-card { order: 2; } .log-card { order: 4; } #chatCard { order: 5; }
}

/* ================= placar ================= */
.score-wrap { overflow-x: auto; margin: 0 -4px; }
.score { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.score th, .score td { padding: 5px 4px; text-align: center; border-bottom: 1px solid var(--line); }
.score tbody th { text-align: left; color: var(--muted); font-weight: 500; white-space: nowrap; cursor: help; }
.score thead th { vertical-align: bottom; border-bottom: 2px solid var(--fc, var(--line)); }
.score thead th.cur { background: color-mix(in srgb, var(--fc) 12%, transparent); border-radius: 6px 6px 0 0; }
.score td.cur { background: rgba(255,255,255,.025); }
.sc-f { display: block; color: var(--fc); font-weight: 800; font-size: 11.5px; white-space: nowrap; }
.sc-n { display: flex; align-items: center; justify-content: center; gap: 4px; color: #c8d3e4; font-weight: 500; font-size: 10.5px; margin-top: 2px; word-break: break-word; }
.sc-n .dot { width: 6px; height: 6px; }
.score td b { color: #fff; }
.score .muted { color: var(--dim); }
.ab-row { display: inline-flex; gap: 2px; }
.ab { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; font-size: 8.5px; font-weight: 800; font-style: normal; border: 1.5px solid; flex: none; }
.ab-on { background: #d6e3f6; border-color: #d6e3f6; color: #0b1222; }
.ab-off { background: transparent; border-color: #5d6b82; color: #8796ad; }
.ab-jam { background: #5a1d22; border-color: #ff7a7e; color: #ffd1d3; }
.ab-frozen { background: #13324f; border-color: #8fd3ff; color: #cdeeff; }
.crew-ability .ab { width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.score-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: 10.5px; color: var(--dim); }
.score-legend span { display: inline-flex; align-items: center; gap: 4px; }
.score-legend .ab { width: 9px; height: 9px; }
.flag { font-size: 10px; color: #cdeeff; border: 1px solid rgba(143,211,255,.4); border-radius: 999px; padding: 0 6px; }

/* ================= chat ================= */
.chat-list { max-height: 240px; min-height: 90px; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.chat-empty { color: var(--dim); font-size: 12px; }
.chat-msg { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 10px; padding: 6px 9px; max-width: 92%; }
.chat-msg.mine { align-self: flex-end; background: rgba(61,130,234,.12); border-color: rgba(61,130,234,.3); }
.chat-meta { display: flex; gap: 6px; align-items: baseline; font-size: 11px; }
.chat-fac { color: var(--dim); }
.chat-time { margin-left: auto; color: var(--dim); font-size: 10px; }
.chat-text { font-size: 13px; line-height: 1.4; margin-top: 2px; word-wrap: break-word; overflow-wrap: anywhere; }
.chat-form { display: flex; gap: 6px; margin-top: 10px; }
.chat-form input { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 10px; font-size: 14px; }
.chat-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.chat-form .primary-btn { min-height: 40px; padding: 8px 12px; }
.badge.unread { background: #2f6fd6; color: #fff; border-color: transparent; }
.lobby-chat { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.lobby-chat .chat-list { max-height: 160px; min-height: 40px; }

/* ================= anomalias / alvos ================= */
.test-controls { display: grid; gap: 6px; }
.test-controls[hidden] { display: none; }
.pawn.target .pawn-halo { stroke: #c4a6ff; stroke-width: 3; }
.pawn .pawn-frozen { fill: none; stroke: #8fd3ff; stroke-width: 2; stroke-dasharray: 2 2; }
.target-btn { border-color: rgba(196,166,255,.4); background: rgba(138,92,214,.12); }
.target-btn:hover { background: rgba(138,92,214,.22); }
.k-pos { color: #7be3a4; } .k-neg { color: #ff9a9d; } .k-mix { color: #c4a6ff; }
.toast.c-anomaly { border-left-color: var(--anomaly); }
.log-entry.e-effect, .log-entry.e-effectTarget { margin-top: -3px; border-left-color: rgba(138,92,214,.5); }

/* placar em cartões */
.score-wrap { display: grid; gap: 8px; margin: 0; overflow: visible; }
.sc-card { border: 1px solid var(--line); border-left: 3px solid var(--fc); border-radius: 10px; padding: 8px 9px; background: rgba(255,255,255,.015); }
.sc-card.cur { background: color-mix(in srgb, var(--fc) 9%, transparent); border-color: color-mix(in srgb, var(--fc) 45%, transparent); border-left-color: var(--fc); }
.sc-card.win { box-shadow: 0 0 0 1px var(--fc); }
.sc-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sc-head .sc-f { color: var(--fc); font-weight: 800; font-size: 13px; display: inline; }
.sc-head .sc-n { color: #c8d3e4; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline; margin: 0; }
.sc-head .dot { width: 6px; height: 6px; }
.sc-turn { margin-left: auto; font-size: 10.5px; color: var(--fc); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.sc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 7px; }
.sc-stat { text-align: center; background: rgba(0,0,0,.18); border-radius: 7px; padding: 4px 2px 3px; cursor: help; }
.sc-stat b { display: block; font-size: 14px; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.15; }
.sc-stat span { display: block; font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.sc-foot { display: flex; align-items: center; gap: 8px; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.sc-foot b { color: #dfe7f3; font-weight: 600; }
.sc-foot .ab-row { margin-left: auto; }
.sc-power { cursor: help; white-space: nowrap; }

.dice-row > * { min-width: 0; }
.dice-controls { min-width: 0; }
.dice-controls .primary-btn, .forced-roll { width: 100%; min-width: 0; }
.forced-roll { text-overflow: ellipsis; }

/* ================= v0.5: colunas alinhadas ao tabuleiro ================= */
.board-panel { padding: 10px; }
.board-toolbar { padding: 0 2px 8px; }
.board-viewport { margin: 0 auto; }
@media (min-width: 1101px) {
  .game-layout { align-items: start; }
  .side-left, .hud { height: var(--panel-h, auto); min-height: 0; overflow: auto; scrollbar-width: thin; }
  .side-left { display: flex; flex-direction: column; gap: 12px; }
  .side-left .others-card { flex: 0 1 auto; min-height: 120px; overflow: auto; }
  .side-left .log-card { flex: 1 1 200px; min-height: 180px; display: flex; flex-direction: column; }
  .side-left .log-card .event-log { flex: 1; min-height: 0; max-height: none; overflow: auto; }
  .hud { display: flex; flex-direction: column; gap: 12px; }
  .hud > .hud-card { flex: none; }
  .hud > .chat-card { flex: 1 1 220px; min-height: 220px; display: flex; flex-direction: column; }
  .chat-card .chat-list { flex: 1; min-height: 0; max-height: none; }
  .chat-card[hidden] { display: none; }
}
.power p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.power:hover p { -webkit-line-clamp: unset; }
.crew-row { padding: 5px 8px; }
.board-viewport.zoomed { cursor: grab; outline: 1px solid var(--line); border-radius: 8px; }

/* tablet deitado: tabuleiro + painel da jogada lado a lado; placar e história embaixo */
@media (min-width: 900px) and (max-width: 1100px) {
  .game-layout { grid-template-columns: auto minmax(260px, 1fr); grid-template-areas: "board right" "left left"; align-items: start; }
  .board-panel { justify-self: start; }
  .hud { display: flex; flex-direction: column; gap: 12px; }
  .turn-card { grid-column: auto; }
}
.sc-foot > span { white-space: nowrap; }

/* ================= v0.6 ================= */
/* som */
.sound-ctl { position: fixed; top: 12px; right: 14px; z-index: 95; }
body[data-screen="game"] .sound-ctl { right: 86px; top: 15px; }
.sound-btn { width: 38px; height: 34px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); font-size: 15px; }
.sound-panel { position: absolute; right: 0; top: 42px; width: 230px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px; display: grid; gap: 10px; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.sound-panel[hidden] { display: none; }
.sound-panel .vol { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.sound-panel input[type=range] { width: 100%; accent-color: var(--accent); }

/* sala: pronto */
.ready-tag { margin-left: auto; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.ready-tag.on { color: #bff0d1; border-color: rgba(47,180,99,.55); background: rgba(47,180,99,.12); }
.seat { padding-right: 26px; }
.seat .dot { top: 8px; right: 8px; }
.ready-btn.is-ready { background: #1f7a45; }
.ready-btn.is-ready:hover:not(:disabled) { background: #26904f; }
.lobby-buttons { flex-wrap: wrap; }

/* outros jogadores (coluna esquerda) */
.others { display: grid; gap: 8px; }
.oc { border: 1px solid var(--line); border-left: 3px solid var(--fc); border-radius: 10px; padding: 8px 10px; background: rgba(255,255,255,.015); display: grid; gap: 6px; }
.oc.cur { background: color-mix(in srgb, var(--fc) 9%, transparent); border-color: color-mix(in srgb, var(--fc) 45%, transparent); border-left-color: var(--fc); }
.oc-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.oc-f { color: var(--fc); font-weight: 800; font-size: 13px; }
.oc-n { color: #c8d3e4; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oc-head .dot { width: 6px; height: 6px; }
.oc-turn { margin-left: auto; font-size: 10.5px; color: var(--fc); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.oc-row { display: flex; align-items: center; gap: 8px; font-size: 12px; min-width: 0; }
.oc-l { color: var(--dim); width: 72px; flex: none; }
.oc-v { color: #dfe7f3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.oc-frag { margin-left: auto; color: var(--muted); white-space: nowrap; }
.oc-fx { display: flex; flex-wrap: wrap; gap: 4px; }
.fx { font-size: 11px; border-radius: 999px; padding: 1px 8px; border: 1px solid; white-space: nowrap; }
.fx-frozen { color: #cdeeff; border-color: rgba(143,211,255,.45); background: rgba(19,50,79,.6); }
.fx-jam { color: #ffd1d3; border-color: rgba(255,122,126,.45); background: rgba(90,29,34,.6); }
.fx-none { font-size: 11px; color: var(--dim); }
.pw { font-size: 10.5px; border-radius: 999px; padding: 1px 8px; white-space: nowrap; border: 1px solid; flex: none; }
.pw.ready { color: #bff0d1; border-color: rgba(47,180,99,.5); background: rgba(47,180,99,.1); }
.pw.used { color: var(--muted); border-color: var(--line-strong); }
.power-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 11px; color: var(--dim); }
.mine-fx { margin-top: 8px; }
.ab-state { color: var(--dim); font-size: 11px; margin-left: 4px; }

/* placar estilo partida (abre por cima do tabuleiro) */
.board-panel { position: relative; }
.score-btn { width: auto !important; padding: 0 10px; font-size: 12.5px; }
.score-btn.on { background: rgba(143,184,240,.16); color: #fff; }
.score-overlay { position: absolute; inset: 48px 10px 10px; z-index: 30; display: grid; place-items: start center; background: rgba(4,8,16,.55); backdrop-filter: blur(2px); border-radius: 10px; padding: 10px; overflow: auto; }
.score-overlay[hidden] { display: none; }
.score-panel { width: min(100%, 1100px); background: rgba(12,19,34,.97); border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; box-shadow: 0 20px 50px rgba(0,0,0,.55); }
.score-table-wrap { overflow-x: auto; }
.st { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.st thead th { color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 6px 6px 8px; text-align: center; white-space: nowrap; border-bottom: 1px solid var(--line-strong); cursor: help; }
.st thead th:first-child { text-align: left; cursor: default; }
.st td, .st tbody th { padding: 9px 6px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.st tbody th { text-align: left; font-weight: 400; position: relative; padding-left: 12px; }
.st .st-bar { position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--fc); }
.st .st-who b { color: var(--fc); display: block; font-size: 13.5px; }
.st .st-who small { color: #c8d3e4; font-size: 11.5px; display: inline-flex; align-items: center; gap: 4px; }
.st .st-who .dot { width: 6px; height: 6px; }
.st td.big { font-size: 17px; font-weight: 800; color: #fff; }
.st td.big small { font-size: 11px; color: var(--muted); font-weight: 500; }
.st tr.cur { background: color-mix(in srgb, var(--fc) 10%, transparent); }
.st tr.me td, .st tr.me th { background: rgba(143,184,240,.06); }
.st tr.win td.big { color: var(--fc); }
.st .fx-cell { white-space: normal; min-width: 120px; }
.st .fx-cell .fx { display: inline-block; margin: 1px; }
.score-hint { margin: 10px 0 0; color: var(--dim); font-size: 11.5px; }

/* tempo da jogada */
.turn-timer { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.turn-timer[hidden] { display: none; }
.tt-bar { flex: 1; height: 6px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.tt-bar i { display: block; height: 100%; background: #8fb8f0; border-radius: 999px; transition: width .2s linear; }
.turn-timer.mine .tt-bar i { background: var(--fc, #8fb8f0); }
.turn-timer span { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.turn-timer.warn .tt-bar i { background: #ff7a7e; }
.turn-timer.warn span { color: #ff9a9d; font-weight: 700; }
.turn-timer.warn.mine span { animation: pulseTxt .5s ease-in-out infinite alternate; }
@keyframes pulseTxt { to { opacity: .45; } }

@media (max-width: 680px) {
  .others-card { order: 2; }
  .sound-ctl { top: 8px; right: 8px; }
  body[data-screen="game"] .sound-ctl { right: 70px; top: 8px; }
  .score-overlay { position: fixed; inset: 0; z-index: 120; padding: 10px; border-radius: 0; }
}
/* placar ocupa a largura da tela, por cima de tudo (como em jogos de partida) */
.score-overlay { position: fixed; inset: 0; z-index: 90; padding: 70px 16px 16px; border-radius: 0; background: rgba(3,6,12,.6); }
.score-panel { width: min(100%, 1240px); max-height: calc(100vh - 100px); overflow: auto; }
.st td, .st tbody th { padding: 9px 5px; }
@media (min-width: 1101px) {
  .hud > .chat-card { min-height: 150px; }
}
.t-power { color: #f2c94c; font-weight: 700; }
.t-ability { color: #8fd3ff; font-weight: 700; }

/* ================= v0.8 ================= */
/* botão de menu (3 traços), fixo no canto em todas as telas */
.menu-btn { position: fixed; top: 12px; right: 14px; z-index: 96; width: 42px; height: 38px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(12,19,34,.92); display: grid; place-content: center; gap: 4px; padding: 0; }
.menu-btn span { display: block; width: 18px; height: 2px; border-radius: 2px; background: #dfe7f3; }
.menu-btn:hover { border-color: var(--accent); }
body[data-screen="game"] .topbar { padding-right: 52px; }
.sound-ctl { display: none; }

/* painel do menu: moldura com placa de título e botões grandes empilhados */
.menu-modal { background: rgba(2,4,10,.62); }
.menu-frame { position: relative; width: min(340px, 92vw); padding: 44px 26px 24px; border-radius: 18px;
  background: linear-gradient(180deg, #121c31, #0b1222); border: 1px solid rgba(143,184,240,.35);
  box-shadow: 0 0 0 6px rgba(12,19,34,.9), 0 0 0 7px rgba(143,184,240,.18), 0 30px 80px rgba(0,0,0,.6); }
.menu-plate { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); padding: 7px 26px; border-radius: 10px;
  background: linear-gradient(180deg, #1b2a48, #111b30); border: 1px solid rgba(143,184,240,.45); box-shadow: 0 6px 16px rgba(0,0,0,.4);
  font-weight: 800; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; color: #e8eef8; white-space: nowrap; }
.menu-view { display: grid; gap: 12px; }
.menu-view[hidden] { display: none; }
.menu-item { min-height: 50px; border-radius: 12px; border: 1px solid rgba(143,184,240,.4); color: #f2f6fc; font-weight: 700; font-size: 16px; letter-spacing: .02em;
  background: linear-gradient(180deg, #2a4f8f, #1c3765); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 4px 12px rgba(0,0,0,.35); }
.menu-item:hover { background: linear-gradient(180deg, #3460aa, #22427a); }
.menu-item.danger { background: linear-gradient(180deg, #5a2a33, #3e1c23); border-color: rgba(255,122,126,.45); }
.menu-item.danger:hover { background: linear-gradient(180deg, #6d323d, #4b222a); }
.menu-item[hidden] { display: none; }
.menu-sep { height: 1px; background: linear-gradient(90deg, transparent, rgba(143,184,240,.35), transparent); margin: 4px 0; }
.menu-toggle { display: flex; align-items: center; gap: 10px; font-size: 15px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.menu-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }
.menu-range { display: grid; gap: 6px; font-size: 14px; color: var(--muted); padding: 4px 2px; }
.menu-range input { width: 100%; accent-color: var(--accent); }
.menu-rules { max-height: 52vh; overflow: auto; font-size: 13.5px; line-height: 1.5; color: #c8d3e4; }
.menu-rules p { margin: 0 0 8px; }

/* início */
.home-actions .ghost-btn small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }

/* treinamento */
.training-card { width: min(640px, 96vw); }
.train-mine { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.train-pick { cursor: pointer; }
.train-bots { display: grid; gap: 8px; }
.bot-row { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-left: 3px solid var(--fc); border-radius: 10px; padding: 8px 10px; }
.bot-row strong { min-width: 70px; font-size: 14px; }
.seg { margin-left: auto; display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 7px 11px; font-size: 13px; color: #c8d3e4; border-left: 1px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button.on { background: color-mix(in srgb, var(--fc) 35%, #0b1424); color: #fff; font-weight: 700; }

/* poderes e habilidades */
.power-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.primary-btn.small, .ghost-btn.small { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.crew-row { position: relative; }
.crew-use { margin-left: auto; flex: none; }
.crew-when { margin-left: auto; font-size: 10.5px; color: var(--dim); white-space: nowrap; }
.tactic-row { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.tactic-row[hidden] { display: none; }
.tr-label { font-size: 12px; color: #8fd3ff; margin-right: 2px; cursor: help; }
.tr-btn { border: 1px solid rgba(143,211,255,.45); background: rgba(19,50,79,.5); color: #e6f6ff; border-radius: 9px; padding: 6px 10px; font-size: 13px; font-weight: 700; }
.tr-btn:hover { background: rgba(19,50,79,.85); }
.boost-btn, .order-btn { border-color: rgba(143,211,255,.35); background: rgba(19,50,79,.35); }
.pick-btn { border-color: rgba(242,201,76,.4); background: rgba(90,70,10,.25); }
.pick-cancel { width: 100%; }
.dice.empty { color: #9aa7bb; background: #1a2438; }
.pawn .pawn-shieldfx { fill: none; stroke: #8fd3ff; stroke-width: 1.6; }
.pawn .pawn-regen { fill: none; stroke: #5fd690; stroke-width: 1.6; stroke-dasharray: 3 2; }

@media (max-width: 680px) {
  .menu-btn { top: 8px; right: 8px; }
  .train-mine { grid-template-columns: 1fr 1fr; }
  .bot-row { flex-wrap: wrap; }
  .seg { margin-left: 0; width: 100%; }
  .seg button { flex: 1; }
}

/* ================= v0.9 ================= */
/* história: ações especiais coloridas */
.c-warn { --fc: #ffb36b; }
.log-entry.hl { color: color-mix(in srgb, var(--fc) 72%, #ffffff); border-left: 3px solid var(--fc); background: color-mix(in srgb, var(--fc) 9%, transparent); border-radius: 0 6px 6px 0; padding: 3px 8px; }
.log-entry.hl b, .log-entry.hl .t-name { color: inherit; }
.log-entry.hl b[class^="t-"] { filter: brightness(1.15); }
.log-entry.e-effect.hl, .log-entry.e-effectTarget.hl { margin-top: -4px; }
/* dado */
.dice.stale { opacity: .55; }
/* botões de habilidade e motivos */
.crew-use.on { border-color: var(--accent); color: #fff; }
.crew-use:disabled { opacity: .45; }
.crew-row.can-use { border-color: color-mix(in srgb, var(--fc) 45%, var(--line)); }
.crew-row.can-use .crew-use { border-color: #8fd3ff; color: #e6f6ff; background: rgba(19,50,79,.5); }
.ab-name { font-weight: 600; color: #dfe7f3; }
.use-reason { margin-top: 6px; font-size: 11.5px; color: var(--muted); line-height: 1.4; }

/* ================= v0.9: celular e tablet (até 1100 px) =================
   Tabuleiro em cima ocupando o espaço livre; painel da jogada fixo embaixo;
   barra de abas abre Tripulação, Jogadores, História, Chat e Placar por cima. */
.tab-bar, .sheet-backdrop { display: none; }
.opt-scroll { display: contents; }
@media (max-width: 1100px) {
  body[data-screen="game"] { overflow: hidden; }
  #screenGame .app-shell { padding: 6px 8px 0; }
  #screenGame .topbar { padding: 2px 52px 6px 2px; }
  #screenGame .brand-logo { height: 15px; }
  .game-layout { display: block !important; }
  .board-panel { padding: 6px; border-radius: 12px; }
  .board-toolbar { padding: 0 0 6px; }
  .board-legend { display: none; }
  .zoom-controls { margin-left: auto; }
  .score-btn { display: none; }
  .side-left, .hud { display: contents !important; height: auto !important; }

  /* painel da jogada (fixo embaixo) */
  #turnCard { position: fixed; left: 8px; right: 8px; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 40; margin: 0;
    display: grid; grid-template-columns: 52px minmax(0, 1fr) minmax(120px, 34%); grid-template-areas: "die line roll" "timer timer timer" "opts opts opts"; gap: 6px 10px; padding: 8px 10px; box-shadow: 0 -8px 30px rgba(0,0,0,.5); }
  #turnCard .turn-head { display: none; }
  #turnCard .dice-row { display: contents; }
  #turnCard .dice-wrap { grid-area: die; }
  #turnCard .dice { width: 52px; height: 52px; font-size: 26px; border-radius: 12px; }
  #turnCard .dice-by { display: none; }
  #turnCard .dice-controls { display: contents; }
  #turnCard .turn-line { grid-area: line; align-self: center; font-size: 13px; line-height: 1.3; }
  #turnCard #rollBtn { grid-area: roll; align-self: center; min-height: 46px; padding: 8px 10px; }
  #turnCard #rollBtn kbd { display: none; }
  #turnCard .test-controls { display: none !important; }
  #turnCard .turn-timer { grid-area: timer; margin: 0; }
  #turnCard .turn-hint { display: none; }
  #turnCard .opt-scroll { grid-area: opts; display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; min-height: 52px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  #turnCard .opt-scroll:empty::before, #turnCard .opt-scroll .move-options:empty::before { content: attr(data-hint); }
  #turnCard .tactic-row { margin: 0; flex: none; flex-wrap: nowrap; }
  #turnCard .move-options { display: flex; gap: 6px; margin: 0; flex: none; }
  #turnCard .move-btn { width: auto; min-width: 168px; max-width: 240px; flex: none; min-height: 48px; padding: 6px 9px; }
  #turnCard .move-btn small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
  #turnCard .pick-cancel { width: auto; flex: none; min-height: 48px; }
  #turnCard .opt-hint { align-self: center; color: var(--muted); font-size: 12.5px; white-space: nowrap; }

  /* abas */
  .tab-bar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(54px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(8,13,24,.97); border-top: 1px solid var(--line-strong); }
  .tab-bar button { background: none; border: 0; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 1px; font-size: 10.5px; position: relative; }
  .tab-bar button i { font-style: normal; font-size: 17px; line-height: 1; }
  .tab-bar button.on { color: #fff; }
  .tab-bar button.on::before { content: ""; position: absolute; top: 0; left: 22%; right: 22%; height: 2px; background: var(--accent); border-radius: 2px; }
  .tab-badge { position: absolute; top: 5px; right: calc(50% - 22px); background: #2f6fd6; color: #fff; font-size: 10px; border-radius: 999px; padding: 0 5px; }
  .tab-badge[hidden] { display: none; }

  /* painéis viram "gavetas" que sobem por cima */
  .others-card, .log-card, #myCard, #chatCard {
    position: fixed !important; left: 6px; right: 6px; bottom: calc(58px + env(safe-area-inset-bottom)); z-index: 50; margin: 0 !important;
    max-height: min(72dvh, 620px); overflow: auto; transform: translateY(calc(100% + 80px)); visibility: hidden;
    transition: transform .22s ease, visibility .22s; box-shadow: 0 -12px 40px rgba(0,0,0,.6); border-radius: 16px 16px 12px 12px; }
  body[data-sheet="crew"] #myCard, body[data-sheet="others"] .others-card, body[data-sheet="log"] .log-card, body[data-sheet="chat"] #chatCard { transform: none; visibility: visible; }
  .log-card .event-log { max-height: none !important; }
  #chatCard { display: flex; flex-direction: column; }
  #chatCard .chat-list { max-height: 46dvh; }
  .sheet-backdrop { position: fixed; inset: 0; z-index: 48; background: rgba(2,4,10,.5); }
  body:not([data-sheet]) .sheet-backdrop, body[data-sheet=""] .sheet-backdrop { display: none; }
  body[data-sheet]:not([data-sheet=""]) .sheet-backdrop { display: block; }
  body[data-sheet]:not([data-sheet=""]) #turnCard { visibility: hidden; }
  .toast { top: 54px; }
  .score-overlay { position: fixed; inset: 0; z-index: 120; padding: 56px 6px calc(64px + env(safe-area-inset-bottom)); }
  .score-panel { max-height: calc(100dvh - 130px); }
}
@media (max-width: 420px) {
  #turnCard { grid-template-columns: 46px minmax(0, 1fr) 112px; }
  #turnCard .dice { width: 46px; height: 46px; font-size: 23px; }
  #turnCard .turn-line { font-size: 12px; }
}

/* ================= tutorial (sala de treinamento) ================= */
#coach { position: fixed; inset: 0; z-index: 140; pointer-events: none; }
.coach-spot { position: fixed; border-radius: 12px; box-shadow: 0 0 0 3px #f2c94c, 0 0 0 9999px rgba(2,4,10,.55); transition: all .25s ease; pointer-events: none; }
#coach.acting .coach-spot { box-shadow: 0 0 0 3px #f2c94c, 0 0 0 9999px rgba(2,4,10,.25); animation: spotPulse 1.2s ease-in-out infinite alternate; }
@keyframes spotPulse { to { box-shadow: 0 0 0 5px #f2c94c, 0 0 0 9999px rgba(2,4,10,.25); } }
.coach-card { position: fixed; pointer-events: auto; background: linear-gradient(180deg, #16223b, #0d1528); border: 1px solid rgba(242,201,76,.55); border-radius: 14px; padding: 14px 16px; box-shadow: 0 20px 50px rgba(0,0,0,.6); transition: left .2s ease, top .2s ease; }
.coach-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.coach-count { font-size: 11px; color: #f2c94c; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.coach-title { margin: 6px 0 6px; font-size: 18px; }
.coach-text { font-size: 13.5px; line-height: 1.55; color: #d6e0ef; max-height: 42vh; overflow: auto; }
.coach-do { margin-top: 10px; font-size: 12.5px; color: #f2c94c; border: 1px dashed rgba(242,201,76,.5); border-radius: 8px; padding: 6px 9px; }
.coach-do.ok { color: #9fe0b8; border-color: rgba(47,180,99,.6); border-style: solid; }
.coach-btns { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
.coach-btns .primary-btn, .coach-btns .ghost-btn { min-height: 40px; padding: 8px 14px; }
body.tutorial-on #testBadge { display: none; }
.tab-bar button[hidden] { display: none !important; }
.coach-card { display: flex; flex-direction: column; overflow: hidden; }
.coach-text { flex: 1 1 auto; min-height: 0; }
@media (max-width: 1100px) {
  .coach-card { padding: 10px 12px; }
  .coach-title { font-size: 16px; margin: 4px 0; }
  .coach-text { font-size: 13px; line-height: 1.45; }
  .coach-btns { margin-top: 8px; }
  .coach-btns .primary-btn, .coach-btns .ghost-btn { min-height: 36px; padding: 6px 10px; font-size: 13px; }
  .coach-do { margin-top: 6px; padding: 4px 8px; }
  body.tutorial-on .others-card, body.tutorial-on .log-card, body.tutorial-on #myCard, body.tutorial-on #chatCard { max-height: 52dvh; }
}
/* mini-história no espaço livre (celular/tablet em pé) */
.mini-log { display: none; }
@media (max-width: 1100px) {
  .board-viewport { margin: 0 auto !important; }
  .mini-log { display: flex; flex-direction: column; gap: 4px; height: var(--mini-h, 0px); overflow: hidden; margin: 6px 2px 0; mask-image: linear-gradient(180deg, #000 70%, transparent); -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); }
  .mini-log .log-entry { font-size: 12px; padding: 2px 8px; }
}
/* celular/tablet deitado: painel da jogada à direita */
@media (max-width: 1100px) and (orientation: landscape) and (min-width: 700px) {
  #screenGame .app-shell { padding-right: 350px; }
  .mini-log { display: none; }
  #turnCard { left: auto; right: 8px; top: 56px; bottom: auto; width: 334px; max-height: calc(100dvh - 120px); overflow: auto;
    grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "die line" "roll roll" "timer timer" "opts opts"; }
  #turnCard #rollBtn { width: 100%; }
  #turnCard .opt-scroll { flex-direction: column; overflow-x: hidden; overflow-y: auto; min-height: 0; }
  #turnCard .move-options { flex-direction: column; }
  #turnCard .move-btn { min-width: 0; max-width: none; width: 100%; }
  #turnCard .move-btn small { max-width: 240px; }
  #turnCard .opt-scroll .move-options:empty::before { white-space: normal; }
  .others-card, .log-card, #myCard, #chatCard { left: auto !important; right: 6px; width: min(420px, 60vw); bottom: calc(58px + env(safe-area-inset-bottom)); }
  body[data-sheet]:not([data-sheet=""]) #turnCard { visibility: visible; }
}

/* ================= v1.0 ================= */
/* menu sempre por cima de tudo (inclusive do treinamento) */
.menu-modal { z-index: 300 !important; }
.menu-btn { z-index: 301; }
.toast { z-index: 290; }

/* relógio da partida */
.game-clock { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; align-self: center; }
.game-clock[hidden] { display: none; }

/* dicas */
.tip-box { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 8px 10px; border-radius: 10px; background: rgba(242,201,76,.09); border: 1px solid rgba(242,201,76,.4); font-size: 12.5px; line-height: 1.45; color: #f3e6bd; }
.tip-box[hidden] { display: none; }
.tip-label { flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #f2c94c; padding-top: 1px; }
#tipText { flex: 1; min-width: 0; }
#tipText b { color: #fff; }
.tip-close { flex: none; background: none; border: 0; color: #c9b77a; font-size: 12px; padding: 0 2px; }

/* tutorial */
.coach-do.watch { color: #8fd3ff; border-color: rgba(143,211,255,.5); }
.coach-do.todo { color: #f2c94c; }
.coach-do.shake { animation: shake .4s ease; }
@keyframes shake { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }

@media (max-width: 1100px) {
  #turnCard { grid-template-areas: "die line roll" "timer timer timer" "tip tip tip" "opts opts opts"; }
  #turnCard .tip-box { grid-area: tip; margin: 0; padding: 6px 8px; font-size: 12px; }
  #screenGame .game-clock { font-size: 11px; padding: 1px 7px; }
}
@media (max-width: 1100px) and (orientation: landscape) and (min-width: 700px) {
  #turnCard { grid-template-areas: "die line" "roll roll" "timer timer" "tip tip" "opts opts"; }
}

/* ================= v1.1: história cinematográfica ================= */
.story-btn { border-color: rgba(143,184,240,.35); }
body[data-screen="story"] #screenStory { display: block; }
body[data-screen="story"] { overflow: hidden; }
.cine { position: fixed; inset: 0; background: #03050b; }
.cine-stage { position: absolute; inset: 0; overflow: hidden; cursor: pointer; user-select: none; -webkit-user-select: none; }
.cine-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.cine-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 14px; padding: 16px 70px 16px 20px; background: linear-gradient(180deg, rgba(3,5,11,.7), rgba(3,5,11,0)); z-index: 3; }
.cine-logo { height: 15px; width: auto; opacity: .9; }
.cine-label { color: #9fb3cf; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cine-skip { margin-left: auto; background: rgba(12,19,34,.6); border: 1px solid var(--line-strong); color: #c8d3e4; border-radius: 999px; padding: 6px 12px; font-size: 12.5px; white-space: nowrap; }
.cine-title { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; z-index: 2; opacity: 0; }
.cine-title.in { animation: cineTitleIn 1.4s ease forwards; }
.cine-title.out { animation: cineTitleOut .8s ease forwards; }
@keyframes cineTitleIn { from { opacity: 0; letter-spacing: .5em; filter: blur(6px); } to { opacity: 1; letter-spacing: .12em; filter: none; } }
@keyframes cineTitleOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-12px); } }
.cine-kicker { color: #8fb8f0; font-size: clamp(12px, 1.4vw, 15px); letter-spacing: .4em; text-transform: uppercase; font-weight: 700; }
.cine-title h2 { margin: 12px 0 0; font-size: clamp(30px, 5.6vw, 64px); font-weight: 300; letter-spacing: .12em; text-transform: uppercase; color: #f2f6fc; text-shadow: 0 0 40px rgba(143,184,240,.35); }
.cine-text { position: absolute; left: 0; right: 0; bottom: 92px; z-index: 2; padding: 0 clamp(18px, 7vw, 120px); pointer-events: none; }
.cine-beat { max-width: 760px; padding: 18px 22px; border-radius: 14px; background: linear-gradient(90deg, rgba(3,5,11,.72), rgba(3,5,11,.35) 70%, rgba(3,5,11,0)); }
.cine-beat p { margin: 0 0 8px; font-size: clamp(16px, 1.9vw, 21px); line-height: 1.55; color: #e7eef8; opacity: 0; transform: translateY(8px); transition: opacity .9s ease, transform .9s ease; text-shadow: 0 2px 12px rgba(0,0,0,.8); }
.cine-beat p.in { opacity: 1; transform: none; }
.cine-beat p:last-child { margin-bottom: 0; }
.cine-beat.big p { font-size: clamp(22px, 3.2vw, 36px); font-weight: 300; letter-spacing: .02em; line-height: 1.35; color: #fff; }
.cine-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 18px; background: linear-gradient(0deg, rgba(3,5,11,.8), rgba(3,5,11,0)); }
.cine-dots { display: flex; gap: 8px; }
.cine-dots button { width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; background: rgba(255,255,255,.22); }
.cine-dots button.done { background: rgba(143,184,240,.55); }
.cine-dots button.on { background: #8fb8f0; transform: scale(1.35); box-shadow: 0 0 10px rgba(143,184,240,.7); }
.cine-controls { display: flex; align-items: center; gap: 8px; }
.cine-btn { background: rgba(12,19,34,.65); border: 1px solid var(--line-strong); color: #dfe7f3; border-radius: 10px; padding: 9px 14px; font-size: 14px; min-height: 42px; }
.cine-btn.auto.on { border-color: var(--accent); color: #fff; }
.cine-btn.next { background: rgba(47,111,214,.35); border-color: rgba(143,184,240,.5); font-weight: 700; }
.cine-btn.next.ready { background: #2f6fd6; border-color: transparent; animation: nextPulse 1.6s ease-in-out infinite; }
@keyframes nextPulse { 50% { box-shadow: 0 0 0 6px rgba(47,111,214,.18); } }
.cine-progress { color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }

.cine-final { position: absolute; inset: 0; z-index: 5; opacity: 0; visibility: hidden; transition: opacity 1.6s ease, visibility 1.6s; background: #02040a; cursor: default; }
.cine-final.in { opacity: 1; visibility: visible; }
.cine-keyart-bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(28px) brightness(.45); }
.cine-keyart { position: absolute; top: 0; bottom: 0; left: 50%; height: 100%; width: auto; max-width: none; transform: translateX(-50%) scale(1.04); animation: keyartZoom 30s ease-out forwards; -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent), linear-gradient(0deg, transparent, #000 25%); mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
@keyframes keyartZoom { to { transform: translateX(-50%) scale(1.12); } }
.cine-final-box { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 20px 34px; text-align: center; background: linear-gradient(0deg, rgba(2,4,10,.95) 40%, rgba(2,4,10,0)); }
.cine-final-logo { height: clamp(20px, 3vw, 30px); width: auto; }
.cine-tagline { color: #8fb8f0 !important; letter-spacing: .3em; text-transform: uppercase; font-size: 13px !important; margin: 0 auto 14px !important; }
#cineFinalText p { color: #d6e0ef; font-size: clamp(15px, 1.6vw, 18px); line-height: 1.6; margin: 0 auto 4px; max-width: 640px; }
.cine-start { margin-top: 22px; min-height: 56px; padding: 14px 44px; font-size: 18px; letter-spacing: .22em; box-shadow: 0 0 30px rgba(47,111,214,.45); }
.cine-final-links { display: flex; gap: 18px; justify-content: center; margin-top: 12px; }
.home-actions.pulse .primary-btn, .home-actions.pulse .ghost-btn { animation: nextPulse 1.2s ease-in-out 2; }
@media (max-width: 700px) {
  .cine-top { padding: 10px 62px 10px 12px; }
  .cine-label { display: none; }
  .cine-text { bottom: 120px; padding: 0 12px; }
  .cine-beat { padding: 14px 14px; background: linear-gradient(0deg, rgba(3,5,11,.75), rgba(3,5,11,.45)); }
  .cine-bottom { flex-direction: column-reverse; align-items: stretch; gap: 10px; padding: 10px 12px 16px; }
  .cine-dots { justify-content: center; }
  .cine-controls { justify-content: space-between; }
  .cine-btn.next { flex: 1; }
  .cine-keyart { height: 72%; top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .cine-keyart, .cine-btn.next.ready, .cine-title.in { animation: none; opacity: 1; }
}

/* ================= v1.2: fundo animado, tela inicial, modos de jogo ================= */
.space-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #02040a; display: none; pointer-events: none; }
body[data-screen="home"] .space-bg, body[data-screen="modes"] .space-bg, body[data-screen="join"] .space-bg, body[data-screen="lobby"] .space-bg { display: block; }
.space-zoom { position: absolute; inset: 0; transform-origin: 50% 62%; animation: spaceDrift 46s ease-in-out infinite alternate; will-change: transform; }
.space-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; filter: saturate(1.08) brightness(.96); animation: spaceIn 2.4s ease-out both; }
.space-fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.space-shade { position: absolute; inset: 0; transition: background .6s ease, backdrop-filter .6s ease;
  background: radial-gradient(ellipse 120% 80% at 50% 40%, transparent 55%, rgba(1,3,8,.55) 100%), linear-gradient(180deg, rgba(2,4,10,.25) 0%, transparent 30%, transparent 70%, rgba(2,4,10,.55) 100%); }
body[data-screen="modes"] .space-shade { background: radial-gradient(ellipse 100% 70% at 50% 45%, rgba(3,6,14,.35), rgba(1,3,8,.78)); backdrop-filter: blur(2px); }
body[data-screen="join"] .space-shade, body[data-screen="lobby"] .space-shade { background: rgba(2,4,10,.78); backdrop-filter: blur(5px); }
@keyframes spaceDrift { from { transform: scale(1.02) translate3d(0,0,0); } to { transform: scale(1.11) translate3d(-1.2%, -1.4%, 0); } }
@keyframes spaceIn { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
#screenHome, #screenModes, #screenJoin, #screenLobby { position: relative; z-index: 1; }

/* início: só logo, frase e Iniciar */
body[data-screen="home"] #screenHome { display: flex; flex-direction: column; align-items: center; justify-content: space-between; min-height: 100vh; min-height: 100dvh; padding: max(9vh, 48px) 20px max(5vh, 22px); text-align: center; }
.home-hero { animation: none; }
body.intro .home-hero { animation: heroIn 1.6s .3s cubic-bezier(.2,.7,.2,1) both; }
.home-hero .home-logo { width: min(420px, 80vw); filter: drop-shadow(0 0 22px rgba(120,170,255,.35)); }
.home-hero .home-tag { margin: 18px 0 0; color: #b9c8de; letter-spacing: .32em; font-size: 12px; text-shadow: 0 1px 8px #000; }
.home-start { margin-top: auto; padding-bottom: 6vh; animation: none; }
body.intro .home-start { animation: heroIn 1.4s 1s cubic-bezier(.2,.7,.2,1) both; }
.start-btn { position: relative; min-width: 240px; padding: 16px 44px; border-radius: 999px; font-size: 17px; font-weight: 800; letter-spacing: .34em; text-transform: uppercase; color: #fff;
  background: linear-gradient(180deg, rgba(90,150,255,.32), rgba(30,70,160,.32)); border: 1px solid rgba(160,200,255,.6);
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset, 0 0 28px rgba(80,150,255,.35), 0 10px 30px rgba(0,0,0,.45); backdrop-filter: blur(6px); overflow: hidden; cursor: pointer; }
.start-btn span { position: relative; padding-left: .34em; }
.start-btn::before { content: ""; position: absolute; inset: -40% -60%; background: linear-gradient(100deg, transparent 42%, rgba(255,255,255,.28) 50%, transparent 58%); transform: translateX(-60%); animation: btnSheen 4.5s 2.4s ease-in-out infinite; }
.start-btn::after { content: ""; position: absolute; inset: -6px; border-radius: inherit; border: 1px solid rgba(140,190,255,.45); animation: btnRing 2.8s ease-out infinite; }
.start-btn:hover, .start-btn:focus-visible { border-color: #cfe2ff; box-shadow: 0 0 0 1px rgba(255,255,255,.1) inset, 0 0 40px rgba(110,170,255,.6), 0 10px 30px rgba(0,0,0,.45); outline: none; }
.start-btn:active { transform: scale(.98); }
#screenHome .home-note { margin: 0; color: rgba(180,195,220,.45); font-size: 11px; }
@keyframes heroIn { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes btnSheen { 0%, 55% { transform: translateX(-60%); } 85%, 100% { transform: translateX(60%); } }
@keyframes btnRing { 0% { opacity: .8; transform: scale(1); } 100% { opacity: 0; transform: scale(1.18, 1.5); } }

/* modos de jogo */
body[data-screen="modes"] #screenModes { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.modes-top { display: flex; align-items: center; gap: 14px; padding: 12px 70px 0 14px; min-height: 62px; }
.modes-back { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: rgba(12,19,34,.7); color: #dfe7f3; font-size: 20px; line-height: 1; backdrop-filter: blur(6px); cursor: pointer; }
.modes-back span { font-size: 13px; }
.modes-back:hover { border-color: var(--accent); }
.modes-logo { height: 18px; opacity: .85; margin-left: auto; margin-right: auto; transform: translateX(28px); }
.modes-body { width: min(920px, 100%); margin: 0 auto; padding: 2vh 16px 28px; flex: 1; display: flex; flex-direction: column; justify-content: center; }
.modes-head { text-align: center; margin-bottom: 18px; }
.modes-kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .3em; font-size: 11px; }
.modes-head h1 { margin: 6px 0 0; font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: .01em; text-shadow: 0 2px 18px rgba(0,0,0,.6); }
.resume-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.resume-row[hidden], .resume-chip[hidden] { display: none; }
.resume-chip { display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--fc) 70%, transparent); background: color-mix(in srgb, var(--fc) 18%, rgba(8,13,24,.8)); color: #fff; font-size: 13px; cursor: pointer; backdrop-filter: blur(6px); }
.resume-chip b { color: color-mix(in srgb, var(--fc) 60%, #fff); }
.resume-chip span { color: #d6deea; }
.resume-chip:hover { box-shadow: 0 0 18px color-mix(in srgb, var(--fc) 45%, transparent); }
.modes-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mode-card { --fc: var(--accent); position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 168px; padding: 16px; text-align: left; color: var(--text); cursor: pointer; overflow: hidden;
  border-radius: 16px; border: 1px solid rgba(190,210,240,.16); background: linear-gradient(160deg, color-mix(in srgb, var(--fc) 30%, rgba(12,19,34,.82)) 0%, rgba(8,13,24,.86) 70%); backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; animation: cardIn .6s cubic-bezier(.2,.7,.2,1) both; }
.mode-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent 5%, var(--fc), transparent 95%); }
.mode-card::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--fc) 30%, transparent), transparent 70%); opacity: .55; transition: opacity .2s; pointer-events: none; }
.mode-card:hover, .mode-card:focus-visible { transform: translateY(-3px); border-color: color-mix(in srgb, var(--fc) 75%, transparent); box-shadow: 0 14px 34px rgba(0,0,0,.45), 0 0 24px color-mix(in srgb, var(--fc) 30%, transparent); outline: none; }
.mode-card:hover::after { opacity: 1; }
.mode-card:active { transform: translateY(-1px) scale(.99); }
.mode-art { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; color: color-mix(in srgb, var(--fc) 55%, #fff); background: color-mix(in srgb, var(--fc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--fc) 40%, transparent); }
.mode-art svg { width: 32px; height: 32px; }
.mode-text { display: grid; gap: 3px; position: relative; z-index: 1; }
.mode-text strong { font-size: 16px; line-height: 1.2; }
.mode-text small { color: #b4c1d4; font-size: 13px; line-height: 1.4; }
.mode-kicker { font-size: 10.5px; text-transform: uppercase; letter-spacing: .22em; color: color-mix(in srgb, var(--fc) 60%, #fff); }
.mode-chip { margin-top: auto; font-size: 11px; color: #cdd8e8; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); position: relative; z-index: 1; }
.mode-go { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 40px; line-height: 1; color: color-mix(in srgb, var(--fc) 60%, #fff); opacity: .8; transition: transform .2s; }
.mode-hero:hover .mode-go { transform: translate(4px, -50%); }
.mode-hero { grid-column: 1 / -1; min-height: 150px; flex-direction: row; align-items: center; gap: 18px; padding: 22px 70px 22px 22px;
  background: linear-gradient(115deg, color-mix(in srgb, var(--fc) 34%, rgba(12,19,34,.8)) 0%, rgba(10,16,30,.86) 55%, rgba(8,13,24,.9) 100%); border-color: color-mix(in srgb, var(--fc) 45%, transparent); }
.mode-hero .mode-art { width: 76px; height: 76px; border-radius: 18px; flex: none; }
.mode-hero .mode-art svg { width: 54px; height: 54px; animation: orbitSpin 18s linear infinite; }
.mode-hero .mode-text strong { font-size: clamp(22px, 3vw, 28px); letter-spacing: .02em; }
.mode-hero .mode-chip { margin-top: 0; align-self: flex-end; position: absolute; right: 70px; bottom: 16px; }
.mode-card.c-story { --fc: #b9a6ff; }
.modes-grid .mode-card:nth-child(2) { animation-delay: .06s; } .modes-grid .mode-card:nth-child(3) { animation-delay: .12s; }
.modes-grid .mode-card:nth-child(4) { animation-delay: .18s; } .modes-grid .mode-card:nth-child(5) { animation-delay: .24s; }
.modes-grid.pulse .mode-card { animation: cardIn .6s both, nextPulse 1.2s .2s ease-in-out 2; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes orbitSpin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@media (max-width: 760px) {
  .modes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mode-card { min-height: 128px; padding: 13px; gap: 8px; }
  .mode-card .mode-art { width: 40px; height: 40px; } .mode-card .mode-art svg { width: 28px; height: 28px; }
  .mode-text strong { font-size: 15px; }
  .mode-hero { min-height: 0; padding: 16px 44px 16px 16px; gap: 14px; }
  .mode-hero .mode-art { width: 58px; height: 58px; } .mode-hero .mode-art svg { width: 42px; height: 42px; }
  .mode-hero .mode-text small { font-size: 12.5px; }
  .mode-hero .mode-chip { position: static; display: none; }
  .mode-go { right: 12px; font-size: 32px; }
  .modes-logo { display: none; }
  .modes-body { justify-content: flex-start; padding-top: 1vh; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .modes-top { min-height: 50px; padding-top: 8px; }
  .modes-body { padding: 0 16px 14px; justify-content: flex-start; }
  .modes-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .mode-card { min-height: 96px; padding: 10px 12px; gap: 6px; flex-direction: column; }
  .mode-card .mode-art { width: 34px; height: 34px; } .mode-card .mode-art svg { width: 24px; height: 24px; }
  .mode-text strong { font-size: 14px; }
  .mode-hero { min-height: 0; padding: 10px 50px 10px 12px; flex-direction: row; }
  .mode-hero .mode-art { width: 46px; height: 46px; } .mode-hero .mode-art svg { width: 34px; height: 34px; }
  .mode-hero .mode-text strong { font-size: 20px; } .mode-hero .mode-chip { display: none; }
  .modes-kicker { display: none; } .modes-logo { display: none; }
  .modes-head { margin: -40px 0 10px; } .modes-head h1 { font-size: 19px; margin: 0; line-height: 30px; }
  .resume-row { margin-bottom: 8px; } .resume-chip { padding: 5px 12px; }
  body[data-screen="home"] #screenHome { padding-top: 24px; } .home-start { padding-bottom: 2vh; }
}

/* ================= v1.2: dado 3D ================= */
.dice3d { --ds: 72px; position: relative; width: var(--ds); height: var(--ds); perspective: 420px; }
.dice3d .die-tilt { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(-16deg) rotateY(-20deg) scale(.74); transition: opacity .25s ease, transform .25s ease; }
.dice3d .die-cube { position: absolute; inset: 0; transform-style: preserve-3d; }
.dice3d .die-face { position: absolute; inset: 0; border-radius: 18%; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 16%; gap: 4%;
  background: radial-gradient(circle at 30% 25%, #ffffff, #e6ecf5 60%, #c9d3e2); box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), inset 0 0 calc(var(--ds) * .14) color-mix(in srgb, var(--fc) 35%, transparent);
  backface-visibility: hidden; border: 1px solid color-mix(in srgb, var(--fc) 55%, #9aa8bd); }
.dice3d .die-face i { display: block; border-radius: 50%; place-self: center; width: 78%; aspect-ratio: 1; }
.dice3d .die-face i.on { background: radial-gradient(circle at 35% 30%, #3a4a66, #0b1222 70%); box-shadow: inset 0 1px 1px rgba(0,0,0,.5); }
.dice3d .die-face.f1 i.on { background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--fc) 70%, #fff), var(--fc) 70%); width: 100%; }
.dice3d .f1 { transform: rotateY(0deg) translateZ(calc(var(--ds) / 2)); }
.dice3d .f6 { transform: rotateY(180deg) translateZ(calc(var(--ds) / 2)); }
.dice3d .f2 { transform: rotateY(90deg) translateZ(calc(var(--ds) / 2)); }
.dice3d .f5 { transform: rotateY(-90deg) translateZ(calc(var(--ds) / 2)); }
.dice3d .f3 { transform: rotateX(90deg) translateZ(calc(var(--ds) / 2)); }
.dice3d .f4 { transform: rotateX(-90deg) translateZ(calc(var(--ds) / 2)); }
.dice3d .die-shadow { position: absolute; left: 12%; right: 12%; bottom: -8%; height: 16%; border-radius: 50%; background: radial-gradient(ellipse, color-mix(in srgb, var(--fc) 55%, transparent), transparent 70%); filter: blur(3px); opacity: .7; transition: opacity .25s; }
.dice3d .die-slot { position: absolute; inset: 4%; border-radius: 22%; display: grid; place-items: center; text-align: center; font-weight: 800; font-size: calc(var(--ds) * .22); letter-spacing: .04em; line-height: 1.05;
  color: color-mix(in srgb, var(--fc) 55%, #fff); border: 2px dashed color-mix(in srgb, var(--fc) 70%, transparent); background: color-mix(in srgb, var(--fc) 10%, rgba(10,16,30,.8)); opacity: 0; transform: scale(.8); transition: opacity .25s ease, transform .25s ease; pointer-events: none; }
.dice3d.empty .die-tilt { opacity: 0; transform: rotateX(-16deg) rotateY(-20deg) scale(.4); }
.dice3d.empty .die-shadow { opacity: 0; }
.dice3d.empty .die-slot { opacity: 1; transform: none; }
.dice3d.empty.ready .die-slot { border-style: solid; animation: slotPulse 1.3s ease-in-out infinite; }
.dice3d.empty .die-slot .q { font-size: calc(var(--ds) * .42); font-weight: 700; opacity: .8; }
.dice3d.landed .die-face { animation: dieFlash .7s ease-out; }
.dice3d.landed .die-shadow { animation: shadowFlash .7s ease-out; }
.dice3d.nomove .die-face { filter: saturate(.6) brightness(.85); }
@keyframes slotPulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--fc) 50%, transparent); } 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--fc) 0%, transparent), 0 0 18px color-mix(in srgb, var(--fc) 55%, transparent); } }
@keyframes dieFlash { 0% { box-shadow: inset 0 0 0 1px #fff, 0 0 calc(var(--ds) * .5) var(--fc); } 100% { box-shadow: inset 0 0 0 1px rgba(255,255,255,.7), inset 0 0 calc(var(--ds) * .14) color-mix(in srgb, var(--fc) 35%, transparent); } }
@keyframes shadowFlash { 0% { opacity: 1; transform: scale(1.5); } 100% { opacity: .7; transform: none; } }
.dice-by .t-warn { font-weight: 700; }
.dice-wrap { gap: 8px; }
#turnCard .turn-info .turn-line { grid-area: auto; }

/* últimos dados (para ninguém perder um resultado, mesmo com vezes rápidas) */
.turn-info { display: grid; gap: 5px; min-width: 0; }
.roll-strip { display: flex; gap: 5px; align-items: center; min-height: 22px; overflow: hidden; }
.roll-strip:empty { display: none; }
.roll-strip .rs-label { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .12em; margin-right: 2px; white-space: nowrap; }
.roll-chip { position: relative; flex: none; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff;
  background: color-mix(in srgb, var(--fc) 72%, #0b1222); border: 1px solid color-mix(in srgb, var(--fc) 80%, #fff); box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.roll-chip:nth-of-type(n+2) { opacity: .85; } .roll-chip:nth-of-type(n+4) { opacity: .65; } .roll-chip:nth-of-type(n+6) { opacity: .45; }
.roll-chip.nomove { background: rgba(20,28,44,.9); color: color-mix(in srgb, var(--fc) 55%, #fff); border-style: dashed; box-shadow: none; }
.roll-chip.new { animation: chipIn .45s cubic-bezier(.2,.9,.3,1.3); }
@keyframes chipIn { from { transform: translateX(-14px) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 1100px) {
  #turnCard .turn-info { grid-area: line; align-self: center; gap: 3px; }
  #turnCard .dice3d { --ds: 50px; }
  #turnCard .roll-strip { min-height: 18px; gap: 4px; }
  #turnCard .roll-strip .rs-label { display: none; }
  #turnCard .roll-chip { width: 18px; height: 18px; font-size: 10.5px; border-radius: 5px; }
  #turnCard .roll-chip:nth-of-type(n+6) { display: none; }
}
@media (max-width: 420px) { #turnCard .dice3d { --ds: 44px; } #turnCard .roll-chip:nth-of-type(n+5) { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .space-zoom, .space-img, .home-hero, .home-start, .start-btn::before, .start-btn::after, .mode-card, .mode-hero .mode-art svg, .roll-chip.new, .dice3d.empty.ready .die-slot { animation: none !important; }
}

/* ================= v1.3: janelas no mesmo padrão da Central de missões ================= */
.modal { background: rgba(2,4,10,.62); backdrop-filter: blur(8px); }
.modal-card, #screenJoin .form-card { --fc: var(--accent); position: relative; overflow: hidden; border-radius: 18px; border: 1px solid color-mix(in srgb, var(--fc) 38%, rgba(190,210,240,.16));
  background: linear-gradient(160deg, color-mix(in srgb, var(--fc) 16%, rgba(12,19,34,.94)) 0%, rgba(8,13,24,.96) 55%); box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.modal-card::before, #screenJoin .form-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, transparent 5%, var(--fc), transparent 95%); }
.modal-card.c-red, .form-card.c-red { --fc: var(--red); } .modal-card.c-yellow { --fc: var(--yellow); } .form-card.c-blue, .modal-card.c-blue { --fc: var(--blue); }
.modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.modal-head .mode-art { flex: none; width: 52px; height: 52px; border-radius: 14px; }
.modal-head .mode-art svg { width: 36px; height: 36px; }
.modal-head h2, #screenJoin .modal-head h2 { margin: 2px 0 0; font-size: 24px; }
.modal-kicker { font-size: 10.5px; text-transform: uppercase; letter-spacing: .22em; color: color-mix(in srgb, var(--fc) 60%, #fff); font-weight: 600; }
.setup-copy { color: #b4c1d4; font-size: 13.5px; line-height: 1.5; margin: 0 0 14px; }
.setup-copy b { color: #e8eef8; }
.setup-card, .training-card { width: min(680px, 96vw); max-height: calc(100dvh - 24px); overflow: auto; }

/* linha de civilização (mesmo ícone em caixa dos cartões de modo) */
.civ-rows { display: grid; gap: 8px; margin-bottom: 14px; }
.civ-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--fc) 45%, transparent); background: linear-gradient(120deg, color-mix(in srgb, var(--fc) 14%, rgba(12,19,34,.7)), rgba(8,13,24,.6)); transition: opacity .2s, border-color .2s; }
.civ-row.off { opacity: .5; border-color: rgba(190,210,240,.14); background: rgba(8,13,24,.5); }
.civ-row.off .civ-icon { filter: grayscale(.8); }
.civ-row .civ-icon { width: 40px; height: 40px; border-radius: 11px; }
.civ-row .civ-icon svg { width: 30px; height: 30px; }
.civ-name strong { display: block; font-size: 15px; }
.civ-name small { color: var(--muted); font-size: 12px; }
.civ-ctrl { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.civ-row .seg { margin: 0; background: rgba(4,8,16,.5); }
.civ-row .seg button { padding: 7px 12px; min-width: 58px; cursor: pointer; }
.civ-row .seg-lv button { padding: 4px 10px; font-size: 12px; min-width: 0; }
.civ-row .seg button.on { background: color-mix(in srgb, var(--fc) 45%, #0b1424); }
@media (max-width: 560px) {
  .civ-row { grid-template-columns: auto minmax(0, 1fr); }
  .civ-ctrl { grid-column: 1 / -1; align-items: stretch; }
  .civ-row .seg { width: 100%; } .civ-row .seg button { flex: 1; }
  .setup-footer { flex-wrap: wrap; } .setup-footer .setup-warning { order: -1; width: 100%; text-align: center; }
  .setup-footer .primary-btn { flex: 1; }
}

/* logo da Central de missões centralizado de verdade */
.modes-top { position: relative; }
.modes-logo { position: absolute; left: 50%; top: calc(50% + 6px); transform: translate(-50%, -50%); margin: 0; }

/* ================= v1.3: coluna da direita sempre do tamanho do tabuleiro ================= */
@media (min-width: 1101px) {
  .hud { overflow: hidden; }
  .hud > #turnCard { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
  #turnCard > * { flex: none; }
  #turnCard > .opt-scroll { display: block; flex: 0 1 auto; min-height: 0; overflow: auto; scrollbar-width: thin; margin: 0 -4px; padding: 0 4px; }
  #turnCard .tactic-row { margin-top: 10px; }
  #turnCard .move-options { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: none; overflow: visible; margin-top: 10px; }
  #turnCard .move-options > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  #turnCard .move-btn { min-height: 46px; padding: 6px 9px; gap: 8px; }
  #turnCard .move-btn > span:last-child { min-width: 0; }
  #turnCard .move-btn small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hud > #myCard { flex: 1 1 0; min-height: 140px; overflow: auto; scrollbar-width: thin; }
  .hud > .chat-card { flex: 1 1 0; min-height: 150px; }
}
@media (min-width: 1101px) {
  #myCard .power { padding: 10px 12px; }
  #myCard .use-reason { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  #myCard .use-reason:hover { -webkit-line-clamp: unset; }
  #myCard .crew { gap: 5px; }
  #myCard .crew-row { padding: 4px 8px; }
  #turnCard .turn-hint { margin-top: 8px; }
}
@media (max-width: 560px) { .modal { padding: 60px 10px 10px; align-items: start; } .setup-card, .training-card { max-height: calc(100dvh - 70px); } }

/* =====================================================================
   v1.4 — SISTEMA VISUAL ÚNICO (menus, janelas e partida usam as mesmas peças)
   cartão de vidro escuro + linha de luz no topo · ícone em caixa · botões iguais
   ===================================================================== */
:root {
  --ui-surface: linear-gradient(160deg, rgba(24,36,62,.93) 0%, rgba(11,17,31,.95) 58%, rgba(8,13,24,.96) 100%);
  --ui-border: rgba(150,180,230,.18);
  --ui-border-strong: rgba(170,200,245,.34);
  --ui-radius: 16px;
  --ui-shadow: 0 12px 34px rgba(0,0,0,.38);
  --ui-line: linear-gradient(90deg, transparent, rgba(143,184,240,.8), transparent);
  --ui-btn: linear-gradient(180deg, #3d80ec, #2a5fc8);
  --ui-btn-hover: linear-gradient(180deg, #4b8cf2, #3068d4);
}
/* cartões */
.hud-card, .board-panel, .modal-card, .home-card, .score-panel, .menu-frame, #screenJoin .form-card {
  position: relative; background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow); }
.hud-card::before, .board-panel::before, .modal-card::before, .home-card::before, .score-panel::before, .menu-frame::before, #screenJoin .form-card::before {
  content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 2px; border-radius: 2px; background: var(--ui-line); opacity: .75; pointer-events: none; }
.modal-card, #screenJoin .form-card { --fc: var(--accent); border-color: var(--ui-border-strong); }
#screenHome .home-card::before { display: none; }
/* a vez de cada um continua marcada pela cor da civilização */
.turn-card.my-turn { border-color: color-mix(in srgb, var(--fc) 70%, transparent); box-shadow: var(--ui-shadow), 0 0 22px color-mix(in srgb, var(--fc) 22%, transparent); }
.turn-card.my-turn::before { background: linear-gradient(90deg, transparent, var(--fc), transparent); opacity: 1; }

/* botões */
.primary-btn { background: var(--ui-btn); border: 1px solid rgba(170,205,255,.45); border-radius: 12px; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 4px 16px rgba(40,100,220,.28); transition: background .15s, box-shadow .15s, transform .1s; }
.primary-btn:hover:not(:disabled) { background: var(--ui-btn-hover); box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 4px 22px rgba(60,130,240,.45); }
.primary-btn:active:not(:disabled) { transform: translateY(1px); }
.primary-btn:disabled { background: linear-gradient(180deg, #24375d, #1c2c4b); border-color: rgba(150,180,230,.2); color: rgba(220,230,245,.45); box-shadow: none; }
.ghost-btn { background: rgba(143,184,240,.07); border: 1px solid rgba(160,190,235,.28); border-radius: 12px; color: #d6e0ee; transition: background .15s, border-color .15s; }
.ghost-btn:hover:not(:disabled) { background: rgba(143,184,240,.14); border-color: rgba(170,205,255,.55); }
.move-btn { border-radius: 12px; background: rgba(143,184,240,.06); border-color: rgba(160,190,235,.22); }
.move-btn:hover, .move-btn.selected { background: rgba(143,184,240,.13); border-color: rgba(170,205,255,.5); }
.seg { border-color: rgba(160,190,235,.28); border-radius: 10px; }
.seg button.on, .civ-row .seg button.on { background: linear-gradient(180deg, rgba(70,130,235,.55), rgba(45,95,200,.55)); color: #fff; }

/* menu ☰ no mesmo cartão das janelas */
.menu-frame { width: min(360px, 92vw); padding: 20px; }
.menu-plate { position: static; transform: none; display: flex; align-items: center; gap: 12px; padding: 0 0 16px; margin: 0; background: none; border: 0; box-shadow: none; }
.menu-plate::before { content: ""; width: 44px; height: 44px; border-radius: 12px; flex: none; background: rgba(143,184,240,.12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 7h14M5 12h14M5 17h14' stroke='%23cfe0fa' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / 24px no-repeat; border: 1px solid rgba(143,184,240,.35); }
.menu-plate span { font-size: 22px; font-weight: 800; letter-spacing: .01em; text-transform: none; color: #fff; }
.menu-item { min-height: 48px; border-radius: 12px; font-size: 15px; font-weight: 700; color: #e6eef9; background: rgba(143,184,240,.07); border: 1px solid rgba(160,190,235,.28); box-shadow: none; }
.menu-item:hover { background: rgba(143,184,240,.15); border-color: rgba(170,205,255,.55); }
.menu-item[data-menu="resume"] { background: var(--ui-btn); border-color: rgba(170,205,255,.45); color: #fff; }
.menu-item[data-menu="resume"]:hover { background: var(--ui-btn-hover); }
.menu-item.danger { background: rgba(217,70,75,.1); border-color: rgba(255,122,126,.4); color: #ffd9da; }
.menu-item.danger:hover { background: rgba(217,70,75,.2); }
.menu-toggle { border-radius: 12px; border-color: var(--ui-border); background: rgba(143,184,240,.04); }

/* janelas de escolha: cor padrão (sem vermelho/amarelo); a cor da civilização fica só no planeta */
.civ-row, .civ-row.off { background: rgba(143,184,240,.04); border: 1px solid var(--ui-border); }
.civ-row.off { opacity: .55; }
.civ-row .civ-icon { color: color-mix(in srgb, var(--fc) 70%, #fff); background: color-mix(in srgb, var(--fc) 14%, transparent); border-color: color-mix(in srgb, var(--fc) 40%, transparent); }
.civ-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.civ-chip { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 12px; text-align: left; color: var(--text); cursor: pointer;
  background: rgba(143,184,240,.04); border: 1px solid var(--ui-border); transition: border-color .15s, background .15s; }
.civ-chip .civ-icon { width: 34px; height: 34px; border-radius: 10px; flex: none; color: color-mix(in srgb, var(--fc) 70%, #fff); background: color-mix(in srgb, var(--fc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--fc) 40%, transparent); }
.civ-chip .civ-icon svg { width: 26px; height: 26px; }
.civ-chip strong { display: block; font-size: 13.5px; } .civ-chip small { color: var(--muted); font-size: 11px; }
.civ-chip:hover { border-color: rgba(170,205,255,.45); }
.civ-chip.on { border-color: rgba(120,175,255,.85); background: rgba(70,130,235,.16); box-shadow: 0 0 0 1px rgba(120,175,255,.35) inset; }
@media (max-width: 640px) { .civ-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .civ-row .seg-lv button, .civ-row .seg button { padding: 7px 6px; } }

/* fundo da partida: o mesmo céu da tela inicial, parado e escurecido (leve, sem animação) */
body[data-screen="game"] .space-bg { display: block; }
body[data-screen="game"] .space-zoom { animation: none; transform: scale(1.04); }
body[data-screen="game"] .space-img { animation: none; filter: blur(3px) brightness(.55) saturate(1.05); }
body[data-screen="game"] .space-fx { display: none; }
body[data-screen="game"] .space-shade { background: radial-gradient(ellipse 110% 80% at 50% 45%, rgba(3,6,14,.62), rgba(2,4,10,.9)); backdrop-filter: none; }
#screenGame { position: relative; z-index: 1; }

/* pausa */
.pause-btn { display: inline-flex; align-items: center; gap: 6px; align-self: center; padding: 3px 11px 3px 9px; border-radius: 999px; font-size: 12px; color: #d6e0ee; cursor: pointer;
  background: rgba(143,184,240,.08); border: 1px solid rgba(160,190,235,.3); }
.pause-btn svg { width: 12px; height: 12px; fill: currentColor; }
.pause-btn:hover { border-color: rgba(170,205,255,.6); background: rgba(143,184,240,.16); }
.pause-btn[hidden] { display: none; }
.pause-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 18px; background: rgba(2,4,10,.6); backdrop-filter: blur(4px); }
.pause-overlay[hidden] { display: none; }
.pause-card { width: min(420px, 94vw); padding: 22px; }
.pause-card .primary-btn { width: 100%; margin-top: 4px; }
body.paused #board .pawn, body.paused .dice3d { animation-play-state: paused !important; }
@media (max-width: 560px) { .pause-btn span { display: none; } .pause-btn { padding: 5px 8px; } }

/* ================= v1.5 ================= */
/* sentido do caminho */
.pawn-dir { fill: #fff; stroke: rgba(0,0,0,.55); stroke-width: .8; pointer-events: none; }
.start-dir { fill: var(--fc); opacity: .9; pointer-events: none; filter: drop-shadow(0 0 2px rgba(0,0,0,.6)); }
.layer-fx { pointer-events: none; }
/* explicação completa do poder e das habilidades no painel da direita */
.power p, #myCard .power p { display: block; -webkit-line-clamp: unset; overflow: visible; color: #b9c6d8; }
.crew-desc { color: var(--muted); font-size: 11.5px; line-height: 1.4; margin-top: 3px; }
.crew-row { align-items: flex-start; }
.crew-row .crew-role { margin-top: 3px; }
.crew-row .crew-use { align-self: center; }
/* carga do poder e fragmentos */
.charge { margin-top: 8px; padding: 7px 9px; border-radius: 10px; background: rgba(4,8,16,.45); border: 1px solid var(--ui-border, var(--line)); display: grid; gap: 5px; }
.ch-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; min-width: 0; }
.ch-l { color: var(--dim); width: 74px; flex: none; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.ch-s { color: #c8d3e4; min-width: 0; }
.cpip { width: 11px; height: 11px; border-radius: 50%; flex: none; border: 1.5px solid color-mix(in srgb, var(--fc, #8fb8f0) 80%, #fff); background: transparent; display: inline-block; }
.cpip.on { background: var(--fc, #8fb8f0); box-shadow: 0 0 8px color-mix(in srgb, var(--fc, #8fb8f0) 70%, transparent); }
.fpips { display: inline-flex; gap: 3px; flex: none; }
.fp { width: 9px; height: 9px; transform: rotate(45deg); border: 1.5px solid #8fd3ff; display: inline-block; border-radius: 1px; opacity: .55; }
.fp.on { background: #8fd3ff; opacity: 1; box-shadow: 0 0 6px rgba(143,211,255,.7); }
.oc .oc-row .cpip { margin-right: 4px; }
.oc-l2 { margin-left: 6px; }
/* nomes neste aparelho */
.civ-nm { display: block; width: min(220px, 100%); margin-top: 4px; padding: 6px 9px; font-size: 13px; color: var(--text); background: rgba(4,8,16,.55); border: 1px solid rgba(160,190,235,.28); border-radius: 8px; }
.civ-nm:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.civ-nm::placeholder { color: var(--dim); }
.pawn-dir { stroke-width: 1.1; stroke: rgba(4,8,16,.85); paint-order: stroke; filter: drop-shadow(0 0 1.5px rgba(0,0,0,.8)); }
.ch-l { width: 88px; white-space: nowrap; }

/* ================= v1.6: conta, amigos, histórico e salas online ================= */
body[data-screen="account"] #screenAccount, body[data-screen="online"] #screenOnline { display: grid; place-items: center; }
body[data-screen="account"] .space-bg, body[data-screen="online"] .space-bg { display: block; }
body[data-screen="account"] .space-shade, body[data-screen="online"] .space-shade { background: rgba(2,4,10,.72); backdrop-filter: blur(4px); }
#screenAccount, #screenOnline { position: relative; z-index: 1; }
.account-card, .online-card { width: min(460px, 100%); padding: 24px; }
.acc-tabs { display: flex; width: 100%; margin: 4px 0 16px; }
.acc-tabs button { flex: 1; padding: 9px 10px; }
.acc-submit { width: 100%; margin-top: 4px; }
.acc-error { color: #ffb3b5; background: rgba(217,70,75,.12); border: 1px solid rgba(255,122,126,.35); border-radius: 10px; padding: 8px 11px; font-size: 13px; margin: 0 0 12px; }
.acc-or { display: flex; align-items: center; gap: 10px; color: var(--dim); font-size: 12px; margin: 16px 0 12px; }
.acc-or::before, .acc-or::after { content: ""; flex: 1; height: 1px; background: var(--ui-border); }
.acc-google { display: grid; justify-items: center; }
#accGoogle { width: 100%; display: flex; justify-content: center; min-height: 44px; }
.acc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.text-btn { background: none; border: 0; color: var(--accent); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 2px; }
.online-opt { width: 100%; min-height: 0; flex-direction: row; align-items: center; padding: 16px 52px 16px 16px; margin: 6px 0 14px; }
.online-opt .mode-go { right: 14px; font-size: 30px; }
.online-join { display: flex; gap: 10px; align-items: flex-end; }
.online-join .field { flex: 1; margin: 0; }
.online-join input { text-transform: uppercase; letter-spacing: .25em; font-weight: 700; }
.online-join .primary-btn { min-height: 46px; }
.online-friends { margin-top: 14px; }
.online-card .form-actions { margin-top: 16px; }
.online-card .acc-error { margin-top: 12px; }

/* chip do perfil na Central de missões */
.profile-chip { position: absolute; right: 66px; top: 12px; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 4px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--ui-border-strong); background: rgba(12,19,34,.75); color: #e6eef9; font-size: 13px; font-weight: 700; backdrop-filter: blur(6px); }
.profile-chip:hover { border-color: rgba(170,205,255,.6); }
.profile-chip[hidden] { display: none; }
.pc-av, .prof-av { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ui-btn); color: #fff; font-weight: 800; font-size: 14px; }
.pc-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-badge, .tab-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #d9464b; color: #fff; font-size: 11px; font-style: normal; font-weight: 800; }
.pc-badge[hidden], .tab-count[hidden] { display: none; }
@media (max-width: 760px) { .profile-chip { right: 58px; top: 10px; } .pc-name { max-width: 84px; } }

/* sala de espera online */
.lobby-online { display: grid; gap: 12px; margin: 4px 0 12px; padding: 12px; border-radius: 12px; background: rgba(143,184,240,.05); border: 1px solid var(--ui-border); }
.lobby-online[hidden] { display: none; }
.lo-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lo-code b { font-size: 26px; letter-spacing: .28em; font-variant-numeric: tabular-nums; color: #fff; }
.lo-l { font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--dim); margin-bottom: 6px; }
.lo-code .lo-l { margin: 0; width: 100%; }
.lo-list { display: grid; gap: 6px; max-height: 190px; overflow: auto; }
.lo-empty { color: var(--muted); font-size: 12.5px; margin: 4px 0; }
.fr-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: rgba(143,184,240,.04); border: 1px solid var(--ui-border); min-height: 40px; }
.fr-row .dot { width: 8px; height: 8px; border-radius: 50%; background: #4a5568; flex: none; display: inline-block; }
.fr-row .dot.on { background: #2fb463; box-shadow: 0 0 6px rgba(47,180,99,.7); }
.fr-name { font-weight: 700; font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-st { color: var(--muted); font-size: 12px; margin-right: auto; white-space: nowrap; }
.fr-row .small, .ghost-btn.small, .primary-btn.small { padding: 5px 10px; font-size: 12px; min-height: 30px; }
.fr-x { padding: 5px 8px !important; }

/* perfil */
.profile-card { width: min(620px, 96vw); max-height: calc(100dvh - 24px); overflow: auto; }
.profile-card .modal-head { position: relative; }
.prof-close { position: absolute; right: 0; top: 0; }
.prof-av { width: 52px; height: 52px; font-size: 22px; border-radius: 14px; }
.prof-tabs { display: flex; width: 100%; margin: 6px 0 14px; }
.prof-tabs button { flex: 1; padding: 9px 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.prof-view[hidden] { display: none; }
.friend-add { display: flex; gap: 8px; margin-bottom: 10px; }
.friend-add input { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; font-size: 15px; color: var(--text); }
.friend-msg { font-size: 13px; color: #ffb3b5; margin: 0 0 10px; }
.friend-msg.ok { color: #9fe0b8; }
.fr-sec { display: grid; gap: 6px; margin-bottom: 14px; }
.danger-btn { border-color: rgba(255,122,126,.45) !important; color: #ffd9da !important; }
.hs-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.hs-tile { display: grid; gap: 2px; padding: 10px 8px; border-radius: 12px; text-align: center; background: rgba(143,184,240,.06); border: 1px solid var(--ui-border); }
.hs-tile b { font-size: 20px; } .hs-tile span { font-size: 10.5px; color: var(--muted); }
.hs-list { display: grid; gap: 8px; }
.hs-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--ui-border); background: rgba(143,184,240,.04); }
.hs-res { font-weight: 800; font-size: 13px; text-align: center; padding: 5px 0; border-radius: 8px; }
.hs-row.won .hs-res { color: #9fe0b8; background: rgba(47,180,99,.14); }
.hs-row.lost .hs-res { color: #ffb3b5; background: rgba(217,70,75,.12); }
.hs-main { display: grid; gap: 5px; min-width: 0; }
.hs-top { font-size: 13px; color: #c8d3e4; }
.hs-players { display: flex; flex-wrap: wrap; gap: 5px; }
.hs-p { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.04); border: 1px solid var(--ui-border); }
.hs-p .swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--fc); display: inline-block; }
.hs-p.win { border-color: color-mix(in srgb, var(--fc) 70%, transparent); }
.hs-p small { color: var(--muted); }
.hs-date { font-size: 11.5px; color: var(--dim); white-space: nowrap; }
@media (max-width: 560px) {
  .hs-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hs-row { grid-template-columns: 64px minmax(0, 1fr); } .hs-date { grid-column: 2; }
}

/* convite recebido */
.invite-bar { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 320; display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; max-width: calc(100vw - 24px);
  border-radius: 14px; background: var(--ui-surface); border: 1px solid rgba(120,175,255,.6); box-shadow: 0 14px 40px rgba(0,0,0,.55), 0 0 24px rgba(60,130,240,.25); font-size: 14px; animation: cardIn .35s both; }
.invite-bar[hidden] { display: none; }
/* o atributo hidden sempre esconde (alguns componentes definem display próprio) */
[hidden] { display: none !important; }
@media (max-width: 560px) { .invite-bar { left: 10px; right: 10px; transform: none; max-width: none; } .invite-bar span { flex: 1; } }

/* ================= v1.7: perfil do comandante ================= */
body[data-screen="profile"] #screenProfile { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body[data-screen="profile"] .space-bg { display: block; }
body[data-screen="profile"] .space-shade { background: radial-gradient(ellipse 100% 70% at 50% 30%, rgba(3,6,14,.55), rgba(1,3,8,.88)); backdrop-filter: blur(3px); }
#screenProfile { position: relative; z-index: 1; }
.pf-body { width: min(900px, 100%); margin: 0 auto; padding: 8px 16px 32px; display: grid; gap: 14px; }
.pf-card { position: relative; display: flex; align-items: center; gap: 18px; padding: 20px; border-radius: var(--ui-radius); background: var(--ui-surface); border: 1px solid var(--ui-border-strong); box-shadow: var(--ui-shadow); overflow: hidden; }
.pf-card::after { content: ""; position: absolute; right: -60px; top: -80px; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(80,140,240,.22), transparent 70%); pointer-events: none; }
.pf-avatar { padding: 0; border: 0; background: none; cursor: pointer; flex: none; border-radius: 50%; }
.pf-avatar:hover .avatar { box-shadow: 0 0 0 3px rgba(170,205,255,.7), 0 0 24px color-mix(in srgb, var(--av) 60%, transparent); }
.pf-id { min-width: 0; display: grid; gap: 4px; position: relative; z-index: 1; }
.pf-id h1 { margin: 0; font-size: clamp(24px, 4vw, 32px); overflow: hidden; text-overflow: ellipsis; }
.pf-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }
.pf-tag { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; letter-spacing: .12em; color: #cfe0fa; background: rgba(143,184,240,.1); border: 1px solid rgba(160,190,235,.3); border-radius: 8px; padding: 3px 8px; cursor: pointer; }
.pf-tag:hover { border-color: rgba(170,205,255,.7); }
.pf-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.pf-badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; color: #8fd3ff; background: rgba(143,211,255,.1); border: 1px solid rgba(143,211,255,.3); }
.pf-badge.muted { color: var(--dim); background: none; border-color: var(--ui-border); }
.pf-tabs { display: flex; width: 100%; }
.pf-tabs button { flex: 1; padding: 10px 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pf-view { display: grid; gap: 14px; }
.pf-sec { padding: 14px; border-radius: 14px; background: var(--ui-surface); border: 1px solid var(--ui-border); display: grid; gap: 8px; }
.pf-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 14px; }
.pf-note { padding: 16px; border-radius: 14px; background: rgba(143,184,240,.06); border: 1px dashed rgba(160,190,235,.35); color: #c8d3e4; font-size: 14px; line-height: 1.55; }
.pf-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pf-ok { color: #9fe0b8; font-size: 13px; }
.pf-danger { display: flex; gap: 10px; flex-wrap: wrap; }
.pw-form { display: flex; gap: 8px; flex-wrap: wrap; }
.pw-form input { flex: 1 1 180px; min-width: 0; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px; font-size: 15px; color: var(--text); }
.fs-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 46px; align-items: center; gap: 10px; font-size: 13px; }
.fs-name { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.fs-name .swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--fc); display: inline-block; }
.fs-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.fs-bar i { display: block; height: 100%; background: var(--fc); border-radius: 99px; }
.fs-num { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.ach-list { display: grid; gap: 6px; }
.ach { display: grid; grid-template-columns: 22px minmax(0, 1fr) 44px; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--ui-border); opacity: .7; }
.ach.done { opacity: 1; border-color: rgba(143,211,255,.4); background: rgba(143,211,255,.06); }
.ach-ic { color: #8fd3ff; font-size: 15px; text-align: center; }
.ach-t { display: grid; gap: 2px; min-width: 0; }
.ach-t b { font-size: 13px; } .ach-t small { color: var(--muted); font-size: 11px; }
.ach-bar { height: 4px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; margin-top: 2px; }
.ach-bar i { display: block; height: 100%; background: #8fd3ff; }
.ach-n { font-size: 11.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
/* avatares */
.avatar { --av: #3d82ea; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; flex: none; color: #fff;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--av) 60%, #fff 0%), color-mix(in srgb, var(--av) 70%, #000)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--av) 55%, #fff), 0 4px 14px rgba(0,0,0,.4); }
.avatar svg { width: 62%; height: 62%; color: rgba(255,255,255,.95); }
.avatar.xs { width: 30px; height: 30px; box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--av) 55%, #fff); }
.avatar.sm { width: 30px; height: 30px; }
.avatar.xl { width: 92px; height: 92px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--av) 55%, #fff), 0 0 30px color-mix(in srgb, var(--av) 40%, transparent); }
.pc-av.has-av { background: none; width: auto; height: auto; }
.avatar-picker { display: grid; gap: 10px; }
.ap-icons { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.ap-opt { padding: 4px; border-radius: 50%; border: 2px solid transparent; background: none; cursor: pointer; display: grid; place-items: center; }
.ap-opt .avatar { width: 44px; height: 44px; }
.ap-opt.on { border-color: #cfe2ff; }
.ap-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.ap-col { width: 28px; height: 28px; border-radius: 50%; background: var(--av); border: 2px solid rgba(255,255,255,.15); cursor: pointer; }
.ap-col.on { border-color: #fff; box-shadow: 0 0 0 2px var(--av); }
.avatar-picker.compact .ap-opt .avatar { width: 34px; height: 34px; }
.fr-who { display: grid; min-width: 0; }
.fr-tag { color: var(--dim); font-size: 10.5px; letter-spacing: .08em; }
.acc-hint { font-size: 12px; color: var(--dim); margin: 10px 0 0; text-align: center; }
@media (max-width: 700px) {
  .pf-grid { grid-template-columns: 1fr; }
  .pf-card { padding: 14px; gap: 12px; }
  .avatar.xl { width: 68px; height: 68px; }
  .ap-icons { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .fr-row { flex-wrap: wrap; }
}
.pf-sec { align-content: start; }
.pf-grid { align-items: start; }
.ap-opt { width: fit-content; justify-self: center; aspect-ratio: 1; }

/* =====================================================================
   v1.8 — emblemas das civilizações · painel Tripulação sem rolagem · contas no aparelho
   ===================================================================== */
/* ---------- emblemas e fundos (uma imagem por civilização, decodificada uma vez) ---------- */
.emb { display: inline-block; background: center / contain no-repeat; flex: none; }
.emb-drakhar { background-image: url(assets/factions/drakhar-emblem.webp); }
.emb-rhazak { background-image: url(assets/factions/rhazak-emblem.webp); }
.emb-varkon { background-image: url(assets/factions/varkon-emblem.webp); }
.emb-tharven { background-image: url(assets/factions/tharven-emblem.webp); }
.art-drakhar .cc-bg { background-image: url(assets/factions/drakhar-bg.webp); }
.art-rhazak .cc-bg { background-image: url(assets/factions/rhazak-bg.webp); }
.art-varkon .cc-bg { background-image: url(assets/factions/varkon-bg.webp); }
.art-tharven .cc-bg { background-image: url(assets/factions/tharven-bg.webp); }

/* ---------- escolha da civilização (contra bots): cartas com fundo e emblema ----------
   O fundo é recortado com o centro da mira a 150/320 da largura; a área do emblema (.cc-art) tem proporção 320:300,
   então o centro da mira, o anel e o emblema caem exatamente no mesmo ponto em qualquer tamanho de carta. */
.civ-pick { gap: 10px; }
.civ-card { position: relative; isolation: isolate; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 0 4px 9px; border-radius: 14px; cursor: pointer; color: var(--text); text-align: center; background: #050811;
  border: 1px solid color-mix(in srgb, var(--fc) 30%, rgba(160,190,235,.18)); transition: transform .2s ease, border-color .2s, box-shadow .2s; }
.cc-bg { position: absolute; inset: 0; z-index: -2; background: center top / 100% auto no-repeat; opacity: .45; transition: opacity .25s; }
.civ-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 50%, rgba(3,6,14,.9) 100%); }
.cc-art { position: relative; width: calc(100% + 8px); margin: 0 -4px; aspect-ratio: 320 / 300; display: grid; place-items: center; }
.cc-art > * { grid-area: 1 / 1; }
.cc-emblem { width: 54%; aspect-ratio: 1; opacity: .8; transition: transform .25s ease, opacity .25s; }
.cc-ring { width: 78%; aspect-ratio: 1; border-radius: 50%; opacity: 0; transition: opacity .25s;
  background: conic-gradient(from 0deg, transparent 0 62%, color-mix(in srgb, var(--fc) 85%, #fff) 80%, transparent 94%);
  -webkit-mask: radial-gradient(circle, transparent 64%, #000 65.5%, #000 68%, transparent 69.5%); mask: radial-gradient(circle, transparent 64%, #000 65.5%, #000 68%, transparent 69.5%); }
.cc-glow { width: 72%; aspect-ratio: 1; border-radius: 50%; opacity: 0; background: radial-gradient(circle, color-mix(in srgb, var(--fc) 55%, transparent) 0, transparent 68%); transition: opacity .25s; }
.cc-sweep { position: absolute; inset: 0 -60%; z-index: -1; background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,.14) 50%, transparent 58%); transform: translateX(-70%); opacity: 0; pointer-events: none; }
.cc-name strong { display: block; font-size: 14px; letter-spacing: .02em; }
.cc-name small { display: block; color: #aab8cc; font-size: 11px; }
.cc-pick { white-space: nowrap; margin-top: 5px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); padding: 2px 8px; border-radius: 999px; border: 1px solid transparent; }
.civ-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--fc) 60%, transparent); }
.civ-card:hover .cc-bg { opacity: .7; }
.civ-card:hover .cc-emblem { opacity: 1; transform: scale(1.05); }
.civ-card:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.civ-card.on { border-color: color-mix(in srgb, var(--fc) 85%, #fff); box-shadow: 0 0 0 1px color-mix(in srgb, var(--fc) 70%, transparent) inset, 0 0 22px color-mix(in srgb, var(--fc) 32%, transparent); }
.civ-card.on .cc-bg { opacity: 1; }
.civ-card.on .cc-emblem { opacity: 1; }
.civ-card.on .cc-ring { opacity: 1; animation: ccSpin 7s linear infinite; }
.civ-card.on .cc-glow { animation: ccGlow 2.6s ease-in-out infinite; }
.civ-card.on .cc-sweep { animation: ccSweep 4s ease-in-out infinite; }
.civ-card.on .cc-pick { color: #fff; background: color-mix(in srgb, var(--fc) 45%, rgba(4,8,16,.6)); border-color: color-mix(in srgb, var(--fc) 80%, #fff); }
.civ-card.pop .cc-emblem { animation: ccPop .5s cubic-bezier(.2,1.4,.4,1); }
/* só transform e opacity: o navegador anima sem redesenhar a carta */
@keyframes ccSpin { to { transform: rotate(360deg); } }
@keyframes ccGlow { 0%, 100% { opacity: .35; } 50% { opacity: .9; } }
@keyframes ccSweep { 0% { transform: translateX(-70%); opacity: 0; } 15% { opacity: 1; } 55%, 100% { transform: translateX(70%); opacity: 0; } }
@keyframes ccPop { 0% { transform: scale(.75); } 100% { transform: scale(1); } }
@media (max-width: 640px) { .civ-card:not(.on) .cc-pick { visibility: hidden; } .civ-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; } .civ-card { padding-bottom: 7px; } .cc-name strong { font-size: 12px; } .cc-name small { display: none; } .cc-pick { font-size: 9px; padding: 1px 5px; letter-spacing: .06em; } }
@media (prefers-reduced-motion: reduce) { .civ-card, .civ-card * { animation: none !important; transition: none !important; } }

/* ---------- linhas de civilização (neste aparelho / adversários) e lugares da sala online: só cor leve + borda ---------- */
.civ-row:not(.off) { background: color-mix(in srgb, var(--fc) 7%, rgba(8,13,24,.6)); border-color: color-mix(in srgb, var(--fc) 32%, var(--ui-border)); }
.civ-row .civ-emb { width: 44px; height: 44px; border-radius: 0; background: none !important; border: 0 !important; display: grid; place-items: center; }
.civ-emblem { width: 40px; height: 40px; transition: transform .2s; }
.civ-row:not(.off):hover .civ-emblem { transform: scale(1.08); }
.civ-row.off .civ-emblem { opacity: .35; }
.seat-emb { width: 38px; height: 38px; }
.seat.taken { background: color-mix(in srgb, var(--fc) 9%, transparent); }
.title-emb { width: 22px; height: 22px; vertical-align: -5px; margin-right: 7px; }

/* ---------- painel Tripulação: cabe sem barra de rolagem ---------- */
#myCard { scrollbar-width: none; }
#myCard::-webkit-scrollbar { display: none; }
@media (min-width: 1101px) { .hud > #myCard { overflow: hidden; display: flex; flex-direction: column; } }
#myCard .card-title { margin-bottom: 8px; }
#myCard .power { padding: 9px 11px; margin-bottom: 8px; }
#myCard .power-head { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; min-width: 0; }
#myCard .power-head .power-kicker { flex: none; }
#myCard .power-head .pw-name { margin: 0; font-size: 14px; flex: 1 1 auto; white-space: nowrap; }
#myCard .power .pw-text { margin: 4px 0 0; font-size: 12px; line-height: 1.4; }
.power-line { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; margin-top: 7px; font-size: 11.5px; color: #c8d3e4; }
.ch-mini { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ch-hint { color: var(--dim); font-size: 10.5px; line-height: 1.3; flex: 1 1 110px; min-width: 0; }
.power-line .power-actions { margin: 0 0 0 auto; display: inline-flex; gap: 6px; }
#myCard .use-reason { margin-top: 5px; font-size: 11px; }
#myCard .crew { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
#myCard .crew-row { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 7px 8px; min-width: 0; }
#myCard .crew-top { display: flex; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
#myCard .crew-top strong { white-space: nowrap; }
#myCard .crew-top .crew-role { width: 22px; height: 22px; font-size: 11px; border-width: 1.5px; margin: 0; }
#myCard .crew-top .crew-status { margin-left: auto; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#myCard .crew-ability { font-size: 11.5px; line-height: 1.35; margin: 0; }
#myCard .crew-desc { font-size: 11px; line-height: 1.38; margin: 0; }
#myCard .crew-use { margin: auto 0 0; align-self: stretch; min-height: 26px; padding: 3px 8px; }
#myCard .crew-when { margin: 0; }
/* compacta em etapas quando falta altura (fitCrew no app.js): primeiro some o que é repetido, depois os textos encurtam linha a linha */
#myCard { --desc-lines: 99; --pw-lines: 99; }
#myCard .crew-desc { display: -webkit-box; -webkit-line-clamp: var(--desc-lines); -webkit-box-orient: vertical; overflow: hidden; }
#myCard .power .pw-text { display: -webkit-box; -webkit-line-clamp: var(--pw-lines); -webkit-box-orient: vertical; overflow: hidden; }
#myCard.dense-1 .ch-hint, #myCard.dense-1 .ab-state { display: none; }
#myCard.dense-1 .crew-row { padding: 6px 7px; gap: 2px; }
#myCard.dense-2 { --desc-lines: 4; --pw-lines: 3; }
#myCard.dense-3 { --desc-lines: 3; --pw-lines: 2; }
#myCard.dense-3 .use-reason { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
#myCard.dense-4 { --desc-lines: 2; }
#myCard.dense-4 .card-title { margin-bottom: 5px; }
#myCard.dense-4 .power { padding: 7px 10px; margin-bottom: 6px; }
#myCard.dense-5 { --pw-lines: 1; }
#myCard.dense-5 .use-reason { display: none; }
#myCard.dense-6 { --desc-lines: 1; }
#myCard.dense-7 .crew-desc, #myCard.dense-7 .power .pw-text { display: none; }
#myCard.dense-7 .crew-ability { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#myCard.dense-7 .crew-use { min-height: 22px; }

/* ---------- contas no aparelho ---------- */
.demo-tag { font-style: normal; color: #c9b6ff; font-size: 10px; letter-spacing: .04em; }
.pf-check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #c8d3e4; cursor: pointer; margin-top: 4px; }
.pf-check input { width: 17px; height: 17px; accent-color: #4a86e8; }
#accDevice { margin: 10px 0 0; }
#myCard .crew-top { align-items: flex-start; }
#myCard .crew-top .crew-role { margin-top: 1px; }
#myCard .crew-id { display: grid; min-width: 0; line-height: 1.2; }
#myCard .crew-id .crew-status { margin: 0; text-align: left; font-size: 10.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#myCard .crew-row.s-saved .crew-id .crew-status { color: #9fe0b8; }
#myCard .crew-top { justify-content: flex-start; }
#myCard .crew-id, #myCard .crew-id .crew-status { text-align: left; }
.pass-match { font-size: 12px; }
.pass-match.ok { color: #7fe0a6; } .pass-match.bad { color: #ff9a9d; }
.acc-show { margin: -4px 0 10px; font-size: 12.5px; }
/* desempenho: o desfoque por trás das janelas era recalculado a cada quadro; um véu escuro dá o mesmo foco e custa quase nada */
.modal { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(2,4,10,.84); }
/* desempenho: na partida o fundo fica parado (antes ele seguia "respirando" por trás do tabuleiro e o desfoque era refeito a cada quadro) */
body[data-screen="game"] .space-zoom { animation: none; transform: scale(1.04); will-change: auto; }
.space-img { filter: none; }
body[data-screen="game"] .space-img { filter: blur(3px) brightness(.55) saturate(1.05); }
/* desempenho: barra do tempo anima por transform (antes: width, que refazia o layout a cada quadro) */
.tt-bar i { width: 100% !important; transform-origin: left center; transition: transform .25s linear; will-change: transform; }
/* desempenho: o pulso do dado anima só a opacidade de um brilho pronto (antes: box-shadow redesenhado a cada quadro) */
.dice3d.empty.ready .die-slot { animation: none; }
.dice3d.empty.ready .die-slot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--fc) 22%, transparent), 0 0 18px color-mix(in srgb, var(--fc) 55%, transparent); animation: slotGlow 1.3s ease-in-out infinite; }
@keyframes slotGlow { 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dice3d.empty.ready .die-slot::after { animation: none; opacity: .6; } }
/* telas baixas (notebook 768 px): carta mais baixa; o fundo sobe junto para a mira continuar no centro do emblema */
.civ-card { container-type: inline-size; }
@media (max-height: 860px) and (min-width: 641px) {
  .cc-art { aspect-ratio: 320 / 220; }
  .cc-bg { top: -12.5cqw; }
  .cc-emblem { width: 44%; } .cc-ring { width: 62%; } .cc-glow { width: 58%; }
}

/* ================= v1.9: chat em todas as partidas ================= */
.lc-head { gap: 8px; }
.lc-tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(4,8,16,.55); border: 1px solid var(--ui-border, var(--line)); }
.lc-tabs button { border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; padding: 5px 12px; border-radius: 7px; cursor: pointer; position: relative; }
.lc-tabs button.on { background: linear-gradient(180deg, rgba(70,130,235,.55), rgba(45,95,200,.55)); color: #fff; }
.lc-badge { display: inline-block; min-width: 16px; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: #2f6fd6; color: #fff; font-size: 10.5px; line-height: 16px; }
.lc-badge[hidden] { display: none; }
.lc-only-title { display: none; }
.chat-quick { display: flex; gap: 6px; overflow-x: auto; padding: 6px 0 2px; scrollbar-width: none; flex: none; }
.chat-quick::-webkit-scrollbar { display: none; }
.chat-chip { flex: none; border: 1px solid rgba(160,190,235,.3); background: rgba(143,184,240,.07); color: #dce6f4; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.chat-chip:hover { background: rgba(143,184,240,.16); border-color: rgba(170,205,255,.55); }
.chat-msg.bot .chat-text { color: #c9d4e4; font-style: italic; }
#chatCard .chat-form { flex: none; }
@media (min-width: 1101px) {
  /* História e Chat ocupam o mesmo lugar na coluna da esquerda (abas) */
  body:not([data-lc="chat"]) .side-left #chatCard { display: none; }
  body[data-lc="chat"] .side-left .log-card { display: none; }
  .side-left #chatCard { flex: 1 1 200px; min-height: 200px; display: flex; flex-direction: column; }
  .side-left #chatCard .chat-list { flex: 1; min-height: 0; max-height: none; overflow: auto; }
  .lc-head h2.lc-only-title { display: none; }
}
@media (max-width: 1100px) {
  /* celular e tablet: cada um tem a sua aba embaixo (História / Chat), então o seletor some */
  .lc-tabs { display: none; }
  .lc-only-title { display: block; }
}
@media (min-width: 1101px) { body[data-lc="chat"] .side-left .others-card { flex: 0 1 auto; max-height: 46%; } }

/* ================= v1.9.1: sem barras de rolagem na partida ================= */
#screenGame, #screenGame * { scrollbar-width: none; }
#screenGame ::-webkit-scrollbar { display: none; }
@media (min-width: 1101px) {
  .side-left { overflow: hidden !important; }
  .side-left .others-card { flex: 0 0 auto !important; max-height: none !important; overflow: hidden !important; min-height: 0; }
  body[data-lc="chat"] .side-left .others-card { max-height: none !important; }
  /* História e Chat: exatamente o mesmo tamanho (o resto da coluna) */
  .side-left .log-card, .side-left #chatCard { flex: 1 1 0 !important; min-height: 150px !important; }
}
/* Outros jogadores, mais compacto: poder · carga, fragmentos e habilidades numa linha */
.oc { gap: 5px; padding: 7px 10px; }
.oc-row2 { gap: 6px; }
.oc-row2 .ab-row { margin-left: auto; }
.others-card.dense-1 .score-legend { display: none; }
.others-card.dense-2 .oc { padding: 5px 9px; gap: 3px; }
.others-card.dense-2 .others { gap: 6px; }
.others-card.dense-3 .card-title { margin-bottom: 6px; }
.others-card.dense-3 .oc-row { font-size: 11.5px; }
.others-card.dense-4 .oc-fx { display: none; }
/* Tripulação: mover direto daqui */
#myCard .crew-row.can-move { border-color: color-mix(in srgb, var(--fc) 75%, #fff); background: color-mix(in srgb, var(--fc) 12%, rgba(255,255,255,.02)); cursor: pointer; box-shadow: 0 0 0 1px color-mix(in srgb, var(--fc) 40%, transparent) inset; }
#myCard .crew-row.can-move:hover { background: color-mix(in srgb, var(--fc) 20%, rgba(255,255,255,.02)); }
#myCard .crew-move { font-size: 11px; color: #e6eef9; line-height: 1.3; }
#myCard .crew-btns { display: flex; gap: 6px; margin-top: auto; }
#myCard .crew-btns > * { flex: 1; min-width: 0; }
#myCard .crew-btns .crew-use { margin: 0; }
#myCard .crew-go { min-height: 26px; padding: 3px 8px; }
#myCard.dense-4 .crew-move { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* fundo de espaço do tabuleiro: um véu escuro por cima para as casas continuarem fáceis de ler */
.board-veil { fill: rgba(6,10,20,.38); stroke: rgba(160,180,210,.12); pointer-events: none; }
.board-space, .planet-img { pointer-events: none; }
#turnCard .move-options:empty::before { white-space: normal; }

/* ================= v1.9.3 ================= */
/* ---------- Outros jogadores: completo, com destaque de quem está na vez ---------- */
.oc { position: relative; gap: 5px; padding: 8px 10px 7px; }
.oc-head { gap: 6px; }
.oc-n { font-size: 11.5px; }
.oc-turn { margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; padding: 1px 7px; border-radius: 999px;
  background: color-mix(in srgb, var(--fc) 70%, #0a1120); animation: ocTurn 1.4s ease-in-out infinite; }
.c-yellow .oc-turn { color: #1d1400; }
.oc-saved { font-size: 11px; color: #c8d3e4; white-space: nowrap; }
.oc-head .oc-turn + .oc-saved { margin-left: 4px; }
.oc-head .oc-saved:not(.oc-turn + .oc-saved) { margin-left: auto; }
.oc.cur { border-color: color-mix(in srgb, var(--fc) 70%, transparent); background: color-mix(in srgb, var(--fc) 13%, rgba(8,13,24,.6));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--fc) 45%, transparent), 0 0 18px color-mix(in srgb, var(--fc) 22%, transparent); }
@keyframes ocTurn { 50% { opacity: .55; } }
.oc-l { width: 46px; }
.oc-charge { gap: 6px; font-size: 11.5px; }
.oc-cs { color: #c8d3e4; }
.oc-charge .fpips { margin-left: 6px; }
.oc-crew { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.ocm { display: flex; align-items: center; gap: 4px; padding: 3px 5px; border-radius: 7px; background: rgba(4,8,16,.45); border: 1px solid rgba(160,190,235,.14); min-width: 0; }
.ocm b { width: 18px; height: 18px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 10px; color: #fff; background: var(--fc); border: 1.5px solid #f4f7fb; }
.c-yellow .ocm b { color: #1d1400; }
.ocm.s-base b { background: #2a3448; border-color: #5d6b82; color: #c8d3e4; }
.ocm.s-saved b { background: #1f6b43; border-color: #7fe0a6; }
.ocm small { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.ocm .ab { width: 8px; height: 8px; margin: 0; flex: none; }
.oc-last { font-size: 11px; color: #c8d3e4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-last span { color: var(--dim); text-transform: uppercase; letter-spacing: .06em; font-size: 9.5px; margin-right: 4px; }
/* encaixe sem rolagem (fitLeft) */
.others-card.dense-1 .score-legend { display: none; }
.others-card.dense-2 .oc-last { display: none; }
.others-card.dense-3 .oc { padding: 6px 9px; gap: 4px; } .others-card.dense-3 .others { gap: 6px; }
.others-card.dense-4 .ocm small { display: none; } .others-card.dense-4 .oc-crew { grid-template-columns: repeat(4, auto); justify-content: start; }
.others-card.dense-5 .oc-cs { display: none; }
.others-card.dense-6 .oc-fx { display: none; }

/* ---------- História e Chat: menores; o resto da coluna fica para os jogadores ---------- */
@media (min-width: 1101px) {
  .side-left .others-card { flex: 1 1 auto !important; }
  .side-left .log-card, .side-left #chatCard { flex: 0 0 auto !important; height: clamp(170px, 27vh, 250px); min-height: 0 !important; }
}
.chat-msg { padding: 5px 9px; }

/* ---------- botões na cor de quem joga (painel da vez e Tripulação) ---------- */
.c-red { --fc-ink: #fff; } .c-blue { --fc-ink: #fff; } .c-green { --fc-ink: #fff; } .c-yellow { --fc-ink: #1d1400; }
#turnCard .primary-btn:not(:disabled), #myCard .primary-btn:not(:disabled) {
  background: linear-gradient(180deg, color-mix(in srgb, var(--fc) 88%, #fff), color-mix(in srgb, var(--fc) 82%, #000));
  border-color: color-mix(in srgb, var(--fc) 60%, #fff); color: var(--fc-ink, #fff);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 4px 16px color-mix(in srgb, var(--fc) 35%, transparent); }
#turnCard .primary-btn:hover:not(:disabled), #myCard .primary-btn:hover:not(:disabled) { filter: brightness(1.1); background: linear-gradient(180deg, color-mix(in srgb, var(--fc) 92%, #fff), color-mix(in srgb, var(--fc) 86%, #000)); }
#turnCard .primary-btn kbd { background: rgba(0,0,0,.18); color: inherit; }
#myCard .ghost-btn:not(:disabled), #turnCard .ghost-btn:not(:disabled) { border-color: color-mix(in srgb, var(--fc) 45%, rgba(160,190,235,.3)); }
#myCard .ghost-btn:hover:not(:disabled), #turnCard .ghost-btn:hover:not(:disabled) { background: color-mix(in srgb, var(--fc) 18%, transparent); }
#myCard .crew-use.on { border-color: var(--fc); background: color-mix(in srgb, var(--fc) 25%, transparent); }
#myCard .crew-row.can-use .crew-use { border-color: color-mix(in srgb, var(--fc) 80%, #fff); color: #fff; background: color-mix(in srgb, var(--fc) 22%, rgba(8,13,24,.6)); }

/* ---------- tempo acabando: igual para todas as cores (a barra pisca e ganha listras; o número treme) ---------- */
.turn-timer.warn .tt-bar i, .turn-timer.warn.mine .tt-bar i { background-color: var(--fc, #8fb8f0);
  background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.55) 0 5px, transparent 5px 10px); animation: ttBlink .5s steps(2, jump-none) infinite; }
.turn-timer.warn .tt-bar { box-shadow: 0 0 0 1px rgba(255,255,255,.55); }
.turn-timer.warn span, .turn-timer.warn.mine span { color: #fff; font-weight: 800; }
.turn-timer.warn span::before { content: "⏱ "; }
.turn-timer.crit .tt-bar { box-shadow: 0 0 0 1.5px #fff, 0 0 12px rgba(255,255,255,.6); }
.turn-timer.crit span { animation: shakeX .4s ease-in-out infinite; display: inline-block; font-size: 14px; }
@keyframes ttBlink { 0% { opacity: 1; } 100% { opacity: .45; } }

/* ---------- botões que tremem quando pedem a sua ação ---------- */
@keyframes nudge { 0%, 78%, 100% { transform: translateX(0) rotate(0); } 80% { transform: translateX(-3px) rotate(-1.5deg); } 84% { transform: translateX(3px) rotate(1.5deg); } 88% { transform: translateX(-2px) rotate(-1deg); } 92% { transform: translateX(2px) rotate(1deg); } 96% { transform: translateX(-1px); } }
@keyframes shakeX { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
@keyframes shakeOnce { 0%, 100% { transform: translateX(0); } 15% { transform: translateX(-4px) rotate(-3deg); } 30% { transform: translateX(4px) rotate(3deg); } 45% { transform: translateX(-3px) rotate(-2deg); } 60% { transform: translateX(3px) rotate(2deg); } 75% { transform: translateX(-1px); } }
.turn-card.my-turn #rollBtn:not(:disabled) { animation: nudge 3.2s ease-in-out 2.5s infinite; }
#myCard .crew-go { animation: nudge 3.2s ease-in-out 3s infinite; }
#myCard .crew-row.can-move:hover .crew-go { animation: none; }
.shake { animation: shakeOnce .6s ease-in-out 2; }
[data-lc="chat"].has-new, #tabChat.has-new { color: #fff; }
[data-lc="chat"].has-new { box-shadow: 0 0 0 1px rgba(120,175,255,.8); }
@media (prefers-reduced-motion: reduce) { .turn-card.my-turn #rollBtn, #myCard .crew-go, .shake, .turn-timer.crit span, .turn-timer.warn .tt-bar i, .oc-turn { animation: none !important; } }
/* tripulantes dos outros: letra em cima (com a bolinha da habilidade) e onde está embaixo */
.ocm { flex-direction: column; gap: 1px; padding: 3px 2px 2px; }
.ocm b { position: relative; }
.ocm b .ab { position: absolute; right: -5px; top: -3px; width: 8px; height: 8px; border: 1.5px solid #0a1120; border-radius: 50%; }
.ocm small { font-size: 9.5px; text-align: center; flex: none; width: 100%; }
.others-card.dense-4 .ocm { flex-direction: row; padding: 2px 4px; }

/* ================= v1.9.4: telas menores, MacBook, iPad e celular ================= */
/* barra de escolhas da jogada sobre o tabuleiro (computador) — não mexe no painel da direita */
.board-panel { position: relative; }
.action-dock { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 30; width: min(560px, calc(100% - 28px));
  display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 14px;
  background: rgba(8,13,26,.94); border: 1px solid rgba(160,190,235,.35); box-shadow: 0 14px 40px rgba(0,0,0,.6); animation: dockIn .22s ease-out; }
.action-dock[hidden] { display: none; }
.action-dock.picking { border-color: rgba(255,255,255,.65); box-shadow: 0 0 0 1px rgba(255,255,255,.25), 0 14px 40px rgba(0,0,0,.6); }
@keyframes dockIn { from { opacity: 0; transform: translate(-50%, 10px); } }
.action-dock .opt-scroll { display: block; max-height: none; overflow: visible; margin: 0; padding: 0; }
.action-dock .move-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 0; max-height: none; overflow: visible; }
.action-dock .move-options:empty { display: none; }
.action-dock .move-options > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.action-dock .move-btn { min-height: 42px; padding: 6px 9px; }
.action-dock .move-btn small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.action-dock .tactic-row { margin: 0 0 6px; }
.action-dock .tip-box { margin: 0; }
@media (prefers-reduced-motion: reduce) { .action-dock { animation: none; } }
@media (min-width: 1101px) {
  /* dica da vez sempre com 2 linhas reservadas: o painel não sobe nem desce quando o texto muda */
  #turnCard .turn-hint { min-height: 2.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
  #turnCard .turn-hint[hidden] { display: none; }
  /* topo da partida: o botão ☰ tem o lugar dele e não encosta nos painéis */
  #screenGame .topbar { min-height: 46px; padding-right: 60px; }
  body[data-screen="game"] .menu-btn { top: 10px; }
}
/* história com fim suave (sem linha cortada pela metade) */
.side-left .log-card .event-log { -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent); mask-image: linear-gradient(180deg, #000 82%, transparent); }

/* notebooks baixos (MacBook 13", 1366×768 com barras do navegador) */
@media (min-width: 1101px) and (max-height: 760px) {
  .side-left .log-card, .side-left #chatCard { height: clamp(150px, 25vh, 190px); }
  .side-left .others-card .card-title, #myCard .card-title { margin-bottom: 6px; }
  #turnCard { padding-top: 10px; padding-bottom: 10px; }
  #turnCard .dice3d { --ds: 64px; }
  .hud-card { padding: 10px 12px; }
  .chat-quick { display: none; }
}
@media (min-width: 1101px) and (max-width: 1320px) {
  .oc-l { display: none; }
  .oc-row .oc-v { font-size: 11.5px; }
}

/* criar conta: largo em vez de comprido (sem barra de rolagem no computador e no tablet) */
@media (min-width: 760px) {
  .account-card:has(#accForm.reg:not([hidden])) { width: min(780px, calc(100vw - 32px)); max-width: none; }
  #accForm.reg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 22px; align-items: start;
    grid-template-areas: "email avatar" "nick avatar" "pass pass2" "show show" "err err" "submit submit" "device device"; }
  #accForm.reg > label:has(#accEmail) { grid-area: email; }
  #accForm.reg > #accNickWrap { grid-area: nick; }
  #accForm.reg > #accAvatarWrap { grid-area: avatar; }
  #accForm.reg > label:has(#accPass) { grid-area: pass; }
  #accForm.reg > #accPass2Wrap { grid-area: pass2; }
  #accForm.reg > .acc-show { grid-area: show; }
  #accForm.reg > #accError { grid-area: err; }
  #accForm.reg > #accSubmit { grid-area: submit; }
  #accForm.reg > #accDevice { grid-area: device; }
  #accForm.reg .avatar-picker .ap-icons { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-height: 820px) and (min-width: 760px) {
  #screenAccount .account-card { padding-top: 18px; padding-bottom: 18px; }
  #screenAccount .account-card .modal-head { margin-bottom: 10px; }
  #screenAccount .field { margin-bottom: 10px; }
}

/* logo maior na Central de missões (proporcional à tela) */
.modes-logo { height: auto !important; width: clamp(170px, 19vw, 320px); opacity: .95; }
@media (max-width: 760px) { .modes-logo { display: none !important; } }
/* avisos na partida (computador): sobre o topo do tabuleiro, sem cobrir o relógio, o Pausar nem os painéis */
@media (min-width: 1101px) { body[data-screen="game"] .toast { top: 60px; box-shadow: 0 10px 30px rgba(0,0,0,.55); } }

/* ================= v1.9.5 ================= */
/* ---------- botão "i" e balão de informação ---------- */
.info-i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; padding: 0; margin-left: 6px; vertical-align: 2px; cursor: pointer;
  font: 700 11px/1 Georgia, 'Times New Roman', serif; font-style: italic; color: #cfe0f7; background: rgba(143,184,240,.12); border: 1px solid rgba(160,190,235,.45); flex: none; }
.info-i:hover, .info-i:focus-visible { background: rgba(143,184,240,.3); color: #fff; outline: none; }
.card-title .info-i { margin-left: 8px; }
#myCard .card-title { gap: 6px; } #myCard .card-title h2 { flex: 1; min-width: 0; }
.turn-info { position: relative; }
.turn-i { position: absolute; right: 0; top: 0; }
.lc-head .info-i { margin-left: auto; }
.info-pop { position: fixed; z-index: 400; width: min(340px, calc(100vw - 20px)); max-height: calc(100vh - 20px); overflow: auto; scrollbar-width: none;
  background: var(--ui-surface); border: 1px solid var(--ui-border-strong); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.6); padding: 14px 16px 12px; font-size: 13px; line-height: 1.5; color: #d8e2f0; animation: dockFade .16s ease-out; }
.info-pop[hidden] { display: none; }
.info-pop h3 { margin: 0 24px 8px 0; font-size: 15px; color: #fff; }
.info-pop p { margin: 0 0 8px; }
.info-x { position: absolute; top: 8px; right: 8px; border: 0; background: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 4px; }
.info-dots { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; }
.info-dots span { display: inline-flex; align-items: center; gap: 5px; }
.info-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; font-size: 12.5px; }
.info-legend span { display: inline-flex; align-items: center; gap: 6px; }
@keyframes dockFade { from { opacity: 0; transform: translateY(4px); } }
.score-legend { display: none !important; }

/* ---------- ferramentas no topo da partida ---------- */
.top-tools { display: flex; align-items: center; gap: 8px; }
.top-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; color: #dfe8f5;
  background: rgba(12,19,34,.85); border: 1px solid var(--ui-border, rgba(160,190,235,.25)); }
.top-btn:hover { border-color: rgba(170,205,255,.55); background: rgba(30,48,82,.85); }
.top-btn.icon-only { width: 34px; padding: 0; justify-content: center; font-size: 15px; }
.top-btn svg { width: 15px; height: 15px; }
.top-btn.off { opacity: .6; }
.top-btn .i-ic { font: 700 12px/1 Georgia, serif; font-style: italic; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; border: 1px solid currentColor; }
.top-btn[hidden] { display: none; }
.top-tools .zoom-controls { margin: 0; }
.top-tools .zoom-controls .icon-btn { height: 34px; }
@media (min-width: 1101px) {
  .board-toolbar { display: none !important; }
  #screenGame .topbar { padding-right: 62px; }
}
@media (max-width: 1100px) { .top-tools .info-only span { display: none; } .top-tools .info-only { width: 34px; padding: 0; justify-content: center; } #fsBtn { display: none; } }
@media (max-width: 560px) { #soundBtn { display: none; } }

/* ---------- colunas usam a largura toda (sem faixas vazias nas laterais) ---------- */
@media (min-width: 1101px) {
  .app-shell { max-width: 2200px; }
  .game-layout { grid-template-columns: minmax(250px, 1fr) calc(var(--board-size, 680px) + 22px) minmax(290px, 1fr) !important; }
}
@media (min-width: 1700px) { .game-layout { grid-template-columns: minmax(250px, 560px) calc(var(--board-size, 680px) + 22px) minmax(290px, 560px) !important; } }

/* ---------- coluna esquerda: jogadores do tamanho do conteúdo; História/Chat ocupam o resto (sem buraco) ---------- */
@media (min-width: 1101px) {
  .side-left .others-card { flex: 0 0 auto !important; }
  .side-left .log-card, .side-left #chatCard { flex: 1 1 0 !important; height: auto !important; min-height: 190px !important; }
  .chat-quick { display: flex !important; }
}
@media (min-width: 1101px) and (max-height: 700px) { .chat-quick { display: none !important; } }

/* ---------- Central de missões e tela inicial no mesmo padrão das janelas (fundo e botões) ---------- */
.mode-card { background: var(--ui-surface) !important; border: 1px solid var(--ui-border-strong, rgba(160,190,235,.35)) !important; backdrop-filter: none !important; border-radius: var(--ui-radius, 16px); box-shadow: var(--ui-shadow); }
.mode-card::before { left: 18px; right: 18px; top: -1px; height: 2px; border-radius: 2px; background: var(--ui-line); opacity: .75; }
.mode-card::after { display: none; }
.mode-card .mode-art { background: rgba(143,184,240,.1) !important; border: 1px solid rgba(160,190,235,.35) !important; color: #dfe8f5 !important; }
.mode-card:hover, .mode-card:focus-visible { border-color: rgba(170,205,255,.7) !important; box-shadow: var(--ui-shadow), 0 0 0 1px rgba(120,175,255,.35) inset; }
.mode-card .mode-go { color: #cfe0f7; }
.start-btn { border-radius: 12px !important; background: var(--ui-btn) !important; border: 1px solid rgba(170,205,255,.45) !important; backdrop-filter: none !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 6px 22px rgba(40,100,220,.38) !important; letter-spacing: .24em; }
.start-btn:hover, .start-btn:focus-visible { background: var(--ui-btn-hover) !important; }
.start-btn::after { border-radius: 16px; }
.resume-chip { border-radius: 12px; border-color: rgba(170,205,255,.45); background: var(--ui-surface); backdrop-filter: none; }
.resume-chip b { color: #8fc1ff; }
.modes-back, .profile-chip { background: rgba(12,19,34,.85); border: 1px solid var(--ui-border, rgba(160,190,235,.25)); backdrop-filter: none; }

/* ================= v1.9.6 ================= */
/* tempo acabando: a barra só pisca (sem listras, contorno ou ícone) */
.turn-timer.warn .tt-bar i, .turn-timer.warn.mine .tt-bar i { background-image: none !important; animation: ttBlink2 .6s ease-in-out infinite alternate !important; }
.turn-timer.warn .tt-bar, .turn-timer.crit .tt-bar { box-shadow: none !important; }
.turn-timer.warn span, .turn-timer.warn.mine span { color: var(--muted) !important; font-weight: 400 !important; animation: none !important; font-size: 12.5px !important; }
.turn-timer.warn span::before { content: none !important; }
@keyframes ttBlink2 { from { opacity: 1; } to { opacity: .25; } }

/* painel da vez com altura fixa: nome numa linha, etiqueta sobre o dado, faixa "Últimos" sempre reservada */
.dice-wrap { position: relative; }
.dice-by { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; height: 1.3em; max-width: 92px; }
.dice-by br { display: none; }
.db-tag { position: absolute; left: 50%; top: calc(var(--ds, 72px) - 14px); transform: translateX(-50%); z-index: 3; white-space: nowrap; font-style: normal; font-size: 10px; font-weight: 700;
  padding: 1px 7px; border-radius: 999px; background: rgba(8,13,24,.92); border: 1px solid rgba(160,190,235,.4); color: #dfe8f5; }
.db-tag.warn { color: #ffcf6e; border-color: rgba(255,207,110,.5); }
.roll-strip:empty { display: flex !important; }
#turnCard .roll-strip { min-height: 22px; }

/* outros jogadores: tripulante que chegou ao planeta fica destacado */
.ocm.s-saved { background: linear-gradient(180deg, rgba(47,180,99,.22), rgba(47,180,99,.08)); border-color: rgba(127,224,166,.55); }
.ocm.s-saved b { background: var(--fc); border-color: #fff; box-shadow: 0 0 8px rgba(127,224,166,.7); }
.ocm .ok { position: absolute; right: -6px; top: -4px; width: 11px; height: 11px; border-radius: 50%; background: #2fb463; color: #fff; font-size: 8px; font-style: normal; display: grid; place-items: center; border: 1.5px solid #0a1120; }
.ocm.s-saved small { color: #9fe0b8; font-weight: 700; }
.oc-frag.has { color: #8fd3ff; font-weight: 600; }

/* ferramentas logo acima do tabuleiro, alinhadas à borda dele */
@media (min-width: 1101px) {
  #screenGame .topbar { position: relative; }
  .top-tools.pinned { position: absolute; top: 0; height: 38px; }
}
/* tamanho único para os botões do topo e o ☰, na mesma posição em todas as telas */
.top-btn, .top-tools .zoom-controls .icon-btn { height: 38px; }
.top-btn.icon-only { width: 38px; }
.menu-btn { top: 14px !important; right: 18px !important; width: 42px; height: 38px; border-radius: 10px; }
.profile-chip { top: 14px !important; right: 70px !important; height: 38px; }
#screenGame .topbar { min-height: 38px; padding-top: 0; padding-bottom: 12px; }
#screenGame .app-shell { padding-top: 14px; }
@media (max-width: 680px) { .menu-btn { top: 8px !important; right: 8px !important; } .profile-chip { top: 8px !important; right: 58px !important; } #screenGame .app-shell { padding-top: 6px; } }

/* logo da Central de missões igual à da tela inicial (mesmo tamanho e mesma altura) */
#screenModes .modes-logo, #screenProfile .modes-logo { display: block !important; position: absolute; left: 50%; top: 9vh; transform: translateX(-50%) !important; width: min(420px, 80vw) !important; height: auto !important; margin: 0; opacity: 1; filter: drop-shadow(0 0 22px rgba(120,170,255,.35)); }
#screenModes .modes-top, #screenProfile .modes-top { min-height: calc(9vh + min(420px, 80vw) * .133 + 18px); }
@media (max-width: 760px) { #screenModes .modes-logo, #screenProfile .modes-logo { top: max(56px, 9vh); } #screenModes .modes-top, #screenProfile .modes-top { min-height: calc(max(56px, 9vh) + 80vw * .133 + 12px); } }
/* "‹ Início/Voltar" na mesma linha do ☰ */
#screenModes .modes-back, #screenProfile .modes-back { position: absolute; top: 14px; left: 18px; height: 38px; }
@media (max-width: 680px) { #screenModes .modes-back, #screenProfile .modes-back { top: 8px; left: 8px; } }

/* ================= v1.9.7 ================= */
/* legenda e zoom de volta na barra do próprio tabuleiro */
@media (min-width: 1101px) { .board-toolbar { display: flex !important; } }
.board-legend { align-items: center; }
.board-legend .info-i { margin-left: 2px; }
/* canto superior direito: Placar, som, tela cheia e ☰ — mesma altura, mesmo espaçamento, ☰ alinhado à borda dos painéis */
#screenGame .topbar { position: relative; align-items: center; min-height: 38px; padding: 0 50px 0 2px !important; margin-bottom: 14px; }
#screenGame .brand { align-items: center; }
#screenGame .game-clock, #screenGame .pause-btn { height: 30px; display: inline-flex; align-items: center; padding-top: 0; padding-bottom: 0; }
.top-tools, .top-tools.pinned { position: static !important; transform: none !important; display: flex; align-items: center; gap: 8px; height: auto; }
.top-tools .score-btn, .top-btn { height: 38px !important; min-height: 38px; border-radius: 10px; padding: 0 14px; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px;
  color: #dfe8f5; background: rgba(12,19,34,.85); border: 1px solid var(--ui-border, rgba(160,190,235,.25)); }
.top-btn.icon-only { width: 42px; padding: 0; justify-content: center; }
.top-tools .score-btn:hover, .top-btn:hover { border-color: rgba(170,205,255,.55); background: rgba(30,48,82,.85); }
.sc-ic { width: 15px; height: 15px; flex: none; }
.top-actions { gap: 8px; }

/* Outros jogadores: tabela organizada (rótulo · valor · situação) */
.oc { gap: 6px; padding: 9px 11px 8px; }
.oc-grid { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; column-gap: 8px; row-gap: 5px; align-items: center; font-size: 12px; }
.oc-grid .oc-l { width: auto; color: var(--dim); }
.oc-grid .oc-v { color: #dfe7f3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; display: flex; align-items: center; gap: 6px; }
.oc-grid .oc-charge .oc-l2 { color: var(--dim); margin-left: 8px; }
.oc-grid .oc-frag { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.oc-grid .oc-frag.has { color: #8fd3ff; font-weight: 700; }
.oc-sv { font-size: 11px; color: #9fe0b8; font-weight: 600; white-space: nowrap; }
.oc .ab-row { gap: 4px; }
.oc .ab { width: 18px; height: 18px; font-size: 9.5px; }
.ab.at-base { opacity: .55; }
.ab.ab-saved { background: #2fb463; border-color: #b9f0cf; color: #fff; box-shadow: 0 0 7px rgba(47,180,99,.7); position: relative; }
.ab.ab-saved::after { content: "✓"; position: absolute; right: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: #fff; color: #1f7a45; font-size: 7px; display: grid; place-items: center; line-height: 1; }
.oc-fx { min-height: 0; }
.oc .fx-none { font-size: 11px; color: var(--dim); }
.others-card.dense-1 .fx-none { display: none; }
.others-card.dense-2 .oc { padding: 6px 10px; gap: 4px; }
.others-card.dense-3 .oc-grid { row-gap: 3px; }
.others-card.dense-4 .oc-grid .oc-charge .oc-l2 { display: none; }
.others-card.dense-5 .oc-fx { display: none; }
.others-card.dense-6 .oc-n { display: none; }
@media (min-width: 1101px) and (max-width: 1320px) { .oc-grid { grid-template-columns: 64px minmax(0, 1fr) auto; } .oc-grid .oc-l { display: block; font-size: 11px; } }

/* ================= v1.9.8 ================= */
/* legenda embaixo do tabuleiro; em cima só o zoom (os avisos não embolam mais) */
.legend-bottom { justify-content: center; margin-top: 8px; }
.board-toolbar { justify-content: flex-end; }
@media (max-width: 1100px) { .legend-bottom { display: none !important; } }
/* sem nome nem etiqueta embaixo do dado */
.dice-by, .db-tag { display: none !important; }

/* painel da vez com altura fixa: dica e escolhas dividem um espaço reservado (nada sobre o mapa) */
@media (min-width: 1101px) {
  #turnCard .turn-hint, #turnCard .tip-box { height: 2.9em; min-height: 2.9em; margin-top: 8px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.45; }
  #turnCard .tip-box[hidden], #turnCard .turn-hint[hidden] { display: none; }
  #turnCard .tip-box { padding: 0 0 0 8px; border-left: 2px solid var(--fc, #8fb8f0); background: none; font-size: 13px; }
  #turnCard .tip-box .tip-label, #turnCard .tip-box .tip-close { display: none; }
  body:not(.tutorial-on) #turnCard > .opt-scroll { height: 64px; flex: none !important; overflow: hidden !important; margin: 6px 0 0; padding: 0; }
  body:not(.tutorial-on) #turnCard .opt-scroll .tactic-row { margin: 0 0 4px; display: flex; gap: 6px; align-items: center; height: 26px; }
  body:not(.tutorial-on) #turnCard .opt-scroll .tactic-row[hidden] { display: none; }
  body:not(.tutorial-on) #turnCard .opt-scroll .move-options { display: flex !important; flex-wrap: wrap; gap: 5px; margin: 0; max-height: 64px; overflow: hidden; }
  body:not(.tutorial-on) #turnCard .opt-scroll .move-options:empty::before { content: none; }
  body:not(.tutorial-on) #turnCard .opt-scroll .move-btn { width: auto !important; min-width: 0; max-width: 100%; min-height: 28px !important; height: 28px; padding: 2px 10px 2px 3px !important; gap: 6px; border-radius: 999px; flex: 0 1 auto; }
  body:not(.tutorial-on) #turnCard .opt-scroll .move-btn small { display: none !important; }
  body:not(.tutorial-on) #turnCard .opt-scroll .move-btn strong { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  body:not(.tutorial-on) #turnCard .opt-scroll .move-btn .move-role { width: 22px; height: 22px; font-size: 11px; }
  body:not(.tutorial-on) #turnCard .opt-scroll .pick-cancel { min-height: 28px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; }
  body:not(.tutorial-on) #turnCard .opt-scroll .move-options > :last-child:nth-child(odd) { grid-column: auto; }
}

/* outros jogadores: uma informação por linha, sem números soltos */
.oc-grid { grid-template-columns: 84px minmax(0, 1fr) auto; }
.oc-grid .oc-v .cpip { margin-right: 2px; }
.oc-grid .fpips .fp { width: 10px; height: 10px; }

/* tripulação: Mover e Usar sempre no lugar; só acendem quando dá para usar */
#myCard .crew-move { min-height: 1.3em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#myCard .crew-go:disabled { background: rgba(143,184,240,.06) !important; border-color: rgba(160,190,235,.22) !important; color: rgba(220,230,245,.4) !important; box-shadow: none !important; animation: none !important; }
#myCard.dense-8 .crew-move { display: none; }
#myCard.dense-8 .crew-row { gap: 1px; padding: 4px 6px; }
#myCard.dense-9 .crew-ability { display: none; }
#myCard.dense-9 .crew-btns .primary-btn, #myCard.dense-9 .crew-btns .ghost-btn { min-height: 24px; height: 24px; padding: 0 6px; }
@media (min-width: 1101px) { body:not(.tutorial-on) #turnCard > .opt-scroll { height: 61px; } }

/* ================= v1.9.9 ================= */
/* tabuleiro grande: legenda + zoom numa linha só, embaixo do mapa */
.toolbar-bottom { display: flex !important; align-items: center; justify-content: space-between; gap: 10px; margin: 0 !important; padding-top: 8px; }
.toolbar-bottom .board-legend { justify-content: flex-start; }
/* colunas com largura limitada e conjunto centralizado (sem espaço vazio entre painel e tabuleiro) */
@media (min-width: 1101px) {
  .game-layout { grid-template-columns: minmax(250px, 430px) calc(var(--board-size, 680px) + 22px) minmax(290px, 430px) !important; justify-content: center; }
}
/* embaixo do dado: só o aviso, sem o nome da raça */
.dice-by { display: block !important; height: 1.3em; text-align: center; max-width: 96px; white-space: nowrap; }
.dice-by .db-tag { display: inline !important; position: static !important; transform: none !important; background: none !important; border: 0 !important; padding: 0 !important; font-size: 10.5px; font-weight: 700; color: var(--muted); }
.dice-by .db-tag.warn { color: #ffcf6e; }
/* Jogar dado com largura própria (não estica) */
@media (min-width: 1101px) {
  #turnCard #rollBtn { width: auto !important; align-self: flex-start; padding: 0 26px; min-width: 170px; flex: none; }
  #turnCard .dice-controls { align-items: flex-start; }
}
/* "Disponível" / "Usado": bolinha na cor da raça quando dá para usar; sem cor quando não dá (sem verde) */
.pw { border: 0 !important; background: none !important; padding: 0 !important; display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; }
.pw::before { content: ""; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pw.ready { color: #e6eef9 !important; }
.pw.ready::before { background: var(--fc, #8fb8f0); box-shadow: 0 0 7px color-mix(in srgb, var(--fc, #8fb8f0) 70%, transparent); }
.pw.used { color: var(--dim) !important; }
.pw.used::before { border: 1.5px solid currentColor; }
/* habilidades: carregada = cor da raça; usada = sem cor */
.oc .ab-on, #myCard .crew-ability .ab-on { background: var(--fc); border-color: color-mix(in srgb, var(--fc) 60%, #fff); color: #fff; }
.c-yellow .oc .ab-on, .oc.c-yellow .ab-on { color: #1d1400; }
.ab.ab-saved { background: #f4f7fb !important; border-color: #fff !important; color: #0b1222 !important; box-shadow: 0 0 7px rgba(255,255,255,.6) !important; }
.ab.ab-saved::after { background: #2fb463; color: #fff; }
.oc-sv { color: #dfe8f5; }
/* fragmentos como na versão anterior */
.oc .fpips { gap: 4px; }
.oc .fpips .fp, .oc-grid .fpips .fp { width: 9px; height: 9px; margin: 0 1px; }
/* rota da nave: tracejado no formato da casa, por fora */
.crossed-ring { stroke-dasharray: 4 3; }
.lg-cross { border-radius: 4px !important; }
.oc .fpips, .oc-grid .fpips { display: inline-flex; gap: 7px; padding-left: 3px; }
.oc .fpips .fp, .oc-grid .fpips .fp { margin: 0 !important; }
.toolbar-bottom .board-legend { flex-wrap: nowrap; white-space: nowrap; }
.top-tools .zoom-controls .icon-btn { height: 38px; }
.top-tools .zoom-controls { border-radius: 10px; }

/* ================= v2.0 ================= */
/* símbolo da Anomalia centralizado na casa (só sobe quando o número da casa aparece) */
.anomaly-glyph { transform: none !important; }
.show-ids .anomaly-glyph { transform: translateY(-4px) !important; }
/* painel da vez: Jogar dado na largura toda (como antes) e "i" no canto do cabeçalho */
@media (min-width: 1101px) {
  #turnCard #rollBtn { width: 100% !important; align-self: stretch !important; min-width: 0; padding: 0 14px; }
  #turnCard .dice-controls { align-items: stretch !important; }
}
.turn-head { align-items: flex-start; }
.turn-head .turn-i { position: static; margin: 4px 0 0 auto; }
#turnCard .turn-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 0; }
/* zona de altura fixa embaixo da barra do tempo: OU a dica (2 linhas) OU as escolhas da jogada (1 linha de botões) */
@media (min-width: 1101px) {
  body:not(.tutorial-on) #turnCard > .opt-scroll { height: auto !important; margin: 8px 0 0 !important; }
  body:not(.tutorial-on) #turnCard:not(.has-opts) > .opt-scroll { display: none !important; }
  body:not(.tutorial-on) #turnCard.has-opts .turn-hint, body:not(.tutorial-on) #turnCard.has-opts .tip-box { display: none !important; }
  body:not(.tutorial-on) #turnCard.has-opts > .opt-scroll { display: block !important; height: 2.9em !important; min-height: 2.9em; overflow: hidden !important; font-size: 13px; }
  body:not(.tutorial-on) #turnCard .opt-scroll .move-options { flex-wrap: nowrap !important; max-height: none; align-items: center; height: 100%; }
  body:not(.tutorial-on) #turnCard .opt-scroll .tactic-row { height: 100%; margin: 0; }
  body:not(.tutorial-on) #turnCard .opt-scroll .tactic-row:not([hidden]) + .move-options { display: none !important; }
  body:not(.tutorial-on) #turnCard .opt-scroll .move-options.many .move-btn { padding: 2px !important; width: 30px !important; height: 30px; min-height: 30px !important; justify-content: center; flex: none; }
  body:not(.tutorial-on) #turnCard .opt-scroll .move-options.many .move-btn > span:last-child { display: none; }
  body:not(.tutorial-on) #turnCard .opt-scroll .move-options.many .move-role { width: 24px; height: 24px; }
  body:not(.tutorial-on) #turnCard .opt-scroll .move-btn { height: 32px; min-height: 32px !important; }
}
/* outros jogadores: fragmentos como losangos grandes e espaçados */
.oc .fpips, .oc-grid .fpips { gap: 10px !important; padding-left: 4px; }
.oc .fpips .fp, .oc-grid .fpips .fp { width: 11px !important; height: 11px !important; border-width: 1.6px; opacity: .9; }
/* tela cheia / telas largas: o topo (logo à esquerda, ☰ à direita) alinha com as bordas dos painéis */
@media (min-width: 1101px) {
  #screenGame .app-shell { --layout-w: calc(860px + var(--board-size, 680px) + 22px + 32px); max-width: calc(var(--layout-w) + 36px) !important; }
  body[data-screen="game"] .menu-btn { right: max(18px, calc((100vw - (860px + var(--board-size, 680px) + 22px + 32px)) / 2)) !important; }
}
/* aviso de conexão / versão (site) */
.net-banner { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 350; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center;
  max-width: min(720px, calc(100vw - 24px)); padding: 10px 14px; border-radius: 12px; background: rgba(40,26,8,.96); border: 1px solid rgba(255,207,110,.6); color: #ffe7b0; font-size: 13px; box-shadow: 0 12px 34px rgba(0,0,0,.55); }
.net-banner[hidden] { display: none; }
@media (max-width: 1100px) { .net-banner { bottom: calc(66px + env(safe-area-inset-bottom)); } }

/* ===== v2.0.1 — Fragmentos: um cristal de 3 faces + contagem, igual em Tripulação e Outros jogadores ===== */
.ch-mini.frag { gap: 5px; }
.ch-mini.frag b { font-weight: 700; font-variant-numeric: tabular-nums; color: #cfeaff; }
.fgem { width: 13px; height: 15px; flex: none; overflow: visible; }
.fgem polygon { fill: rgba(143,211,255,.08); stroke: #8fd3ff; stroke-width: 1.1; stroke-linejoin: round; opacity: .75; }
.fgem polygon.on { fill: #8fd3ff; opacity: 1; filter: drop-shadow(0 0 3px rgba(143,211,255,.75)); }

/* ===== v2.0.1 — seletor de modo da partida (Casual / Competitivo / Turbo) ===== */
.match-field { margin: 4px 0 10px; }
.match-pick { display: inline-flex; gap: 0; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line, rgba(255,255,255,.12)); }
.match-pick .mp-opt { appearance: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 9px; cursor: pointer; }
.match-pick .mp-opt.on { background: var(--accent, #7aa7ff); color: #08111f; }
.match-pick .mp-opt:disabled { cursor: default; }
.match-pick .mp-opt:disabled:not(.on) { opacity: .45; }
.match-pick .mp-opt[hidden] { display: none; }
.match-field .mp-text { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; }
.match-pick { justify-self: start; }
.hs-kicker { margin: 0 0 8px; } .hs-kicker .pts-total { color: var(--accent, #7aa7ff); }
.hs-local { margin: 8px 0 0; color: var(--muted); font-size: 12.5px; }
.pts-up { color: #7fe0a0; } .pts-down { color: #ff8f8f; }
.hs-unver { color: var(--muted); font-style: italic; }

/* ===== v2.0.1 — muitas escolhas: chips compactos (letra do tripulante na cor da civilização), todos visíveis ===== */
body:not(.tutorial-on) #turnCard .opt-scroll .move-options.compact { display: flex !important; flex-wrap: wrap !important; align-content: flex-start; gap: 3px 5px; max-height: none; overflow: visible; width: 100%; }
body:not(.tutorial-on) #turnCard .opt-scroll .move-options.compact .move-btn { width: 22px !important; height: 22px !important; min-height: 22px !important; padding: 0 !important; border-radius: 50%; justify-content: center; flex: none !important; gap: 0; }
body:not(.tutorial-on) #turnCard .opt-scroll .move-options.compact .move-btn > span:not(.move-role) { display: none !important; }
body:not(.tutorial-on) #turnCard .opt-scroll .move-options.compact .move-btn .move-role { width: 20px; height: 20px; font-size: 10px; margin: 0; }
body:not(.tutorial-on) #turnCard .opt-scroll .move-options.compact .move-btn:focus-visible, body:not(.tutorial-on) #turnCard .opt-scroll .move-options.compact .move-btn:hover { outline: 2px solid var(--fc, #8fb8f0); outline-offset: 1px; }
body:not(.tutorial-on) #turnCard .opt-scroll .move-options.compact .pick-cancel { height: 22px; min-height: 22px; padding: 0 10px; border-radius: 999px; font-size: 12px; flex: none; }
@media (max-width: 1100px) {
  body:not(.tutorial-on) #turnCard .opt-scroll:has(.move-options.compact) { overflow: visible; flex-wrap: wrap; }
}
@media (min-width: 1101px) { body:not(.tutorial-on) #turnCard > .opt-scroll:has(.move-options.compact) { margin-top: 2px; } }
body:not(.tutorial-on) #turnCard .opt-scroll .move-options.compact.tiny { gap: 2px 3px; }
body:not(.tutorial-on) #turnCard .opt-scroll .move-options.compact.tiny .move-btn { width: 18px !important; height: 18px !important; min-height: 18px !important; }
body:not(.tutorial-on) #turnCard .opt-scroll .move-options.compact.tiny .move-btn .move-role { width: 16px; height: 16px; font-size: 9px; }
body:not(.tutorial-on) #turnCard .opt-scroll .move-options.compact.tiny .pick-cancel { height: 18px; min-height: 18px; font-size: 11px; }
/* Outros jogadores: Fragmentos e Habilidades ocupam a linha toda (a 3ª coluna é só do estado do poder) */
.oc-grid .oc-wide { grid-column: 2 / -1; display: flex; align-items: center; gap: 8px; min-width: 0; overflow: visible; }
.oc-grid .oc-wide .oc-sv { margin-left: auto; white-space: nowrap; }
