:root {
  --ink: #19242C;
  --muted: #64747E;
  --paper: #FFFEFC;
  --panel: rgba(255, 255, 255, .86);
  --panel-solid: #FFFFFF;
  --soft: #EEF3F4;
  --line: #CCD9DD;
  --shadow: 0 18px 54px rgba(21, 35, 44, .12);
  --header: rgba(252, 253, 253, .88);
  --accent: #73509A;
  --accent-strong: #58357F;
  --accent-soft: #EEE4F3;
  --accent-contrast: #FFFFFF;
  --success: #238668;
  --danger: #BC4D4D;
  --warning: #AF741E;
  --radius: 22px;
  color-scheme: light;
}

html[data-social-game="dixit"] {
  --accent: #7C4F98;
  --accent-strong: #5A357C;
  --accent-soft: #F1E6F1;
  --page-a: #F8F0F7;
  --page-b: #EEF4F4;
  --glow-a: rgba(154, 91, 149, .18);
  --glow-b: rgba(57, 112, 130, .12);
}

html[data-social-game="catan"] {
  --accent: #B65632;
  --accent-strong: #8B3F27;
  --accent-soft: #F9E8D7;
  --page-a: #FAF3E8;
  --page-b: #EEF4EF;
  --glow-a: rgba(199, 92, 48, .17);
  --glow-b: rgba(46, 123, 113, .13);
}

html[data-social-game="codenames"] {
  --accent: #286D99;
  --accent-strong: #174C70;
  --accent-soft: #E0EDF4;
  --page-a: #EFF5F8;
  --page-b: #F7F2EC;
  --glow-a: rgba(36, 113, 160, .16);
  --glow-b: rgba(190, 63, 51, .12);
}

html[data-social-game="coup"] {
  --accent: #A34F2C;
  --accent-strong: #71351F;
  --accent-soft: #F3E4D6;
  --page-a: #F8F1E7;
  --page-b: #EEE8DD;
  --glow-a: rgba(151, 70, 34, .16);
  --glow-b: rgba(59, 77, 72, .11);
}

html[data-social-game="wavelength"] {
  --accent: #B3476B;
  --accent-strong: #84304F;
  --accent-soft: #F7DFE7;
  --page-a: #FCF1E9;
  --page-b: #EDF5F1;
  --glow-a: rgba(190, 70, 107, .18);
  --glow-b: rgba(224, 174, 66, .14);
}

:root[data-theme="dark"] {
  --ink: #EDF3F4;
  --muted: #A7B5BA;
  --paper: #11191E;
  --panel: rgba(25, 36, 43, .9);
  --panel-solid: #19242B;
  --soft: #233139;
  --line: #40525B;
  --shadow: 0 22px 64px rgba(0, 0, 0, .34);
  --header: rgba(17, 25, 30, .9);
  --success: #62CFA7;
  --danger: #F08A84;
  --warning: #EDB75C;
  color-scheme: dark;
}

:root[data-theme="dark"][data-social-game="dixit"] {
  --accent: #D39ACB;
  --accent-strong: #B97AAF;
  --accent-soft: #372C40;
  --page-a: #17131C;
  --page-b: #101A1D;
  --glow-a: rgba(192, 117, 184, .17);
  --glow-b: rgba(89, 151, 166, .1);
}

:root[data-theme="dark"][data-social-game="catan"] {
  --accent: #F0A064;
  --accent-strong: #DC8250;
  --accent-soft: #3C2C23;
  --page-a: #19140F;
  --page-b: #111A18;
  --glow-a: rgba(218, 119, 66, .16);
  --glow-b: rgba(73, 149, 133, .1);
}

:root[data-theme="dark"][data-social-game="codenames"] {
  --accent: #75BCE8;
  --accent-strong: #A8D9F4;
  --accent-soft: #203849;
  --page-a: #101820;
  --page-b: #17191B;
  --glow-a: rgba(63, 149, 201, .15);
  --glow-b: rgba(209, 88, 76, .09);
}

:root[data-theme="dark"][data-social-game="coup"] {
  --accent: #E69A6A;
  --accent-strong: #F2BD91;
  --accent-soft: #402D22;
  --page-a: #19130F;
  --page-b: #121816;
  --glow-a: rgba(204, 104, 56, .14);
  --glow-b: rgba(91, 126, 116, .08);
}

:root[data-theme="dark"][data-social-game="wavelength"] {
  --accent: #ED8DAD;
  --accent-strong: #FFC0D3;
  --accent-soft: #472938;
  --page-a: #1B1118;
  --page-b: #121C1B;
  --glow-a: rgba(204, 74, 115, .17);
  --glow-b: rgba(226, 177, 71, .09);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100%; margin: 0; overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 2%, var(--glow-a), transparent 31rem),
    radial-gradient(circle at 94% 18%, var(--glow-b), transparent 27rem),
    linear-gradient(145deg, var(--page-a), var(--page-b));
  font-family: "Avenir Next", "Trebuchet MS", sans-serif;
  font-weight: 600;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: .27;
  background-image:
    linear-gradient(rgba(91, 113, 122, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(91, 113, 122, .08) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, #000 0 58%, transparent 94%);
}

.site-header {
  position: sticky; z-index: 100; top: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  background: var(--header); backdrop-filter: blur(18px) saturate(1.15);
}

.header-inner {
  width: min(100% - 32px, 1260px); min-height: 70px; margin: auto;
  display: grid; grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 1fr);
  align-items: center; gap: 18px;
}

body.is-social-game-active .header-inner {
  min-height: 52px; grid-template-columns: minmax(0, 1fr) auto; gap: 10px;
}
body.is-social-game-active .primary-nav { display: none; }
body.is-social-game-active .game-switcher { min-height: 44px; padding-block: 4px; }
body.is-social-game-active .brand-game-icon { width: 27px; height: 27px; }
body.is-social-game-active .icon-button,
body.is-social-game-active .account-button { min-height: 44px; height: 44px; }
body.is-social-game-active .icon-button { width: 44px; padding: 10px; }
body.is-social-game-active .app-shell {
  min-height: calc(100dvh - 53px); padding-top: 10px; padding-bottom: 28px;
}

.game-menu { position: relative; justify-self: start; }
.game-switcher, .account-button, .icon-button {
  border: 1px solid var(--line); background: var(--panel); box-shadow: 0 5px 18px rgba(18, 32, 41, .07);
}
.game-switcher, .account-button, .primary-nav a, .button, .choice,
.directory-tabs button, .room-card, .lobby-seat {
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease,
    box-shadow 180ms ease, opacity 160ms ease, transform 180ms cubic-bezier(.2, .8, .2, 1);
}
.game-switcher {
  width: fit-content; max-width: 100%; min-height: 42px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 8px 5px 6px; border-radius: 13px; cursor: pointer;
  color: var(--ink); background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
  box-shadow: 0 1px 2px rgba(20, 35, 45, .05);
  font-size: 17px; font-weight: 900; letter-spacing: -.035em;
}
.game-switcher:hover,
.game-switcher[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: var(--panel-solid);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--ink) 9%, transparent);
}
.brand-game-icon {
  width: 29px; height: 29px; display: grid; place-items: center;
  overflow: hidden; flex: none; border-radius: 9px;
  box-shadow: 0 5px 14px color-mix(in srgb, var(--accent) 22%, transparent);
}
.brand-game-icon img { width: 100%; height: 100%; display: block; border-radius: inherit; }
.game-switcher .brand-text {
  width: max-content; min-width: 0; max-width: 100%; overflow: hidden;
  white-space: nowrap; text-align: left; text-overflow: ellipsis;
}
.game-menu-chevron {
  width: 14px; height: 14px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform 150ms ease;
}
.game-switcher[aria-expanded="true"] .game-menu-chevron { transform: rotate(180deg); }

.game-dropdown {
  position: absolute; z-index: 120; top: calc(100% + 8px); left: 0;
  width: min(300px, calc(100vw - 24px)); padding: 9px;
  border: 1px solid var(--line); border-radius: 15px;
  background: var(--panel-solid); box-shadow: 0 18px 45px color-mix(in srgb, var(--ink) 18%, transparent);
  opacity: 1; isolation: isolate; -webkit-backdrop-filter: none; backdrop-filter: none;
}
.game-dropdown:not([hidden]) { animation: social-menu-in 170ms cubic-bezier(.2, .8, .2, 1) both; }
.game-dropdown-label {
  padding: 5px 8px 7px; color: var(--muted);
  font-size: 10px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase;
}
.game-dropdown-list { display: grid; gap: 2px; }
.game-dropdown-divider { height: 1px; margin: 8px 4px; background: var(--line); }
.game-dropdown-item {
  min-width: 0; display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center; gap: 9px; padding: 7px 8px;
  border-radius: 10px; color: var(--ink); text-decoration: none;
}
.game-dropdown-item:hover,
.game-dropdown-item:focus-visible {
  color: var(--ink); background: var(--soft); outline: none;
}
.game-dropdown-more { border: 1px solid var(--line); background: var(--soft); }
.game-dropdown-more:hover,
.game-dropdown-more:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
}
.game-dropdown-icon {
  width: 28px; height: 28px; display: grid; place-items: center;
  overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  border-radius: 8px; color: var(--muted); background: var(--panel-solid);
}
.game-dropdown-icon svg { width: 17px; height: 17px; }
.game-dropdown-icon img { width: 100%; height: 100%; display: block; border-radius: inherit; }
.game-dropdown-copy { min-width: 0; display: grid; gap: 1px; }
.game-dropdown-copy strong {
  overflow: hidden; font-size: 13px; font-weight: 900;
  text-overflow: ellipsis; white-space: nowrap;
}
.game-dropdown-copy small {
  overflow: hidden; color: var(--muted); font-size: 10px; font-weight: 650;
  text-overflow: ellipsis; white-space: nowrap;
}
.game-current-indicator {
  display: none; padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 999px; color: var(--accent-strong); background: var(--accent-soft);
  font-size: 7px; font-weight: 950; letter-spacing: .07em;
  line-height: 1.1; text-transform: uppercase; white-space: nowrap;
}
.game-dropdown-item[aria-current="page"] .game-current-indicator { display: inline-flex; }
.game-dropdown-arrow {
  width: 17px; height: 17px; fill: none; stroke: var(--muted);
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.primary-nav {
  display: flex; align-items: center; padding: 4px;
  border: 1px solid var(--line); border-radius: 15px; background: var(--soft);
}
.primary-nav a {
  min-height: 40px; display: grid; place-items: center; padding: 7px 18px;
  border-radius: 11px; color: var(--muted); text-decoration: none;
  font-size: 13px; font-weight: 900;
}
.primary-nav a[aria-current="page"] {
  color: var(--accent-strong); background: var(--panel-solid);
  box-shadow: 0 3px 12px rgba(19, 32, 40, .09);
}

.header-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.icon-button {
  width: 44px; height: 44px; display: grid; place-items: center; padding: 10px;
  overflow: hidden; border-radius: 13px; cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease,
    box-shadow 180ms ease, transform 180ms ease;
}
.icon-button svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.theme-icon { position: relative; width: 22px; height: 22px; display: block; }
.theme-icon svg {
  position: absolute; inset: 0; margin: auto;
  transition: opacity 180ms ease, transform 240ms cubic-bezier(.2, .8, .2, 1);
}
.theme-icon .sun-icon { opacity: 0; transform: rotate(-35deg) scale(.58); }
#theme-toggle[data-theme-resolved="dark"] {
  color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  background: var(--accent-soft);
}
#theme-toggle[data-theme-resolved="dark"] .moon-icon { opacity: 0; transform: rotate(28deg) scale(.58); }
#theme-toggle[data-theme-resolved="dark"] .sun-icon { opacity: 1; transform: rotate(0) scale(1); }
#theme-toggle:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(18, 32, 41, .12); }
#theme-toggle:active { transform: translateY(0) scale(.96); }
.account-button {
  min-height: 44px; max-width: 180px; padding: 8px 14px; overflow: hidden;
  border-radius: 13px; cursor: pointer; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 900;
}

.app-shell { width: min(100% - 32px, 1260px); min-height: calc(100dvh - 71px); margin: 0 auto; padding: 34px 0 72px; }
.app-shell:focus { outline: none; }

.page-head {
  display: flex; align-items: end; justify-content: space-between; gap: 28px;
  margin-bottom: 24px;
}
.eyebrow {
  margin-bottom: 7px; color: var(--accent-strong); font-size: 11px; font-weight: 950;
  letter-spacing: .16em; text-transform: uppercase;
}
.page-head h1, .hero h1 {
  margin: 0; font-size: clamp(38px, 6vw, 68px); line-height: .94;
  letter-spacing: -.055em; font-weight: 950;
}
.page-head p, .hero p { max-width: 650px; margin: 10px 0 0; color: var(--muted); font-size: 16px; line-height: 1.45; }

