:root {
  --ink: #092f29;
  --muted: #6c7a70;
  --paper: #efe3c8;
  --paper-light: #fff4d8;
  --line: rgba(217, 183, 95, 0.34);
  --red: #d84d38;
  --yellow: #d9b75f;
  --green: #0b4a3e;
  --felt: #0b4a3e;
  --felt-dark: #062c25;
  --felt-light: #155f4f;
  --gold: #d9b75f;
  --gold-dark: #9a7630;
  --cream: #fff4d8;
  --shadow: 0 22px 60px rgba(3, 27, 23, 0.24);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--cream);
  background:
    radial-gradient(circle at 78% 10%, rgba(217,183,95,.22), transparent 19%),
    radial-gradient(circle at 20% 18%, rgba(255,244,216,.12), transparent 24%),
    linear-gradient(135deg, #062c25 0%, #0d4d40 48%, #05261f 100%);
  font-family: "Manrope", sans-serif;
}

button, input { font: inherit; }
button { color: inherit; }

.noise {
  position: fixed;
  inset: 0;
  opacity: .28;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

.topbar {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 4vw, 64px);
  border-bottom: 1px solid rgba(217,183,95,.34);
  background: rgba(5, 36, 30, .9);
  box-shadow: 0 10px 28px rgba(0,0,0,.16);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cream);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .14em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--gold);
  border-radius: 50%;
  font-size: 11px;
  letter-spacing: -.02em;
  transform: rotate(-7deg);
}

.top-actions { display: flex; align-items: center; gap: 22px; }
.text-button, .icon-button, .ding-button {
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--cream);
}
.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(217,183,95,.46);
  border-radius: 50%;
  color: var(--gold);
}
.ding-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid rgba(217,183,95,.46);
  border-radius: 999px;
  color: var(--ink);
  background: var(--gold);
}
.ding-button.muted {
  color: rgba(255,244,216,.72);
  background: transparent;
  border-color: rgba(255,244,216,.24);
}
.sound-button.playing { color: var(--ink); background: var(--gold); border-color: var(--gold); }

.landing {
  min-height: calc(100vh - 82px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 50px clamp(24px, 7vw, 110px) 80px;
  background:
    radial-gradient(circle at 63% 32%, rgba(217,183,95,.18), transparent 18%),
    radial-gradient(circle at 30% 72%, rgba(255,244,216,.08), transparent 24%);
}

.eyebrow {
  margin: 0 0 18px;
  font: 500 11px/1 "DM Mono", monospace;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
}

.hero h1 {
  max-width: 740px;
  margin: 0;
  font-size: clamp(64px, 8vw, 126px);
  line-height: .84;
  letter-spacing: -.075em;
}

.hero h1 em {
  display: block;
  color: var(--red);
  font-family: Georgia, serif;
  font-weight: 400;
}

.hero-copy {
  max-width: 500px;
  margin: 32px 0 0;
  color: rgba(255,244,216,.76);
  font-size: 16px;
  line-height: 1.7;
}

.hero-meta {
  display: flex;
  gap: 34px;
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.hero-meta span { font: 500 11px "DM Mono", monospace; letter-spacing: .08em; }

.lobby-card {
  position: relative;
  padding: clamp(28px, 4vw, 48px);
  color: var(--cream);
  background:
    radial-gradient(circle at 88% 12%, rgba(217,183,95,.17), transparent 24%),
    linear-gradient(145deg, rgba(13, 83, 69, .98), rgba(5, 50, 42, .98));
  border: 2px solid rgba(217,183,95,.7);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.lobby-card::before {
  content: "";
  position: absolute;
  width: 84px;
  height: 84px;
  right: -25px;
  top: -30px;
  background: var(--gold);
  border-radius: 26% 74% 54% 46%;
  transform: rotate(17deg);
  z-index: -1;
}

.lobby-card h2 { margin: 0 0 9px; color: var(--cream); font-size: 34px; letter-spacing: -.055em; }
.lobby-card > p { margin: 0 0 28px; color: rgba(255,244,216,.78); font-size: 14px; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; margin-bottom: 8px; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .09em; }

input {
  width: 100%;
  height: 54px;
  padding: 0 17px;
  border: 1px solid rgba(217,183,95,.5);
  border-radius: 12px;
  outline: none;
  color: var(--ink);
  background: var(--cream);
}
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217,183,95,.22); }

.primary-button, .secondary-button {
  min-height: 54px;
  padding: 0 22px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  transition: transform .18s ease, box-shadow .18s ease;
}
.primary-button { color: var(--ink); background: var(--gold); box-shadow: 0 10px 22px rgba(3,27,23,.24); }
.secondary-button { color: var(--cream); background: rgba(255,244,216,.05); border: 1px solid rgba(217,183,95,.46); }
.danger-button { min-height: 42px; padding: 0 22px; color: white; background: var(--red); border: 0; border-radius: 12px; cursor: pointer; font-size: 12px; font-weight: 800; letter-spacing: .08em; box-shadow: 0 9px 20px rgba(239,86,63,.22); }
.primary-button:hover, .secondary-button:hover, .danger-button:hover { transform: translateY(-2px); }
.primary-button:disabled, .secondary-button:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.wide { width: 100%; }

.or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: rgba(255,244,216,.62);
  font: 500 10px "DM Mono", monospace;
}
.or::before, .or::after { content: ""; height: 1px; flex: 1; background: rgba(217,183,95,.34); }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.join-row input { text-transform: uppercase; font-family: "DM Mono"; letter-spacing: .15em; }
.join-row .secondary-button { color: var(--ink); background: var(--gold); border-color: var(--gold); }

