:root {
  --bg: #0d1628;
  --bg2: #15223b;
  --panel: rgba(22, 34, 60, 0.86);
  --panel2: rgba(34, 50, 84, 0.9);
  --line: rgba(255, 255, 255, 0.1);
  --text: #eef2fb;
  --muted: #9aa8c7;
  --gold: #ffc233;
  --pink: #ff5d8f;
  --green: #3ddc84;
  --red: #ff5a5a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: 'Nunito', system-ui, sans-serif;
  --display: 'Fredoka', 'Nunito', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 800px at 20% 0%, #1d3561 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  overflow-x: hidden;
}
button { font-family: inherit; }
.hidden { display: none !important; }
h1, h2, h3 { font-family: var(--display); margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--text); font-weight: 700; font-size: 14px;
  cursor: pointer; transition: transform .12s, background .15s, box-shadow .15s; white-space: nowrap;
}
.btn:hover:not(:disabled) { background: #3a5285; transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn.primary { background: linear-gradient(180deg, #ffd25a, #f5a300); color: #2a1a00; border-color: #ffdd7a; box-shadow: 0 4px 0 #b37400; }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffe07f, #ffb300); }
.btn.pink { background: linear-gradient(180deg, #ff7aa5, #e8386e); border-color: #ff9fbf; box-shadow: 0 4px 0 #a51d49; }
.btn.green { background: linear-gradient(180deg, #56e59a, #1fae62); color: #042; border-color: #8ff0bd; box-shadow: 0 4px 0 #11703e; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.btn.active { outline: 3px solid var(--gold); outline-offset: 1px; }
.btn.big { font-size: 18px; padding: 14px 26px; }

.screen { min-height: 100vh; }

/* ---------- menu ---------- */
.menu { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; position: relative; overflow: hidden; }
.menu-bg { position: absolute; inset: 0; opacity: .35; pointer-events: none; }
.menu-bg .fhex { position: absolute; font-size: 42px; animation: floaty 9s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(0) } 50% { transform: translateY(-26px) rotate(12deg) } }
.logo { text-align: center; position: relative; margin-bottom: 30px; }
.logo .t1 { font-family: var(--display); font-weight: 700; font-size: clamp(52px, 11vw, 110px); line-height: .9; letter-spacing: 2px;
  background: linear-gradient(180deg, #fff3c4, #ffc233 55%, #e58a00); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 #7a4700) drop-shadow(0 14px 18px rgba(0,0,0,.5)); }
.logo .x { font-family: var(--display); font-size: clamp(28px, 6vw, 52px); color: var(--pink); margin: 4px 0; display: block; transform: rotate(-6deg); }
.logo .t2 { font-family: var(--display); font-weight: 700; font-size: clamp(36px, 7.5vw, 76px); color: #fff; letter-spacing: 3px;
  text-shadow: 0 5px 0 #a51d49, 0 12px 20px rgba(0,0,0,.5); }
.logo .sub { color: var(--muted); margin-top: 14px; font-weight: 600; }
.menu-buttons { display: grid; gap: 12px; width: min(360px, 100%); position: relative; }
.menu-buttons .btn { font-size: 17px; padding: 14px; }
.menu-foot { margin-top: 26px; color: var(--muted); font-size: 13px; position: relative; text-align: center; }

/* ---------- lobby ---------- */
.lobby { max-width: 1320px; margin: 0 auto; padding: 18px 16px 110px; }
.lobby-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.lobby-head h2 { font-size: 28px; flex: 1; }
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .lobby-grid { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h3 { font-size: 19px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h3 small { font-family: var(--font); color: var(--muted); font-weight: 600; font-size: 13px; }
.preview-card { position: sticky; top: 12px; }
.preview { width: 100%; aspect-ratio: 1 / 0.9; border-radius: 12px; background: radial-gradient(circle, #1e6aa3, #0e3a5e); overflow: hidden; }
.preview .board-svg { width: 100%; height: 100%; }
.preview-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; color: var(--muted); font-size: 13px; align-items: center; }
.pill { background: rgba(255,255,255,.08); padding: 4px 10px; border-radius: 99px; font-weight: 700; font-size: 12px; }

.player-row { display: grid; grid-template-columns: 36px minmax(0,1fr) 150px 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.swatch { width: 36px; height: 36px; border-radius: 10px; border: 3px solid rgba(255,255,255,.7); cursor: pointer; }
input[type=text], select, textarea {
  background: rgba(0,0,0,.28); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; font: inherit; width: 100%;
}
select option { background: #1a2745; }
textarea { min-height: 80px; resize: vertical; font-family: ui-monospace, monospace; font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 12px; border-radius: 99px; background: rgba(255,255,255,.07); border: 1px solid var(--line); cursor: pointer; font-weight: 700; color: var(--text); font-size: 14px; }
.chip:hover { background: rgba(255,255,255,.14); }
.chip.on { background: var(--gold); color: #2a1a00; border-color: #ffe08a; }
.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.map-card { border-radius: 12px; border: 2px solid transparent; background: rgba(0,0,0,.2); padding: 8px; cursor: pointer; text-align: center; transition: transform .12s; color: var(--text); }
.map-card:hover { transform: translateY(-2px); }
.map-card.on { border-color: var(--gold); background: rgba(255,194,51,.12); }
.map-card .mini { height: 78px; }
.map-card .mini svg { width: 100%; height: 100%; }
.map-card b { display: block; font-size: 13px; margin-top: 4px; }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.mode { display: grid; grid-template-columns: 40px 1fr 44px; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: rgba(0,0,0,.2); border: 2px solid transparent; cursor: pointer; }
.mode.on { border-color: var(--pink); background: rgba(255,93,143,.12); }
.mode .mi { font-size: 26px; text-align: center; }
.mode b { display: block; }
.mode small { color: var(--muted); font-size: 12px; line-height: 1.3; display: block; }
.switch { width: 40px; height: 24px; border-radius: 99px; background: #445; position: relative; transition: background .15s; }
.switch::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.on > .switch, .switch.on { background: var(--pink); }
.on > .switch::after, .switch.on::after { left: 19px; }
.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 18px; }
.rule label { display: flex; justify-content: space-between; font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.rule label span { color: var(--gold); }
input[type=range] { width: 100%; accent-color: var(--gold); }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.opt-grid label { font-size: 12px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 3px; }
.start-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px; background: linear-gradient(0deg, rgba(10,18,34,.98), rgba(10,18,34,.8)); border-top: 1px solid var(--line); display: flex; justify-content: center; gap: 12px; z-index: 20; backdrop-filter: blur(6px); }

/* ---------- game ---------- */
.game { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100vh; height: 100dvh; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: rgba(8,14,28,.85); border-bottom: 1px solid var(--line); flex-wrap: wrap; z-index: 5; }
.brand { font-family: var(--display); font-weight: 700; font-size: 20px; color: var(--gold); white-space: nowrap; }
.brand i { color: var(--pink); font-style: normal; }
.turn-info { display: flex; align-items: center; gap: 8px; font-weight: 700; flex: 1; min-width: 180px; }
.turn-dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
.phase-tag { color: var(--muted); font-weight: 600; font-size: 13px; }
.event-badge { display: flex; gap: 6px; align-items: center; padding: 5px 12px; border-radius: 99px; background: rgba(255,93,143,.18); border: 1px solid rgba(255,93,143,.5); font-weight: 700; font-size: 13px; cursor: help; }
.top-actions { display: flex; gap: 6px; }
.dice { display: flex; gap: 6px; }
.die { width: 34px; height: 34px; background: #fffaf0; border-radius: 8px; display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 5px; box-shadow: 0 3px 0 #b8a988, inset 0 -2px 0 #e0d3b5; }
.die.red-die { background: #ffe9e9; }
.die i { width: 6px; height: 6px; border-radius: 50%; background: #222; place-self: center; opacity: 0; }
.die i.on { opacity: 1; }
.dice.rolling .die { animation: dieRoll .5s ease-out; }
@keyframes dieRoll { 0% { transform: rotate(-200deg) scale(.5) translateY(-20px) } 70% { transform: rotate(20deg) scale(1.15) } 100% { transform: none } }
.dice-sum { font-family: var(--display); font-size: 22px; font-weight: 700; min-width: 28px; text-align: center; }
.dice-sum.seven { color: var(--red); }

.game-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; min-height: 0; }
.board-wrap { position: relative; min-height: 0; overflow: hidden; background: radial-gradient(ellipse at center, #1f78b8 0%, #0e3f68 70%, #0a2c4b 100%); }
.board-3d { width: 100%; height: 100%; display: block; touch-action: none; }
.board-wrap .board-svg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; }
.banner { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: rgba(8,14,28,.82); padding: 9px 18px; border-radius: 99px; font-weight: 800; border: 1px solid var(--line); pointer-events: none; text-align: center; max-width: 92%; backdrop-filter: blur(4px); }
.zoom-ctrl { position: absolute; right: 10px; bottom: 10px; display: flex; flex-direction: column; gap: 6px; }
.zoom-ctrl .btn { width: 38px; height: 38px; padding: 0; font-size: 18px; }
.side { background: rgba(8,14,28,.7); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.players { padding: 10px; display: grid; gap: 8px; }
.pcard { border-radius: 12px; padding: 9px 10px; background: var(--panel); border: 2px solid transparent; position: relative; }
.pcard.current { border-color: var(--pc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 30%, transparent); }
.pcard.winner { background: linear-gradient(90deg, rgba(255,194,51,.25), var(--panel)); }
.pcard .top { display: flex; align-items: center; gap: 8px; }
.pcard .avatar { width: 30px; height: 30px; border-radius: 9px; background: var(--pc); display: grid; place-items: center; font-weight: 900; color: rgba(0,0,0,.65); font-size: 14px; flex: none; }
.pcard .name { font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .name small { color: var(--muted); font-weight: 600; font-size: 11px; margin-left: 4px; }
.pcard .vp { font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--gold); }
.pcard .vp small { font-size: 12px; color: var(--muted); }
.pcard .stats { display: flex; gap: 10px; margin-top: 6px; font-size: 12.5px; color: var(--muted); font-weight: 700; flex-wrap: wrap; }
.pcard .stats .award { color: var(--gold); }
.pcard .gainfx { position: absolute; right: 10px; top: -6px; font-weight: 900; animation: gainUp 1.6s ease-out forwards; pointer-events: none; font-size: 15px; white-space: nowrap; }
@keyframes gainUp { 0% { opacity: 0; transform: translateY(10px) } 15% { opacity: 1 } 100% { opacity: 0; transform: translateY(-26px) } }
.acting-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2 } }
.bank-info { padding: 0 12px 6px; display: flex; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 700; flex-wrap: wrap; }
.log { flex: 1; overflow-y: auto; padding: 8px 12px 12px; font-size: 13px; line-height: 1.45; border-top: 1px solid var(--line); min-height: 80px; }
.log div { padding: 2px 0; border-bottom: 1px dashed rgba(255,255,255,.04); }
.pname { color: var(--pc); filter: brightness(1.2); }
.actionbar { background: rgba(8,14,28,.92); border-top: 1px solid var(--line); padding: 10px 14px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; z-index: 5; }
.hand { display: flex; gap: 6px; align-items: flex-end; flex-wrap: wrap; }
.rcard { width: 46px; height: 62px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 22px; position: relative; border: 2px solid rgba(255,255,255,.35); box-shadow: 0 3px 0 rgba(0,0,0,.35); transition: transform .15s; }
.rcard b { font-size: 14px; font-weight: 900; background: rgba(0,0,0,.45); border-radius: 6px; padding: 0 5px; margin-top: 2px; }
.rcard.zero { opacity: .3; }
.rcard.bump { animation: bump .5s; }
@keyframes bump { 40% { transform: translateY(-10px) scale(1.12) } }
.devcards { display: flex; gap: 6px; }
.dcard { width: 46px; height: 62px; border-radius: 8px; background: linear-gradient(160deg, #6d4bd8, #3b2896); border: 2px solid #a893ff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; color: #fff; position: relative; }
.dcard b { font-size: 12px; }
.dcard.new { opacity: .55; cursor: default; }
.dcard.playable { box-shadow: 0 0 0 3px var(--gold); animation: glow 1.4s infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 5px rgba(255,194,51,.4) } }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.cost { display: block; font-size: 11px; font-weight: 700; opacity: .75; letter-spacing: -1px; }
.btn .cost { margin-left: 2px; }
.waiting { color: var(--muted); font-weight: 700; display: flex; gap: 8px; align-items: center; }

@media (max-width: 860px) {
  .game { height: auto; min-height: 100dvh; grid-template-rows: auto auto auto; }
  .game-main { grid-template-columns: 1fr; }
  .board-wrap { height: 62vh; }
  .side { border-left: 0; }
  .log { max-height: 180px; }
  .players { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .actionbar { position: sticky; bottom: 0; background: #0a1222; padding: 8px 10px; gap: 8px; }
  .actions { margin-left: 0; gap: 6px; }
  .actions .btn { padding: 8px 10px; font-size: 13px; }
  .brand { font-size: 15px; }
  .topbar { gap: 6px 10px; padding: 6px 10px; }
  .turn-info { min-width: 0; font-size: 14px; }
  .phase-tag { display: none; }
  .top-actions { margin-left: auto; }
  .rcard, .dcard { width: 40px; height: 54px; font-size: 19px; }
  .banner { font-size: 13px; top: 8px; padding: 7px 14px; }
}

/* ---------- board svg ---------- */
.sea-hex { fill: #1c6fae; stroke: #2a86c8; stroke-width: 2; opacity: .55; }
.tile .hex { transition: filter .3s; }
.tile-icon { text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.fog-q { text-anchor: middle; font-family: var(--display); font-size: 40px; fill: #dfe6ff; font-weight: 700; pointer-events: none; }
.token-num { text-anchor: middle; font-family: var(--display); font-weight: 700; font-size: 26px; fill: #2a2a2a; pointer-events: none; }
.token-num.q { fill: #7a6a4a; }
.token.red .token-num { fill: #d32f2f; }
.pip { fill: #2a2a2a; }
.token.red .pip { fill: #d32f2f; }
.tile.rolled .hex { animation: rolledPulse .65s ease-in-out 4; }
@keyframes rolledPulse { 50% { filter: brightness(1.25) drop-shadow(0 0 16px #7ee2a0); } }
.tile.rolled .token circle { animation: rolledTok .65s ease-in-out 4; }
@keyframes rolledTok { 50% { fill: #7ee2a0; stroke: #38b764; } }
.tile.pulse .hex { animation: revealPulse 1.2s ease-out 2; }
@keyframes revealPulse { 0% { filter: brightness(2.2) } 100% { filter: none } }
.dock { stroke: #c9a46a; stroke-width: 5; stroke-dasharray: 6 5; }
.port { fill: #fdf6e3; stroke: #8a6b3c; stroke-width: 3; }
.port-icon { text-anchor: middle; font-size: 20px; dominant-baseline: central; }
.port-label { text-anchor: middle; font-weight: 900; font-size: 13px; fill: #5a3d12; font-family: var(--font); }
.port-label.big { font-size: 17px; }
.road-out { stroke: rgba(0,0,0,.7); stroke-width: 21; stroke-linecap: round; }
.road-in { stroke-width: 14; stroke-linecap: round; }
.road.ghost, .piece.ghost { opacity: .7; }
.road.ghost .road-in { stroke-dasharray: 4 5; }
.piece.ghost path { stroke-dasharray: 5 3; stroke: #fff !important; }
.road.new, .piece.new { animation: popIn .55s cubic-bezier(.3,1.6,.5,1); transform-box: fill-box; transform-origin: center; }
.piece.new { animation-name: dropIn; }
@keyframes popIn { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes dropIn { 0% { opacity: 0; translate: 0 -40px; } 100% { opacity: 1; translate: 0 0; } }
.robber-body { fill: #2d2d35; stroke: #111; stroke-width: 2; }
.robber { filter: drop-shadow(0 4px 4px rgba(0,0,0,.5)); }
.hot-v { fill: #ffe7a3; stroke: #1a1c2c; stroke-width: 4; animation: hotFade 2.4s ease-in-out infinite; pointer-events: none; transform-box: fill-box; transform-origin: center; }
.hot-e-bg { stroke: #1a1c2c; stroke-width: 18; stroke-linecap: round; opacity: .8; pointer-events: none; animation: hotFade 2.4s ease-in-out infinite; }
.hot-e { stroke: #ffe7a3; stroke-width: 11; stroke-linecap: round; opacity: .9; animation: hotFade 2.4s ease-in-out infinite; pointer-events: none; }
@keyframes hotPulse { 50% { transform: scale(.7); opacity: .6 } }
@keyframes hotFade { 50% { opacity: .55 } }
.hit, .hit-e { fill: transparent; stroke: transparent; cursor: pointer; }
.hit-e { stroke-width: 26; stroke-linecap: round; }
.hit:hover + *, .hit:hover { fill: rgba(255,255,255,.25); }
.hit-e:hover { stroke: rgba(255,255,255,.3); }
.hot-tile { fill: rgba(255,255,255,.12); stroke: #fff; stroke-width: 4; stroke-dasharray: 10 8; cursor: pointer; animation: hotFade 1.3s infinite; }
.hot-tile:hover { fill: rgba(255,90,90,.35); animation: none; }

/* ---------- modals ---------- */
.overlay { position: fixed; inset: 0; background: rgba(4,8,18,.66); display: grid; place-items: center; z-index: 50; padding: 16px; backdrop-filter: blur(3px); animation: fadeIn .2s; }
@keyframes fadeIn { from { opacity: 0 } }
.modal { background: #17243f; border: 1px solid var(--line); border-radius: 18px; padding: 20px; width: min(560px, 100%); max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow); animation: modalIn .25s cubic-bezier(.3,1.4,.5,1); }
@keyframes modalIn { from { transform: scale(.9) translateY(20px); opacity: 0 } }
.modal h2 { font-size: 24px; margin-bottom: 12px; }
.modal p { color: var(--muted); margin: 6px 0 12px; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.steppers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stepper { background: rgba(0,0,0,.25); border-radius: 12px; padding: 8px 4px; text-align: center; }
.stepper .ic { font-size: 26px; }
.stepper .n { font-family: var(--display); font-size: 22px; font-weight: 700; }
.stepper .have { font-size: 11px; color: var(--muted); font-weight: 700; }
.stepper .ctl { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.stepper .ctl .btn { padding: 2px 10px; font-size: 16px; }
.respick { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.respick .btn { flex-direction: column; font-size: 24px; padding: 10px 4px; }
.respick .btn small { font-size: 11px; }
.tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.section-label { font-weight: 800; margin: 12px 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.offer { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: #17243f; border: 2px solid var(--gold); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); z-index: 8; width: min(460px, 94%); animation: modalIn .25s; }
.offer .line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 800; }
.offer .resp { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.tag { padding: 3px 8px; border-radius: 8px; background: rgba(255,255,255,.1); font-size: 12px; font-weight: 800; }
.tag.ok { background: rgba(61,220,132,.2); color: var(--green); }
.tag.no { background: rgba(255,90,90,.2); color: var(--red); }
.res-inline { font-size: 18px; letter-spacing: 1px; }

.pass-screen { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: radial-gradient(circle, #2a1840, #0b0f1e); text-align: center; padding: 20px; cursor: pointer; }
.pass-screen .big { font-family: var(--display); font-size: clamp(34px, 7vw, 60px); font-weight: 700; }
.pass-screen .eye { font-size: 90px; animation: floaty 3s infinite; }

.announce { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 40; }
.announce > div { background: rgba(8,14,28,.88); border: 2px solid var(--pink); padding: 22px 34px; border-radius: 22px; text-align: center; animation: announce 2.6s ease-in-out forwards; box-shadow: 0 0 60px rgba(255,93,143,.4); }
.announce .ai { font-size: 64px; }
.announce .at { font-family: var(--display); font-size: 34px; font-weight: 700; }
.announce .ad { color: var(--muted); font-weight: 700; }
@keyframes announce { 0% { transform: scale(.4) rotate(-8deg); opacity: 0 } 12% { transform: scale(1.08) rotate(2deg); opacity: 1 } 20% { transform: scale(1) rotate(0) } 82% { opacity: 1; transform: scale(1) } 100% { opacity: 0; transform: scale(1.1) } }

.toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { background: #22345c; border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; font-weight: 700; box-shadow: var(--shadow); animation: modalIn .2s; transition: opacity .4s, transform .4s; }
.toast.error { background: #5c2230; border-color: #ff7a8a; }
.toast.good { background: #1d4d38; border-color: #56e59a; }
.toast.out { opacity: 0; transform: translateY(-10px); }
.toast button { pointer-events: auto; margin-left: 8px; }

.winner-hero { text-align: center; }
.winner-hero .trophy { font-size: 80px; animation: floaty 2.5s infinite; }
.score-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.score-table td, .score-table th { padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--line); }
.score-table td:first-child, .score-table th:first-child { text-align: left; }
.hist { display: flex; align-items: flex-end; gap: 4px; height: 110px; margin: 8px 0 4px; }
.hist div { flex: 1; background: linear-gradient(0deg, #f5a300, #ffd25a); border-radius: 4px 4px 0 0; position: relative; min-height: 2px; }
.hist div.s { background: linear-gradient(0deg, #e8386e, #ff7aa5); }
.hist span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); font-weight: 800; }
.hist em { position: absolute; top: -16px; left: 0; right: 0; text-align: center; font-size: 10px; font-style: normal; font-weight: 800; }
.confetti { position: fixed; top: -20px; width: 10px; height: 14px; z-index: 70; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: 300px minmax(0,1fr); height: 100vh; height: 100dvh; }
@media (max-width: 860px) { .editor { grid-template-columns: 1fr; height: auto; } .editor .board-wrap { height: 65vh; } }
.editor-side { padding: 14px; overflow-y: auto; background: rgba(8,14,28,.8); border-right: 1px solid var(--line); }
.brushes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.brush { border-radius: 10px; padding: 8px 2px; text-align: center; cursor: pointer; border: 2px solid transparent; background: rgba(255,255,255,.06); font-size: 22px; color: var(--text); }
.brush small { display: block; font-size: 10px; font-weight: 800; }
.brush.on { border-color: var(--gold); background: rgba(255,194,51,.16); }
.slot { fill: rgba(255,255,255,.04); stroke: rgba(255,255,255,.18); stroke-width: 2; stroke-dasharray: 6 6; cursor: pointer; }
.slot:hover { fill: rgba(255,255,255,.14); }
.help-body h3 { margin: 16px 0 6px; font-size: 17px; color: var(--gold); }
.help-body li { margin-bottom: 4px; color: #cfd8ee; }
.room-code { font-family: var(--display); font-size: 44px; letter-spacing: 8px; color: var(--gold); text-align: center; background: rgba(0,0,0,.3); border-radius: 14px; padding: 8px; user-select: all; }

/* face-down tiles (Blindfold) and the flip */
.back-rune { text-anchor: middle; font-size: 44px; fill: #f3d9a4; opacity: .85; pointer-events: none; }
.tile.flip { animation: tileFlip .7s cubic-bezier(.3,1.4,.5,1) both; transform-box: fill-box; transform-origin: center; }
@keyframes tileFlip { 0% { transform: scaleX(0) scaleY(.85); filter: brightness(2); } 60% { transform: scaleX(1.08); } 100% { transform: none; filter: none; } }
/* fog of war */
.fog-layer { fill: #060912; opacity: .94; pointer-events: none; }