.button {
  min-height: 46px; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 10px 17px; border: 1px solid var(--line); border-radius: 13px;
  color: var(--ink); background: var(--panel-solid); cursor: pointer;
  text-decoration: none; font-weight: 900; line-height: 1.1;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button.primary { color: var(--accent-contrast); border-color: var(--accent-strong); background: var(--accent-strong); }
:root[data-theme="dark"] .button.primary { color: #17131A; }
html[data-social-game="catan"][data-theme="dark"] .button.primary { color: #21130C; }
.button.soft { color: var(--accent-strong); border-color: transparent; background: var(--accent-soft); }
.button.danger { color: var(--danger); }
.button.small { min-height: 38px; padding: 7px 12px; border-radius: 10px; font-size: 12px; }
.button:disabled { opacity: .46; cursor: not-allowed; transform: none; }
.button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

.panel {
  min-width: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(16px);
}
.panel-body { padding: 24px; }
.panel-title { margin: 0; font-size: 22px; line-height: 1.05; letter-spacing: -.035em; font-weight: 950; }
.panel-sub { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

.lobby-grid { display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: 18px; align-items: start; }
.create-panel { position: sticky; top: 94px; }
.create-form { display: grid; gap: 17px; margin-top: 22px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span, .field legend { font-size: 12px; font-weight: 900; }
.field small { color: var(--muted); font-size: 11px; }
.text-input, .select-input {
  width: 100%; min-height: 48px; padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 12px; color: var(--ink);
  background: var(--soft); outline: none;
}
.text-input:focus, .select-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.choice-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.choice {
  position: relative; min-height: 76px; display: grid; align-content: center; gap: 2px;
  padding: 12px 13px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--soft); cursor: pointer;
}
.choice input { position: absolute; opacity: 0; }
.choice strong { font-size: 14px; }
.choice small { color: var(--muted); font-size: 10px; line-height: 1.25; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.choice:has(input:disabled) { opacity: .48; cursor: not-allowed; }
.rating-mode-field { margin: 0; padding: 0; border: 0; }
.rating-mode-choices { align-items: stretch; }
.rating-mode-choice {
  min-height: 86px; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  align-content: center; column-gap: 9px;
}
.rating-mode-choice > span:first-of-type { min-width: 0; display: grid; gap: 2px; }
.rating-mode-state {
  max-width: 110px; padding: 5px 7px; overflow: hidden; border-radius: 999px;
  color: var(--muted); background: var(--panel-solid); font-size: 9px; font-weight: 900;
  line-height: 1.15; text-align: center; text-overflow: ellipsis; white-space: nowrap;
}
.rating-mode-choice:has(input:checked) .rating-mode-state {
  color: var(--accent-strong); background: color-mix(in srgb, var(--panel-solid) 70%, var(--accent-soft));
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.create-submit { width: 100%; }

.directory-panel { overflow: hidden; }
.directory-heading {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 22px; border-bottom: 1px solid var(--line);
}
.directory-tabs { display: flex; gap: 6px; }
.directory-tabs button {
  min-height: 36px; padding: 6px 11px; border: 0; border-radius: 9px;
  color: var(--muted); background: transparent; cursor: pointer; font-size: 11px; font-weight: 900;
}
.directory-tabs button[aria-selected="true"] { color: var(--accent-strong); background: var(--accent-soft); }
.room-list { display: grid; gap: 10px; padding: 12px; }
.room-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 13px;
  align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: 15px;
  background: var(--panel-solid);
}
.room-card:hover { border-color: color-mix(in srgb, var(--accent) 34%, var(--line)); box-shadow: 0 10px 28px rgba(19, 32, 40, .08); }
.room-card h3 { margin: 0; overflow-wrap: anywhere; font-size: 15px; }
.room-meta { display: flex; flex-wrap: wrap; gap: 6px 11px; margin-top: 6px; color: var(--muted); font-size: 10px; font-weight: 800; }
.room-people { margin-top: 7px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.empty-state { min-height: 250px; display: grid; place-items: center; padding: 34px; text-align: center; }
.empty-state svg { width: 48px; margin-bottom: 12px; fill: none; stroke: var(--accent); stroke-width: 1.8; }
.empty-state h3 { margin: 0; font-size: 18px; }
.empty-state p { max-width: 360px; margin: 6px 0 0; color: var(--muted); font-size: 12px; }

.join-view { width: min(100%, 660px); margin: 6vh auto 0; }
.join-card { overflow: hidden; }
.join-art {
  min-height: 190px; padding: 24px; display: flex; flex-direction: column; justify-content: end;
  color: #fff; background:
    linear-gradient(to top, rgba(20, 20, 28, .82), transparent),
    var(--join-image) center/cover;
}
.join-art h1 { margin: 0; font-size: clamp(34px, 8vw, 56px); line-height: .95; letter-spacing: -.05em; }
.join-body { padding: 22px; }
.join-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 5px 9px;
  border-radius: 999px; color: var(--muted); background: var(--soft);
  font-size: 10px; font-weight: 900; letter-spacing: .02em;
}
.pill.live { color: var(--success); }
.pill.rated { color: var(--accent-strong); background: var(--accent-soft); }
.join-actions { display: flex; gap: 9px; margin-top: 15px; }

.table-view { display: grid; gap: 14px; }
.table-banner {
  position: relative; min-height: 148px; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  align-items: end; gap: 24px; overflow: hidden; padding: 25px;
  border-radius: 24px; color: #fff; box-shadow: var(--shadow);
  background: linear-gradient(120deg, var(--accent-strong), color-mix(in srgb, var(--accent) 68%, #1E6E75));
}
.table-banner::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 88% 22%, rgba(255,255,255,.18), transparent 18rem),
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: auto, 30px 30px, 30px 30px;
}
.banner-copy, .banner-tools { position: relative; z-index: 1; min-width: 0; }
.banner-kicker { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
.table-banner .pill { color: #fff; background: rgba(14, 23, 29, .2); border: 1px solid rgba(255,255,255,.18); }
.table-banner h1 { margin: 0; overflow-wrap: anywhere; font-size: clamp(30px, 5vw, 48px); line-height: .96; letter-spacing: -.045em; }
.table-banner p { margin: 8px 0 0; color: rgba(255,255,255,.82); font-size: 12px; }
.banner-tools { display: flex; gap: 8px; align-items: center; }
.banner-tools .button { border-color: rgba(255,255,255,.24); color: #fff; background: rgba(19, 27, 33, .22); }

.table-banner.multiplayer-matchbar {
  min-height: 72px; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
  gap: 14px; padding: 11px 14px; border-radius: 18px;
}
body.is-social-game-active .table-view { gap: 10px; }
body.is-social-game-active .table-banner.multiplayer-matchbar {
  min-height: 62px; padding: 8px 11px; border-radius: 16px;
}
.table-banner.multiplayer-matchbar .banner-copy {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "kicker title" "kicker meta"; align-items: center;
  gap: 2px 13px;
}
.table-banner.multiplayer-matchbar .banner-kicker { grid-area: kicker; gap: 5px; margin: 0; }
.table-banner.multiplayer-matchbar .pill { min-height: 22px; padding: 3px 7px; font-size: 9px; }
.table-banner.multiplayer-matchbar h1 {
  grid-area: title; min-width: 0; overflow: hidden; font-size: clamp(19px, 2.25vw, 27px);
  line-height: 1.04; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap;
}
.table-banner.multiplayer-matchbar p { grid-area: meta; margin: 0; font-size: 10px; }
.multiplayer-matchbar .button.small { min-height: 44px; padding: 9px 11px; }
.match-home span, .match-share span { white-space: nowrap; }

.score-strip {
  display: grid; grid-template-columns: repeat(var(--seat-count, 4), minmax(0, 1fr));
  overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--panel-solid); box-shadow: var(--shadow);
}
.score-seat {
  min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 8px; padding: 9px 11px; border-right: 1px solid var(--line);
}
.score-seat:last-child { border-right: 0; }
.seat-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--seat-color); box-shadow: 0 0 0 4px color-mix(in srgb, var(--seat-color) 17%, transparent); }
.table-player-identity { display: inline-flex; align-items: center; gap: 5px; vertical-align: baseline; white-space: nowrap; }
.table-player-identity-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--seat-color); box-shadow: 0 0 0 2px color-mix(in srgb, var(--seat-color) 18%, transparent); }
.table-player-identity strong { color: color-mix(in srgb, var(--seat-color) 76%, var(--ink)); }
:root[data-theme="dark"] .table-player-identity strong { color: color-mix(in srgb, var(--seat-color) 74%, white); }
.seat-copy { min-width: 0; }
.seat-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 950; }
.seat-status { display: block; margin-top: 1px; color: var(--muted); font-size: 8px; font-weight: 800; }
.seat-score { font-size: 20px; font-weight: 950; letter-spacing: -.04em; }
.score-seat.is-current { background: var(--accent-soft); }
.score-seat.is-disconnected { opacity: .58; }

.lobby-table { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .6fr); gap: 14px; }
.seat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.lobby-seat {
  min-height: 92px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 11px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft);
}
.lobby-seat.empty { grid-template-columns: 1fr; place-items: center; border-style: dashed; color: var(--muted); text-align: center; }
.avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: var(--seat-color, var(--accent)); font-weight: 950; }
.lobby-seat strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.lobby-seat small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.ready-mark { color: var(--success); font-size: 10px; font-weight: 950; }
.lobby-controls { display: grid; gap: 10px; margin-top: 18px; }
.host-settings { display: grid; gap: 12px; }
.settings-line { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 13px; padding-bottom: 11px; border-bottom: 1px solid var(--line); }
.settings-line:last-child { padding-bottom: 0; border: 0; }
.settings-line strong { display: block; font-size: 12px; }
.settings-line small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.settings-line select { min-width: 110px; min-height: 40px; }
.catan-color-picker {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 13px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--soft);
}
.catan-color-picker > span strong { display: block; font-size: 12px; }
.catan-color-picker > span small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.catan-color-picker [role="radiogroup"] { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.catan-color {
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid color-mix(in srgb, var(--swatch) 72%, #18262d);
  border-radius: 10px; background: color-mix(in srgb, var(--swatch) 18%, var(--panel-solid)); cursor: pointer;
  transition: opacity 150ms ease, transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.catan-color span { width: 23px; height: 23px; border-radius: 7px; background: var(--swatch); box-shadow: inset 0 1px 1px rgba(255,255,255,.35); }
.catan-color:hover:not(:disabled), .catan-color:focus-visible { outline: none; transform: translateY(-1px); }
.catan-color.is-selected { border-color: var(--ink); box-shadow: 0 0 0 2px var(--panel-solid), 0 0 0 4px var(--swatch); }
.catan-color:disabled { opacity: .22; cursor: not-allowed; }
.invite-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px; border-radius: 13px; background: var(--accent-soft); }
.invite-code-copy { min-width: 0; display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 8px; row-gap: 3px; }
.invite-code code { flex: none; color: var(--accent-strong); font: 950 18px/1 "Avenir Next", sans-serif; letter-spacing: .14em; white-space: nowrap; }

.dixit-stage { padding: 18px; }
.dixit-table .dixit-stage { overflow: hidden; }
.phase-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.phase-head h2 { margin: 0; font-size: clamp(22px, 4vw, 34px); line-height: 1; letter-spacing: -.04em; }
.phase-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.clue-display {
  min-height: 76px; display: grid; place-items: center; padding: 14px 20px; margin-bottom: 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 16px;
  color: var(--accent-strong); background: var(--accent-soft); text-align: center;
  font-size: clamp(22px, 4vw, 34px); font-weight: 900; letter-spacing: -.025em;
}
.dixit-cards { display: grid; grid-template-columns: repeat(var(--card-count, 5), minmax(0, 1fr)); gap: 11px; align-items: start; }
.dixit-card {
  position: relative; min-width: 0; padding: 0; overflow: hidden;
  border: 4px solid transparent; border-radius: 16px; background: #121720;
  box-shadow: 0 9px 24px rgba(13, 20, 28, .2); cursor: pointer;
  isolation: isolate;
  transition: transform 220ms cubic-bezier(.2, .8, .2, 1), border-color 180ms ease,
    box-shadow 220ms ease, filter 180ms ease;
}
.dixit-card::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  opacity: 0; border-radius: 11px;
  background: linear-gradient(118deg, transparent 30%, rgba(255,255,255,.22) 48%, transparent 66%);
  transform: translateX(-115%); transition: opacity 180ms ease, transform 420ms ease;
}
.dixit-card:hover { transform: translateY(-4px) scale(1.012); }
.dixit-card:hover::after { opacity: .78; transform: translateX(115%); }
.dixit-card.is-selected {
  z-index: 3;
  border-color: var(--accent-strong);
  transform: translateY(-8px) scale(1.025);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 24%, transparent),
    0 18px 34px color-mix(in srgb, var(--accent) 35%, rgba(13, 20, 28, .2));
}
.dixit-card.is-selected img { filter: saturate(1.08) contrast(1.04); }
.dixit-cards.has-selection .dixit-card.is-selectable:not(.is-selected) {
  opacity: .7;
  filter: saturate(.76) brightness(.9);
  transform: scale(.975);
}
.dixit-card.is-unavailable {
  opacity: .46;
  filter: saturate(.62) brightness(.82);
}
.dixit-card:disabled { cursor: default; }
.dixit-card:disabled:hover { transform: none; }
.dixit-card img { width: 100%; aspect-ratio: 3/4; display: block; object-fit: cover; }
.dixit-preview-modal {
  width: min(100%, 680px); overflow: hidden;
}
.dixit-preview-modal .modal-head { align-items: center; padding: 14px 16px 10px; }
.dixit-preview-modal .modal-head h2 { font-size: 18px; }
.dixit-preview-modal .modal-body { min-height: 0; padding: 0 16px 16px; }
.dixit-card-preview { min-height: 0; display: grid; justify-items: center; gap: 13px; }
.dixit-card-preview-frame {
  width: min(100%, 500px); max-height: calc(100dvh - 180px); overflow: hidden;
  border: 1px solid rgba(255,255,255,.16); border-radius: 18px; background: #111720;
  box-shadow: 0 18px 46px rgba(8,12,19,.28);
}
.dixit-card-preview-frame img {
  width: 100%; max-height: calc(100dvh - 180px); aspect-ratio: 3/4; display: block;
  object-fit: contain; user-select: none; -webkit-user-drag: none;
}
.dixit-preview-actions { width: min(100%, 500px); display: grid; }
.dixit-preview-select { width: 100%; min-height: 50px; }
.card-number {
  position: absolute; z-index: 4; top: 8px; left: 8px;
  min-width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.28); border-radius: 50%;
  color: #fff; background: rgba(14,20,28,.78); font-size: 14px; font-weight: 950;
  backdrop-filter: blur(8px);
}
.card-selection-mark,
.card-result-badge {
  position: absolute; z-index: 5; top: 8px; right: 8px;
  display: inline-flex; align-items: center; gap: 5px; min-height: 32px;
  padding: 6px 9px; border: 1px solid rgba(255,255,255,.34); border-radius: 999px;
  color: #fff; background: color-mix(in srgb, var(--accent-strong) 90%, #111927);
  box-shadow: 0 6px 16px rgba(10,14,22,.26); backdrop-filter: blur(9px);
  font-size: 11px; font-weight: 950; line-height: 1; white-space: nowrap;
}
.card-selection-mark {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-5px) scale(.92);
  transition: opacity 150ms ease, transform 220ms cubic-bezier(.2,.82,.2,1);
}
.card-selection-mark svg,
.card-result-badge svg { width: 14px; height: 14px; flex: none; }
.dixit-card.is-selected .card-selection-mark {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.card-result-badge {
  border-color: color-mix(in srgb, var(--success) 44%, #fff);
  background: color-mix(in srgb, var(--success) 90%, #0C2720);
}
.card-owner {
  position: absolute; z-index: 4; inset: auto 8px 8px; display: grid; gap: 5px;
  padding: 10px 11px; border: 1px solid rgba(255,255,255,.17); border-radius: 11px;
  color: #fff; background: rgba(9,15,22,.86); backdrop-filter: blur(8px); text-align: left;
}
.card-owner strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.15; }
.card-owner span { font-size: 10px; line-height: 1.25; color: rgba(255,255,255,.84); }
.dixit-result-callout {
  display: flex; align-items: center; gap: 10px; min-height: 58px;
  margin: -3px 0 13px; padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--success) 48%, var(--line));
  border-radius: 14px; color: var(--ink);
  background: color-mix(in srgb, var(--success) 12%, var(--panel-solid));
}
.dixit-result-check {
  width: 36px; height: 36px; display: grid; flex: none; place-items: center;
  border-radius: 11px; color: #fff; background: var(--success);
  box-shadow: 0 7px 16px color-mix(in srgb, var(--success) 22%, transparent);
}
.dixit-result-check svg { width: 18px; height: 18px; }
.dixit-result-callout > span:nth-child(2) { display: grid; gap: 1px; }
.dixit-result-callout small {
  color: var(--muted); font-size: 9px; font-style: normal; font-weight: 850;
  letter-spacing: .08em; text-transform: uppercase;
}
.dixit-result-callout strong { font-size: 16px; line-height: 1.05; }
.dixit-result-callout em {
  min-width: 0; margin-left: auto; overflow: hidden; color: var(--success);
  font-size: 12px; font-style: normal; font-weight: 900; text-overflow: ellipsis; white-space: nowrap;
}
.dixit-table[data-dixit-phase="round_result"] .dixit-card:not(.is-story-card) img {
  filter: saturate(.72) brightness(.74);
}
.dixit-table[data-dixit-phase="round_result"] .dixit-card.is-story-card {
  z-index: 3;
  border-color: var(--success);
  transform: translateY(-7px) scale(1.018);
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--success) 24%, transparent),
    0 20px 38px color-mix(in srgb, var(--success) 30%, rgba(13,20,28,.22));
}
.dixit-table[data-dixit-phase="round_result"] .dixit-card.is-story-card:hover {
  transform: translateY(-7px) scale(1.018);
}
.story-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; margin-top: 15px; }
.story-form .text-input { background: var(--panel-solid); }
.waiting-orb { min-height: 360px; display: grid; place-items: center; text-align: center; }
.waiting-orb-inner { position: relative; isolation: isolate; width: min(70vw, 250px); aspect-ratio: 1; display: grid; place-items: center; padding: 24px; border-radius: 50%; color: #fff; background: radial-gradient(circle at 35% 28%, color-mix(in srgb, var(--accent) 78%, #fff), var(--accent-strong)); box-shadow: 0 24px 70px color-mix(in srgb, var(--accent) 24%, transparent); animation: dixit-orb-float 3.6s ease-in-out infinite; }
.waiting-orb-inner::before { content: ""; position: absolute; z-index: -1; inset: -12px; border: 1px solid color-mix(in srgb, var(--accent) 44%, transparent); border-radius: inherit; animation: dixit-orb-ring 3.6s ease-in-out infinite; }
.waiting-orb-inner > div { position: relative; z-index: 1; }
.waiting-orb strong { display: block; font-size: 22px; line-height: 1.05; }
.waiting-orb span { display: block; margin-top: 8px; color: rgba(255,255,255,.76); font-size: 10px; }
.round-points { display: flex; flex-wrap: wrap; gap: 7px; margin: 13px 0; }
.point-chip { padding: 7px 10px; border-radius: 999px; background: var(--soft); font-size: 10px; font-weight: 900; }
.point-chip strong { color: var(--accent-strong); }
.round-footer { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 15px; padding-top: 15px; border-top: 1px solid var(--line); }
.round-footer p { margin: 0; color: var(--muted); font-size: 11px; }

.dixit-table:is(.is-table-enter, .is-round-enter) > .table-banner {
  animation: dixit-banner-in 420ms cubic-bezier(.2, .8, .2, 1) both;
}
.dixit-table:is(.is-table-enter, .is-round-enter, .is-phase-enter) .phase-head {
  animation: dixit-copy-in 280ms ease-out both;
}
.dixit-table:is(.is-table-enter, .is-round-enter, .is-phase-enter) .clue-display {
  animation: dixit-clue-in 360ms cubic-bezier(.2, .8, .2, 1) both;
}
.dixit-table:is(.is-table-enter, .is-round-enter, .is-phase-enter) .dixit-card {
  animation: dixit-card-in 420ms cubic-bezier(.16, .84, .28, 1) both;
  animation-delay: calc(var(--card-index, 0) * 45ms);
}
.dixit-table.is-phase-enter[data-dixit-phase="round_result"] .card-owner {
  animation: dixit-label-in 300ms ease-out both;
  animation-delay: calc(180ms + var(--card-index, 0) * 45ms);
}
.dixit-table.is-phase-enter[data-dixit-phase="round_result"] .card-result-badge {
  animation: dixit-result-badge-in 360ms cubic-bezier(.18,.86,.24,1.14) both;
  animation-delay: 220ms;
}
.dixit-table.is-phase-enter[data-dixit-phase="round_result"] .dixit-result-callout {
  animation: dixit-label-in 300ms ease-out both;
}
.dixit-table.is-phase-enter[data-dixit-phase="round_result"] .point-chip {
  animation: dixit-point-in 300ms cubic-bezier(.2, .8, .2, 1) both;
}
.dixit-table.is-phase-enter[data-dixit-phase="round_result"] .point-chip:nth-child(2) { animation-delay: 45ms; }
.dixit-table.is-phase-enter[data-dixit-phase="round_result"] .point-chip:nth-child(3) { animation-delay: 90ms; }
.dixit-table.is-phase-enter[data-dixit-phase="round_result"] .point-chip:nth-child(4) { animation-delay: 135ms; }
.dixit-table.is-phase-enter[data-dixit-phase="round_result"] .point-chip:nth-child(5) { animation-delay: 180ms; }
.dixit-table.is-phase-enter[data-dixit-phase="round_result"] .point-chip:nth-child(6) { animation-delay: 225ms; }
.score-seat { transition: background-color 220ms ease, opacity 220ms ease; }
.score-seat.is-score-up .seat-score { animation: dixit-score-pop 440ms cubic-bezier(.18, .9, .3, 1.35) both; }

@keyframes dixit-banner-in {
  from { transform: translateY(-5px) scale(.996); }
}
@keyframes dixit-copy-in {
  from { opacity: .78; transform: translateY(4px); }
}
@keyframes dixit-clue-in {
  from { opacity: .82; transform: translateY(5px) scale(.992); }
}
@keyframes dixit-card-in {
  from { opacity: .84; transform: translateY(8px) scale(.988); }
}
@keyframes dixit-label-in {
  from { opacity: 0; transform: translateY(8px); }
}
@keyframes dixit-result-badge-in {
  from { opacity: 0; transform: translateY(-6px) scale(.88); }
}
@keyframes dixit-point-in {
  from { opacity: 0; transform: translateY(7px) scale(.94); }
}
@keyframes dixit-score-pop {
  45% { color: var(--accent-strong); transform: translateY(-3px) scale(1.18); }
}
@keyframes dixit-orb-float {
  50% { transform: translateY(-6px); box-shadow: 0 31px 76px color-mix(in srgb, var(--accent) 30%, transparent); }
}
@keyframes dixit-orb-ring {
  50% { opacity: .46; transform: scale(1.035); }
}
@keyframes social-menu-in {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
}

/* Codenames keeps the full word grid visible while team context stays close by. */
.codenames-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 270px); gap: 14px; align-items: start; }
.codenames-stage { min-width: 0; overflow: hidden; padding: clamp(13px, 2vw, 20px); }
.codenames-status { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.codenames-status > div:first-child { min-width: 0; display: flex; align-items: center; gap: 12px; }
.codenames-status-tools { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.codenames-status h2 { margin: 0; overflow-wrap: anywhere; font-size: clamp(18px, 2.4vw, 27px); line-height: 1.05; letter-spacing: -.035em; }
.codenames-status h2.is-bot-thinking { display: flex; align-items: center; gap: 8px; }
.codenames-thinking-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 13%, transparent); animation: codenames-thinking 1.15s ease-in-out infinite; }
.team-signal { width: 12px; height: 44px; flex: 0 0 12px; border-radius: 999px; box-shadow: 0 0 0 4px var(--soft); }
.team-signal.red { background: #C84C43; }
.team-signal.blue { background: #347FB4; }
.codenames-clue { min-width: 130px; display: grid; justify-items: end; padding: 9px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--soft); }
.codenames-clue small, .codenames-clue span { color: var(--muted); font-size: 8px; font-weight: 850; }
.codenames-clue strong { max-width: 220px; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.codenames-clue b { color: var(--accent-strong); }
.codenames-board {
  width: min(100%, 900px, max(300px, calc(162dvh - 432px)));
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: clamp(4px, .75vw, 9px); padding: clamp(7px, 1vw, 11px);
  margin-inline: auto;
  border: 1px solid var(--line); border-radius: 18px;
  background: color-mix(in srgb, var(--soft) 86%, var(--panel-solid));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45); contain: layout paint;
}
.codename-card {
  position: relative; min-width: 0; aspect-ratio: 1.62; display: grid; place-items: center;
  overflow: hidden; padding: 5px; border: 1px solid color-mix(in srgb, var(--line) 70%, #A88962);
  border-radius: clamp(7px, .9vw, 12px); color: #273037;
  background: linear-gradient(155deg, #FFF8E9, #E9DDC8); box-shadow: 0 4px 9px rgba(39,31,24,.1);
  cursor: default; isolation: isolate; transition: border-color 150ms ease, box-shadow 180ms ease, filter 180ms ease, transform 150ms ease;
}
.codename-card::before { content: ""; position: absolute; z-index: -1; inset: 0; opacity: .36; background: linear-gradient(135deg, transparent 0 63%, rgba(74,55,35,.12) 63% 65%, transparent 65%); }
.codename-card span {
  max-width: 100%; overflow-wrap: normal; word-break: normal;
  font-size: clamp(11px, 1.45vw, 15px); font-weight: 950; line-height: 1;
  letter-spacing: -.01em; text-align: center; text-transform: uppercase;
}
.codename-card.is-selectable { cursor: pointer; }
.codename-card.is-selectable:hover, .codename-card.is-selectable:focus-visible { z-index: 1; border-color: var(--accent); outline: none; box-shadow: 0 8px 20px rgba(22,37,46,.18), inset 0 0 0 2px var(--accent); transform: translateY(-2px); }
.codename-card.is-selectable:active { transform: scale(.97); }
.codename-card.role-red { color: #FFF8F4; border-color: #A93D37; background: linear-gradient(145deg, #D9665D, #A93D37); }
.codename-card.role-blue { color: #F5FBFF; border-color: #236792; background: linear-gradient(145deg, #4A98C9, #236792); }
.codename-card.role-bystander { color: #3C342B; border-color: #B79B74; background: linear-gradient(145deg, #E9D7B7, #C5AB82); }
.codename-card.role-assassin { color: #F7F7F4; border-color: #11181C; background: linear-gradient(145deg, #374149, #11181C); }
.codename-card:not(.is-revealed).role-red { color: #7D2924; background: linear-gradient(145deg, #F8E5DF, #EDCBC5); }
.codename-card:not(.is-revealed).role-blue { color: #1E5E85; background: linear-gradient(145deg, #E4F1F8, #C7DFED); }
.codename-card:not(.is-revealed).role-bystander { color: #55483A; background: linear-gradient(145deg, #F6EDDD, #E8D8BD); }
.codename-card:not(.is-revealed).role-assassin { color: #DCE3E6; background: linear-gradient(145deg, #59636A, #353E44); }
.codename-card.is-revealed { box-shadow: inset 0 0 0 2px rgba(255,255,255,.18); }
.codenames-clue-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, .25fr) auto; align-items: end; gap: 9px; margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--soft); }
.codenames-clue-form .compact { max-width: 130px; }
.codenames-clue-form .text-input { min-height: 43px; background: var(--panel-solid); }
.codenames-clue-form .button { min-height: 43px; }
@keyframes codenames-thinking { 50% { opacity: .38; transform: scale(.76); } }
.codenames-turn-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.codenames-turn-actions span { color: var(--muted); font-size: 10px; }
.codenames-teams { position: sticky; top: 84px; display: grid; gap: 10px; padding: 11px; }
.team-roster { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-solid); }
.team-roster > header { display: flex; align-items: end; justify-content: space-between; gap: 8px; padding: 13px; border-bottom: 1px solid var(--line); }
.team-roster > header div { display: flex; align-items: baseline; gap: 8px; }
.team-roster > header span { font-size: 13px; font-weight: 950; }
.team-roster > header strong { font-size: 22px; line-height: 1; }
.team-roster > header small { color: var(--muted); font-size: 8px; }
.team-roster.red.is-active > header { color: #9C342F; background: #FAE3DF; }
.team-roster.blue.is-active > header { color: #1E658F; background: #DDEDF7; }
:root[data-theme="dark"] .team-roster.red.is-active > header { color: #FFAAA2; background: #4B2A2B; }
:root[data-theme="dark"] .team-roster.blue.is-active > header { color: #9FD9F7; background: #243D4D; }
.team-roster > div { display: grid; gap: 1px; }
.team-roster > div > span { display: flex; justify-content: space-between; gap: 8px; padding: 9px 11px; font-size: 10px; font-weight: 900; }
.team-roster > div > span + span { border-top: 1px solid var(--line); }
.team-roster > div small { color: var(--muted); font-size: 8px; }
.codenames-table .seat-score { display: none; }

/* Coup favors a compact table so rivals and the current decision remain visible. */
.coup-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 290px); gap: 14px; align-items: start; }
.coup-stage { min-width: 0; overflow: hidden; padding: clamp(14px, 2vw, 21px); }
.coup-status { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.coup-status h2 { margin: 0; font-size: clamp(19px, 2.5vw, 28px); line-height: 1.04; letter-spacing: -.04em; }
.coup-status-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: none; }
.button.small.coup-guide-button { min-height: 44px; }
.coup-deck { min-width: 80px; display: grid; justify-items: center; padding: 9px 12px; border-radius: 12px; color: var(--accent-strong); background: var(--accent-soft); }
.coup-deck strong { font-size: 22px; line-height: 1; }
.coup-deck span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.coup-declaration { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 12px; margin-bottom: 12px; padding: 11px 13px; border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line)); border-radius: 13px; background: var(--accent-soft); }
.coup-declaration small { grid-row: 1 / span 2; color: var(--muted); font-size: 8px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.coup-declaration strong { font-size: 15px; }
.coup-declaration span { color: var(--muted); font-size: 9px; }
.coup-player-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.coup-player { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); transition: border-color 180ms ease, box-shadow 180ms ease, opacity 180ms ease, transform 180ms ease; }
.coup-player.is-current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 7px 20px rgba(36,28,22,.08); }
.coup-player.is-eliminated { opacity: .52; filter: grayscale(.55); }
.coup-player > header { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.coup-player > header > strong { min-width: 0; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.coup-player > header > b { font-size: 19px; }
.coup-player > header small { color: var(--muted); font-size: 9px; font-weight: 850; }
.influence-row { min-height: 98px; display: flex; gap: 7px; margin-top: 9px; }
.influence-card {
  --role-color: #9A6948;
  position: relative; min-width: 0; min-height: 98px; flex: 1 1 0;
  display: block; overflow: hidden; padding: 0;
  border: 1px solid color-mix(in srgb, var(--role-color) 76%, #241711);
  border-radius: 11px; color: #fff; background: #2D1E1A; text-align: left;
  box-shadow: 0 5px 12px rgba(38,22,14,.18); isolation: isolate;
}
button.influence-card { cursor: pointer; transition: transform 150ms ease, box-shadow 170ms ease, border-color 150ms ease; }
button.influence-card:hover, button.influence-card:focus-visible {
  z-index: 1; outline: none; border-color: color-mix(in srgb, var(--role-color) 72%, #fff);
  box-shadow: 0 9px 22px color-mix(in srgb, var(--role-color) 28%, transparent); transform: translateY(-2px);
}
button.influence-card:active { transform: translateY(0) scale(.98); }
.influence-card.role-duke, .coup-guide-role.role-duke { --role-color: #A94C7A; }
.influence-card.role-assassin, .coup-guide-role.role-assassin { --role-color: #3F819D; }
.influence-card.role-captain, .coup-guide-role.role-captain { --role-color: #28A6A0; }
.influence-card.role-ambassador, .coup-guide-role.role-ambassador { --role-color: #C28B35; }
.influence-card.role-contessa, .coup-guide-role.role-contessa { --role-color: #CD5D72; }
.coup-card-art { position: absolute; z-index: -1; inset: 0; display: block; }
.coup-card-art::after { content: ""; position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, rgba(15,10,13,.92)); }
.coup-card-art img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 18%; }
.coup-card-copy { position: absolute; z-index: 1; inset: auto 7px 7px; display: grid; gap: 1px; }
.coup-card-copy strong { overflow: hidden; color: #fff; font-size: 12px; line-height: 1; text-overflow: ellipsis; white-space: nowrap; }
.coup-card-copy small { overflow: hidden; color: rgba(255,255,255,.76); font-size: 8px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.influence-card.is-hidden { border-color: #9E7249; }
.influence-card.is-hidden .coup-card-art img { object-position: center; }
.influence-card.is-lost { opacity: .64; filter: grayscale(.62); }
.influence-card.is-lost::before {
  content: "Revealed"; position: absolute; z-index: 4; top: 5px; left: 5px; padding: 3px 5px;
  border-radius: 6px; color: #fff; background: rgba(17, 20, 23, .78); font-size: 6px;
  font-weight: 950; letter-spacing: .06em; text-transform: uppercase;
}
.influence-card.is-lost::after { content: ""; position: absolute; z-index: 3; inset: 8px; border-top: 2px solid rgba(255,255,255,.72); transform: rotate(-29deg); transform-origin: center; }
.coup-decision { min-height: 108px; margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-solid); }
.coup-decision > .eyebrow { margin-bottom: 8px; }
.coup-actions { display: grid; grid-template-columns: repeat(4, minmax(125px, 1fr)); gap: 8px; }
.coup-action, .coup-target-action {
  --action-color: var(--accent); --action-wash: var(--accent-soft);
  min-width: 0; border: 1px solid color-mix(in srgb, var(--action-color) 35%, var(--line));
  border-radius: 13px; background: linear-gradient(135deg, var(--panel-solid), color-mix(in srgb, var(--action-wash) 72%, var(--panel-solid)));
}
.coup-action { min-height: 66px; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 9px; padding: 9px; color: var(--ink); text-align: left; cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease, box-shadow 170ms ease, transform 150ms ease; }
.coup-action:hover, .coup-action:focus-visible, .coup-target-button:hover, .coup-target-button:focus-visible { border-color: var(--action-color); outline: none; box-shadow: 0 7px 18px color-mix(in srgb, var(--action-color) 16%, transparent); transform: translateY(-1px); }
.coup-action:active, .coup-target-button:active { transform: scale(.98); }
.coup-action-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: var(--action-color); background: color-mix(in srgb, var(--action-wash) 82%, var(--panel-solid)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--action-color) 24%, transparent); }
.coup-action-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.coup-action-copy { min-width: 0; display: grid; gap: 2px; }
.coup-action strong { overflow: hidden; color: var(--ink); font-size: 13px; line-height: 1.05; text-overflow: ellipsis; }
.coup-action-copy strong { overflow: hidden; color: var(--ink); font-size: 13px; line-height: 1.05; text-overflow: ellipsis; }
.coup-action-copy > span { overflow: hidden; color: var(--muted); font-size: 9px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.coup-action.danger .coup-action-copy strong { color: var(--danger); }
.coup-action.tone-income, .coup-target-action.tone-income { --action-color: #3B8D6A; --action-wash: #DDF3E8; }
.coup-action.tone-aid, .coup-target-action.tone-aid { --action-color: #477D9F; --action-wash: #E0EEF7; }
.coup-action.tone-duke, .coup-target-action.tone-duke { --action-color: #A94C7A; --action-wash: #F5E0EB; }
.coup-action.tone-assassin, .coup-target-action.tone-assassin { --action-color: #3F819D; --action-wash: #DCEEF4; }
.coup-action.tone-captain, .coup-target-action.tone-captain { --action-color: #218C88; --action-wash: #DCF2EF; }
.coup-action.tone-ambassador, .coup-target-action.tone-ambassador { --action-color: #A97828; --action-wash: #F6EBCF; }
.coup-action.tone-contessa, .coup-target-action.tone-contessa { --action-color: #BC4E66; --action-wash: #F6DFE4; }
.coup-action.tone-allow, .coup-target-action.tone-allow { --action-color: #3D8B68; --action-wash: #DDF2E7; }
.coup-action.tone-block, .coup-target-action.tone-block { --action-color: #52719A; --action-wash: #E0E9F4; }
.coup-action.tone-challenge, .coup-target-action.tone-challenge { --action-color: #B66A35; --action-wash: #F7E7DA; }
.coup-action.tone-danger, .coup-target-action.tone-danger { --action-color: var(--danger); --action-wash: color-mix(in srgb, var(--danger) 13%, var(--panel-solid)); }
.coup-target-action { grid-column: 1 / -1; display: grid; grid-template-columns: 38px minmax(120px, .42fr) minmax(0, 1fr); align-items: center; gap: 9px; padding: 9px; }
.coup-target-list { min-width: 0; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.coup-target-button { min-width: 92px; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 8px 10px; border: 1px solid color-mix(in srgb, var(--action-color) 31%, var(--line)); border-radius: 10px; color: var(--ink); background: var(--panel-solid); font: inherit; font-size: 11px; font-weight: 900; cursor: pointer; transition: border-color 150ms ease, box-shadow 170ms ease, transform 150ms ease; }
.coup-target-button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coup-target-button svg { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: var(--action-color); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="dark"] .coup-action, :root[data-theme="dark"] .coup-target-action { --action-wash: color-mix(in srgb, var(--action-color) 18%, var(--panel-solid)); }
.coup-waiting { min-height: 72px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); text-align: center; }
.waiting-pulse { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); animation: coup-wait 1.4s ease-in-out infinite; }
.coup-log { position: sticky; top: 84px; overflow: hidden; }
.coup-log h2 { margin: 0; padding: 15px; border-bottom: 1px solid var(--line); font-size: 16px; }
.coup-log ol { max-height: 510px; display: grid; gap: 0; margin: 0; padding: 0; overflow: auto; list-style: none; scrollbar-width: thin; }
.coup-log li { padding: 10px 12px; color: var(--muted); border-bottom: 1px solid var(--line); font-size: 11px; line-height: 1.4; }
.coup-log li:last-child { border-bottom: 0; }
.coup-log li span { display: block; margin-bottom: 2px; color: var(--accent-strong); font-size: 7px; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.coup-log li strong { color: var(--ink); }
.coup-log .table-player-identity { display: inline-flex; margin: 0 1px; font-size: inherit; letter-spacing: normal; text-transform: none; }
.coup-log .table-player-identity-dot { display: inline-block; margin: 0; color: inherit; }
.coup-log .table-player-identity strong { color: color-mix(in srgb, var(--seat-color) 76%, var(--ink)); }
:root[data-theme="dark"] .coup-log .table-player-identity strong { color: color-mix(in srgb, var(--seat-color) 74%, white); }
.table-history-label { color: var(--ink); }
.coup-table .seat-score { display: none; }
@keyframes coup-wait { 50% { opacity: .45; transform: scale(.72); } }

.modal.coup-guide-modal { width: min(100%, 820px); }
.coup-guide-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.coup-guide-steps span { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 11px; background: var(--soft); font-size: 11px; font-weight: 850; }
.coup-guide-steps b { width: 23px; height: 23px; flex: 0 0 23px; display: grid; place-items: center; border-radius: 50%; color: var(--accent-contrast); background: var(--accent-strong); }
.coup-guide-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.coup-guide-role { --role-color: var(--accent); min-width: 0; overflow: hidden; border: 1px solid color-mix(in srgb, var(--role-color) 52%, var(--line)); border-radius: 13px; background: var(--soft); }
.coup-guide-role img { width: 100%; aspect-ratio: 1.2; display: block; object-fit: cover; object-position: center 22%; background: var(--role-color); }
.coup-guide-role > div { padding: 10px; }
.coup-guide-role h3 { margin: 0 0 6px; color: color-mix(in srgb, var(--role-color) 76%, var(--ink)); font-size: 15px; }
.coup-guide-role strong { display: block; font-size: 12px; }
.coup-guide-role p, .coup-guide-role small { display: block; margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.35; }
.coup-guide-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); }
.coup-guide-footer p { margin: 0; color: var(--muted); font-size: 10px; }
.coup-guide-footer strong { color: var(--ink); }
.coup-guide-modal.focus-duke .role-duke,
.coup-guide-modal.focus-assassin .role-assassin,
.coup-guide-modal.focus-captain .role-captain,
.coup-guide-modal.focus-ambassador .role-ambassador,
.coup-guide-modal.focus-contessa .role-contessa { box-shadow: 0 0 0 2px var(--role-color), 0 12px 26px color-mix(in srgb, var(--role-color) 22%, transparent); }

/* Wavelength keeps the spectrum large while team state remains readable at a glance. */
.wavelength-team-strip {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
}
.wavelength-team {
  min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center;
  gap: 13px; padding: 12px 14px; overflow: hidden; border: 1px solid var(--line);
  border-radius: 17px; background: var(--panel-solid); box-shadow: var(--shadow);
  transition: border-color 200ms ease, background-color 200ms ease, transform 220ms ease;
}
.wavelength-team.rose.is-active { border-color: #B94D71; background: color-mix(in srgb, #B94D71 11%, var(--panel-solid)); }
.wavelength-team.gold.is-active { border-color: #D9A238; background: color-mix(in srgb, #D9A238 13%, var(--panel-solid)); }
.wavelength-team-score { min-width: 78px; display: grid; grid-template-columns: auto auto; align-items: center; gap: 8px; }
.wavelength-team-score span { max-width: 70px; font-size: 10px; font-weight: 950; line-height: 1.1; }
.wavelength-team-score strong { font-size: clamp(27px, 4vw, 38px); line-height: .9; letter-spacing: -.05em; }
.wavelength-team.rose .wavelength-team-score strong { color: #B34269; }
.wavelength-team.gold .wavelength-team-score strong { color: #B27A11; }
:root[data-theme="dark"] .wavelength-team.rose .wavelength-team-score strong { color: #F29BB7; }
:root[data-theme="dark"] .wavelength-team.gold .wavelength-team-score strong { color: #F0C56B; }
.wavelength-team-members { min-width: 0; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.wavelength-team-members > span {
  min-width: 0; display: inline-flex; align-items: center; gap: 5px; max-width: 180px;
  padding: 5px 8px; overflow: hidden; border-radius: 999px; color: var(--muted);
  background: var(--soft); font-size: 9px; font-weight: 850; text-overflow: ellipsis; white-space: nowrap;
}
.wavelength-team-members > span b {
  min-width: 0; overflow: hidden; font: inherit; text-overflow: ellipsis; white-space: nowrap;
}
.wavelength-team-members > span.is-psychic { color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.wavelength-team-members small {
  flex: 0 0 auto;
  padding: 2px 5px; border-radius: 999px; color: var(--accent-strong);
  background: var(--accent-soft); font-size: 8px; font-weight: 950; letter-spacing: .04em; text-transform: uppercase;
}
.wavelength-stage { min-width: 0; overflow: hidden; padding: clamp(14px, 2.2vw, 25px); }
.wavelength-stage-head { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.wavelength-stage-head h2 { margin: 0; font-size: clamp(23px, 3.4vw, 37px); line-height: 1; letter-spacing: -.045em; }
.wavelength-stage-head p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.wavelength-clue {
  min-width: 150px; max-width: min(42%, 330px); display: grid; justify-items: end; padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 13px;
  color: var(--accent-strong); background: var(--accent-soft); text-align: right;
}
.wavelength-clue small { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.wavelength-clue strong { max-width: 100%; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.wavelength-meter { position: relative; width: min(100%, 900px); margin: 12px auto 0; }
.wavelength-endpoints { display: flex; justify-content: space-between; gap: 20px; padding: 0 5.5%; }
.wavelength-endpoints strong {
  width: min(42%, 260px); overflow-wrap: anywhere; font-size: clamp(13px, 2vw, 20px); line-height: 1.05;
}
.wavelength-endpoints strong:last-child { text-align: right; }
.wavelength-dial { width: 100%; height: auto; display: block; overflow: visible; }
.wavelength-arc-shadow, .wavelength-arc, .wavelength-target-band {
  fill: none; stroke-linecap: butt; stroke-width: 62;
}
.wavelength-arc-shadow { stroke: color-mix(in srgb, var(--ink) 14%, var(--soft)); stroke-width: 74; stroke-linecap: round; }
.wavelength-arc { stroke: url(#wavelength-spectrum-gradient); opacity: .42; }
.wavelength-meter.is-revealed .wavelength-arc { opacity: .16; }
.wavelength-target-band.points-two { stroke: #C9567B; }
.wavelength-target-band.points-three { stroke: #E4A83E; }
.wavelength-target-band.points-four { stroke: #62A9A2; }
.wavelength-target-band { animation: wavelength-band-in 420ms cubic-bezier(.2, .8, .2, 1) both; }
.wavelength-tick { fill: none; stroke: color-mix(in srgb, var(--ink) 58%, transparent); stroke-width: 3; stroke-linecap: round; }
.wavelength-needle {
  fill: none; stroke: var(--ink); stroke-width: 9; stroke-linecap: round;
  filter: drop-shadow(0 5px 6px rgba(18, 25, 31, .25));
  transition: d 90ms linear;
}
.wavelength-hub-ring { fill: var(--panel-solid); stroke: color-mix(in srgb, var(--ink) 35%, var(--line)); stroke-width: 5; }
.wavelength-hub { fill: var(--ink); }
.wavelength-private-target {
  position: absolute; left: 50%; bottom: 3px; padding: 4px 8px; transform: translateX(-50%);
  border-radius: 999px; color: var(--accent-strong); background: var(--accent-soft);
  font-size: 8px; font-weight: 950; letter-spacing: .08em; text-transform: uppercase;
}
.wavelength-controls {
  min-height: 92px; display: grid; align-items: center; margin-top: -2px; padding: 14px;
  border: 1px solid var(--line); border-radius: 16px; background: var(--soft);
}
.wavelength-clue-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.wavelength-clue-form .text-input { min-height: 44px; background: var(--panel-solid); }
.wavelength-clue-form .button { min-height: 44px; }
.wavelength-dial-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 7px 15px; }
.wavelength-dial-controls label { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.wavelength-dial-controls label > span { font-size: 11px; font-weight: 900; }
.wavelength-dial-controls output { color: var(--accent-strong); font-size: 16px; font-weight: 950; font-variant-numeric: tabular-nums; }
.wavelength-dial-controls input { grid-column: 1; width: 100%; min-height: 44px; margin: -9px 0; accent-color: var(--accent-strong); cursor: ew-resize; touch-action: pan-y; }
.wavelength-dial-controls .button { grid-column: 2; grid-row: 1 / span 2; }
.wavelength-side-controls { display: grid; grid-template-columns: minmax(140px, .5fr) minmax(220px, 1fr) auto; align-items: center; gap: 13px; }
.wavelength-side-controls > span { color: var(--muted); font-size: 10px; font-weight: 850; }
.wavelength-side-controls > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.wavelength-side {
  min-height: 43px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted);
  background: var(--panel-solid); cursor: pointer; font-weight: 950;
  transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}
.wavelength-side:hover { transform: translateY(-1px); }
.wavelength-side.is-selected { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.wavelength-waiting { display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); text-align: center; }
.wavelength-result { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; }
.wavelength-result-points { display: flex; gap: 7px; }
.wavelength-result-points > span { min-width: 82px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 12px; background: var(--panel-solid); }
.wavelength-result-points .rose { color: #A63E61; }
.wavelength-result-points .gold { color: #A8700C; }
.wavelength-result-points small { max-width: 55px; font-size: 7px; font-weight: 900; line-height: 1.1; }
.wavelength-result-points strong { font-size: 22px; }
.wavelength-result p { margin: 0; color: var(--muted); font-size: 10px; }
.wavelength-table[data-phase="round_result"] .wavelength-stage { animation: wavelength-result-in 360ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes wavelength-band-in { from { opacity: 0; stroke-width: 15; } }
@keyframes wavelength-result-in { from { opacity: .55; transform: translateY(6px); } }

.catan-table { overflow-anchor: none; }
.catan-gamebar {
  min-height: 62px; display: grid; grid-template-columns: minmax(150px, .62fr) minmax(240px, 1.38fr) auto;
  align-items: center; gap: 12px; padding: 8px 12px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line)); border-radius: 18px;
  color: #fff; background:
    radial-gradient(circle at 87% 12%, rgba(255,255,255,.2), transparent 18rem),
    linear-gradient(120deg, color-mix(in srgb, var(--accent-strong) 86%, #4c2f20), color-mix(in srgb, var(--accent) 66%, #176a6e));
  box-shadow: var(--shadow);
}
.catan-room-meta { display: flex; flex-wrap: wrap; gap: 6px; align-content: center; }
.catan-gamebar .pill { min-height: 22px; padding: 3px 7px; color: #fff; border: 1px solid rgba(255,255,255,.2); background: rgba(15,25,28,.2); font-size: 9px; }
.catan-turn-heading { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; }
.catan-turn-heading > div { min-width: 0; }
.catan-turn-marker { width: 10px; height: 10px; border-radius: 50%; background: var(--seat-color); box-shadow: 0 0 0 4px rgba(255,255,255,.18); }
.catan-turn-heading span { color: rgba(255,255,255,.72); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.catan-turn-heading h1 { margin: 1px 0 0; overflow-wrap: anywhere; font-size: clamp(18px, 2.15vw, 25px); line-height: 1.04; letter-spacing: -.03em; }
.catan-turn-heading h1 span { color: inherit; font: inherit; letter-spacing: inherit; text-transform: none; }
.catan-phase-short { display: none; }
.catan-game-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.catan-game-tools .button { border-color: rgba(255,255,255,.26); color: #fff; background: rgba(17,27,30,.23); }

.catan-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(314px, 348px); gap: 13px; align-items: start; }
.island-panel { overflow: hidden; }
.island-toolbar {
  min-height: 54px; display: grid; grid-template-columns: minmax(78px, auto) auto minmax(0, 1fr);
  align-items: center; gap: 11px; padding: 7px 13px; border-bottom: 1px solid var(--line);
}
.roll-summary { min-width: 0; display: grid; }
.roll-summary span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.roll-summary strong { margin-top: 1px; font-size: 20px; line-height: 1; }
.dice { min-width: 68px; min-height: 32px; display: flex; align-items: center; justify-content: flex-start; gap: 5px; }
.die {
  width: 32px; height: 32px; display: grid; grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr); gap: 2px; padding: 5px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, #5d4635); border-radius: 9px;
  background: linear-gradient(145deg, #fffdf7, #efe2cc); box-shadow: 0 3px 8px rgba(55, 39, 27, .15);
}
.die i { width: 4px; height: 4px; place-self: center; border-radius: 50%; background: transparent; }
.die i.is-on { background: #33271f; box-shadow: inset 0 1px 1px rgba(255,255,255,.28); }
.no-roll { min-width: 74px; justify-content: center; }
.catan-awards { min-width: 0; display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.award-chip { max-width: 100%; overflow: hidden; padding: 6px 9px; border-radius: 999px; color: var(--accent-strong); background: var(--accent-soft); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; font-weight: 900; }
.island-wrap {
  position: relative; display: grid; place-items: center; overflow: hidden; padding: clamp(7px, 1.2vw, 12px);
  background: linear-gradient(145deg, color-mix(in srgb, var(--panel-solid) 92%, #dbece8), var(--panel-solid));
}
.catan-board {
  width: min(100%, 800px); height: auto; display: block; overflow: hidden;
  border-radius: 18px; filter: drop-shadow(0 16px 18px rgba(24,43,48,.2)); touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.catan-board [role="button"] { -webkit-tap-highlight-color: transparent; }
.catan-water { fill: url(#catan-water); }
.catan-waves { fill: url(#catan-waves); opacity: .78; pointer-events: none; }
.island-shadow { fill: rgba(18, 51, 55, .24); transform: translateY(.14px) scale(1.035); transform-box: fill-box; transform-origin: center; filter: blur(.06px); }
.hex { stroke: rgba(54, 44, 34, .62); stroke-width: .062; stroke-linejoin: round; }
.hex.hills { fill: #B9633E; }
.hex.forest { fill: #3E7651; }
.hex.pasture { fill: #88AD60; }
.hex.fields { fill: #D8B550; }
.hex.mountains { fill: #747E7E; }
.hex.desert { fill: #D7BC80; }
.hex-texture { fill: none; stroke: rgba(255,255,255,.16); stroke-width: .022; pointer-events: none; }
.terrain-art { pointer-events: none; opacity: .68; }
.terrain-art path { stroke-linecap: round; stroke-linejoin: round; }
.forest-art { fill: #244E37; stroke: #E3F0D1; stroke-width: .032; }
.forest-art .terrain-detail { fill: none; stroke: #D8C394; stroke-width: .045; }
.fields-art { fill: none; stroke: #7D5D22; stroke-width: .045; }
.fields-art .terrain-detail { stroke: #F8E49A; stroke-width: .035; }
.mountains-art { fill: #505A5C; stroke: #3D4648; stroke-width: .035; }
.mountains-art .terrain-snow { fill: #EAF0E9; stroke: none; }
.hills-art { fill: #874126; stroke: #F0AA6E; stroke-width: .035; }
.hills-art .terrain-detail { fill: none; stroke: #F3C189; stroke-width: .035; }
.pasture-art { fill: #5B8E4D; stroke: #D4E8A5; stroke-width: .03; }
.terrain-sheep { fill: #F4F0DD; stroke: #596E4B; stroke-width: .025; }
.desert-art { fill: none; stroke: #9D7841; stroke-width: .055; }
.number-token { fill: #FFF2D4; stroke: rgba(74,55,35,.44); stroke-width: .04; }
.number-label { fill: #3B3026; font-size: .35px; font-weight: 950; text-anchor: middle; dominant-baseline: central; }
.number-label.red { fill: #B63D2E; }
.pip-label { fill: #5C4B38; font-size: .11px; text-anchor: middle; }
.board-road { stroke: var(--road-color); stroke-width: .19; stroke-linecap: round; paint-order: stroke; filter: drop-shadow(0 .03px .03px rgba(0,0,0,.5)); }
.board-road-under { stroke: rgba(43,37,31,.62); stroke-width: .27; stroke-linecap: round; }
.board-building { fill: var(--building-color); stroke: rgba(44,34,28,.74); stroke-width: .055; }
.board-building-wrap, .robber-wrap { transform-box: fill-box; transform-origin: center; }
.robber { fill: #31363A; stroke: #EEE0C4; stroke-width: .035; }
.catan-port { pointer-events: none; }
.port-waterway { fill: none; stroke: rgba(226,246,240,.46); stroke-width: .26; stroke-linecap: round; }
.port-dock-under { fill: none; stroke: rgba(246,229,191,.9); stroke-width: .15; stroke-linecap: round; stroke-linejoin: round; }
.port-dock { fill: none; stroke: #76563B; stroke-width: .075; stroke-linecap: round; stroke-linejoin: round; }
.port-boat path:first-child { fill: #724731; stroke: #F0D9AF; stroke-width: .025; }
.port-boat path:last-child { fill: #F7E4BB; stroke: #754E35; stroke-width: .025; }
.port-token { fill: #FFF4DC; stroke: rgba(76,53,35,.76); stroke-width: .045; filter: drop-shadow(0 .07px .07px rgba(20,47,53,.38)); }
.catan-port.brick .port-token { fill: #E7AA90; }
.catan-port.wood .port-token { fill: #A8C9A5; }
.catan-port.sheep .port-token { fill: #CFE2A7; }
.catan-port.wheat .port-token { fill: #EAD58A; }
.catan-port.ore .port-token { fill: #C4CCCB; }
.port-give-count, .port-receive-count {
  fill: #493D31; font-size: .22px; font-weight: 950; text-anchor: middle; dominant-baseline: central;
}
.port-resource-icon { color: #493D31; fill: currentColor; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; }
.port-resource-icon.brick { color: #9F4C33; }
.port-resource-icon.wood { color: #34714A; }
.port-resource-icon.sheep { color: #708D38; }
.port-resource-icon.wheat { color: #A97912; }
.port-resource-icon.ore { color: #657171; }
.port-any-icon circle.brick { fill: #B85E42; }
.port-any-icon circle.wood { fill: #4B8B5D; }
.port-any-icon circle.sheep { fill: #8EAD51; }
.port-any-icon circle.wheat { fill: #D0A32E; }
.port-any-icon circle.ore { fill: #748180; }
.port-trade-arrow { fill: none; stroke: #6E5B47; stroke-width: .045; stroke-linecap: round; stroke-linejoin: round; }
.legal-target { outline: none; cursor: pointer; }
.target-hit, .legal-edge-hit { fill: transparent; stroke: none; stroke-width: 0; pointer-events: fill; }
.legal-target .target-visible {
  fill: rgba(255,255,255,.9); stroke: rgba(40,63,65,.75); stroke-width: .035;
  filter: drop-shadow(0 .035px .05px rgba(0,0,0,.28)); animation: catan-target-ready 240ms ease-out both; pointer-events: none;
}
.legal-target:hover .target-visible, .legal-target:focus-visible .target-visible { fill: #FFE09C; stroke: #6A4A2D; stroke-width: .055; transform: scale(1.3); transform-box: fill-box; transform-origin: center; }
.robber-target { fill: transparent; stroke: rgba(255,255,255,.52); stroke-width: .035; stroke-dasharray: .11 .1; animation: catan-target-ready 240ms ease-out both; }
.robber-target:hover, .robber-target:focus-visible, .robber-target.is-selected { fill: rgba(255,226,159,.16); stroke: #FFE09C; stroke-width: .055; }
.legal-edge-visible { stroke: rgba(255,255,255,.78); stroke-width: .09; stroke-linecap: round; pointer-events: none; filter: drop-shadow(0 0 .05px rgba(28,63,65,.8)); animation: catan-target-ready 240ms ease-out both; }
.legal-target:hover .legal-edge-visible, .legal-target:focus-visible .legal-edge-visible { stroke: #FFE09C; stroke-width: .13; }
.placement-preview { pointer-events: none; animation: catan-preview-in 180ms cubic-bezier(.2,.8,.2,1) both; transform-box: fill-box; transform-origin: center bottom; }
.building-preview path { fill: var(--preview-color); stroke: #FFF6DE; stroke-width: .055; filter: drop-shadow(0 .05px .06px rgba(0,0,0,.48)); }
.placement-preview-road { stroke: var(--preview-color); stroke-width: .21; stroke-linecap: round; pointer-events: none; filter: drop-shadow(0 0 .065px #FFF6DE); animation: catan-preview-line 190ms ease-out both; }
.robber-preview path { fill: #30363A; stroke: #FFF0CE; stroke-width: .05; filter: drop-shadow(0 .06px .06px rgba(0,0,0,.45)); }
.placement-inline-actions { animation: catan-inline-actions-in 160ms ease-out both; }
.placement-inline-stem {
  fill: none; stroke: rgba(255,255,255,.86); stroke-width: .07; stroke-linecap: round;
  filter: drop-shadow(0 .035px .04px rgba(20,34,35,.45)); pointer-events: none;
}
.placement-inline-button { pointer-events: none; }
.placement-inline-hit { fill: transparent; pointer-events: all; outline: none; cursor: pointer; }
.placement-inline-surface {
  stroke: rgba(255,255,255,.92); stroke-width: .055;
  filter: drop-shadow(0 .07px .08px rgba(20,31,33,.42));
  transition: filter 140ms ease, stroke-width 140ms ease; pointer-events: none;
}
.placement-inline-button.is-confirm .placement-inline-surface { fill: #27885F; }
.placement-inline-button.is-cancel .placement-inline-surface { fill: #B94848; }
.placement-inline-mark { fill: none; stroke: #fff; stroke-width: .075; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.placement-inline-hit:is(:hover, :focus-visible) + .placement-inline-surface { stroke-width: .085; filter: brightness(1.09) drop-shadow(0 .08px .09px rgba(20,31,33,.5)); }
.placement-inline-hit:active + .placement-inline-surface { filter: brightness(.94) drop-shadow(0 .035px .04px rgba(20,31,33,.35)); }
@keyframes catan-target-ready { from { opacity: 0; } }
@keyframes catan-preview-in { from { opacity: 0; transform: translateY(.08px) scale(.72); } }
@keyframes catan-preview-line { from { opacity: 0; stroke-dasharray: 1; stroke-dashoffset: 1; } }
@keyframes catan-inline-actions-in { from { opacity: 0; } }

.catan-table.is-table-enter .island-panel { animation: catan-panel-in 420ms cubic-bezier(.2, .8, .2, 1) both; }
.catan-table.is-table-enter .catan-sidebar > * { animation: catan-side-in 360ms cubic-bezier(.2, .8, .2, 1) both; }
.catan-table.is-table-enter .catan-sidebar > :nth-child(2) { animation-delay: 55ms; }
.catan-table.is-table-enter .catan-sidebar > :nth-child(3) { animation-delay: 110ms; }
.catan-table.is-table-enter .catan-sidebar > :nth-child(4) { animation-delay: 165ms; }
.catan-table:is(.is-turn-enter, .is-phase-enter) .catan-turn-heading h1 { animation: catan-turn-in 280ms ease-out both; }
.catan-table.is-dice-roll .die { animation: catan-die-roll 520ms cubic-bezier(.18, .78, .25, 1.22) both; animation-delay: calc(var(--die-index, 0) * 75ms); }
.catan-hex.is-producing .hex { animation: catan-production-pulse 760ms cubic-bezier(.2, .8, .2, 1) both; }
.catan-hex.is-producing .number-token { animation: catan-token-pulse 620ms cubic-bezier(.18, .9, .3, 1.25) both; transform-box: fill-box; transform-origin: center; }
.board-road-group.is-new .board-road-under,
.board-road-group.is-new .board-road { stroke-dasharray: 1; animation: catan-road-build 480ms cubic-bezier(.22, .76, .24, 1) both; }
.board-building-wrap.is-new .board-building { animation: catan-building-in 420ms cubic-bezier(.18, .9, .3, 1.3) both; transform-box: fill-box; transform-origin: center bottom; }
.robber-wrap.is-moved .robber { animation: catan-robber-in 460ms cubic-bezier(.18, .82, .24, 1.18) both; transform-box: fill-box; transform-origin: center bottom; }

@keyframes catan-panel-in { from { opacity: 0; transform: translateY(9px) scale(.995); } }
@keyframes catan-side-in { from { opacity: 0; transform: translateX(8px); } }
@keyframes catan-turn-in { from { opacity: .35; transform: translateY(5px); } }
@keyframes catan-die-roll {
  0% { opacity: .35; transform: translateY(-8px) rotate(-16deg) scale(.88); }
  58% { transform: translateY(2px) rotate(5deg) scale(1.06); }
}
@keyframes catan-production-pulse {
  42% { filter: brightness(1.2) saturate(1.14); stroke: #fff3c4; stroke-width: .1; }
}
@keyframes catan-token-pulse { 48% { transform: scale(1.2); filter: drop-shadow(0 .08px .09px rgba(66,45,22,.4)); } }
@keyframes catan-road-build { from { opacity: .25; stroke-dashoffset: 1; } }
@keyframes catan-building-in { from { opacity: .2; transform: translateY(.16px) scale(.15); } }
@keyframes catan-robber-in { from { opacity: .15; transform: translateY(-.2px) scale(.62); } }

.catan-sidebar { position: sticky; top: 84px; display: grid; gap: 12px; }
.hand-panel { padding: 15px; }
.hand-title { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 13px; }
.hand-title h2 { margin: 0; font-size: 19px; }
.resource-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.resource-card { min-width: 0; display: grid; place-items: center; gap: 5px; padding: 10px 3px; border-radius: 11px; color: #302A22; font-size: 9px; font-weight: 900; text-transform: capitalize; transition: filter 180ms ease, transform 180ms ease; }
.catan-resource-icon { width: 18px; height: 18px; overflow: visible; fill: currentColor; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.resource-card-value { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.resource-card .catan-resource-icon { width: 23px; height: 23px; opacity: .92; }
.resource-card strong { font-size: 27px; line-height: 1; font-variant-numeric: tabular-nums; }
.resource-card-label { font-size: 9px; line-height: 1; }
.resource-card:is(.is-resource-up, .is-resource-down) { animation: catan-resource-card 460ms ease-out both; animation-delay: calc(var(--resource-index, 0) * 35ms); }
.resource-card.is-resource-up strong { animation: catan-resource-up 460ms cubic-bezier(.18, .9, .3, 1.3) both; }
.resource-card.is-resource-down strong { animation: catan-resource-down 420ms ease-out both; }
.resource-card.brick { background: #E6A087; }
.resource-card.wood { background: #8ABB92; }
.resource-card.sheep { background: #C4DD9A; }
.resource-card.wheat { background: #EAD486; }
.resource-card.ore { background: #BCC4C3; }
.action-dock { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.action-dock .button { min-width: 0; min-height: 48px; padding: 8px 9px; font-size: 12px; }
.action-dock .button.wide { grid-column: 1 / -1; }
.build-action { min-height: 60px !important; display: grid; grid-template-columns: auto minmax(0, 1fr); justify-content: stretch; text-align: left; }
.build-action-icon, .action-menu-icon {
  width: 34px; height: 34px; display: grid; place-items: center; flex: none;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line)); border-radius: 10px;
  color: var(--accent-strong); background: color-mix(in srgb, var(--accent-soft) 72%, var(--panel-solid));
}
.build-action-icon svg, .action-menu-icon svg { width: 19px; height: 19px; }
.build-action-copy { min-width: 0; display: grid; align-content: center; gap: 5px; }
.build-action strong { display: block; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.build-action.is-active { color: var(--accent-strong); border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.build-action.is-active .build-action-icon { border-color: var(--accent); background: var(--panel-solid); }
.build-cost { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.build-cost-chip {
  --resource-color: #8C9796; display: inline-flex; align-items: center; gap: 2px; min-height: 19px; padding: 2px 4px;
  border: 1px solid color-mix(in srgb, var(--resource-color) 38%, var(--line)); border-radius: 6px;
  color: color-mix(in srgb, var(--resource-color) 52%, var(--ink)); background: color-mix(in srgb, var(--resource-color) 15%, var(--panel-solid));
}
.build-cost-chip .catan-resource-icon { width: 12px; height: 12px; fill: currentColor; stroke: currentColor; stroke-width: 1.35; }
.build-cost-chip b { font-size: 9px; line-height: 1; font-variant-numeric: tabular-nums; }
.build-note { color: var(--muted); font-size: 9px; font-weight: 850; }
.roll-action { min-height: 58px !important; font-size: 14px !important; }
.roll-action > span { display: grid; justify-items: start; }
.roll-action small { margin-top: 2px; opacity: .72; font-size: 9px; }
.secondary-action { gap: 7px; }
.action-menu-button { display: grid !important; grid-template-columns: auto minmax(0, 1fr); justify-content: stretch; text-align: left; }
.action-menu-button > span:last-child { min-width: 0; }
.action-menu-button strong, .action-menu-button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-menu-button strong { font-size: 11px; }
.action-menu-button small { margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 800; }
.action-separator { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 2px; color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.action-separator::before, .action-separator::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.end-turn-action { margin-top: 2px; }
.required-action { display: grid; gap: 5px; margin-top: 14px; padding: 14px; border: 1px solid color-mix(in srgb, var(--accent) 48%, var(--line)); border-radius: 14px; background: var(--accent-soft); }
.required-action > span { color: var(--accent-strong); font-size: 9px; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.required-action > strong { font-size: 16px; }
.required-action > small { color: var(--muted); font-size: 11px; }
.required-action .button { margin-top: 5px; }
.turn-wait { min-height: 46px; display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; color: var(--muted); background: var(--soft); font-size: 11px; font-weight: 850; }
.turn-wait-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; background: var(--seat-color); box-shadow: 0 0 0 4px color-mix(in srgb, var(--seat-color) 17%, transparent); }
.trade-banner {
  position: fixed; z-index: 160; right: max(14px, calc((100vw - 1260px) / 2)); bottom: 16px;
  width: min(420px, calc(100vw - 28px)); padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 52%, var(--line)); border-radius: 17px;
  background: color-mix(in srgb, var(--panel-solid) 94%, var(--accent-soft)); box-shadow: 0 20px 52px rgba(20,30,33,.25);
  backdrop-filter: blur(15px) saturate(1.08);
}
.trade-banner.is-passive { position: static; width: auto; }
.trade-banner.is-new { animation: catan-trade-in 380ms cubic-bezier(.2, .8, .2, 1) both; }
.trade-banner header { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 2px 8px; }
.trade-banner header strong { min-width: 0; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.trade-banner header small { grid-column: 2; color: var(--muted); font-size: 9px; font-weight: 800; }
.trade-badge { grid-row: 1 / 3; padding: 6px 8px; border-radius: 9px; color: var(--accent-strong); background: var(--accent-soft); font-size: 8px; font-weight: 950; letter-spacing: .07em; text-transform: uppercase; }
.trade-banner-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 10px; }
.trade-flow {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; gap: 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft);
}
.trade-flow > div { min-width: 0; }
.trade-flow > div > small { display: block; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.trade-flow-arrow { display: grid; place-items: center; color: var(--muted); }
.trade-flow-arrow svg, .trade-flow.compact > svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; }
.trade-flow.compact { margin-top: 11px; padding: 9px; }
.trade-flow.compact .trade-resource-chip span { display: none; }
.trade-chip-list { min-height: 29px; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.trade-resource-chip {
  --resource-color: #a9b3b2; min-width: 0; display: inline-flex; align-items: center; gap: 4px; padding: 5px 7px;
  border: 1px solid color-mix(in srgb, var(--resource-color) 72%, var(--line)); border-radius: 9px;
  color: color-mix(in srgb, var(--resource-color) 34%, var(--ink)); background: color-mix(in srgb, var(--resource-color) 25%, var(--panel-solid));
  font-size: 9px; font-weight: 850;
}
.trade-resource-chip .catan-resource-icon { width: 14px; height: 14px; }
.trade-resource-chip strong { font-size: 11px; }
.trade-empty { align-self: center; color: var(--muted); font-size: 9px; font-weight: 800; }
:is(.trade-resource-card, .trade-resource-chip, .bank-resource-option, .build-cost-chip).brick { --resource-color: #c86e4f; }
:is(.trade-resource-card, .trade-resource-chip, .bank-resource-option, .build-cost-chip).wood { --resource-color: #4e9163; }
:is(.trade-resource-card, .trade-resource-chip, .bank-resource-option, .build-cost-chip).sheep { --resource-color: #8cae55; }
:is(.trade-resource-card, .trade-resource-chip, .bank-resource-option, .build-cost-chip).wheat { --resource-color: #c89d2e; }
:is(.trade-resource-card, .trade-resource-chip, .bank-resource-option, .build-cost-chip).ore { --resource-color: #7c8989; }
.modal.catan-trade-modal { width: min(100%, 820px); }
.modal.bank-trade-modal { width: min(100%, 760px); }
.trade-builder, .bank-trade-builder { display: grid; gap: 14px; }
.trade-builder section > h3, .bank-trade-builder section > h3, .trade-targets > h3 { margin: 0 0 8px; font-size: 12px; }
.trade-resource-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.trade-resource-card {
  --resource-color: #a9b3b2; min-width: 0; display: grid; gap: 9px; padding: 10px 8px;
  border: 1px solid color-mix(in srgb, var(--resource-color) 32%, var(--line)); border-radius: 13px;
  background: color-mix(in srgb, var(--resource-color) 9%, var(--panel-solid));
}
.trade-resource-card.is-selected { border-color: var(--resource-color); background: color-mix(in srgb, var(--resource-color) 20%, var(--panel-solid)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--resource-color) 60%, transparent); }
.trade-resource-name { min-width: 0; display: flex; align-items: center; gap: 7px; color: color-mix(in srgb, var(--resource-color) 38%, var(--ink)); }
.trade-resource-name > span { min-width: 0; }
.trade-resource-name strong, .trade-resource-name small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-resource-name strong { font-size: 10px; }
.trade-resource-name small { margin-top: 1px; color: var(--muted); font-size: 8px; }
.trade-resource-card .counter { justify-content: space-between; gap: 3px; }
.trade-resource-card .counter button { width: 44px; height: 44px; padding: 0; }
.trade-resource-card .counter button:disabled { opacity: .3; cursor: not-allowed; }
.trade-resource-card .counter output { min-width: 20px; width: auto; font-size: 13px; font-variant-numeric: tabular-nums; }
.trade-warning { margin: -4px 0 0; color: var(--danger); font-size: 10px; font-weight: 850; }
.trade-target-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.trade-target {
  min-width: 0; min-height: 54px; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px;
  padding: 8px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: var(--panel-solid); cursor: pointer; text-align: left;
}
.trade-target.is-selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.trade-target-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: #fff; background: var(--seat-color, var(--accent)); font-size: 9px; font-weight: 950; }
.trade-target strong, .trade-target small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trade-target strong { font-size: 11px; }
.trade-target small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.bank-resource-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.bank-rate-hero {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line)); border-radius: 15px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent-soft) 78%, var(--panel-solid)), var(--panel-solid));
}
.bank-rate-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--accent-strong); background: var(--accent-soft); }
.bank-rate-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.bank-rate-hero small, .bank-rate-hero strong { display: block; }
.bank-rate-hero small { color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.bank-rate-hero strong { margin-top: 2px; font-size: 17px; }
.bank-rate-stock { padding: 6px 8px; border-radius: 999px; color: var(--accent-strong); background: var(--accent-soft); font-size: 8px; font-weight: 900; text-transform: capitalize; }
.bank-trade-steps { display: grid; gap: 11px; }
.bank-trade-step { padding: 11px; border: 1px solid var(--line); border-radius: 15px; background: var(--soft); }
.bank-trade-step > header { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; margin-bottom: 9px; }
.bank-trade-step > header > span { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; color: var(--accent-contrast); background: var(--accent-strong); font-size: 10px; font-weight: 950; }
:root[data-theme="dark"] .bank-trade-step > header > span { color: #21130C; }
.bank-trade-step h3 { margin: 0; font-size: 12px; }
.bank-trade-step header small { display: block; margin-top: 1px; color: var(--muted); font-size: 8px; }
.bank-resource-option {
  --resource-color: #a9b3b2; min-width: 0; min-height: 62px; display: grid; grid-template-columns: auto minmax(0, 1fr);
  align-items: center; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 13px;
  color: var(--ink); background: var(--panel-solid); cursor: pointer; text-align: left;
}
.bank-resource-option.is-selected { border-color: var(--resource-color); background: color-mix(in srgb, var(--resource-color) 18%, var(--panel-solid)); box-shadow: inset 0 0 0 1px var(--resource-color); }
.bank-resource-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: color-mix(in srgb, var(--resource-color) 68%, var(--ink)); background: color-mix(in srgb, var(--resource-color) 18%, var(--panel-solid)); }
.bank-resource-option .catan-resource-icon { width: 18px; height: 18px; color: inherit; }
.bank-resource-option strong, .bank-resource-option small { display: block; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.bank-resource-option strong { font-size: 10px; }
.bank-resource-option small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.bank-trade-receipt .trade-flow { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 45%, var(--soft)); }
.bank-trade-submit svg { width: 18px; height: 18px; }
.game-log { overflow: hidden; }
.game-log summary { min-height: 58px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 14px; cursor: pointer; list-style: none; }
.game-log summary::-webkit-details-marker { display: none; }
.game-log summary strong { display: block; font-size: 13px; }
.game-log summary small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.game-log summary > span:last-child { min-width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px; color: var(--muted); background: var(--soft); font-size: 9px; font-weight: 900; }
.game-log ul { max-height: 220px; display: grid; gap: 8px; margin: 0; padding: 12px 14px 14px; overflow: auto; border-top: 1px solid var(--line); list-style: none; scrollbar-width: thin; }
.game-log li { color: var(--muted); font-size: 10px; line-height: 1.4; }
.game-log li:last-child { color: var(--ink); font-weight: 800; }
.game-log li.is-new { animation: catan-log-in 300ms ease-out both; }
.placement-tip {
  position: absolute; z-index: 3; inset: 12px auto auto 50%; max-width: calc(100% - 24px); padding: 8px 12px;
  transform: translateX(-50%); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #fff;
  background: rgba(18, 30, 35, .8); box-shadow: 0 8px 22px rgba(10,20,25,.16); font-size: 10px; font-weight: 900;
  white-space: nowrap; backdrop-filter: blur(8px); pointer-events: none;
}
.catan-sound-toggle[aria-pressed="false"] { opacity: .72; }
.catan-sound-toggle svg { width: 17px; }

@keyframes catan-resource-card { 45% { filter: brightness(1.08); transform: translateY(-2px); } }
@keyframes catan-resource-up { 48% { color: #1f7043; transform: scale(1.18); } }
@keyframes catan-resource-down { 48% { color: #9a3b32; transform: scale(.88); } }
@keyframes catan-trade-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes catan-log-in { from { opacity: 0; transform: translateY(5px); } }

.rules-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 16px; }
.rules-copy { padding: 28px; }
.rules-copy h2 { margin: 25px 0 8px; font-size: 21px; letter-spacing: -.03em; }
.rules-copy h2:first-child { margin-top: 0; }
.rules-copy p, .rules-copy li { color: var(--muted); font-size: 13px; line-height: 1.6; }
.rules-copy ol, .rules-copy ul { padding-left: 20px; }
.rules-aside { position: sticky; top: 94px; overflow: hidden; }
.rules-aside img { width: 100%; display: block; aspect-ratio: 4/3; object-fit: cover; }
.rules-aside .panel-body { padding: 18px; }
.rules-aside dl { display: grid; gap: 11px; margin: 0; }
.rules-aside div { display: flex; justify-content: space-between; gap: 18px; }
.rules-aside dt { color: var(--muted); font-size: 11px; }
.rules-aside dd { margin: 0; text-align: right; font-size: 11px; font-weight: 900; }

.stats-grid { display: grid; grid-template-columns: minmax(260px, .65fr) minmax(0, 1.35fr); gap: 16px; align-items: start; }
.profile-card { padding: 24px; }
.rating-number { margin-top: 18px; color: var(--accent-strong); font-size: 58px; line-height: .9; font-weight: 950; letter-spacing: -.06em; }
.stats-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 18px; }
.stat { padding: 13px; border-radius: 13px; background: var(--soft); }
.stat strong { display: block; font-size: 21px; }
.stat span { color: var(--muted); font-size: 9px; font-weight: 800; }
.leaderboard { overflow: hidden; }
.leaderboard header { padding: 20px; border-bottom: 1px solid var(--line); }
.leaderboard h2 { margin: 0; font-size: 20px; }
.leaderboard table { width: 100%; border-collapse: collapse; }
.leaderboard th, .leaderboard td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 11px; }
.leaderboard th { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .1em; }
.leaderboard tr:last-child td { border: 0; }
.history { grid-column: 1 / -1; padding: 22px; }
.history-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 15px; }
.history-item { padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--soft); }
.history-item strong { display: block; font-size: 12px; }
.history-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }

.result-panel { width: min(100%, 760px); margin: 0 auto; padding: 32px; text-align: center; }
.result-panel h2 { margin: 0; font-size: clamp(34px, 7vw, 58px); line-height: .95; letter-spacing: -.05em; }
.result-panel > p { margin: 9px 0 22px; color: var(--muted); }
.result-ranking { display: grid; gap: 8px; text-align: left; }
.result-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 13px; border-radius: 13px; background: var(--soft); }
.result-rank { font-size: 18px; font-weight: 950; }
.result-score { font-size: 18px; font-weight: 950; }
.result-actions { display: flex; justify-content: center; gap: 9px; margin-top: 20px; }
.result-final-card {
  width: min(100%, 300px); display: grid; gap: 4px; margin: -8px auto 20px; padding: 16px;
  border: 1px solid var(--line); border-radius: 15px; color: #fff; background: #39434a;
  box-shadow: 0 8px 20px rgba(22, 28, 31, .14);
}
.result-final-card.role-red { background: linear-gradient(145deg, #D9665D, #A93D37); }
.result-final-card.role-blue { background: linear-gradient(145deg, #4A98C9, #236792); }
.result-final-card.role-assassin { background: linear-gradient(145deg, #374149, #11181C); }
.result-final-card small { font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.result-final-card strong { font-size: 24px; letter-spacing: .04em; }
.catan-result.is-result-enter .result-panel { animation: catan-result-in 480ms cubic-bezier(.2, .8, .2, 1) both; }
.catan-result.is-result-enter .result-row { animation: catan-rank-in 360ms cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(120ms + var(--result-index, 0) * 65ms); }
.catan-result.is-result-enter .result-actions { animation: catan-actions-in 320ms ease-out 300ms both; }
@keyframes catan-result-in { from { opacity: 0; transform: translateY(12px) scale(.992); } }
@keyframes catan-rank-in { from { opacity: 0; transform: translateX(-9px); } }
@keyframes catan-actions-in { from { opacity: 0; transform: translateY(6px); } }

.modal-backdrop { position: fixed; z-index: 300; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(10, 18, 23, .5); backdrop-filter: blur(5px); }
.modal {
  width: min(100%, 560px); max-height: calc(100dvh - 32px); overflow: auto;
  border: 1px solid var(--line); border-radius: 22px; color: var(--ink); background: var(--panel-solid); box-shadow: 0 30px 90px rgba(0,0,0,.34);
}
.modal-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; padding: 20px 20px 14px; }
.modal-head h2 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
.modal-head p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.modal-close { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--soft); cursor: pointer; }
.modal-body { padding: 0 20px 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.auth-tabs { display: flex; gap: 5px; margin-bottom: 15px; padding: 4px; border-radius: 12px; background: var(--soft); }
.auth-tabs button { flex: 1; min-height: 39px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; cursor: pointer; font-weight: 900; }
.auth-tabs button[aria-selected="true"] { color: var(--accent-strong); background: var(--panel-solid); }
.auth-form { display: grid; gap: 12px; }
.resource-picker { display: grid; gap: 8px; }
.resource-pick-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 11px; background: var(--soft); }
.resource-pick-row strong { font-size: 11px; text-transform: capitalize; }
.counter { display: flex; align-items: center; gap: 7px; }
.counter button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-solid); cursor: pointer; font-weight: 950; }
.counter output { width: 25px; text-align: center; font-weight: 950; }

.toast-region { position: fixed; z-index: 500; inset: 84px 16px auto; display: grid; justify-items: center; pointer-events: none; }
.toast { max-width: min(92vw, 460px); padding: 11px 15px; border-radius: 12px; color: #fff; background: #263943; box-shadow: 0 10px 36px rgba(0,0,0,.25); font-size: 11px; font-weight: 850; animation: toast-in 180ms ease-out; }
.toast.error { background: #8C3E3E; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.skeleton { position: relative; overflow: hidden; min-height: 16px; border-radius: 8px; background: var(--soft); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.34), transparent); animation: shimmer 1.25s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.loading-view { min-height: 55vh; display: grid; place-items: center; }
.loading-card { width: min(100%, 580px); display: grid; gap: 12px; padding: 24px; }

@media (max-width: 980px) {
  .header-inner { grid-template-columns: 1fr auto; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; width: 100%; margin-bottom: 8px; }
  .primary-nav a { flex: 1; padding-inline: 8px; }
  .site-header { position: relative; }
  .app-shell { min-height: auto; padding-top: 24px; }
  .create-panel, .rules-aside { position: static; }
  .lobby-grid, .rules-grid, .stats-grid { grid-template-columns: 1fr; }
  .history { grid-column: auto; }
  .lobby-table { grid-template-columns: 1fr; }
  .catan-layout { grid-template-columns: 1fr; }
  .codenames-layout, .coup-layout { grid-template-columns: 1fr; }
  .codenames-board { width: min(100%, 820px, max(300px, calc(162dvh - 632px))); }
  .codenames-teams { position: static; grid-row: 1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .codenames-stage { grid-row: 2; }
  .coup-log { position: static; }
  .coup-log ol { max-height: 180px; }
  .island-panel { grid-row: 1; }
  .catan-sidebar { position: static; grid-row: 2; grid-template-columns: 1fr; }
}

@media (min-width: 701px) and (max-width: 900px) {
  .wavelength-table .table-banner.multiplayer-matchbar { min-height: 92px; }
  .wavelength-table .table-banner.multiplayer-matchbar .banner-copy {
    grid-template-columns: 1fr; grid-template-areas: "kicker" "title" "meta"; gap: 3px;
  }
  .wavelength-table .table-banner.multiplayer-matchbar h1 {
    display: -webkit-box; overflow: hidden; white-space: normal;
    -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  }
}

@media (max-width: 1120px) and (min-width: 701px) {
  .coup-player-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 981px) {
  .catan-board { width: min(100%, 800px); }
  .catan-sidebar {
    max-height: calc(100dvh - 168px); overflow-y: auto; overscroll-behavior: contain;
    padding-right: 3px; scrollbar-width: thin;
  }
}

@media (max-height: 700px) and (min-width: 701px) {
  .coup-stage { padding: 12px; }
  .coup-status { margin-bottom: 8px; }
  .coup-player { padding: 8px; }
  .influence-row, .influence-card { min-height: 82px; }
  .coup-decision { min-height: 72px; margin-top: 8px; padding: 9px; }
  .coup-action { min-height: 48px; padding-block: 6px; }
  .wavelength-team { padding: 7px 10px; }
  .wavelength-team-score strong { font-size: 28px; }
  .wavelength-team-members > span { padding-block: 3px; }
  .wavelength-stage { padding: 10px 14px; }
  .wavelength-stage-head h2 { font-size: 24px; }
  .wavelength-stage-head p { margin-top: 4px; }
  .wavelength-meter { width: min(100%, 430px); margin-top: 3px; }
  .wavelength-controls { min-height: 66px; margin-top: -8px; padding: 9px 11px; }
}

@media (max-width: 700px) {
  .header-inner { width: min(100% - 20px, 1260px); gap: 9px; }
  .game-switcher { max-width: min(58vw, 220px); min-height: 44px; gap: 4px; padding: 5px 7px; }
  .game-switcher .brand-text {
    width: max-content; min-width: 0; max-width: min(34vw, 150px);
    overflow: hidden; font-size: 13.5px; text-overflow: ellipsis;
  }
  .game-menu-chevron { width: 12px; height: 12px; }
  .account-button { max-width: 118px; padding-inline: 11px; }
  .app-shell { width: min(100% - 20px, 1260px); padding-bottom: 45px; }
  .page-head { display: block; }
  .page-head .button { margin-top: 16px; }
  .page-head h1, .hero h1 { font-size: clamp(38px, 13vw, 56px); }
  .panel-body { padding: 18px; }
  .choice-row, .form-grid, .seat-grid { grid-template-columns: 1fr; }
  .room-card { grid-template-columns: 1fr; }
  .room-card .button { width: 100%; }
  .table-banner { min-height: 172px; grid-template-columns: 1fr; align-items: end; padding: 20px; }
  .table-banner.multiplayer-matchbar {
    min-height: 84px; display: block; padding: 10px 11px;
  }
  .table-banner.multiplayer-matchbar .banner-copy {
    grid-template-columns: minmax(0, 1fr); grid-template-areas: "kicker" "title";
    gap: 4px;
  }
  .table-banner.multiplayer-matchbar .banner-kicker {
    padding-right: 170px; flex-wrap: nowrap; overflow: hidden;
  }
  .table-banner.multiplayer-matchbar .banner-kicker .pill:nth-child(n+3) { display: none; }
  .table-banner.multiplayer-matchbar h1 {
    display: -webkit-box; overflow: hidden; white-space: normal;
    -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  }
  .table-banner.multiplayer-matchbar p { display: none; }
  .table-banner.multiplayer-matchbar .banner-tools {
    position: absolute; top: 10px; right: 10px; justify-content: flex-end;
  }
  .banner-tools { justify-content: flex-start; }
  body.is-social-game-active .header-inner { width: min(100% - 16px, 1260px); }
  body.is-social-game-active .game-switcher .brand-text { max-width: min(34vw, 150px); }
  body.is-social-game-active .account-button { display: none; }
  body.is-social-game-active .app-shell { width: min(100% - 12px, 1260px); padding-top: 6px; }
  body.is-social-game-active .table-banner.multiplayer-matchbar { min-height: 72px; padding: 9px 10px; }
  .multiplayer-matchbar .match-home,
  .multiplayer-matchbar .match-share { width: 44px; min-height: 44px; padding: 10px; }
  .multiplayer-matchbar .match-home span,
  .multiplayer-matchbar .match-share span { display: none; }
  .score-strip { display: flex; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; }
  .score-strip::-webkit-scrollbar { display: none; }
  .score-seat { min-width: min(72vw, 230px); border-right: 1px solid var(--line); scroll-snap-align: start; }
  .dixit-stage { padding: 13px; }
  .phase-head { display: block; }
  .dixit-cards { display: flex; overflow-x: auto; gap: 9px; padding: 4px 2px 13px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
  .dixit-card { min-width: min(63vw, 220px); scroll-snap-align: center; }
  .dixit-preview-modal { width: min(100%, 520px); border-radius: 18px; }
  .dixit-preview-modal .modal-head { padding: 11px 12px 8px; }
  .dixit-preview-modal .modal-body { padding: 0 12px 12px; }
  .dixit-card-preview { gap: 10px; }
  .dixit-card-preview-frame,
  .dixit-card-preview-frame img { max-height: calc(100dvh - 154px); }
  .story-form { grid-template-columns: 1fr; }
  .story-form .button { width: 100%; }
  .round-footer { align-items: stretch; flex-direction: column; }
  .round-footer .button { width: 100%; }
  .codenames-table .score-strip, .coup-table .score-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: hidden; }
  .codenames-table .score-seat, .coup-table .score-seat { min-width: 0; border-bottom: 1px solid var(--line); }
  .codenames-status { min-height: 54px; display: grid; grid-template-columns: 1fr; align-items: start; gap: 8px; }
  .codenames-status-tools { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .codenames-clue { min-width: 104px; padding: 7px 9px; }
  .codenames-status-tools .codenames-clue { justify-items: start; text-align: left; }
  .codenames-status-tools .button { min-height: 44px; }
  .codenames-clue strong { font-size: 14px; }
  .codename-card { min-height: 44px; aspect-ratio: 1.18; padding: 3px; border-radius: 6px; }
  .codename-card span {
    font-size: clamp(10px, 2.8vw, 12px); line-height: 1; letter-spacing: -.02em;
    overflow-wrap: normal;
  }
  .team-roster > div small { font-size: 8px; }
  .codenames-clue-form { grid-template-columns: minmax(0, 1fr) 78px; }
  .codenames-clue-form .button { grid-column: 1 / -1; width: 100%; }
  .codenames-turn-actions { align-items: stretch; flex-direction: column; }
  .codenames-turn-actions .button { width: 100%; }
  .team-roster > header { padding: 9px; }
  .team-roster > header small { display: none; }
  .team-roster > div { grid-template-columns: 1fr; gap: 0; }
  .team-roster > div > span {
    min-width: 0; display: grid; padding: 7px 5px; overflow: hidden;
    font-size: 9px; text-overflow: ellipsis; white-space: nowrap;
  }
  .team-roster > div > span + span { border-top: 1px solid var(--line); border-left: 0; }
  .team-roster > div small { overflow: hidden; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
  .codenames-stage { padding: 10px; }
  .codenames-board { width: 100%; }
  .coup-player-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coup-player { padding: 9px; }
  .coup-status { display: grid; grid-template-columns: 1fr; align-items: flex-start; }
  .coup-status-tools { justify-content: flex-start; }
  .button.small.coup-guide-button { min-height: 44px; }
  .coup-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coup-target-action { grid-template-columns: 38px minmax(0, 1fr); }
  .coup-target-list { grid-column: 1 / -1; justify-content: flex-start; }
  .influence-card { min-height: 104px; }
  .coup-guide-steps { grid-template-columns: 1fr; }
  .coup-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .coup-guide-role { display: grid; grid-template-columns: 68px minmax(0, 1fr); }
  .coup-guide-role img { height: 100%; aspect-ratio: auto; }
  .coup-guide-footer { display: grid; }
  .wavelength-team-strip { gap: 6px; }
  .wavelength-team { grid-template-columns: 1fr; gap: 7px; padding: 10px; }
  .wavelength-team-score { min-width: 0; justify-content: space-between; }
  .wavelength-team-members { justify-content: flex-start; flex-wrap: wrap; overflow: visible; }
  .wavelength-team-members::-webkit-scrollbar { display: none; }
  .wavelength-team-members > span { flex: 0 0 auto; max-width: 100%; padding: 4px 6px; font-size: 9px; }
  .wavelength-stage { padding: 13px 10px; }
  .wavelength-stage-head { display: block; }
  .wavelength-clue { max-width: 100%; margin-top: 10px; justify-items: start; text-align: left; }
  .wavelength-endpoints { padding-inline: 2%; }
  .wavelength-dial { margin-top: -8px; }
  .wavelength-controls { min-height: 104px; margin-top: -12px; padding: 11px; }
  .wavelength-clue-form, .wavelength-dial-controls { grid-template-columns: 1fr; }
  .wavelength-clue-form .button, .wavelength-dial-controls .button { width: 100%; }
  .wavelength-dial-controls input, .wavelength-dial-controls .button { grid-column: 1; grid-row: auto; }
  .wavelength-side-controls { grid-template-columns: 1fr; gap: 8px; }
  .wavelength-side-controls > span { text-align: center; }
  .wavelength-side-controls .button { width: 100%; }
  .wavelength-result { grid-template-columns: 1fr; gap: 10px; text-align: center; }
  .wavelength-result-points { justify-content: center; }
  .wavelength-result .button { width: 100%; }
  .catan-gamebar {
    min-height: 0; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "turn tools" "meta meta"; gap: 6px 10px;
    padding: 9px 10px; border-radius: 16px;
  }
  .catan-room-meta {
    grid-area: meta; flex-wrap: nowrap; gap: 5px; min-width: 0; overflow: hidden;
  }
  .catan-turn-heading { grid-area: turn; }
  .catan-turn-heading h1 {
    overflow: hidden; font-size: clamp(16px, 4.8vw, 19px); line-height: 1.02;
    text-overflow: ellipsis; white-space: nowrap;
  }
  .catan-game-tools { grid-area: tools; }
  .catan-game-tools .button { min-height: 36px; padding: 7px 10px; }
  .trade-banner { right: 10px; bottom: 10px; width: min(420px, calc(100vw - 20px)); }
  .trade-resource-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .trade-target-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bank-resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .island-wrap { padding: 7px; }
  .island-wrap.is-placement-active {
    display: block; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin;
  }
  .island-wrap.is-placement-active .catan-board { width: 520px; min-width: 520px; margin-inline: auto; }
  .catan-board { width: 100%; max-height: none; }
  .island-toolbar { grid-template-columns: auto auto minmax(0, 1fr); gap: 8px; padding-inline: 11px; }
  .catan-awards { gap: 4px; }
  .award-chip { padding-inline: 7px; font-size: 8px; }
  .placement-tip { white-space: normal; text-align: center; }
  .bank-rate-hero { grid-template-columns: auto minmax(0, 1fr); }
  .bank-rate-stock { grid-column: 1 / -1; justify-self: start; }
  .catan-color-picker { align-items: flex-start; flex-direction: column; }
  .catan-color-picker [role="radiogroup"] { justify-content: flex-start; }
  .history-list { grid-template-columns: 1fr; }
  .leaderboard { overflow-x: auto; }
  .leaderboard table { min-width: 520px; }
  .join-actions, .result-actions { flex-direction: column; }
  .join-actions .button, .result-actions .button { width: 100%; }
}

@media (max-width: 360px) {
  body.is-social-game-active .table-banner.multiplayer-matchbar { min-height: 68px; }
  .coup-stage { padding: 9px; }
  .coup-status { margin-bottom: 8px; }
  .coup-player { padding: 6px; }
  .coup-player > header { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 4px 6px; }
  .coup-player > header > strong {
    display: -webkit-box; overflow: hidden; white-space: normal;
    font-size: 12px; line-height: 1.05; text-overflow: clip;
    -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  }
  .coup-player > header > b { grid-column: 2; font-size: 15px; line-height: 1; }
  .coup-player > header > b small { font-size: 8px; }
  .influence-row, .influence-card { min-height: 82px; }
  .coup-card-copy { inset: auto 5px 5px; }
  .coup-card-copy strong {
    overflow: visible; font-size: 10px; line-height: .86; text-overflow: clip; white-space: normal;
  }
  .coup-card-copy small { display: none; }
  .coup-action { grid-template-columns: 34px minmax(0, 1fr); gap: 7px; padding: 7px; }
  .coup-action-icon { width: 34px; height: 34px; border-radius: 9px; }
  .coup-action-icon svg { width: 19px; height: 19px; }
  .coup-guide-grid { grid-template-columns: 1fr; }
  .coup-guide-role { grid-template-columns: 78px minmax(0, 1fr); }
}

@media (max-width: 430px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; }
  .game-switcher { width: auto; min-width: 0; }
  .icon-button { width: 40px; height: 40px; }
  .header-actions { gap: 5px; }
  .account-button { max-width: 92px; min-height: 40px; font-size: 11px; }
  .primary-nav a { font-size: 11px; }
  .resource-grid { gap: 3px; }
  .resource-card { padding: 9px 1px; font-size: 8px; }
  .resource-card-value { gap: 3px; }
  .resource-card .catan-resource-icon { width: 19px; height: 19px; }
  .resource-card strong { font-size: 22px; }
  .resource-card-label { font-size: 8px; }
  .catan-gamebar { grid-template-columns: minmax(0, 1fr) auto; }
  .catan-game-tools .button { padding-inline: 9px; }
  .catan-game-tools .button svg { display: none; }
  .catan-game-tools .catan-sound-toggle { width: 36px; padding-inline: 8px; }
  .catan-game-tools .catan-sound-toggle svg { display: block; }
  .catan-sound-toggle span { display: none; }
  .catan-turn-marker { width: 11px; height: 11px; }
  .catan-turn-heading span { font-size: 8px; }
  .catan-phase-full { display: none; }
  .catan-phase-short { display: inline; }
  .trade-resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-dock .button { font-size: 11px; }
  .build-action { min-height: 58px !important; }
  .build-action-icon, .action-menu-icon { width: 31px; height: 31px; }
  .table-banner h1 { font-size: 34px; }
  html[data-social-game="catan"] .score-strip { display: grid; grid-template-columns: repeat(var(--seat-count), minmax(0, 1fr)); overflow: hidden; scroll-snap-type: none; }
  html[data-social-game="catan"] .score-seat { min-width: 0; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 5px; padding: 9px 7px; }
  html[data-social-game="catan"] .seat-dot { width: 6px; height: 6px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--seat-color) 17%, transparent); }
  html[data-social-game="catan"] .seat-name { font-size: 9px; }
  html[data-social-game="catan"] .seat-status { display: none; }
  html[data-social-game="catan"] .seat-score { font-size: 18px; }
}

@media (pointer: coarse) {
  .game-dropdown-item { min-height: 44px; }
  .trade-resource-card .counter button, .counter button { min-width: 44px; width: 44px; min-height: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