.auth-landing { padding-top: 70px; }
.auth-card { width: min(480px, 100%); }
.auth-choice-grid { display: grid; gap: 12px; }
.auth-form { display: grid; gap: 10px; }
.remember-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 8px;
  color: rgba(255,244,216,.74);
  font-size: 13px;
}
.remember-row input { width: 17px; height: 17px; padding: 0; }
.auth-switch {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.lobby-account-actions {
  position: fixed;
  top: 100px;
  right: clamp(20px, 4vw, 64px);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(217,183,95,.44);
  border-radius: 999px;
  background: rgba(5, 42, 35, .94);
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
  backdrop-filter: blur(12px);
}
.lobby-account-actions .secondary-button { min-height: 34px; padding: 0 13px; font-size: 10px; }
.friends-button {
  position: relative;
  overflow: visible;
}
.friends-button.has-alert {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(242, 193, 107, .18);
}
.friend-alert-badge {
  position: absolute;
  top: -9px;
  right: -10px;
  min-width: 30px;
  padding: 4px 6px;
  border: 2px solid rgba(5, 42, 35, .96);
  border-radius: 999px;
  color: var(--ink);
  background: var(--yellow);
  font: 800 8px "DM Mono", monospace;
  letter-spacing: .08em;
  line-height: 1;
}
.waiting-account-bar { top: 98px; }
.invite-banner {
  position: fixed;
  top: 92px;
  left: 50%;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(620px, calc(100% - 28px));
  padding: 12px 14px 12px 18px;
  border: 1px solid rgba(217,183,95,.45);
  border-radius: 18px;
  color: var(--cream);
  background: rgba(5, 42, 35, .98);
  box-shadow: 0 18px 45px rgba(0,0,0,.24);
  transform: translateX(-50%);
}
.invite-banner span { flex: 1; font-size: 13px; }
.invite-banner .primary-button, .invite-banner .secondary-button { min-height: 38px; padding: 0 14px; font-size: 10px; }
.friends-panel {
  position: fixed;
  top: 154px;
  right: clamp(16px, 4vw, 64px);
  z-index: 30;
  width: min(390px, calc(100vw - 32px));
  max-height: calc(100vh - 180px);
  overflow-y: auto;
  padding: 22px;
  color: var(--ink);
  border: 1px solid rgba(217,183,95,.6);
  border-radius: 24px;
  background: rgba(255,244,216,.98);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.friends-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}
.friends-head h3 { margin: -10px 0 18px; font-size: 24px; letter-spacing: -.04em; }
.friend-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 18px;
}
.email-invite-form { margin-top: -8px; }
.friend-search input { height: 42px; }
.friend-search .secondary-button { min-height: 42px; padding: 0 13px; }
.friend-section {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
}
.friend-section > strong {
  font: 800 10px "DM Mono", monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.friend-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  min-height: 50px;
  padding: 9px;
  border: 1px solid rgba(9,47,41,.14);
  border-radius: 13px;
  background: rgba(255,255,255,.5);
}
.friend-row b { display: block; font-size: 13px; }
.friend-row small { color: var(--muted); font-size: 10px; }
.friend-row .primary-button, .friend-row .secondary-button { min-height: 34px; padding: 0 10px; font-size: 9px; }
.profile-inline,
.avatar-button,
.profile-name-button,
.seat-name-button {
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: inherit;
}
.profile-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-align: left;
  font-weight: 800;
}
.profile-inline span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-inline-guest,
.profile-inline-guest .avatar,
.profile-inline-guest .player-avatar,
.profile-inline-guest .friend-avatar,
.profile-inline-guest .opponent-avatar {
  cursor: default;
}
.avatar-button {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
}
.avatar-button:focus-visible,
.profile-inline:focus-visible,
.profile-name-button:focus-visible,
.seat-name-button:focus-visible {
  outline: 3px solid rgba(217,183,95,.58);
  outline-offset: 3px;
}
.profile-name-button,
.seat-name-button {
  display: block;
  font-weight: 800;
  text-align: left;
}
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #a6aaa4;
}
.status-dot.online {
  background: #2f9d67;
  box-shadow: 0 0 0 4px rgba(47,157,103,.14);
}
.friend-empty { margin: 3px 0; color: var(--muted); font-size: 12px; }

.friends-panel .secondary-button,
.invite-banner .secondary-button,
.resolution-panel .secondary-button,
dialog .secondary-button {
  color: var(--ink);
  background: rgba(9,47,41,.05);
  border-color: rgba(9,47,41,.22);
}

.friends-panel .primary-button,
.invite-banner .primary-button,
.resolution-panel .primary-button,
dialog .primary-button {
  color: var(--ink);
  background: var(--gold);
}

