/* Shiftshore — "sunlit archipelago".
   Deep-sea background, light foam panels like tiles on a table, sun-yellow for the
   one action that matters, Fredoka for anything you'd read off a game box. */

@font-face { font-family: Fredoka; font-weight: 500; font-display: swap; src: url(/fonts/fredoka-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Fredoka; font-weight: 500; font-display: swap; src: url(/fonts/fredoka-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Fredoka; font-weight: 600; font-display: swap; src: url(/fonts/fredoka-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Fredoka; font-weight: 600; font-display: swap; src: url(/fonts/fredoka-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Fredoka; font-weight: 700; font-display: swap; src: url(/fonts/fredoka-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Fredoka; font-weight: 700; font-display: swap; src: url(/fonts/fredoka-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Atkinson; font-weight: 400; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Atkinson; font-weight: 400; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Atkinson; font-weight: 400; font-style: italic; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: Atkinson; font-weight: 700; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Atkinson; font-weight: 700; font-display: swap; src: url(/fonts/atkinson-hyperlegible-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --sea-900: #0b3b4a;
  --sea-800: #0f4a5c;
  --sea-700: #13596b;
  --sea-500: #1f8a9e;
  --foam: #eef7f3;
  --foam-2: #e0eee8;
  --sand: #f3d9a4;
  --sun: #ffb21a;
  --sun-2: #ffc94d;
  --sun-ink: #3a2500;
  --ink: #12313d;
  --ink-2: #4b6772;
  --line: #c6dbd3;
  --coral: #e5534b;
  --ember: #2b1519;
  --kelp: #2c8c5a;
  --on-sea: #eaf6f3;
  --on-sea-2: #a7cdd2;
  --display: Fredoka, ui-rounded, "Segoe UI", system-ui, sans-serif;
  --body: Atkinson, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-panel: 20px;
  --r-card: 14px;
  --r-input: 12px;
  --lift: 0 1px 0 rgba(255,255,255,.6) inset, 0 10px 30px rgba(3, 30, 38, .28);
  color-scheme: light;
  font-family: var(--body);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--on-sea);
  font-size: 16px;
  line-height: 1.5;
  background-color: var(--sea-900);
  background-image:
    radial-gradient(1100px 520px at 50% -120px, rgba(64, 170, 186, .45), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0l28 16v32L28 64 0 48V16zM28 64l28 16v32M28 64L0 80v32' fill='none' stroke='%23ffffff' stroke-opacity='.035' stroke-width='1.2'/%3E%3C/svg%3E");
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0 0 .6rem; letter-spacing: .005em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: .95rem; color: var(--ink-2); }
p { margin: .4rem 0; }
a { color: inherit; }
.muted { color: var(--ink-2); }
.small { font-size: .86rem; }
.hint { color: #8a5a00; }
.center { text-align: center; justify-content: center; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--sun); color: var(--sun-ink); padding: .5rem 1rem; border-radius: 99px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 1.2rem;
  padding: .55rem clamp(.8rem, 3vw, 2rem);
  background: rgba(8, 46, 58, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.3rem; color: var(--on-sea); }
.brand-mark { width: 30px; height: 30px; }
.nav-links { display: flex; gap: .2rem; flex: 1; }
.nav-link { text-decoration: none; color: var(--on-sea-2); font-family: var(--display); font-weight: 500; padding: .4rem .8rem; border-radius: 99px; }
.nav-link:hover, .nav-link.active { color: var(--on-sea); background: rgba(255,255,255,.08); }
.nav-link.back-to-table { color: var(--sun); }
.nav-tools { display: flex; align-items: center; gap: .6rem; }
.nav-account { display: flex; align-items: center; gap: .5rem; }
.nav-coins { text-decoration: none; background: rgba(255, 178, 26, .14); border: 1px solid rgba(255, 178, 26, .35); padding: .2rem .7rem; border-radius: 99px; color: var(--on-sea); }
.nav-user { display: flex; align-items: center; gap: .45rem; text-decoration: none; color: var(--on-sea); font-weight: 700; padding: .2rem .7rem .2rem .25rem; border-radius: 99px; }
.nav-user:hover, .nav-user.active { background: rgba(255,255,255,.08); }
.lang-select { width: auto; padding: .3rem .5rem; font-size: .85rem; background: transparent; color: var(--on-sea); border-color: rgba(255,255,255,.2); }
.lang-select option { color: var(--ink); }
.conn { display: inline-flex; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--on-sea-2); display: inline-block; }
.dot.online { background: #5fd38d; }
.dot.offline { background: var(--coral); }
.dot.connecting { background: var(--sun); }

.view { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: clamp(1rem, 3vw, 2rem) clamp(.8rem, 3vw, 2rem) 3rem; }
.view-room { max-width: 1640px; }
.view:focus { outline: none; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid rgba(255,255,255,.08); padding: 1.6rem clamp(.8rem, 3vw, 2rem); color: var(--on-sea-2); font-size: .9rem; }
body[data-page="room"] .site-footer { display: none; }
.footer-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: .6rem 1.5rem; align-items: center; }
.footer-brand { font-family: var(--display); font-weight: 600; color: var(--on-sea); }
.site-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-footer a { color: var(--on-sea-2); }
.site-footer a:hover { color: var(--on-sea); }
.footer-note { flex-basis: 100%; margin: 0; font-size: .8rem; opacity: .8; }

/* ---------- buttons & inputs ---------- */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  border: 2px solid var(--line); background: #fff; color: var(--ink);
  padding: .5rem 1.05rem; border-radius: 99px;
  font: 600 .98rem/1.2 var(--display); cursor: pointer; text-decoration: none;
  transition: transform .06s, background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover:not(:disabled) { border-color: var(--sea-500); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.sun { background: var(--sun); border-color: #e09700; color: var(--sun-ink); box-shadow: 0 3px 0 #c98500; }
.btn.sun:hover:not(:disabled) { background: var(--sun-2); border-color: #e09700; }
.btn.sun:active:not(:disabled) { box-shadow: 0 1px 0 #c98500; transform: translateY(2px); }
.btn.big { padding: .75rem 1.4rem; font-size: 1.08rem; }
.btn.small { padding: .32rem .8rem; font-size: .88rem; }
.btn.tiny { padding: .18rem .55rem; font-size: .8rem; border-width: 1.5px; }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,.25); color: inherit; }
.panel .btn.ghost { border-color: var(--line); }
.btn.link { background: none; border: none; color: var(--ink-2); padding: .4rem 0; text-decoration: underline; font-family: var(--body); font-weight: 400; box-shadow: none; }
.btn.link:hover { color: var(--ink); }
.btn.danger { background: #fff; border-color: var(--coral); color: #b4231c; }
.btn.danger:hover:not(:disabled) { background: #fde8e6; border-color: var(--coral); }
.btn.price b { font-family: var(--display); }
.btn.price.short { opacity: .7; }
.icon-btn {
  appearance: none; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: var(--on-sea);
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: rgba(255,255,255,.15); }

input, select, textarea {
  font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--line);
  border-radius: var(--r-input); padding: .55rem .75rem; width: 100%;
}
input:focus, select:focus { border-color: var(--sea-500); outline: none; box-shadow: 0 0 0 3px rgba(31, 138, 158, .25); }
.field { display: grid; gap: .3rem; }
.field > span { font-size: .9rem; font-weight: 700; color: var(--ink); }
.check { display: flex; gap: .55rem; align-items: flex-start; font-size: .92rem; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; margin-top: .15rem; flex: none; accent-color: var(--kelp); }
.form-error { color: #b4231c; font-weight: 700; min-height: 0; margin: 0; }
.form-error:empty { display: none; }
.code-input { text-transform: uppercase; letter-spacing: .18em; font-family: var(--display); font-weight: 600; }
.row { display: flex; align-items: center; gap: .5rem; }
.row.gap { gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.stack { display: grid; gap: .5rem; }
.stack-form { display: grid; gap: .9rem; }

/* ---------- surfaces ---------- */
.panel { background: var(--foam); color: var(--ink); border-radius: var(--r-panel); padding: 1.2rem 1.3rem; box-shadow: var(--lift); }
.panel a { color: #0d6474; }
.tag { font-size: .72rem; padding: .08rem .5rem; border-radius: 99px; background: var(--foam-2); color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.tag.bot { background: #dde4fb; color: #33449a; }
.tag.warn { background: #fde3e1; color: #a52a22; }
.chip { display: inline-flex; align-items: center; gap: .1rem; font-size: .9rem; margin-right: .2rem; }
.coins { display: inline-flex; align-items: center; gap: .3rem; font-family: var(--display); font-weight: 600; }
.coin-ico { width: 1.1em; height: 1.1em; flex: none; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; box-shadow: 0 0 0 3px var(--pc, var(--line)); font-size: 1.05rem; flex: none;
}
.avatar.small { width: 24px; height: 24px; font-size: .85rem; box-shadow: 0 0 0 2px var(--pc, var(--line)); }
.avatar.large { width: 76px; height: 76px; font-size: 2.4rem; box-shadow: 0 0 0 5px var(--pc, var(--sun)); }
.avatar.empty { box-shadow: 0 0 0 2px var(--line); background: transparent; }
.supporter { color: #d39400; margin-left: .25rem; font-size: .9em; }
.section-title { color: var(--on-sea); margin-top: 2.8rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head .section-title { margin-bottom: .8rem; }
.lede { color: var(--on-sea-2); font-size: 1.1rem; max-width: 60ch; }
.page-head { text-align: center; margin-bottom: 1.6rem; }
.page-head .lede { margin: 0 auto; }
.live-line { display: inline-flex; align-items: center; gap: 1rem; color: var(--on-sea-2); font-size: .92rem; margin-top: .4rem; }
.live-line:empty { display: none; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #5fd38d; box-shadow: 0 0 0 4px rgba(95, 211, 141, .2); }

/* ---------- home ---------- */
.hero { text-align: center; display: flex; flex-direction: column; align-items: center; padding-top: .5rem; }
.hero-island { width: min(560px, 94vw); aspect-ratio: 1.05 / 1; margin-bottom: -1.1rem; filter: drop-shadow(0 22px 30px rgba(2, 25, 32, .55)); }
.hero-island svg { width: 100%; height: 100%; }
.hero-island .hex { transform-box: fill-box; transform-origin: center; }
.hero-island.rising .hex { animation: tile-rise .55s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes tile-rise { from { opacity: 0; transform: translateY(-26px) scale(.7); } to { opacity: 1; transform: none; } }
.hero-island .ports, .hero-island .roads, .hero-island .buildings, .hero-island .bandit { animation: fade-in .4s 1.1s both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.wordmark {
  position: relative; font-size: clamp(3.4rem, 11vw, 6.6rem); font-weight: 700; color: var(--sand);
  letter-spacing: .01em; line-height: 1; margin: 0;
  text-shadow: 0 5px 0 #082d39, 0 14px 30px rgba(0,0,0,.35);
}
.hero .lede { margin: .9rem auto 1.4rem; font-size: 1.18rem; color: var(--on-sea); max-width: 34ch; }
.play-panel { background: var(--foam); color: var(--ink); border-radius: 26px; padding: 1.3rem; width: min(470px, 100%); box-shadow: var(--lift); display: grid; gap: .9rem; text-align: left; }
.playing-as { display: flex; align-items: center; gap: .55rem; margin: 0; justify-content: center; }
.play-buttons { display: grid; grid-template-columns: 1.15fr 1fr; gap: .6rem; }
.code-join { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: center; font-size: .9rem; color: var(--ink-2); }
.code-join input { padding: .4rem .6rem; }
.hero .live-line { margin-top: 1rem; }

.mode-pair { display: grid; grid-template-columns: 1fr 1.25fr; gap: 1.2rem; }
.mode-card { border-radius: 24px; padding: 1.6rem; display: flex; flex-direction: column; gap: .7rem; align-items: flex-start; }
.mode-card.classic { background: var(--foam); color: var(--ink); box-shadow: var(--lift); }
.mode-card.classic { position: relative; overflow: hidden; }
.mode-card.classic::after { content: ""; position: absolute; right: -46px; bottom: -52px; width: 230px; height: 230px; pointer-events: none; opacity: .22; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-60 -60 120 120'%3E%3Cg stroke='%23ffffff' stroke-width='2'%3E%3Cpolygon points='0,-20 17,-10 17,10 0,20 -17,10 -17,-10' fill='%232f7d4a'/%3E%3Cpolygon points='34,-20 51,-10 51,10 34,20 17,10 17,-10' fill='%23e3bd3b'/%3E%3Cpolygon points='-34,-20 -17,-10 -17,10 -34,20 -51,10 -51,-10' fill='%23c8693f'/%3E%3Cpolygon points='17,10 34,20 34,40 17,50 0,40 0,20' fill='%238cc56b'/%3E%3Cpolygon points='-17,10 0,20 0,40 -17,50 -34,40 -34,20' fill='%238f96a3'/%3E%3Cpolygon points='17,-50 34,-40 34,-20 17,-10 0,-20 0,-40' fill='%238cc56b'/%3E%3Cpolygon points='-17,-50 0,-40 0,-20 -17,-10 -34,-20 -34,-40' fill='%232f7d4a'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; }
.mode-card.classic > * { position: relative; z-index: 1; }
.mode-card.classic h3 { font-size: 1.6rem; }
.mode-card.catastrophic { background: radial-gradient(120% 90% at 100% 0, #5a2230, var(--ember) 65%); color: #fbe9e1; box-shadow: 0 0 0 2px rgba(229, 83, 75, .55), 0 18px 40px rgba(20, 4, 8, .45); }
.mode-card.catastrophic h3 { font-size: 1.6rem; color: #ffd2a6; }
.mode-facts { margin: 0; padding-left: 1.1rem; color: var(--ink-2); }
.mode-facts li { margin: .2rem 0; }
.mode-card .btn { margin-top: auto; }
.cat-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; width: 100%; }
.cat-cards li { display: grid; grid-template-columns: 2rem 1fr; gap: .5rem; align-items: start; }
.cat-cards li > span { font-size: 1.4rem; }
.cat-cards small { display: block; color: #e8c1b4; line-height: 1.35; }
.event-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.event-chip { font-size: .8rem; padding: .15rem .6rem; border-radius: 99px; background: rgba(255, 210, 166, .12); border: 1px solid rgba(255, 210, 166, .3); }
.cat-note { color: #e8c1b4; margin: 0; }

.table-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.table-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: .9rem; align-items: center; background: var(--foam); color: var(--ink); border-radius: var(--r-card); padding: .65rem .8rem; box-shadow: var(--lift); }
.panel .table-row { box-shadow: none; background: #fff; border: 1px solid var(--line); }
.table-row.catastrophic { box-shadow: inset 4px 0 0 var(--coral), var(--lift); }
.table-host { font-size: 1.6rem; width: 2.4rem; text-align: center; }
.table-info { display: grid; gap: .1rem; min-width: 0; }
.table-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-meta { display: flex; gap: .7rem; flex-wrap: wrap; color: var(--ink-2); font-size: .85rem; align-items: center; }
.mode-tag { font-size: .78rem; font-weight: 700; padding: .05rem .55rem; border-radius: 99px; background: var(--foam-2); color: var(--ink-2); }
.mode-tag.catastrophic { background: #fde3e1; color: #9b2620; }
.seats { display: flex; gap: .2rem; }
.seat { width: 26px; height: 26px; border-radius: 50%; border: 2px dashed var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.seat.taken { border: 2px solid var(--sea-500); background: #fff; }
.empty-tables { text-align: center; padding: 1.6rem; border: 2px dashed rgba(255,255,255,.25); border-radius: var(--r-panel); color: var(--on-sea-2); display: grid; gap: .8rem; justify-items: center; }
.panel .empty-tables { border-color: var(--line); color: var(--ink-2); }

.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; counter-reset: step; }
.steps li { position: relative; padding: 1.2rem 1.2rem 1.2rem 1.2rem; border-radius: var(--r-card); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; top: 1rem; right: 1rem; font-family: var(--display); font-weight: 700; color: var(--sand); opacity: .55; font-size: 1.6rem; }
.step-ico { font-size: 1.8rem; display: block; margin-bottom: .3rem; }
.steps b { font-family: var(--display); font-size: 1.15rem; }
.steps p { color: var(--on-sea-2); margin: .3rem 0 0; }

/* ---------- tables page ---------- */
.play-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.2rem; align-items: start; }
.tables-panel h2 { margin: 0; }
.filter-chips { display: flex; gap: .3rem; }
.chip-btn { border: 1.5px solid var(--line); background: #fff; color: var(--ink-2); border-radius: 99px; padding: .2rem .7rem; font: 600 .85rem var(--display); cursor: pointer; }
.chip-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tables-panel .table-list, .tables-panel .empty-tables { margin-top: 1rem; }
.play-side { display: grid; gap: 1rem; }
.create-panel { display: grid; gap: .8rem; }
.create-panel h2, .join-panel h2 { margin: 0; font-size: 1.25rem; }
.radio-row { border: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem 1rem; }
.radio-row legend { font-size: .9rem; font-weight: 700; margin-bottom: .3rem; }
.radio-row label { display: flex; gap: .35rem; align-items: center; cursor: pointer; }
.radio-row input { width: auto; accent-color: var(--kelp); }

/* ---------- store ---------- */
.store-head { display: flex; justify-content: space-between; gap: 1.5rem; align-items: flex-end; flex-wrap: wrap; margin-bottom: 1.2rem; }
.store-head h1 { margin: 0; }
.balance-card { background: var(--foam); color: var(--ink); border-radius: var(--r-panel); padding: 1rem 1.2rem; display: grid; gap: .3rem; justify-items: start; max-width: 360px; box-shadow: var(--lift); }
.balance { font-size: 2rem; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin: .4rem 0 1.4rem; }
.tab-btn { border: none; background: rgba(255,255,255,.08); color: var(--on-sea-2); border-radius: 99px; padding: .4rem .95rem; font: 600 .95rem var(--display); cursor: pointer; }
.tab-btn:hover { color: var(--on-sea); }
.tab-btn.active { background: var(--on-sea); color: var(--ink); }
.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 1rem; }
.mode-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.2rem; }
.item-card { background: var(--foam); color: var(--ink); border-radius: var(--r-card); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--lift); }
.item-card.wide { display: grid; grid-template-columns: 170px 1fr; grid-template-rows: 1fr auto; border-radius: var(--r-panel); }
.item-card.wide .item-preview { grid-row: span 2; height: 100%; min-height: 170px; }
.item-card.wide.cat-modes:first-child { box-shadow: 0 0 0 2px rgba(229, 83, 75, .45), var(--lift); }
.item-preview { height: 128px; display: flex; align-items: center; justify-content: center; background: var(--foam-2); overflow: hidden; }
.preview-svg { width: 100%; height: 100%; display: block; }
.cat-buildings .item-preview { background: linear-gradient(#d5ebe3, #c3e0d4); padding: 0 1rem; }
.cat-dice .item-preview, .dice-preview { display: flex; gap: .6rem; align-items: center; justify-content: center; }
.cat-dice .item-preview { background: #1d5466; }
.item-body { padding: .8rem 1rem .2rem; flex: 1; }
.item-body h3 { margin: 0 0 .2rem; }
.item-body p { margin: 0; color: var(--ink-2); font-size: .9rem; }
.item-foot { padding: .6rem 1rem .9rem; display: flex; justify-content: flex-end; align-items: center; }
.real-price { font-size: .82rem; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-right: .5rem; }
.owned-tag { color: var(--kelp); font-weight: 700; font-family: var(--display); }
.emoji-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .2rem .6rem; font-size: 1.5rem; }
.swatch-row { display: flex; gap: .4rem; }
.swatch-row span { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0,0,0,.2); }
.bundle-list { list-style: none; padding: 0 1rem; margin: 0; font-family: var(--display); font-weight: 500; display: grid; gap: .15rem; text-align: center; }
.mode-art { display: flex; flex-wrap: wrap; gap: .3rem .6rem; justify-content: center; font-size: 1.9rem; padding: 1rem; width: 100%; height: 100%; align-content: center; }
.mode-art.cat { background: radial-gradient(circle at 70% 20%, #5a2230, var(--ember)); }
.mode-art.big { background: linear-gradient(160deg, #1f8a9e, #0f4a5c); color: #fff; font-family: var(--display); font-weight: 700; }
.coin-section .section-title { margin-top: 3rem; }
.coin-section > .muted { color: var(--on-sea-2); }
.packs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1rem; }
.pack { position: relative; background: var(--foam); color: var(--ink); border-radius: var(--r-panel); padding: 1.4rem 1rem 1rem; display: grid; gap: .5rem; justify-items: center; box-shadow: var(--lift); }
.pack.popular { box-shadow: 0 0 0 3px var(--sun), var(--lift); }
.pack .btn { width: 100%; }
.pack-coins { display: flex; align-items: center; gap: .4rem; font-family: var(--display); font-size: 1.9rem; font-weight: 700; }
.pack-coins .coin-ico { width: 1.25em; height: 1.25em; }
.bonus { font-size: .85rem; font-weight: 700; color: var(--kelp); }
.ribbon { position: absolute; top: -.75rem; background: var(--sun); color: var(--sun-ink); font: 700 .8rem var(--display); padding: .15rem .8rem; border-radius: 99px; }
.packs .hint { grid-column: 1 / -1; color: var(--sand); }
.legal-note { color: var(--on-sea-2) !important; margin-top: 1rem; }
.legal-note a { color: var(--on-sea); }
.checkout-summary { display: flex; justify-content: space-between; align-items: center; background: var(--foam-2); border-radius: var(--r-card); padding: .8rem 1rem; margin: .4rem 0; }
.checkout-price { font: 700 1.5rem var(--display); }
.paypal-slot { min-height: 60px; display: grid; gap: .5rem; margin: 1rem 0 .4rem; }
paypal-button { display: block; min-height: 45px; }
.confirm-modal { text-align: center; }
.confirm-modal .item-preview { border-radius: var(--r-card); margin-bottom: 1rem; height: 140px; }

/* ---------- account ---------- */
.profile-head { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.profile-name h1 { margin: 0; }
.profile-name .muted { color: var(--on-sea-2); }
.profile-stats { display: flex; gap: .6rem; margin: 0 0 0 auto; flex-wrap: wrap; }
.profile-stats div { background: var(--foam); color: var(--ink); border-radius: var(--r-card); padding: .55rem 1rem; min-width: 96px; }
.profile-stats dt { font-size: .8rem; color: var(--ink-2); }
.profile-stats dd { margin: 0; font: 700 1.35rem var(--display); }
.account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; }
.account-grid.wide { grid-template-columns: 1fr; }
.equip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .6rem; }
.equip-tile { display: grid; gap: .3rem; border: 2px solid var(--line); background: #fff; border-radius: var(--r-card); padding: .4rem; cursor: pointer; font: 600 .88rem var(--display); color: var(--ink); text-align: center; }
.equip-tile .item-preview { height: 70px; border-radius: 10px; }
.equip-tile.on { border-color: var(--kelp); box-shadow: 0 0 0 2px rgba(44, 140, 90, .3); }
.equip-tile small { color: var(--kelp); }
.plain-list { margin: .3rem 0 .8rem; padding-left: 1.1rem; }
.data-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin-bottom: .8rem; }
.data-table th { text-align: left; font-weight: 700; color: var(--ink-2); border-bottom: 2px solid var(--line); padding: .4rem .5rem; }
.data-table td { border-bottom: 1px solid var(--line); padding: .45rem .5rem; }
.plus { color: var(--kelp); font-weight: 700; }
.minus { color: #b4231c; font-weight: 700; }
.danger-zone { box-shadow: 0 0 0 2px rgba(229, 83, 75, .35), var(--lift); }

/* ---------- auth ---------- */
.auth-wrap { display: grid; place-items: center; min-height: 60vh; position: relative; }
.auth-card { width: min(440px, 100%); position: relative; z-index: 1; }
.auth-card h1 { font-size: 1.9rem; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.captcha-slot:not(:empty) { min-height: 65px; }
.notice-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .4rem .9rem; padding: .5rem clamp(.8rem, 3vw, 2rem); background: #fff3d1; color: var(--ink); font-size: .92rem; text-align: center; border-bottom: 1px solid rgba(0,0,0,.08); }
.notice-bar[hidden] { display: none; }
.auth-links { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; font-size: .92rem; }
.auth-island { position: absolute; width: 520px; height: 520px; max-width: 100vw; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-60 -60 120 120'%3E%3Cg stroke='%23f3e6c4' stroke-width='2'%3E%3Cpolygon points='0,-20 17,-10 17,10 0,20 -17,10 -17,-10' fill='%232f7d4a'/%3E%3Cpolygon points='34,-20 51,-10 51,10 34,20 17,10 17,-10' fill='%23e3bd3b'/%3E%3Cpolygon points='-34,-20 -17,-10 -17,10 -34,20 -51,10 -51,-10' fill='%23c8693f'/%3E%3Cpolygon points='17,10 34,20 34,40 17,50 0,40 0,20' fill='%238cc56b'/%3E%3Cpolygon points='-17,10 0,20 0,40 -17,50 -34,40 -34,20' fill='%238f96a3'/%3E%3Cpolygon points='17,-50 34,-40 34,-20 17,-10 0,-20 0,-40' fill='%238cc56b'/%3E%3Cpolygon points='-17,-50 0,-40 0,-20 -17,-10 -34,-20 -34,-40' fill='%232f7d4a'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; opacity: .18; }

/* ---------- leaderboard & legal ---------- */
.leaderboard { max-width: 760px; margin: 0 auto; }
.lb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.lb-list li { display: grid; grid-template-columns: 2.4rem auto 1fr auto auto 3.2rem; gap: .8rem; align-items: center; padding: .55rem .7rem; border-radius: var(--r-card); }
.lb-list li:nth-child(odd) { background: #fff; }
.lb-list li.me { box-shadow: inset 0 0 0 2px var(--sea-500); }
.rank { font: 700 1.2rem var(--display); text-align: center; color: var(--ink-2); }
.podium.p1 .rank { color: #c08a00; font-size: 1.6rem; }
.podium.p2 .rank { color: #7d8a93; font-size: 1.45rem; }
.podium.p3 .rank { color: #a8643a; font-size: 1.35rem; }
.lb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-rate { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 700; }
.lb-wins b { font: 700 1.2rem var(--display); }
.legal { max-width: 820px; margin: 0 auto; line-height: 1.65; }
.legal h1 { margin-bottom: 1rem; }
.legal h2 { margin-top: 1.8rem; font-size: 1.25rem; }
.legal .placeholder { background: #fff3c4; padding: 0 .25rem; border-radius: 4px; }

/* ---------- room: join & lobby ---------- */
.room-join { display: grid; place-items: center; min-height: 55vh; }
.join-card { width: min(440px, 100%); display: grid; gap: .9rem; text-align: center; }
.join-card .field { text-align: left; }
.lobby { display: grid; grid-template-columns: 1fr 340px; gap: 1.2rem; align-items: start; }
.lobby-main { display: grid; gap: 1rem; }
.lobby-title { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.lobby-title h1 { margin: 0; }
.code { color: #0d6474; letter-spacing: .14em; }
.invite { margin-top: .6rem; flex-wrap: nowrap; }
.invite input { min-width: 0; }
.invite .btn { white-space: nowrap; flex: none; }
.player-list { list-style: none; padding: 0; margin: 0 0 .4rem; display: grid; gap: .4rem; }
.player-row { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); }
.player-row.empty { border-style: dashed; background: transparent; }
.player-row .pname { flex: 1; font-weight: 700; }
.player-row em, .pcard em { color: var(--ink-2); font-style: normal; font-weight: 400; font-size: .85em; }
.waiting { color: var(--ink-2); text-align: center; padding: .6rem; }
.setting { display: grid; grid-template-columns: 1fr 1.3fr; align-items: center; gap: .6rem; padding: .3rem 0; }
.setting span { color: var(--ink-2); font-size: .92rem; }
.unlock-hint { margin-top: .6rem; }
.swatches { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .8rem; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0,0,0,.18); font-size: .7rem; }
.swatch.selected { border-color: var(--ink); }
.swatch.locked { opacity: .55; }
.swatch:disabled { opacity: .2; cursor: not-allowed; }
.avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: .35rem; }
.avatar-btn { font-size: 1.35rem; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: .3rem 0; cursor: pointer; }
.avatar-btn.selected { border-color: var(--sun); box-shadow: 0 0 0 2px rgba(255, 178, 26, .5); }
.chat-card { display: flex; flex-direction: column; height: min(600px, 78vh); position: sticky; top: 76px; }
.chat-tools { display: grid; gap: .45rem; margin-top: .6rem; }
.chat-form { display: flex; gap: .4rem; }
.chat-form input { flex: 1; }
.quick-chat { font-size: .88rem; padding: .35rem .5rem; }
.feed-list { flex: 1; overflow-y: auto; font-size: .9rem; padding-right: .3rem; min-height: 120px; }
.msg { padding: .25rem 0; border-bottom: 1px solid var(--foam-2); }
.msg.private { color: #8a5a00; }
.msg.event { background: #fde9dc; border-radius: 8px; padding: .3rem .5rem; border: none; margin: .2rem 0; }
.feed-card { display: flex; flex-direction: column; height: 330px; }
.feed-tabs { display: flex; gap: .3rem; margin-bottom: .5rem; }
.tab { background: none; border: none; color: var(--ink-2); font: 600 .95rem var(--display); padding: .25rem .7rem; border-radius: 99px; cursor: pointer; }
.tab.active { background: var(--ink); color: #fff; }
.count { background: var(--coral); color: #fff; border-radius: 99px; padding: 0 .4rem; font-size: .75rem; }

/* ---------- room: game ---------- */
.game { display: grid; gap: 1rem; align-items: start; grid-template-columns: 250px minmax(0, 1fr) 340px; }
.players-panel, .side-panel { display: grid; gap: .8rem; }
.side-panel .panel, .players-panel .panel { padding: 1rem 1.05rem; }
.board-area { display: grid; gap: .6rem; position: sticky; top: 70px; }
.board-frame {
  position: relative; overflow: hidden; border-radius: 26px;
  background: radial-gradient(circle at 50% 42%, var(--sea-a, #1f7f99) 0%, var(--sea-b, #11536a) 75%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 18px 40px rgba(2, 20, 28, .45);
  padding: .5rem; aspect-ratio: 1 / .95; max-height: calc(100vh - 210px);
  display: flex; align-items: center; justify-content: center;
}
#board { width: 100%; height: 100%; user-select: none; touch-action: none; }
.board-frame.zoomed #board { cursor: grab; }
.zoom-controls { position: absolute; right: .7rem; bottom: .7rem; display: grid; gap: .3rem; }
.zoom-controls .icon-btn { background: rgba(8, 46, 58, .7); }
.status-bar { display: flex; align-items: center; gap: .7rem; min-height: 54px; background: var(--foam); color: var(--ink); border-radius: var(--r-card); padding: .5rem .9rem; box-shadow: var(--lift); }
.status-text { flex: 1; }
.turn-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
.dice { display: flex; align-items: center; gap: .3rem; }
.dice b { font: 700 1.1rem var(--display); background: var(--foam-2); border-radius: 8px; padding: .1rem .45rem; }
.timer { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.timer.urgent { color: #b4231c; font-weight: 700; }
.event-bar { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; background: var(--ember); color: #fbe9e1; border-radius: var(--r-card); padding: .45rem .9rem; font-size: .9rem; box-shadow: 0 0 0 1px rgba(229, 83, 75, .5); }
.event-mode { font-family: var(--display); font-weight: 600; color: #ffd2a6; }
.event-text { color: #f0c9bc; }
.fx-chip { background: rgba(255,255,255,.1); border-radius: 99px; padding: .05rem .55rem; font-size: .82rem; }
.fx-chip .muted { color: #f0c9bc; }
.event-round { font-variant-numeric: tabular-nums; background: rgba(255,255,255,.12); border-radius: 99px; padding: .05rem .55rem; font-weight: 700; }

.die-face { position: relative; display: inline-block; width: 30px; height: 30px; border-radius: 8px; border: 2px solid; flex: none; }
.die-face i { position: absolute; width: 18%; height: 18%; border-radius: 50%; transform: translate(-50%, -50%); }
.die-face.big { width: 82px; height: 82px; border-radius: 18px; border-width: 3px; }
.dice-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 1.1rem; pointer-events: none; transition: opacity .45s; }
.dice-overlay.rolling .die-face { animation: tumble .32s linear infinite; }
.dice-overlay.rolling .die-face:last-child { animation-duration: .27s; animation-direction: reverse; }
.dice-overlay.settled .die-face { animation: settle .3s ease-out; }
.dice-overlay.fade { opacity: 0; }
@keyframes tumble { 0% { transform: rotate(0) translateY(0); } 50% { transform: rotate(180deg) translateY(-14px); } 100% { transform: rotate(360deg) translateY(0); } }
@keyframes settle { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }

.pcard { background: var(--foam); color: var(--ink); border-radius: var(--r-card); padding: .7rem .8rem; box-shadow: inset 5px 0 0 var(--pc), var(--lift); }
.pcard.active { box-shadow: inset 5px 0 0 var(--pc), 0 0 0 3px var(--pc), var(--lift); }
.pcard-head { display: flex; align-items: center; gap: .45rem; }
.pcard .pname { font-weight: 700; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .avatar { width: 28px; height: 28px; font-size: .95rem; }
.vp { font: 700 1.35rem var(--display); white-space: nowrap; }
.vp small { font-size: .65rem; color: var(--ink-2); margin-left: .15rem; }
.pcard-stats { display: flex; gap: .7rem; color: var(--ink-2); font-size: .88rem; margin-top: .3rem; flex-wrap: wrap; }
.badges { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .35rem; }
.badges:empty { display: none; }
.badge { font-size: .74rem; background: #fff3d1; color: #7a5200; border: 1px solid #f2d27a; padding: .05rem .5rem; border-radius: 99px; font-weight: 700; }
.badge.warn { background: #fde3e1; color: #a52a22; border-color: #f4b4ae; }
.bank h4 { margin-bottom: .3rem; }
.res-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; margin: .3rem 0; }
.res-row.small { display: flex; flex-wrap: wrap; gap: .3rem; }
.res { display: inline-flex; align-items: center; gap: .25rem; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: .35rem .2rem; font: 700 1.08rem var(--display); justify-content: center; }
.res i { font-style: normal; font-size: 1.12rem; }
.res.small { font-size: .85rem; padding: .15rem .4rem; }
.res.small i { font-size: .95rem; }
.pieces { display: flex; gap: .7rem; }
.build-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.btn.build { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .45rem; text-align: left; padding: .45rem .7rem; border-radius: var(--r-card); justify-content: stretch; }
.btn.build .bicon { grid-row: span 2; font-size: 1.4rem; align-self: center; }
.btn.build .cost { font: 400 .8rem var(--body); }
.btn.build.active { border-color: var(--sun); box-shadow: 0 0 0 3px rgba(255, 178, 26, .45); }
.trade-card { box-shadow: 0 0 0 3px var(--sun), var(--lift); }
.responses { list-style: none; padding: 0; margin: .3rem 0; display: grid; gap: .25rem; }
.devcards { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.devcard { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r-card); padding: .45rem .6rem; }
.devcard.catastrophe { border-color: #f1a49c; background: #fff6f4; }
.dicon { font-size: 1.4rem; }
.reaction-bar { display: flex; gap: .3rem; justify-content: center; flex-wrap: wrap; }
.react-btn { font-size: 1.3rem; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); border-radius: 99px; padding: .15rem .55rem; cursor: pointer; transition: transform .1s; }
.react-btn:hover { transform: scale(1.15); background: rgba(255,255,255,.18); }

/* board svg */
.hex polygon { stroke-width: 3.5; stroke-linejoin: round; }
.hex.hot polygon { stroke: #fff7d6; stroke-width: 5; filter: drop-shadow(0 0 10px rgba(255, 240, 180, .85)); }
.hex.sunny polygon { filter: drop-shadow(0 0 12px rgba(255, 210, 80, .9)); }
.hex.selected polygon { stroke: var(--sun); stroke-width: 6; }
.flood-overlay { fill: rgba(40, 120, 220, .42); stroke: none; pointer-events: none; }
.fx-icon { font-size: 18px; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.terrain-icon { font-size: 17px; text-anchor: middle; dominant-baseline: central; opacity: .9; pointer-events: none; }
.token { stroke: rgba(0,0,0,.35); stroke-width: 1.2; }
.token-num { font: 700 17px var(--display); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.dock { stroke: #e2d3ab; stroke-width: 3; stroke-dasharray: 4 3; }
.port circle { fill: #fbf3dc; stroke: #6b5a3a; stroke-width: 1.5; }
.port-icon { font-size: 12px; text-anchor: middle; dominant-baseline: central; font-weight: 800; fill: #2b2417; }
.port-ratio { font: 700 10px var(--display); text-anchor: middle; dominant-baseline: central; fill: #2b2417; }
.road-outline { stroke: #10141f; stroke-width: 11; stroke-linecap: round; }
.road { stroke-width: 7; stroke-linecap: round; }
.building { stroke: #10141f; stroke-width: 1.8; stroke-linejoin: round; }
.bandit { pointer-events: none; }
.target-vertex { fill: rgba(255, 255, 255, .9); stroke: var(--sun); stroke-width: 3; cursor: pointer; animation: pulse 1.2s ease-in-out infinite; }
.target-vertex.city { fill: rgba(255, 255, 255, .25); }
.target-vertex:hover { fill: var(--sun); }
.target-edge { stroke: rgba(255, 255, 255, .6); stroke-width: 9; stroke-linecap: round; cursor: pointer; animation: pulse 1.2s ease-in-out infinite; }
.target-edge:hover { stroke: var(--sun); }
.target-edge.quake { stroke: rgba(229, 83, 75, .85); }
.target-hex { fill: rgba(255, 255, 255, .12); stroke: var(--sun); stroke-width: 3; cursor: pointer; }
.target-hex.tile { fill: rgba(255, 255, 255, .05); stroke: rgba(255, 210, 166, .9); }
.target-hex:hover { fill: rgba(255, 178, 26, .35); }
.hit-vertex { fill: transparent; cursor: pointer; }
.hit-edge { stroke: transparent; stroke-width: 22; stroke-linecap: round; cursor: pointer; }
@keyframes pulse { 50% { opacity: .55; } }
.pop { transform-box: fill-box; transform-origin: center; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.float-res { font-size: 22px; text-anchor: middle; dominant-baseline: central; pointer-events: none; transform-box: fill-box; animation: floatUp 1.6s ease-out both; }
@keyframes floatUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-6px) scale(1.1); } 100% { transform: translateY(-46px) scale(1); opacity: 0; } }

/* ---------- dialogs ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(4, 22, 28, .62); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50; }
.modal:focus { outline: none; }
.modal { background: var(--foam); color: var(--ink); border-radius: 24px; padding: 1.4rem; width: min(560px, 100%); max-height: 92vh; overflow-y: auto; box-shadow: 0 24px 60px rgba(0,0,0,.4); animation: modal-in .18s ease-out; }
@keyframes modal-in { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.steppers { display: grid; gap: .35rem; margin: .6rem 0; }
.stepper { display: grid; grid-template-columns: 2rem auto 2rem auto; align-items: center; gap: .5rem; justify-content: start; }
.stepper b { min-width: 1.4rem; text-align: center; font-family: var(--display); }
.sicon { font-size: 1.2rem; }
.trade-section { border-top: 1px solid var(--line); padding-top: .7rem; margin-top: .7rem; }
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: .6rem; }
.res-buttons { display: flex; gap: .35rem; flex-wrap: wrap; }
.btn.res-btn { display: grid; justify-items: center; gap: .1rem; min-width: 66px; font-size: 1.2rem; padding: .35rem .5rem; border-radius: var(--r-card); }
.res-btn span { font: 600 .74rem var(--body); color: var(--ink-2); }
.btn.res-btn.selected { border-color: var(--sun); box-shadow: 0 0 0 3px rgba(255, 178, 26, .45); }
.big-icons { font-size: 1.4rem; }
.die-row { display: flex; gap: .5rem; flex-wrap: wrap; margin: .8rem 0 1rem; }
.die-btn { background: none; border: none; padding: .2rem; cursor: pointer; border-radius: 12px; }
.die-btn .die-face { width: 52px; height: 52px; border-radius: 12px; }
.die-btn:hover .die-face { transform: translateY(-3px); }
.gameover { text-align: center; }
.trophy { font-size: 3rem; }
.results { width: 100%; border-collapse: collapse; margin: .6rem 0 1rem; }
.results th, .results td { padding: .4rem; border-bottom: 1px solid var(--line); text-align: left; }
.histogram { display: flex; align-items: flex-end; gap: 4px; height: 90px; margin-bottom: 1rem; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.bar span { width: 100%; background: var(--sea-500); border-radius: 4px 4px 0 0; min-height: 2px; }
.bar small { color: var(--ink-2); font-size: .7rem; }
.rules p { margin: .5rem 0; }
.rule-cards { padding-left: 1.1rem; }
.costs { border-collapse: collapse; margin: .5rem 0; }
.costs td { padding: .25rem .6rem .25rem 0; }

/* ---------- toasts & floating effects ---------- */
#toast-root { position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%); display: grid; gap: .4rem; z-index: 60; width: max-content; max-width: calc(100vw - 2rem); }
.toast { background: var(--foam); color: var(--ink); padding: .65rem 1.1rem; border-radius: 99px; box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: opacity .4s; font-weight: 700; text-align: center; }
.toast.error { background: #fde3e1; color: #8f1f19; }
.toast.reward { background: var(--sun); color: var(--sun-ink); }
.toast.event { background: var(--ember); color: #ffd2a6; }
.toast.hide { opacity: 0; }
#fx-root { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 70; }
.float { position: absolute; transform: translate(-50%, -50%); pointer-events: none; font-weight: 800; white-space: nowrap; animation: floatHtml 1.8s ease-out forwards; }
.float-gain { color: #16794a; font: 700 1.1rem var(--display); text-shadow: 0 1px 0 #fff; }
.float-reaction { font-size: 2.2rem; }
@keyframes floatHtml { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -60%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -260%) scale(1); } }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .game { grid-template-columns: 220px minmax(0, 1fr) 300px; }
}
@media (max-width: 980px) {
  .game { grid-template-columns: 1fr; }
  .board-area { position: static; order: 1; }
  .side-panel { order: 2; }
  .players-panel { order: 3; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .board-frame { max-height: none; }
  .lobby, .play-layout { grid-template-columns: 1fr; }
  .chat-card { position: static; height: 420px; }
  .mode-pair, .steps { grid-template-columns: 1fr; }
  .packs { grid-template-columns: repeat(2, 1fr); }
  .profile-stats { margin-left: 0; }
}
@media (max-width: 720px) {
  .topbar { gap: .5rem; flex-wrap: wrap; }
  .nav-links { order: 3; flex-basis: 100%; overflow-x: auto; }
  .nav-tools { margin-left: auto; gap: .35rem; }
  .nav-account { gap: .25rem; }
  .nav-account .nav-link { padding: .35rem .5rem; }
  .nav-account .btn.small { padding-inline: .75rem; }
  .nav-user span { display: none; }
  .lang-select { padding: .25rem .3rem; font-size: .8rem; }
  .table-row { grid-template-columns: auto 1fr auto; }
  .table-row .seats { display: none; }
  .item-card.wide { grid-template-columns: 1fr; }
  .item-card.wide .item-preview { grid-row: auto; min-height: 120px; }
  .setting { grid-template-columns: 1fr; gap: .2rem; }
  .trade-cols { grid-template-columns: 1fr; }
  .lb-list li { grid-template-columns: 2rem auto 1fr auto 2.8rem; }
  .lb-games { display: none; }
  .play-buttons { grid-template-columns: 1fr; }
  .code-join { grid-template-columns: 1fr auto; }
  .code-join > span { grid-column: 1 / -1; }
  .die-face.big { width: 64px; height: 64px; }
}
@media (max-width: 460px) {
  .packs { grid-template-columns: 1fr; }
  .brand span { display: none; }
  .react-btn { font-size: 1.1rem; padding: .1rem .35rem; }
  .reaction-bar { gap: .2rem; }
}
@media (pointer: coarse) {
  .target-vertex { r: 13px; }
  .btn.tiny { padding: .35rem .7rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
