@font-face{font-family:'Nunito';src:url('/static/fonts/nunito-latin.woff2') format('woff2');font-weight:200 1000;font-style:normal;font-display:swap}
*{box-sizing:border-box}
html,body{height:100%}
body{margin:0;font-family:'Nunito',system-ui,'Segoe UI',Roboto,sans-serif;color:#22303c;-webkit-text-size-adjust:100%}
a{color:#1f6fb2}
h1,h2,h3{margin:.2em 0}
.muted{color:#7c8b98;font-size:13px}
.center{text-align:center}
.small{font-size:11px}
.win{font-weight:800;color:#1f8a4c}
code{background:#0f151b;color:#e9eef2;padding:1px 6px;border-radius:5px}

/* Home / lobby / join / error share the game's blue ocean theme so the whole
   app reads as one product instead of a dark landing page plus a blue game. */
body:not(.game){min-height:100vh;display:flex;flex-direction:column;color:#f2f7fb;background-color:#0e5c8e;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);background-image:linear-gradient(rgba(7,45,71,.60),rgba(5,33,53,.82)),url('/static/board/ocean.webp');background-size:cover;background-position:center;background-repeat:no-repeat;background-attachment:fixed}
body:not(.game)>.wrap{flex:1 0 auto}
/* Centered single-column layout for the option screens (fixes the "content
   stretches weirdly across a wide page" look). */
body:not(.game) .wrap.page{width:100%;max-width:560px;margin:0 auto;padding:20px 16px 10px}
.hero{text-align:center;margin:4px 0 20px}
.hero img{width:78px;height:78px;border-radius:20px;display:block;margin:0 auto 12px;box-shadow:0 8px 22px #0006;border:1px solid #ffffff2e}
.hero h1{font-size:30px;font-weight:900;letter-spacing:.3px;margin:0 0 6px}
.hero .muted{font-size:14px}
body:not(.game) .muted{color:#cfe0ec}
body:not(.game) h1,body:not(.game) h2,body:not(.game) h3{color:#fff}
/* Translucent glass cards that echo the in-game pills and chips. */
body:not(.game) .card{background:rgba(7,40,63,.66);border:1px solid #ffffff2e;border-radius:16px;padding:16px;margin-bottom:14px;box-shadow:0 8px 26px #00000038;backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}
body:not(.game) .card h3{display:flex;align-items:center;gap:8px;margin:0 0 12px;font-size:16px;font-weight:900}
body:not(.game) .card h3 .ic{width:20px;height:20px;color:#ffeaa7}
body:not(.game) .card form+form{margin-top:10px}
/* Stacked, labeled fields — simpler than the old single wrapping row. */
body:not(.game) .field{display:flex;flex-direction:column;gap:5px;margin-bottom:10px}
body:not(.game) .field>span{font-size:11px;font-weight:900;letter-spacing:.7px;text-transform:uppercase;color:#bcd3e3}
body:not(.game) .field input,body:not(.game) .field select{width:100%}
body:not(.game) input[type=text],body:not(.game) input[type=number]{background:#ffffff1c;color:#fff;border:1px solid #ffffff3d;border-radius:10px;padding:10px 12px;font:inherit;font-size:15px;min-height:44px}
/* Basic styled dropdown (home + lobby). The old control used a translucent
   background and left the native option list unstyled, so some browsers painted
   the options translucently or white-on-white — the "weird" selection the board
   reported. Use a solid readable closed surface with a light chevron, and give
   native options a solid surface + dark text so the expanded list is legible. */
body:not(.game) select{background-color:#0b3f63;color:#fff;border:1px solid #ffffff3d;border-radius:10px;padding:10px 40px 10px 12px;font:inherit;font-size:15px;min-height:44px;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath fill='%23bcd3e3' d='M0 0l6 6 6-6z'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 13px center}
body:not(.game) select option{background-color:#ffffff;color:#22303c}
body:not(.game) input::placeholder{color:#bcd0df}
body:not(.game) .formrow{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}
body:not(.game) .formrow .field{flex:1 1 150px;margin-bottom:0}
body:not(.game) .card .btn{width:100%}
body:not(.game) .card .formrow .btn{width:auto}
/* Home menu: three big, self-explanatory buttons so a new player can start
   without scanning the page. Icon + label + one-line hint per row. */
.menu{display:flex;flex-direction:column;gap:12px}
.menu .btn{display:flex;align-items:center;gap:14px;width:100%;min-height:64px;padding:14px 16px;text-align:left;border-radius:14px;font-size:17px}
.menu .btn .ic{width:26px;height:26px}
.menu .btn .menu-txt{display:flex;flex-direction:column;gap:2px;min-width:0}
.menu .btn .m1{font-weight:900;line-height:1.1}
.menu .btn .m2{font-size:12px;font-weight:600;opacity:.78;line-height:1.15}
.page-back{margin:2px 0 20px;text-align:center}
.page-back a{color:#ffeaa7;font-weight:700;text-decoration:none}
body:not(.game) .pcard{background:#ffffff1f;border:1px solid #ffffff33}
body:not(.game) .pcard .pname{color:#fff}
body:not(.game) code.roomcode{background:#ffffff22;color:#ffeaa7;font-weight:900;letter-spacing:6px;font-size:30px;padding:8px 16px 8px 22px;border-radius:12px}
.codecard{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center}
.codecard .codelabel{font-size:11px;font-weight:900;letter-spacing:1px;text-transform:uppercase;color:#bcd3e3}
/* Invite link under the room code: a read-only copyable field plus copy/share
   buttons. The code above stays visible as the fallback for typing. */
.codecard .invite{width:100%;display:flex;flex-direction:column;gap:8px;margin-top:8px}
.codecard .invite-field{display:flex;flex-direction:column;gap:4px;text-align:left}
.codecard .invite-field>span{font-size:11px;font-weight:900;letter-spacing:.7px;text-transform:uppercase;color:#bcd3e3}
body:not(.game) .codecard .invite-field input{width:100%;min-height:40px;font-size:13px;text-transform:none}
.codecard .invite-actions{display:flex;gap:8px;flex-wrap:wrap}
/* Icon centred above the label on the copy/share buttons (owner request);
   keeps the two buttons side by side and wrapping cleanly on a phone. */
body:not(.game) .codecard .invite-actions .btn{width:auto;flex:1 1 140px;min-height:52px;gap:4px;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
body:not(.game) .codecard .invite-actions .btn .ic{width:20px;height:20px}
/* The display override above would otherwise beat the UA `[hidden]` rule, so
   keep Share hidden until lobby.js confirms navigator.share exists. */
body:not(.game) .codecard .invite-actions .btn[hidden]{display:none}
.invite-status{min-height:16px;font-size:12px;font-weight:700;color:#ffeaa7}
body:not(.game) #audio-toggle{background:#ffffff22}
body:not(.game) #audio-toggle:hover{background:#ffffff33}
.wrap{max-width:1180px;margin:0 auto;padding:14px}
.card{background:rgba(22,29,36,.86);border:1px solid #2c3742;border-radius:12px;padding:12px;margin-bottom:12px}
.btn{background:#2e7dd1;color:#fff;border:0;border-radius:10px;padding:10px 14px;font:inherit;font-weight:700;font-size:14px;cursor:pointer;min-height:40px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.btn:hover{background:#3a8fe0}
.btn.sec{background:#37424e}
.btn.warn{background:#c0392b}
.btn:disabled{opacity:.4;cursor:not-allowed}
.btn.tiny{min-height:30px;padding:5px 9px;font-size:11px;border-radius:8px;gap:3px;display:inline-flex;align-items:center}
.btn.tiny .ic{width:12px;height:12px}
.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}
select,input[type=text],input[type=number]{background:#0f151b;color:#e9eef2;border:1px solid #35414c;border-radius:8px;padding:6px}
.players{display:flex;gap:6px;margin-bottom:2px}
.pcard{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 4px;border-radius:10px;background:#232c35;border:2px solid transparent}
.pcard .pdot{width:11px;height:11px;border-radius:50%;border:1px solid #0006}
.pcard .pname{font-size:12px;font-weight:800;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pcard .pbadges{font-size:10px;line-height:1}
.pcard .pact{margin-top:5px}
.pcard .pact .btn{width:100%}
.pcard .pact+.pact{margin-top:2px}
body:not(.game) .leavehost{display:flex;flex-direction:column;gap:8px;align-items:stretch}
body:not(.game) .leavehost select{width:100%}
.dot{width:14px;height:14px;border-radius:50%;border:1px solid #0006;flex:0 0 auto}
.badge{font-size:11px;background:#33414e;border-radius:6px;padding:2px 6px;margin-left:4px}
header.site .wrap{display:flex;align-items:center;gap:10px;padding-top:12px;padding-bottom:2px}
.brand{display:inline-flex;align-items:center;gap:10px;text-decoration:none;color:inherit}
.brand img{height:42px;width:42px;border-radius:11px;border:1px solid #ffffff26;box-shadow:0 3px 12px #000a;display:block}
.brand .bt{font-weight:800;font-size:19px;letter-spacing:.4px;background:linear-gradient(#ffeaa7,#dfa032);-webkit-background-clip:text;background-clip:text;color:transparent}
#audio-toggle{margin-left:auto;background:#37424e;border:0;color:#e9eef2;border-radius:999px;width:42px;height:42px;font-size:18px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;flex:0 0 auto}
#audio-toggle.off{opacity:.55}
footer.site{margin-top:auto;padding-top:10px;padding-bottom:22px}
footer.site .wrap{display:flex;justify-content:center}
footer.site .fnote{font-size:13px;color:#c7d2db;background:rgba(15,20,26,.62);border:1px solid #ffffff14;border-radius:999px;padding:6px 14px}
footer.site a{color:#ffeaa7;font-weight:700;text-decoration:none}
#install-bar{position:fixed;left:50%;bottom:calc(160px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:65;display:none;align-items:center;gap:10px;background:rgba(20,27,34,.98);border:1px solid #4a5a6a;border-left:4px solid #6cc0ff;border-radius:12px;padding:8px 8px 8px 14px;box-shadow:0 10px 30px #000a;max-width:calc(100% - 24px)}
#install-bar .ib-text{font-size:13px;color:#e9eef2}
#install-bar #install-btn{background:#2e7dd1;color:#fff;border:0;border-radius:8px;padding:8px 14px;font-size:14px;font-weight:700;cursor:pointer;min-height:36px}
#install-bar #install-close{background:transparent;border:0;color:#8ea0af;font-size:14px;cursor:pointer;padding:4px 6px}

/* Inline icon sizing */
.ic{width:1.15em;height:1.15em;display:block;flex:0 0 auto}
.glyph{width:1em;height:1em;display:block;object-fit:contain}

/* Game shell — fixed, no page scroll (colonist-style) */
body.game{--titlebar-h:0px;height:var(--app-h,100dvh);overflow:hidden;background:#0e5c8e url('/static/board/ocean.webp') center/cover no-repeat fixed;color:#fff;display:flex;flex-direction:column}
body.game #app{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;height:100%;padding-bottom:env(safe-area-inset-bottom)}

/* PWA title bar: an installed app has no browser chrome, which leaves the
   game shell extending under the system bars. Show a slim in-app bar (game
   name only) plus the JS-measured viewport height above, so the shell fits the
   visible area. Hidden in a normal browser tab. */
.pwa-titlebar{display:none;flex:0 0 auto;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:calc(env(safe-area-inset-top,0px) + 2px) 10px 2px;background:#ffffff14;border-bottom:1px solid #ffffff1f;font-weight:800;font-size:15px;letter-spacing:.4px;color:#ffeaa7}
.pwa-titlebar img{width:22px;height:22px;border-radius:6px;display:block}
@media (display-mode:standalone){
  .pwa-titlebar{display:flex}
  body.game{--titlebar-h:44px}
}
body.pwa .pwa-titlebar{display:flex}
body.pwa{--titlebar-h:44px}

/* Top bar: menu + bank + your dev/VP */
.topbar{flex:0 0 auto;display:flex;align-items:center;gap:6px;padding:6px 8px 4px;flex-wrap:nowrap}
.tb-btn{width:38px;height:38px;flex:0 0 auto;display:flex;align-items:center;justify-content:center;border:0;border-radius:11px;background:#ffffff22;color:#fff;font-size:19px;cursor:pointer}
.tb-btn:hover{background:#ffffff33}
.bank{display:flex;gap:4px;margin:0 auto;flex-wrap:nowrap;flex:1 1 auto;justify-content:center;min-width:0;overflow:hidden}
.bank-ic{display:flex;align-items:center;justify-content:center;color:#fff;opacity:.92;flex:0 0 auto}
.bank-ic .ic{width:20px;height:20px}
.reschip{display:flex;align-items:center;gap:4px;background:var(--rc,#3f6ba0);color:#fff;border-radius:9px;padding:3px 6px 3px 5px;font-weight:800;font-size:12px;line-height:1;flex:0 1 auto;box-shadow:0 2px 5px #0003;border:1px solid #00000026}
.reschip .rc-glyphbox{display:flex;color:#fff;background:#ffffff33;border-radius:999px;padding:2px}
.reschip .rc-glyphbox .glyph{width:14px;height:14px}
.reschip .rc-num{min-width:13px;text-align:center}
.tb-right{display:flex;align-items:center;gap:5px;flex:0 0 auto}
/* Round board-style toggle (theme-switch style). */
.tb-btn.round{border-radius:999px;width:34px;height:34px}
.tb-btn.round .ic{width:19px;height:19px}
/* One deliberate management action instead of a per-card control strip. */
.tb-btn.tb-manage{width:auto;min-width:40px;height:40px;padding:0 10px;gap:6px;font-size:12px;font-weight:800;white-space:nowrap;flex:0 1 auto}
.tb-btn.tb-manage .ic{width:17px;height:17px}
.tb-chip{display:flex;align-items:center;gap:4px;background:#ffffff1f;border-radius:9px;padding:5px 7px;font-weight:800;font-size:12px;color:#fff}
.tb-chip .ic{width:15px;height:15px}
.tb-chip .glyph{width:15px;height:15px}
body.game #audio-toggle{background:#ffffff22;color:#fff;width:34px;height:34px;font-size:17px;border-radius:10px;margin-left:0;flex:0 0 auto}
body.game #audio-toggle:hover{background:#ffffff33}
body.game #audio-toggle.off{opacity:.5}

/* Player strip */
.pstrip{flex:0 0 auto;display:flex;gap:5px;padding:0 7px 5px;overflow:hidden}
.pstrip .pcard{position:relative;background:var(--pc,#4a6ea8);border-radius:11px;padding:5px 6px 6px;gap:2px;align-items:stretch;color:#fff;border:2px solid #ffffff2e;box-shadow:0 2px 6px #0003}
.pstrip .pcard.light{color:#22303c}
.pstrip .pcard.me{border-color:#ffffff}
.pstrip .pcard.turn{border-color:#ffd84d;box-shadow:0 0 12px #ffd84d99}
.pstrip .phead{display:flex;align-items:center;gap:5px;min-width:0}
.pstrip .pvp{display:inline-flex;align-items:center;gap:2px;height:19px;padding:0 6px;border-radius:999px;font-size:11px;font-weight:900;color:#22303c;background:#fff;border:1.5px solid #0000002e;flex:0 0 auto}
.pstrip .pvp .ic{width:12px;height:12px;color:#c9a227}
.pstrip .pvp.revealed{background:#ffd84d;border-color:#00000045}
.pstrip .pname{flex:1;font-size:12px;font-weight:800;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 1px 2px #0004}
.pstrip .pcard.light .pname{text-shadow:none}
.pstrip .prow{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:3px 6px;font-size:11px;font-weight:700;color:inherit}
.pstrip .prow .stat{display:flex;align-items:center;gap:2px}
.pstrip .prow .ic{width:13px;height:13px;opacity:.9}
.pstrip .prow .glyph{width:12px;height:12px}
.pstrip .ptimer{align-self:flex-start;margin-top:1px;background:#0d5f96;border-radius:6px;padding:1px 6px;font-size:10px;font-weight:800;color:#fff}
.pstrip .ptimer.expiring{background:#c0392b}
.pstrip .pact{align-self:flex-start;margin-top:3px}
.pstrip .pcard.gone{opacity:.55}
.pstrip .pcard.gone .pname{text-decoration:line-through}
.pstrip .prow .stat.gone{background:#00000040;border-radius:6px;padding:1px 5px}
.pstrip .bot-tag{font-size:9px;opacity:.8;font-weight:700}
.pstrip .phint{display:flex;flex-direction:column;gap:2px;margin-top:3px;background:#00000040;border-radius:8px;padding:3px 5px;color:#fff}
.pstrip .ph-row{display:flex;align-items:center;gap:3px;flex-wrap:wrap}
.pstrip .ph-l{font-size:8px;font-weight:900;letter-spacing:.4px;text-transform:uppercase;opacity:.85;flex:0 0 auto}
.pstrip .ph-r{display:inline-flex;align-items:center;gap:1px}
.pstrip .ph-r .glyph{width:13px;height:13px}
.pstrip .ph-n{font-size:9px;font-weight:900}
.pstrip .phint.angry{background:#9c2f27;color:#fff}
.pstrip .phint.angry .ic{width:15px;height:15px;color:#ffd84d}
.pstrip .ph-angry{font-size:9px;font-weight:800;line-height:1.1}

/* Whose-turn banner. It sits above the board in normal flow, so it never
   covers the dock, the roll dialog, or a toast. The active player's line is
   emphasised so "your turn" is unmistakable next to the roll. */
.turnbanner{flex:0 0 auto;display:flex;align-items:center;justify-content:center;gap:8px;margin:0 7px 4px;padding:5px 12px;border-radius:999px;background:#0b4d7ccc;color:#fff;font-size:13px;font-weight:800;letter-spacing:.2px;text-align:center;min-height:28px;box-shadow:0 3px 10px #0003;overflow:hidden}
.turnbanner .tb-dot{width:9px;height:9px;border-radius:50%;flex:0 0 auto;background:var(--tb,#fff);box-shadow:0 0 0 1.5px #00000033}
.turnbanner .tb-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.turnbanner .tb-text.me{color:#ffeaa7;font-weight:900;text-transform:uppercase;letter-spacing:.6px}
.turnbanner .tb-text.win{color:#ffeaa7}

/* Board */
.board-wrap{position:relative;flex:1 1 0;min-height:0;display:flex}
.board{flex:1 1 0;min-height:0;display:flex;align-items:center;justify-content:center;padding:2px;position:relative}
.board svg{width:100%;height:100%;display:block;touch-action:manipulation;filter:drop-shadow(0 6px 16px #00000030)}
.spot{cursor:pointer}
.spot:hover{filter:brightness(1.4)}

/* Floating controls pill. It is absolute inside `.board-wrap`, so it sits at
   the top of the board directly under the whose-turn banner and follows the
   banner down when the player strip grows. It can never overlap the banner. */
.ctl{position:absolute;left:50%;top:6px;transform:translateX(-50%);z-index:30;pointer-events:none;max-width:calc(100% - 24px)}
.ctl .pill{pointer-events:auto;display:inline-flex;align-items:center;gap:6px;background:#0b4d7ccc;color:#fff;border-radius:999px;padding:6px 14px;font-size:13px;font-weight:700;box-shadow:0 4px 14px #0004;white-space:nowrap}
.ctl .pill.win{background:#1f8a4ccc}
.pill.over{background:#37424ecc}
.ctl .pill .ic{width:15px;height:15px}

/* Active trade offer card */
.trades .trade-card{position:fixed;left:50%;bottom:150px;transform:translateX(-50%);z-index:44;width:calc(100% - 20px);max-width:420px;background:#f3ead6;color:#2b2118;border-radius:14px;padding:10px 12px;box-shadow:0 10px 30px #0006}
.trade-head{display:flex;justify-content:space-between;align-items:center;gap:8px}
.trade-head h3{margin:0;font-size:15px;color:#2b2118}
.trade-timer{font-size:13px;font-weight:800;color:#8a6a1a;background:#00000010;border-radius:6px;padding:2px 8px;white-space:nowrap}
.trade-timer.expiring{color:#c0392b}
.trade-line{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:8px 0;font-size:15px}

/* Dock */
.dockwrap{flex:0 0 auto}
.dock{display:flex;align-items:center;gap:8px;padding:4px 8px 6px}
.dock-dice{display:flex;align-items:center;gap:6px;min-width:0}
.dock-wait{margin-left:auto;font-size:12px;font-weight:700;color:#e8f2fa;opacity:.92;text-align:right}
.dock-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.dockbtn{width:50px;height:50px;border:0;border-radius:14px;background:#eaf3fb;color:#11527d;font-size:22px;display:flex;align-items:center;justify-content:center;cursor:pointer;box-shadow:0 4px 12px #0003;-webkit-tap-highlight-color:transparent}
.dockbtn:hover{background:#fff}
.dockbtn .ic{width:24px;height:24px}
.dockbtn:disabled{opacity:.4;cursor:not-allowed}
.dockbtn.primary{width:auto;padding:0 20px;gap:9px;background:#3aa35a;color:#fff;font-weight:800;font-size:16px}
.dockbtn.primary:hover{background:#43b465}
.dockbtn.primary .ic{width:22px;height:22px}
.dockbtn.end{background:#ffd84d;color:#6a4b00}
.dockbtn.end:hover{background:#ffe27a}

/* Dice */
.dice-wrap{position:relative;display:inline-flex;align-items:center;gap:5px}
.dice-real{display:inline-flex;align-items:center;gap:5px}
.die{filter:drop-shadow(0 2px 3px #0006)}
.dice-total{font-weight:900;font-size:15px;color:#fff;margin-left:2px;text-shadow:0 1px 2px #0005}
.dice-anim{position:relative;width:30px;height:30px;display:none}
.dice-wrap.rolling .dice-anim{display:inline-block}
.dice-wrap.rolling .dice-real{visibility:hidden}
.dice-anim svg{position:absolute;inset:0;opacity:0;animation:droll .72s linear infinite}
.dice-anim svg:nth-child(1){animation-delay:0s}
.dice-anim svg:nth-child(2){animation-delay:.12s}
.dice-anim svg:nth-child(3){animation-delay:.24s}
.dice-anim svg:nth-child(4){animation-delay:.36s}
.dice-anim svg:nth-child(5){animation-delay:.48s}
.dice-anim svg:nth-child(6){animation-delay:.6s}
@keyframes droll{0%,15.9%{opacity:1}16%,100%{opacity:0}}
@keyframes diepop{from{transform:scale(.5) rotate(-18deg);opacity:.3}to{transform:none;opacity:1}}

/* Respect the OS motion preference: no tumble, no card pop. The static first
   die face shows while a roll is in flight, then the landed pair appears. */
@media (prefers-reduced-motion: reduce){
  .dice-anim svg{animation:none;opacity:0}
  .dice-anim svg:nth-child(1){opacity:1}
  .die{animation:none}
}

/* Non-modal retry fallback in the dock when the auto-roll fails or times out.
   It reuses the dock button styling and never opens an overlay. */
.dockbtn[hidden],.dice-wrap[hidden]{display:none}
.retrybtn{width:auto;padding:0 14px;gap:7px;background:#3aa35a;color:#fff;font-weight:800;font-size:14px}
.retrybtn:hover{background:#43b465}

/* Hand strip */
.handstrip{flex:0 0 auto;display:flex;align-items:center;gap:6px;padding:6px 8px;overflow-x:auto;background:#0a3e63aa;border-top:1px solid #ffffff1c}
.gamefoot{flex:0 0 auto;text-align:center;font-size:10px;line-height:1.3;color:#cfe3f0;opacity:.75;background:#0a3e63aa;padding:3px 8px 4px}
.gamefoot a{color:#ffeaa7;font-weight:800;text-decoration:none}
.gamefoot a:hover{text-decoration:underline}
.handstrip .hspace{flex:1}
.rcard{position:relative;flex:0 0 auto;width:54px;height:66px;border-radius:9px;background:var(--rc,#3f6ba0);color:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;box-shadow:0 2px 6px #0004;border:1px solid #00000022;text-shadow:0 1px 2px #0005;overflow:visible}
.rcard.zero{opacity:.45}
.rcard .rcard-count{position:absolute;top:1px;left:5px;font-size:14px;font-weight:900}
.rcard .rcard-icon{font-size:24px;line-height:1;display:flex;background:#ffffff30;border-radius:999px;padding:3px}
.rcard .rcard-icon .glyph{width:24px;height:24px}
.rcard .rcard-name{font-size:9px;font-weight:700;opacity:.92}
/* Board layout: resource card face uses the painted card art. */
.rcard.art{background-image:var(--card,#3f6ba0);background-size:cover;background-position:center;border-color:#00000044;justify-content:flex-end}
.rcard.art .rcard-icon{display:none}
.rcard.art .rcard-name{position:absolute;left:0;right:0;bottom:0;padding:3px 0 4px;background:#00000073;border-radius:0 0 8px 8px;font-size:9px;letter-spacing:.2px}
.rcard.art .rcard-count{top:2px;left:6px;color:#fff;text-shadow:0 1px 3px #000a,0 0 4px #000}
.rcard.pick{cursor:pointer;opacity:.6;transition:opacity .15s,transform .1s}
.rcard.pick.sel{opacity:1;box-shadow:0 0 0 2px #17603f,0 2px 6px #0004;transform:translateY(-3px)}
.rcard.pick.disabled{opacity:.25;pointer-events:none}
.pick-count{position:absolute;top:-7px;right:-7px;background:#1f6fb2;color:#fff;border-radius:11px;min-width:20px;height:20px;font-size:12px;line-height:20px;text-align:center;font-weight:900;padding:0 4px;box-shadow:0 1px 3px #0004}
.pick-count[data-count='0']{display:none}
.handstrip .devchip{display:flex;align-items:center;gap:4px;background:#5b3fa0;color:#fff;border-radius:9px;height:66px;padding:0 12px;font-weight:800;font-size:13px;flex:0 0 auto}
.handstrip .devchip .ic{width:22px;height:22px}
.handstrip .hint{color:#dbeaf4;font-size:12px;font-weight:700;padding:0 6px}

/* Bottom sheets */
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:60;background:#f4ecd9;color:#2b2118;border-radius:18px 18px 0 0;box-shadow:0 -10px 34px #0006;padding:12px 14px calc(14px + env(safe-area-inset-bottom));max-height:82dvh;overflow:auto;animation:sheetup .2s ease}
.sheet[hidden]{display:none}
@keyframes sheetup{from{transform:translateY(30px);opacity:.5}to{transform:none;opacity:1}}
.sheet-head{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.sheet-head h3{margin:0;font-size:17px;font-weight:900;color:#2b2118}
.sheet-hint{margin:0 0 8px;font-size:12px;font-weight:700;line-height:1.35;color:#7a6a55}
.ptimer{align-self:center;background:#0d5f96;border-radius:6px;padding:1px 6px;font-size:10px;font-weight:800;color:#fff;white-space:nowrap}
.ptimer.expiring{background:#c0392b}
.sheet-head .grow{flex:1}
.sheet-close{width:34px;height:34px;border:0;border-radius:10px;background:#00000012;color:#2b2118;font-size:16px;cursor:pointer;display:flex;align-items:center;justify-content:center}
.sheet-close:hover{background:#00000022}
.sheet .muted{color:#6c6154}
.sheet .picker{margin-top:4px}
.build-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.build-opt{display:flex;flex-direction:column;align-items:flex-start;gap:5px;border:0;border-radius:13px;background:#fff;color:#2b2118;padding:10px 12px;cursor:pointer;box-shadow:0 1px 3px #0002;font:inherit;text-align:left;min-height:64px}
.build-opt:hover{background:#fffdf6}
.build-opt:disabled{opacity:.45;cursor:not-allowed}
.build-opt .bo-top{display:flex;align-items:center;gap:7px;font-weight:800;font-size:14px}
.build-opt .cost-free{font-size:13px;font-weight:900;color:#1f8a4c}
.build-opt .bo-top .ic{width:20px;height:20px;color:#11527d}
.cost{display:inline-flex;align-items:center;gap:2px;font-size:14px;flex-wrap:wrap}
.cost-item{display:inline-flex;align-items:center;gap:1px;margin-right:4px}
.cost .glyph{width:16px;height:16px}
.cost .cnt{font-size:11px;font-weight:900;margin-left:1px}
.devrow{display:flex;align-items:center;gap:10px;background:#fff;border-radius:12px;padding:9px 11px;margin-bottom:8px;box-shadow:0 1px 3px #0002}
.devrow .dev-ic{width:38px;height:38px;flex:0 0 auto;border-radius:10px;background:#5b3fa0;color:#fff;display:flex;align-items:center;justify-content:center}
.devrow .dev-ic .ic{width:20px;height:20px}
.devrow .dev-ic.art{background-image:var(--card);background-size:cover;background-position:center;background-color:transparent}
.devrow .dev-ic.art .ic{display:none}
.devrow .dev-body{flex:1;min-width:0}
.devrow .dev-name{font-weight:800;font-size:14px}
.devrow .dev-desc{font-size:11px;color:#6c6154;line-height:1.25}
.devrow .dev-note{margin-top:3px;font-size:10px;font-weight:800;color:#b23b2e}
.devrow .dev-auto{align-self:center;flex:0 0 auto;background:#5b3fa0;color:#fff;border-radius:999px;font-size:11px;font-weight:900;padding:4px 10px}
.devrow form{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:5px}
.devrow select{background:#f0e7d2;color:#2b2118;border:1px solid #00000022;border-radius:8px;padding:6px;font:inherit}
.devrow .dockbtn{width:44px;height:44px}
.steal-grid{display:flex;flex-wrap:wrap;gap:8px}
.steal-opt{display:flex;align-items:center;gap:8px;border:0;border-radius:12px;background:#fff;color:#2b2118;padding:10px 14px;font:inherit;font-weight:800;cursor:pointer;box-shadow:0 1px 3px #0002}
.steal-opt .pdot{width:14px;height:14px;border-radius:50%;border:1px solid #0006}
.steal-opt .cnt{background:#1f6fb2;color:#fff;border-radius:999px;font-size:11px;padding:1px 7px}
.logbox{font-size:13px;line-height:1.45;max-height:38dvh;overflow:auto}
.logbox div{border-bottom:1px solid #00000010;padding:4px 0}
.rules-list{margin:6px 0 12px;padding-left:18px;font-size:13px;line-height:1.5}
.rules-list li{margin-bottom:3px}
.guide-row{display:flex;align-items:center;gap:9px;padding:6px 0;border-bottom:1px solid #00000010}
.guide-row:last-child{border-bottom:0}
.guide-icon{width:24px;height:24px;color:#11527d;display:flex;align-items:center;justify-content:center}
.guide-icon .ic{width:20px;height:20px}
.guide-name{flex:1;font-size:13px;font-weight:700}
code.roomcode{background:#00000010;color:#11527d;font-weight:900;letter-spacing:3px;font-size:16px;padding:3px 9px;border-radius:8px}

/* Trade modal — now a bottom sheet for parity. */
.modal{position:fixed;left:0;right:0;bottom:0;top:auto;z-index:62;background:#f4ecd9;color:#2b2118;border-radius:18px 18px 0 0;box-shadow:0 -10px 34px #0006;padding:12px 14px calc(14px + env(safe-area-inset-bottom));max-height:86dvh;overflow:auto;animation:sheetup .2s ease}
.modal[hidden]{display:none}
.modal-card{width:100%;max-width:520px;margin:0 auto}
.modal-card strong{font-size:14px}
.picker{display:flex;gap:8px;flex-wrap:wrap;margin:6px 0 12px}
.trade-preview{display:flex;align-items:center;justify-content:center;gap:10px;font-size:18px;background:#00000010;border-radius:10px;padding:8px;margin-bottom:10px;min-height:44px;color:#2b2118}
.trade-preview .arrow,.arrow{color:#8a7c66;font-size:18px}
.btn.sheetbtn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border-radius:12px;font-weight:800;min-height:44px}
.btn.sheetbtn.wide{width:100%;justify-content:center}
.sheet-actions{display:flex;flex-direction:column;gap:8px;margin-top:8px}
.sheet-form{display:flex;flex-direction:column;gap:8px;margin-top:8px}
.sheet .leave-next{display:flex;flex-direction:column;gap:4px;width:100%}
.sheet .leave-next span{font-size:11px;font-weight:800;letter-spacing:.4px;text-transform:uppercase;color:#6c6154}
.sheet .leave-next select{width:100%;min-height:40px;font-size:14px}
.sheet .muted.small{margin:8px 0 0;font-size:12px}
/* Manage players list (host kick flow) */
.manage-list{display:flex;flex-direction:column;gap:6px;margin-top:6px}
.manage-row{display:flex;align-items:center;gap:10px;background:#0000000a;border-radius:10px;padding:7px 10px}
.manage-who{display:flex;align-items:center;gap:6px;flex:1;min-width:0}
.manage-name{font-weight:800;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.manage-row .bot-tag{font-size:10px;font-weight:800;letter-spacing:.3px;text-transform:uppercase;background:#00000014;border-radius:6px;padding:2px 6px;flex:0 0 auto}
.manage-row .btn{flex:0 0 auto;min-height:40px}
#manage{display:contents}

/* Toasts + notifications */
.toasts{position:fixed;left:50%;top:calc(10px + env(safe-area-inset-top,0px));transform:translateX(-50%);z-index:72;max-width:calc(100% - 24px)}
#toasts:not(:empty){background:#c0392b;color:#fff;border-radius:10px;padding:7px 14px;font-size:13px;font-weight:700;box-shadow:0 6px 20px #0005}
.notif{position:fixed;left:50%;top:calc(52px + env(safe-area-inset-top,0px));transform:translateX(-50%);z-index:70;display:flex;flex-direction:column;gap:6px;align-items:center;pointer-events:none;width:calc(100% - 24px);max-width:460px}
.notif .note{background:#0b4d7cee;color:#fff;border-radius:10px;padding:8px 14px;font-size:13px;font-weight:700;box-shadow:0 8px 24px #0006;animation:notifin .18s ease-out}
@keyframes notifin{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}

@media(min-width:860px){
 .wrap{padding:16px}
 /* Desktop shell: board on the left, the player panel as a right-hand column,
    so the board gets the full height. Mobile keeps the stacked flex layout. */
 body.game #app{
   display:grid;
   /* Symmetric side columns keep the board centred in the viewport. */
   grid-template-columns:250px minmax(0,1fr) 250px;
   grid-template-rows:auto auto minmax(0,1fr) auto auto;
 }
 .pwa-titlebar{grid-column:1 / -1;grid-row:1}
 #status{grid-column:1 / -1;grid-row:2}
 #board{grid-column:2;grid-row:3;min-height:0}
 #players{grid-column:3;grid-row:3;flex-direction:column;gap:6px;padding:0 2px 0 10px;overflow-y:auto;overflow-x:hidden;justify-content:flex-start}
 #players .pcard{flex:0 0 auto;width:100%;max-width:none;padding:6px 8px}
 #trades{display:contents}
 #turn{grid-column:1 / -1;grid-row:4}
 #hand{grid-column:1 / -1;grid-row:5}
 .bank{gap:6px}
 .reschip{font-size:14px;padding:4px 9px 4px 6px}
 .dock{padding:2px 18px 4px}
 .dockbtn{width:48px;height:48px;border-radius:14px}
 .handstrip{padding:4px 18px}
 .handstrip .rcard{width:50px;height:60px}
 .ctl{top:calc(132px + var(--titlebar-h,0px))}
 .trades .trade-card{bottom:172px}
 .modal-card{padding-bottom:4px}
 .topbar{padding:4px 8px 2px}
 .board{padding:0}
 .gamefoot{display:none}
}
@media(max-width:860px){body:not(.game) .wrap{padding:10px}}
@media(max-width:430px){
 .topbar{gap:2px;padding:5px 4px 3px}
 .tb-btn{width:34px;height:34px;border-radius:10px}
 .tb-btn.round{width:32px;height:32px}
 body.game #audio-toggle{width:32px;height:32px}
 .tb-btn.tb-manage{width:auto;height:40px;padding:0 4px;gap:4px;font-size:11px}
 .tb-btn.tb-manage .ic{width:15px;height:15px}
 /* Keep all five bank counts on a 390px phone next to the extra control. */
 .bank-ic{display:none}
 .bank{gap:2px}
 .reschip{padding:1px;font-size:10px;gap:1px}
 .reschip .rc-num{min-width:11px}
 .reschip .rc-glyphbox{padding:1px}
 .reschip .rc-glyphbox .glyph{width:11px;height:11px}
 .tb-chip{padding:4px 5px;font-size:11px}
 .tb-chip .ic{width:14px;height:14px}
 .bank-ic .ic{width:17px;height:17px}
 .pstrip .prow{gap:2px 4px;font-size:10px}
 .pstrip .pname{font-size:11px}
}

/* Tutorial / how-to-play */
a.btn{text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.howto-cta p{margin:0 0 10px}
/* Separate the stacked return controls in the resume card. */
.howto-cta .btn+.btn{margin-top:8px}
.howto .hero{margin-bottom:12px}
/* Two return controls side by side; gap keeps them from touching. */
.howto-back{margin:4px 0 20px;text-align:center;display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.beat-head{display:flex;align-items:center;gap:10px;margin:0 0 8px}
.beat-head h3{margin:0}
.beat-num{flex:0 0 auto;width:26px;height:26px;border-radius:50%;background:#2e7dd1;color:#fff;font-weight:900;font-size:13px;display:flex;align-items:center;justify-content:center}
.beat p{margin:0 0 8px;font-size:14px;line-height:1.5}
.beat p:last-child{margin-bottom:0}
.beat .ic{display:inline-block;width:1.05em;height:1.05em;vertical-align:-3px}
.beat .glyph{width:16px;height:16px}
.beat .cost{flex-wrap:wrap}
.beat-chips{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 8px}
.beat-chips .chip{display:inline-flex;align-items:center;gap:4px;background:#00000018;border-radius:999px;padding:3px 9px 3px 5px;font-size:12px;font-weight:700}
.beat-list{margin:0;padding-left:18px;font-size:14px;line-height:1.5}
.beat-list li{margin-bottom:4px}
.beat-list li:last-child{margin-bottom:0}
/* Build-guide rows sit on the dark how-to-play cards here, but the shared
   .guide-icon colour (#11527d) is tuned for the light in-game build sheet.
   Lighten the icon/name and divider only on the .howto surface. */
.howto .guide-icon{color:#eaf3fb}
.howto .guide-name{color:#f2f7fb}
.howto .guide-row{border-bottom-color:#ffffff1f}

/* --- Pause: creation option + blinded paused screen --- */
body:not(.game) .check{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:14px;font-weight:700;color:#e8f2fa;cursor:pointer}
body:not(.game) .check input{width:18px;height:18px;accent-color:#2e7dd1}
.pause-screen{width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:16px}
.pause-card{max-width:340px;text-align:center}
.pause-card .pause-ic .ic{width:42px;height:42px;color:#ffd84d}
.pause-card h2{margin:10px 0 6px;font-size:22px;font-weight:900}
.pause-card p{margin:6px 0}
.pause-card .btn{margin-top:14px}

/* Privacy policy (public, Play Store requirement) */
.policy .hero{margin-bottom:12px}
.policy .policy-updated{margin:2px 0 0;font-size:12px;font-weight:700;letter-spacing:.3px;color:#bcd3e3}
.policy .card h3{display:block;margin:0 0 8px}
.policy .card p{margin:0 0 8px;font-size:14px;line-height:1.55}
.policy .card p:last-child{margin-bottom:0}
.policy .policy-list{margin:0 0 8px;padding-left:18px;font-size:14px;line-height:1.55}
.policy .policy-list:last-child{margin-bottom:0}
.policy .policy-list li{margin-bottom:6px}
.policy .policy-list li:last-child{margin-bottom:0}
.policy a{color:#ffeaa7;font-weight:700;text-decoration:none}
.policy a:hover{text-decoration:underline}
.policy code{font-size:12px}

/* --- End-of-game replay (issue #13) --- */
.replay h1{font-size:22px;margin:0}
.replay-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.replay-bar .btn{width:auto}
.replay-pos{margin-left:auto;font-weight:800;font-size:13px}
.replay-main{display:flex;flex-direction:column;gap:12px}
.replay-board{background:rgba(7,40,63,.55);border:1px solid #ffffff2e;border-radius:16px;padding:8px;box-shadow:0 8px 26px #00000038}
.replay-board svg{display:block;width:100%;height:auto;max-height:58vh}
.replay-now{font-weight:800;font-size:15px;margin:0 0 10px}
.replay-nav{display:flex;gap:10px;margin-bottom:12px}
.replay-nav .btn{flex:1}
.replay-nav .btn.disabled{opacity:.4;cursor:not-allowed;background:#37424e;color:#fff;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;padding:10px 14px;font-weight:700;font-size:14px;min-height:40px}
.rp-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-bottom:12px}
.rp-card{background:#ffffff14;border:1px solid #ffffff2e;border-radius:12px;padding:8px 10px;display:flex;flex-direction:column;gap:6px}
.rp-card.light{color:#22303c;background:#eef1f4;border-color:#ffffff66}
.rp-name{display:flex;align-items:center;gap:6px;font-weight:900;font-size:13px}
.rp-stats{display:flex;flex-wrap:wrap;gap:4px 8px;font-size:12px;font-weight:700}
.rp-stat{display:inline-flex;align-items:center;gap:3px}
.rp-stat .ic{width:14px;height:14px}
.rp-stat .glyph{width:14px;height:14px}
.replay-list{list-style:none;margin:0;padding:0;max-height:44vh;overflow:auto;border-top:1px solid #ffffff1f}
.replay-item{border-bottom:1px solid #ffffff14}
.replay-item a{display:flex;gap:6px;padding:7px 4px;text-decoration:none;color:#dbebf7;font-size:13px}
.replay-item a:hover{background:#ffffff14}
.replay-item.on a{color:#ffeaa7;font-weight:900}
.replay-num{color:#9fc0d8;font-weight:900;min-width:26px;text-align:right}
.pill.win .replay-open,.pill.over .replay-open{margin-left:10px;padding:4px 10px;min-height:28px;font-size:12px}

/* --- One-time rename notice (OMK-642) --- */
.rename-notice{background:#8c1c13;color:#fff;border-bottom:1px solid #ffffff33;box-shadow:0 2px 10px #0004}
.rename-notice[hidden]{display:none}
.rename-notice .notice-inner{max-width:1180px;margin:0 auto;padding:10px 14px;display:flex;align-items:center;gap:10px}
.rename-notice .notice-text{margin:0;flex:1 1 auto;font-size:14px;font-weight:700;line-height:1.35}
.rename-notice .notice-text strong{color:#ffeaa7;font-weight:900}
.rename-notice .notice-close{flex:0 0 auto;width:34px;height:34px;border-radius:50%;border:1px solid #ffffff59;background:#00000026;color:#fff;font-size:15px;font-weight:900;line-height:1;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.rename-notice .notice-close:hover,.rename-notice .notice-close:focus-visible{background:#ffffff26;border-color:#ffffffaa}
@media(max-width:420px){.rename-notice .notice-inner{padding:10px 12px;gap:8px}.rename-notice .notice-text{font-size:13px}}