.waiting {
  min-height: calc(100vh - 82px);
  display: grid;
  place-items: center;
  padding: 30px;
}
.waiting-panel { width: min(720px, 100%); text-align: center; }
.room-code {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  margin: 18px 0 44px;
  padding: 18px 22px 18px 28px;
  color: var(--ink);
  border: 2px solid rgba(217,183,95,.64);
  border-radius: 14px;
  background: var(--cream);
}
.room-code strong { font: 500 clamp(26px, 5vw, 42px) "DM Mono"; letter-spacing: .17em; }
.copy-button { border: 0; background: var(--yellow); border-radius: 9px; padding: 10px 13px; cursor: pointer; font-size: 11px; font-weight: 800; }
.waiting h1 { margin: 0; color: var(--cream); font-size: clamp(44px, 8vw, 78px); letter-spacing: -.06em; }
.waiting-sub { color: rgba(255,244,216,.72); }
.seats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.seat {
  min-height: 142px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--cream);
  border: 1px dashed rgba(217,183,95,.42);
  border-radius: 18px;
}
.seat.filled { border-style: solid; background: rgba(3,35,29,.32); }
.avatar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--gold); font-weight: 800; }
.seat:nth-child(2) .avatar { background: #268f80; }
.seat:nth-child(3) .avatar { background: #3155a6; }
.seat:nth-child(4) .avatar { background: #a05b9d; }
.seat small { color: rgba(255,244,216,.68); }
.lobby-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.lobby-actions .waiting-turn { margin: 0 8px 0 0; }
.timer-setup {
  width: min(420px, 100%);
  margin: 22px auto 0;
  padding: 14px;
  border: 1px solid rgba(217,183,95,.44);
  border-radius: 16px;
  background: rgba(3,35,29,.32);
}
.timer-setup label span { display: block; margin-bottom: 6px; font: 800 10px "DM Mono"; letter-spacing: .1em; color: rgba(255,244,216,.74); }
.timer-setup label span em { font-style: normal; font-weight: 500; text-transform: none; letter-spacing: 0; }
.timer-setup input { height: 42px; width: 100%; }

.game {
  min-height: calc(100vh - 82px);
  display: grid;
  grid-template-columns: 260px 1fr;
}

.game-sidebar {
  padding: 28px 22px;
  color: var(--ink);
  border-right: 1px solid var(--line);
  background: rgba(255,244,216,.9);
  box-shadow: inset -1px 0 0 rgba(217,183,95,.22);
}
.room-chip { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; }
.room-chip span { font: 500 12px "DM Mono"; letter-spacing: .12em; }
.turn-number { color: var(--muted); font-size: 11px; }
.player-list { display: grid; gap: 8px; }
.player-row {
  padding: 13px;
  border-radius: 12px;
  border: 1px solid transparent;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}
.player-row.active { background: var(--paper-light); border-color: var(--line); }
.player-dot { width: 9px; height: 9px; border-radius: 50%; background: #bdc1bb; }
.active .player-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(239,86,63,.13); }
.player-row strong { display: block; font-size: 13px; }
.player-row small { color: var(--muted); font-size: 10px; }
.set-count { font: 500 11px "DM Mono"; }
.activity { margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.activity h3 { font-size: 10px; letter-spacing: .14em; }
.activity p { font-size: 11px; line-height: 1.5; color: var(--muted); }
.chat-panel { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.chat-panel h3 { margin: 0 0 12px; font-size: 10px; letter-spacing: .14em; }
.chat-messages {
  max-height: 190px;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}
.chat-messages p {
  margin: 0;
  padding: 8px 9px;
  border-radius: 10px;
  background: rgba(255,255,255,.48);
  font-size: 11px;
  line-height: 1.35;
}
.chat-messages strong { display: block; margin-bottom: 2px; font-size: 10px; color: var(--ink); }
.chat-messages span { color: var(--muted); overflow-wrap: anywhere; }
.chat-messages .empty-chat { color: var(--muted); background: transparent; padding: 0; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 6px; margin-top: 12px; }
.chat-form input {
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 11px;
}
.chat-form button {
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: var(--ink);
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}

.table-wrap { min-width: 0; padding: 18px clamp(18px, 3vw, 42px) 20px; display: grid; grid-template-rows: auto auto 1fr auto; gap: 14px; }
.turn-timer {
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(21,47,43,.12);
}
.turn-timer span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f9d67, var(--yellow), var(--red));
  transition: width 1.2s linear;
}
.game-status { display: flex; align-items: center; justify-content: space-between; }
.game-status h1 { margin: 0; font-size: clamp(22px, 3vw, 34px); letter-spacing: -.04em; }
.status-actions { display: flex; align-items: center; gap: 10px; }
.plays-badge { padding: 9px 13px; border-radius: 99px; color: var(--ink); background: var(--yellow); font: 500 10px "DM Mono"; }
.quit-button { min-height: 38px; padding: 0 14px; font-size: 10px; }

.table {
  min-height: 500px;
  padding: clamp(18px, 3vw, 34px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
  border-radius: 34px;
  border: 2px solid rgba(217,183,95,.5);
  background:
    radial-gradient(circle at 24% 18%, rgba(255,244,216,.08), transparent 22%),
    radial-gradient(circle at 78% 72%, rgba(3,27,23,.22), transparent 26%),
    linear-gradient(145deg, #176655 0%, #0c4c40 48%, #07372e 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255,244,216,.1),
    inset 0 0 52px rgba(3,27,23,.22),
    0 22px 60px rgba(3,27,23,.24);
  color: white;
  overflow: visible;
}
.opponents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.spectator-board {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
}
.spectator-table {
  grid-template-rows: 1fr;
}
.spectator-panel {
  grid-template-columns: auto 1fr;
}
.spectator-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.opponent { position: relative; min-width: 0; padding: 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 16px; background: rgba(4,34,28,.16); overflow: visible; }
.opponent-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; }
.opponent-head span { color: rgba(255,255,255,.78); white-space: nowrap; }
.mini-cards, .mini-card, .property-strips, .property-strip { display: none; }
.opponent-played-rows { display: grid; gap: 8px; margin-top: 12px; }
.opponent-card-row { display: grid; grid-template-columns: 35px 1fr; align-items: start; gap: 7px; min-height: 39px; }
.opponent-card-row > span { color: rgba(255,255,255,.56); font: 500 8px "DM Mono"; letter-spacing: .08em; text-transform: uppercase; }
.opponent-card-row small { color: rgba(255,255,255,.5); font-size: 9px; }
.cash-row > div, .opponent-property-groups { display: flex; align-items: flex-start; min-width: 0; overflow: visible; }
.cash-row img, .opponent-property-set img {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 51px;
  margin-right: -12px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 2px 5px rgba(0,0,0,.28);
  cursor: zoom-in;
  transform-origin: center center;
  transition: transform .16s ease, z-index 0s;
}
.cash-row img:hover, .opponent-property-set img:hover {
  z-index: 20;
  transform: translateY(4px) scale(3.4);
  box-shadow: 0 10px 24px rgba(0,0,0,.38);
}
.cash-row img.rotated-card-image:hover, .opponent-property-set img.rotated-card-image:hover {
  transform: translateY(4px) scale(3.4) rotate(180deg);
}
.opponent-property-set {
  display: flex;
  align-items: flex-start;
  margin-right: 16px;
  padding-left: 5px;
  border-left: 4px solid var(--set-color);
}
.opponent-property-set:last-child { margin-right: 0; }

.my-board { display: grid; grid-template-columns: minmax(130px, .25fr) 1fr; gap: 14px; }
.bank-zone, .sets-zone { padding: 13px; border-radius: 14px; background: rgba(4,34,28,.2); }
.zone-label { display: flex; justify-content: space-between; margin-bottom: 10px; font: 500 9px "DM Mono"; letter-spacing: .1em; color: rgba(255,255,255,.7); }
.bank-cards { display: flex; flex-wrap: wrap; gap: 5px; }
.bank-note { padding: 7px 8px; color: var(--ink); background: var(--paper-light); border-radius: 6px; font: 700 10px "DM Mono"; }
.bank-card-image { width: 45px; height: 64px; object-fit: cover; border-radius: 5px; box-shadow: 0 2px 6px rgba(0,0,0,.24); }
.set-groups { display: flex; flex-wrap: wrap; gap: 12px; }
.set-group { min-width: 145px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.1); }
.set-color { height: 5px; border-radius: 5px; margin-bottom: 5px; }
.set-group small { font-size: 9px; color: rgba(255,255,255,.8); }
.owned-property-cards { display: flex; height: 66px; margin-bottom: 6px; padding-left: 2px; align-items: flex-start; }
.owned-property-cards img {
  width: 43px;
  height: 64px;
  margin-left: -7px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 2px 5px rgba(0,0,0,.24);
}
.owned-property-cards img:first-child { margin-left: 0; }
.owned-wild-button {
  flex: 0 0 43px;
  width: 43px;
  height: 64px;
  margin-left: -7px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(244,199,85,.42);
}
.owned-wild-button:first-child { margin-left: 0; }
.owned-wild-button img { width: 100%; height: 100%; margin-left: 0; box-shadow: none; }
.owned-wild-button:hover { transform: translateY(-2px); }
.owned-upgrade-card, .opponent-upgrade-card { outline: 2px solid rgba(244,199,85,.9); outline-offset: -2px; }

.hand-area { min-width: 0; }
.hand-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.hand-header span { font: 500 10px "DM Mono"; letter-spacing: .12em; }
.hand { display: flex; align-items: end; min-height: 170px; padding: 0 10px; overflow-x: auto; overflow-y: hidden; }
.card {
  flex: 0 0 132px;
  height: 185px;
  margin-left: -15px;
  padding: 9px;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 12px;
  text-align: left;
  color: var(--ink);
  background: var(--paper-light);
  box-shadow: 0 8px 18px rgba(29,44,39,.18);
  cursor: pointer;
  transition: transform .18s ease, margin .18s ease;
  overflow: hidden;
}
.card:first-child { margin-left: 0; }
.card:hover { transform: translateY(-15px) rotate(-1deg); margin-right: 16px; }
.card.selected-card {
  outline: 4px solid var(--red);
  outline-offset: -4px;
  transform: translateY(-12px);
  box-shadow: 0 13px 28px rgba(239,86,63,.26);
}
.card-band { height: 13px; margin: -9px -9px 9px; background: var(--ink); }
.card-type { font: 500 8px "DM Mono"; letter-spacing: .1em; color: var(--muted); }
.card strong { margin-top: 7px; font-size: 13px; line-height: 1.1; }
.card p { margin: 6px 0 0; font-size: 9px; line-height: 1.35; color: var(--muted); }
.card-value { margin-top: auto; align-self: end; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--ink); font: 500 9px "DM Mono"; }
.card.money { background: #f8d868; }
.card.action .card-band { background: var(--red); }
.card.scanned-card {
  padding: 0;
  background: transparent;
}
.card.scanned-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}
.rotated-card-image { transform: rotate(180deg); transform-origin: center center; }
.card.action.scanned-card > img,
.card.money.scanned-card > img,
.bank-card-image,
.payment-asset img,
.owned-upgrade-card,
.opponent-upgrade-card {
  transform: none !important;
}
.card.action.scanned-card[data-tooltip] { position: relative; overflow: visible; }
.card.action.scanned-card[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  width: 210px;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--paper-light);
  background: rgba(21,47,43,.96);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 12px 24px rgba(0,0,0,.22);
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
  transition: .16s ease;
  z-index: 40;
}
.card.action.scanned-card[data-tooltip]:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
.card.scanned-card.tooltip-hidden::after { display: none; }

.turn-actions { display: flex; gap: 10px; }
.turn-actions button { min-height: 42px; }
.waiting-turn { color: rgba(255,244,216,.72); font-size: 12px; }
.game-sidebar .waiting-turn, dialog .waiting-turn { color: var(--muted); }
.begin-turn-button { min-height: 44px; }

.resolution-panel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 16px 18px;
  color: var(--ink);
  border: 1px solid rgba(217,183,95,.48);
  border-radius: 18px;
  background: rgba(255,244,216,.94);
  box-shadow: 0 12px 32px rgba(3,27,23,.18);
}
.resolution-panel > img { width: 58px; height: 82px; object-fit: cover; border-radius: 7px; box-shadow: 0 5px 12px rgba(0,0,0,.15); }
.resolution-copy .eyebrow { margin-bottom: 7px; }
.resolution-copy strong { font-size: 17px; }
.resolution-copy p:last-child, .waiting-resolution p:last-child { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.resolution-actions { display: flex; gap: 8px; }
.resolution-actions button { min-height: 46px; }
.payment-panel { grid-template-columns: minmax(180px, .6fr) minmax(0, 1fr) auto; min-width: 0; }
.payment-assets {
  display: flex;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  padding: 5px 8px 10px 5px;
  scrollbar-gutter: stable;
}
.payment-asset { position: relative; flex: 0 0 61px; height: 87px; padding: 0; border: 2px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; opacity: .7; }
.payment-asset.selected { border-color: var(--red); opacity: 1; transform: translateY(-3px); }
.payment-asset img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
.payment-asset span { position: absolute; right: -5px; bottom: -5px; padding: 3px 5px; color: white; background: var(--ink); border-radius: 8px; font: 500 9px "DM Mono"; }

dialog {
  width: min(560px, calc(100% - 30px));
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--ink);
  background: var(--paper-light);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(10,35,30,.62); backdrop-filter: blur(5px); }
.dialog-close { position: absolute; top: 15px; right: 17px; border: 0; background: none; cursor: pointer; font-size: 25px; }
dialog h2 { margin: 0 0 26px; font-size: 34px; letter-spacing: -.05em; }
.dialog-copy { margin: -12px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; }
.bank-confirm-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 24px;
  padding: 12px;
  border: 1px solid rgba(9,47,41,.12);
  border-radius: 16px;
  background: rgba(9,47,41,.05);
}
.bank-confirm-preview img {
  width: 58px;
  height: 82px;
  object-fit: cover;
  border-radius: 7px;
  box-shadow: 0 5px 12px rgba(0,0,0,.15);
}
.bank-confirm-preview strong {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--gold);
  border-radius: 50%;
  font: 800 17px "DM Mono", monospace;
}
.rules-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.rules-list li { display: grid; grid-template-columns: 40px 1fr; gap: 15px; }
.rules-list li > span { font: 500 11px "DM Mono"; color: var(--red); }
.rules-list strong { font-size: 14px; }
.rules-list p { margin: 3px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.play-options { display: grid; gap: 10px; }
.play-options button { text-align: left; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: pointer; }
.play-options button:hover { border-color: var(--ink); }
.play-options strong { display: block; }
.play-options small { color: var(--muted); }
.play-options button.property-choice {
  color: var(--choice-fg);
  background: var(--choice-bg);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);
}
.play-options button.property-choice small {
  color: var(--choice-fg);
  opacity: .78;
}
.bank-from-steal {
  margin-top: 14px;
}
.rent-builder { display: grid; gap: 16px; }
.rent-builder strong { display: block; margin-bottom: 9px; }
.rent-color-options, .rent-target-options { display: flex; flex-wrap: wrap; gap: 8px; }
.rent-color-options button, .rent-target-options button {
  min-height: 42px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.rent-color-options button span {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 7px;
  border-radius: 4px;
  background: var(--rent-color);
  vertical-align: -2px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
}
.rent-color-options button.selected, .rent-target-options button.selected, .double-rent-toggle.selected {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,86,63,.13);
}
.rent-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-radius: 14px;
  color: white;
  background: var(--ink);
}
.rent-total span { font: 500 10px "DM Mono"; letter-spacing: .12em; }
.rent-total strong { margin: 0; font-size: 28px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 30;
  padding: 12px 18px;
  color: white;
  background: var(--ink);
  border-radius: 10px;
  font-size: 12px;
  transform: translate(-50%, 90px);
  opacity: 0;
  transition: .25s ease;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.save-popup {
  position: fixed;
  top: 108px;
  left: 50%;
  z-index: 120;
  padding: 13px 20px;
  border: 1px solid rgba(217,183,95,.66);
  border-radius: 999px;
  color: var(--cream);
  background: rgba(5, 42, 35, .98);
  box-shadow: 0 16px 38px rgba(0,0,0,.26);
  font: 800 12px "DM Mono", monospace;
  letter-spacing: .1em;
  text-transform: uppercase;
  transform: translate(-50%, -18px) scale(.96);
  opacity: 0;
  pointer-events: none;
  transition: .24s ease;
}
.save-popup.show {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
}
.winner { text-align: center; padding: 40px; }
.winner h2 { font-size: 52px; margin: 8px 0; }
.winner-actions { justify-content: center; margin-top: 24px; }
.customize-dialog { width: min(760px, calc(100% - 30px)); }
.leaderboard-dialog,
.profile-stats-dialog {
  width: min(940px, calc(100% - 28px));
  max-height: min(820px, calc(100vh - 32px));
  overflow-y: auto;
}
.profile-stats-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.profile-stats-head h2 { margin-bottom: 0; }
.leaderboard-section,
.stats-section {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(9,47,41,.12);
}
.leaderboard-section h3,
.stats-section h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -.02em;
}
.leaderboard-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.leaderboard-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 12px;
}
.leaderboard-table th,
.leaderboard-table td {
  padding: 10px 9px;
  border-bottom: 1px solid rgba(9,47,41,.1);
  text-align: right;
}
.leaderboard-table th:nth-child(2),
.leaderboard-table td:nth-child(2) {
  text-align: left;
}
.leaderboard-table th {
  color: var(--muted);
  font: 800 9px "DM Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px;
}
.stat-card {
  padding: 14px;
  border: 1px solid rgba(9,47,41,.12);
  border-radius: 16px;
  background: rgba(9,47,41,.05);
}
.stat-card > strong {
  display: block;
  color: var(--muted);
  font: 800 9px "DM Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.stat-main {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 8px 0 12px;
}
.stat-main span {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.05em;
}
.stat-main small { color: var(--muted); }
.stat-card dl {
  display: grid;
  gap: 5px;
  margin: 0;
}
.stat-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.stat-card dt {
  color: var(--muted);
  font-size: 11px;
}
.stat-card dd {
  margin: 0;
  font-weight: 800;
}
.stats-note {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.customize-section {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.customize-section > strong {
  font: 800 11px "DM Mono", monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.theme-option {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid rgba(9,47,41,.16);
  border-radius: 14px;
  background: rgba(255,255,255,.55);
  cursor: pointer;
  text-align: left;
  font-size: 12px;
  font-weight: 800;
}
.theme-option.selected {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(216,77,56,.14);
}
.theme-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.8);
  box-shadow: 0 0 0 1px rgba(9,47,41,.18);
  background: linear-gradient(135deg, #f5f1df 0 45%, #14352e 45% 100%);
}
.theme-felt { background: linear-gradient(135deg, #0b4a3e 0 58%, #d9b75f 58%); }
.theme-original { background: linear-gradient(135deg, #f6f1df 0 52%, #092f29 52% 78%, #d9b75f 78%); }
.theme-speakeasy { background: linear-gradient(135deg, #171119 0 58%, #cfa55b 58%); }
.theme-kitchen { background: linear-gradient(135deg, #fff7e7 0 58%, #2f2a21 58%); }
.theme-mobile { background: linear-gradient(135deg, #37b7ff 0 58%, #ff5a70 58%); }
.theme-arcade { background: linear-gradient(135deg, #06142a 0 46%, #2fffd2 46% 70%, #e842ff 70%); }
.theme-ledger { background: linear-gradient(135deg, #ead9bc 0 58%, #a3352a 58%); }
.theme-minimal { background: linear-gradient(135deg, #ffffff 0 58%, #111817 58%); }
.theme-poker { background: linear-gradient(135deg, #3a141a 0 52%, #092f29 52% 78%, #f2c16b 78%); }
.profile-upload-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}
.profile-upload-row p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.account-email-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
}
.account-email-form .field { margin: 0; }
.account-email-form .secondary-button { min-height: 48px; }
.settings-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.file-button {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  margin-right: 8px;
}
.file-button input { display: none; }
.avatar, .player-avatar, .friend-avatar, .opponent-avatar, .profile-preview {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  color: var(--ink);
  background: var(--gold);
  font-weight: 800;
}
.avatar { width: 44px; height: 44px; }
.player-avatar, .friend-avatar, .opponent-avatar { width: 28px; height: 28px; font-size: 11px; }
.opponent-avatar { width: 24px; height: 24px; }
.profile-preview { width: 74px; height: 74px; font-size: 24px; }
.avatar-photo {
  object-fit: cover;
  color: transparent;
}
.opponent-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  overflow: hidden;
}

html[data-theme="original"] {
  --ink: #092f29;
  --muted: #5f6f67;
  --paper: #efe3c8;
  --paper-light: #fff7df;
  --cream: #fff4d8;
  --gold: #d1aa52;
  --yellow: #d9b75f;
  --red: #cf553f;
  --line: rgba(9,47,41,.18);
}
html[data-theme="original"] body {
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 10%, rgba(217,183,95,.14), transparent 20%),
    linear-gradient(135deg, #f6f1df 0%, #e9e2ca 52%, #d8cfb3 100%);
}
html[data-theme="original"] .topbar,
html[data-theme="original"] .lobby-account-actions,
html[data-theme="original"] .invite-banner {
  background: rgba(9,47,41,.94);
}
html[data-theme="felt"] body {
  background:
    radial-gradient(circle at 78% 10%, rgba(217,183,95,.22), transparent 19%),
    radial-gradient(circle at 20% 18%, rgba(255,244,216,.12), transparent 24%),
    linear-gradient(135deg, #062c25 0%, #0d4d40 48%, #05261f 100%);
}
html[data-theme="speakeasy"] {
  --ink: #171119;
  --gold: #cfa55b;
  --yellow: #cfa55b;
  --red: #9d3431;
  --line: rgba(207,165,91,.38);
}
html[data-theme="speakeasy"] body {
  background:
    radial-gradient(circle at 76% 18%, rgba(207,165,91,.16), transparent 24%),
    linear-gradient(135deg, #22151f, #120d14 60%, #080608);
}
html[data-theme="speakeasy"] .topbar,
html[data-theme="speakeasy"] .lobby-account-actions,
html[data-theme="speakeasy"] .invite-banner {
  background: rgba(20,13,18,.94);
}
html[data-theme="speakeasy"] .lobby-card,
html[data-theme="speakeasy"] .table {
  background: linear-gradient(145deg, #241923, #140d12);
}
html[data-theme="kitchen"] {
  --ink: #2f2a21;
  --gold: #d2a64c;
  --yellow: #ffd66d;
  --red: #c76a47;
  --line: rgba(177,142,84,.34);
}
html[data-theme="kitchen"] body {
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 13%, rgba(255,214,109,.28), transparent 19%),
    linear-gradient(135deg, #fff7e7, #ead7b5);
}
html[data-theme="kitchen"] .topbar,
html[data-theme="kitchen"] .lobby-account-actions,
html[data-theme="kitchen"] .invite-banner {
  background: rgba(47,42,33,.92);
}
html[data-theme="kitchen"] .lobby-card,
html[data-theme="kitchen"] .table {
  background: linear-gradient(145deg, #674930, #30261d);
}
html[data-theme="mobile"] {
  --ink: #082d3d;
  --gold: #ffcf48;
  --yellow: #ffcf48;
  --red: #ff5a70;
  --line: rgba(55,183,255,.35);
}
html[data-theme="mobile"] body {
  background: linear-gradient(135deg, #eaf9ff, #37b7ff);
}
html[data-theme="mobile"] .topbar,
html[data-theme="mobile"] .lobby-account-actions,
html[data-theme="mobile"] .invite-banner {
  background: rgba(8,45,61,.92);
}
html[data-theme="mobile"] .lobby-card,
html[data-theme="mobile"] .table {
  background: linear-gradient(145deg, #0e6685, #082d3d);
}
html[data-theme="arcade"] {
  --ink: #06142a;
  --gold: #2fffd2;
  --yellow: #ffde59;
  --red: #e842ff;
  --line: rgba(47,255,210,.35);
}
html[data-theme="arcade"] body {
  background:
    radial-gradient(circle at 74% 18%, rgba(232,66,255,.22), transparent 22%),
    radial-gradient(circle at 24% 72%, rgba(47,255,210,.2), transparent 22%),
    #06142a;
}
html[data-theme="arcade"] .topbar,
html[data-theme="arcade"] .lobby-account-actions,
html[data-theme="arcade"] .invite-banner {
  background: rgba(6,20,42,.94);
}
html[data-theme="arcade"] .lobby-card,
html[data-theme="arcade"] .table {
  background: linear-gradient(145deg, #0d2244, #06142a);
  box-shadow: 0 0 28px rgba(47,255,210,.14), var(--shadow);
}
html[data-theme="ledger"] {
  --ink: #2a2118;
  --gold: #b99e73;
  --yellow: #d6b172;
  --red: #a3352a;
  --cream: #f7efd5;
  --paper-light: #f7efd5;
  --line: rgba(107,69,35,.28);
}
html[data-theme="ledger"] body {
  color: var(--ink);
  background:
    radial-gradient(circle at 72% 20%, rgba(185,158,115,.18), transparent 24%),
    linear-gradient(135deg, #ead9bc, #d8bf94);
}
html[data-theme="ledger"] .topbar,
html[data-theme="ledger"] .lobby-account-actions,
html[data-theme="ledger"] .invite-banner {
  background: rgba(42,33,24,.94);
}
html[data-theme="ledger"] .lobby-card,
html[data-theme="ledger"] .table {
  background: linear-gradient(145deg, #6d5638, #2a2118);
}
html[data-theme="minimal"] {
  --ink: #111817;
  --muted: #59625f;
  --gold: #d8b657;
  --yellow: #ead07a;
  --red: #d4513e;
  --cream: #fbfaf4;
  --paper-light: #ffffff;
  --line: rgba(17,24,23,.22);
}
html[data-theme="minimal"] body {
  color: var(--ink);
  background: #f5f5f0;
}
html[data-theme="minimal"] .topbar,
html[data-theme="minimal"] .lobby-account-actions,
html[data-theme="minimal"] .invite-banner {
  background: rgba(17,24,23,.94);
}
html[data-theme="minimal"] .lobby-card,
html[data-theme="minimal"] .table {
  background: linear-gradient(145deg, #293533, #111817);
  border-radius: 14px;
}

html[data-theme="original"] .landing,
html[data-theme="original"] .waiting,
html[data-theme="original"] .game-status,
html[data-theme="kitchen"] .landing,
html[data-theme="kitchen"] .waiting,
html[data-theme="kitchen"] .game-status,
html[data-theme="ledger"] .landing,
html[data-theme="ledger"] .waiting,
html[data-theme="ledger"] .game-status,
html[data-theme="minimal"] .landing,
html[data-theme="minimal"] .waiting,
html[data-theme="minimal"] .game-status {
  color: var(--ink);
}

html[data-theme="original"] .waiting h1,
html[data-theme="original"] .room-chip span,
html[data-theme="original"] .hand-header span,
html[data-theme="original"] .hand-header .waiting-turn,
html[data-theme="kitchen"] .waiting h1,
html[data-theme="kitchen"] .room-chip span,
html[data-theme="kitchen"] .hand-header span,
html[data-theme="kitchen"] .hand-header .waiting-turn,
html[data-theme="ledger"] .waiting h1,
html[data-theme="ledger"] .room-chip span,
html[data-theme="ledger"] .hand-header span,
html[data-theme="ledger"] .hand-header .waiting-turn,
html[data-theme="minimal"] .waiting h1,
html[data-theme="minimal"] .room-chip span,
html[data-theme="minimal"] .hand-header span,
html[data-theme="minimal"] .hand-header .waiting-turn {
  color: var(--ink);
}

html[data-theme="original"] .waiting-sub,
html[data-theme="original"] .waiting .waiting-turn,
html[data-theme="kitchen"] .waiting-sub,
html[data-theme="kitchen"] .waiting .waiting-turn,
html[data-theme="ledger"] .waiting-sub,
html[data-theme="ledger"] .waiting .waiting-turn,
html[data-theme="minimal"] .waiting-sub,
html[data-theme="minimal"] .waiting .waiting-turn {
  color: rgba(17,24,23,.74);
}

html[data-theme="original"] .lobby-card,
html[data-theme="original"] .table,
html[data-theme="kitchen"] .lobby-card,
html[data-theme="kitchen"] .table,
html[data-theme="ledger"] .lobby-card,
html[data-theme="ledger"] .table,
html[data-theme="minimal"] .lobby-card,
html[data-theme="minimal"] .table {
  color: var(--cream);
}

html[data-theme="original"] .lobby-card h2,
html[data-theme="original"] .lobby-card > p,
html[data-theme="kitchen"] .lobby-card h2,
html[data-theme="kitchen"] .lobby-card > p,
html[data-theme="ledger"] .lobby-card h2,
html[data-theme="ledger"] .lobby-card > p,
html[data-theme="minimal"] .lobby-card h2,
html[data-theme="minimal"] .lobby-card > p {
  color: var(--cream);
}
html[data-theme="poker"] {
  --ink: #2b120f;
  --gold: #f2c16b;
  --yellow: #f2c16b;
  --red: #c64b3f;
  --line: rgba(242,193,107,.42);
}
html[data-theme="poker"] body {
  background:
    radial-gradient(circle at 50% 18%, rgba(242,193,107,.17), transparent 28%),
    linear-gradient(135deg, #4b1721 0%, #321116 52%, #1b0b0d 100%);
}
html[data-theme="poker"] .topbar,
html[data-theme="poker"] .lobby-account-actions,
html[data-theme="poker"] .invite-banner {
  background: rgba(20,8,9,.94);
}
html[data-theme="poker"] .lobby-card,
html[data-theme="poker"] .table {
  background:
    radial-gradient(circle at 35% 18%, rgba(242,193,107,.12), transparent 24%),
    linear-gradient(145deg, #0e5a4a 0%, #082f28 58%, #041c18 100%);
  border-color: rgba(242,193,107,.7);
}
.confetti-layer span {
  position: absolute;
  left: var(--x);
  top: -20px;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  background: var(--color);
  animation: confetti-fall var(--duration) ease-in var(--delay) forwards;
}
@keyframes confetti-fall {
  to {
    transform: translateY(110vh) rotate(var(--spin));
    opacity: .9;
  }
}

@media (max-width: 850px) {
  .landing { grid-template-columns: 1fr; padding-top: 70px; }
  .hero h1 { font-size: clamp(60px, 18vw, 110px); }
  .lobby-card { width: min(540px, 100%); }
  .game { grid-template-columns: 1fr; }
  .game-sidebar { display: none; }
  .opponents { grid-template-columns: repeat(3, minmax(130px, 1fr)); overflow-x: auto; }
  .spectator-board { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); overflow-x: visible; }
  .my-board { grid-template-columns: 1fr; }
  .table-wrap { padding: 16px; }
  .resolution-panel, .payment-panel { grid-template-columns: 1fr; }
  .resolution-panel > img { display: none; }
  .resolution-actions { justify-content: stretch; }
  .resolution-actions button { flex: 1; }
}

@media (max-width: 560px) {
  .topbar { height: 68px; }
  .text-button { display: none; }
  #customizeButton, #leaderboardButton { display: inline-block; font-size: 8px; }
  .top-actions { gap: 8px; }
  .landing { min-height: calc(100vh - 68px); padding: 42px 18px; }
  .hero-meta { gap: 14px; justify-content: space-between; }
  .hero-meta span { font-size: 9px; }
  .lobby-card { padding: 25px 20px; border-radius: 22px; }
  .seats { grid-template-columns: repeat(2, 1fr); }
  .waiting { padding: 24px 16px; }
  .room-code { gap: 10px; }
  .room-code strong { font-size: 26px; }
  .game { min-height: calc(100vh - 68px); }
  .table { padding: 13px; border-radius: 22px; }
  .opponent { padding: 10px; }
  .hand { min-height: 158px; }
  .card { flex-basis: 112px; height: 158px; }
}
