:root {
  color-scheme: dark;
  --bg: #090c10;
  --bg-2: #111820;
  --surface: rgba(18, 23, 29, 0.94);
  --surface-2: rgba(25, 31, 39, 0.9);
  --surface-3: rgba(37, 45, 55, 0.82);
  --line: rgba(221, 206, 160, 0.16);
  --line-strong: rgba(221, 206, 160, 0.34);
  --text: #f5ecd9;
  --muted: #a4adba;
  --soft: #d5dce5;
  --gold: #e9b85c;
  --gold-2: #b87327;
  --aqua: #5dc8d6;
  --green: #58c58a;
  --red: #d96459;
  --violet: #9f87f7;
  --wood: #3b2619;
  --felt: #124a3c;
  --shadow: rgba(0, 0, 0, 0.42);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

html {
  background: var(--bg);
}

body {
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(245, 236, 217, 0.055), transparent 36%),
    linear-gradient(130deg, rgba(93, 200, 214, 0.085), transparent 32%),
    linear-gradient(320deg, rgba(217, 100, 89, 0.055), transparent 36%),
    radial-gradient(circle at 50% 0, rgba(233, 184, 92, 0.08), transparent 28%),
    #090c10;
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--aqua);
  outline-offset: 2px;
}

@media (min-width: 821px) {
  .landscape-button {
    display: none;
  }
}

.orientation-lock {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(8, 11, 15, 0.96);
  text-align: center;
}

.orientation-lock > div {
  width: min(100%, 360px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 22px;
  box-shadow: 0 24px 64px var(--shadow);
}

.orientation-lock strong,
.orientation-lock span {
  display: block;
}

.orientation-lock strong {
  font-size: 18px;
  color: #fff7e4;
}

.orientation-lock span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.toast-layer {
  position: fixed;
  z-index: 120;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 10px;
  align-items: start;
  border: 1px solid rgba(93, 200, 214, 0.28);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 48%),
    rgba(10, 15, 22, 0.96);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.44);
  padding: 12px;
  pointer-events: auto;
  animation: toast-in 180ms ease both;
}

.toast strong {
  color: #fff8e8;
  font-size: 13px;
}

.toast span {
  grid-column: 1 / 2;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.35;
}

.toast button {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.toast-success {
  border-color: rgba(88, 197, 138, 0.34);
}

.toast-error {
  border-color: rgba(217, 100, 89, 0.44);
}

.app-shell {
  width: min(100%, 1440px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  grid-template-rows: auto auto minmax(420px, 1fr) auto;
  grid-template-areas:
    "topbar topbar"
    "status log"
    "board log"
    "controls controls";
  gap: 12px;
}

.is-setup .app-shell {
  grid-template-columns: 1fr;
  grid-template-rows: auto minmax(620px, 1fr);
  grid-template-areas:
    "topbar"
    "board";
}

.is-setup .status-strip,
.is-setup .controls,
.is-setup .log-panel {
  display: none;
}

.is-setup .board-wrap {
  min-height: min(820px, calc(100vh - 100px));
}

.topbar,
.status-strip > div,
.board-wrap,
.controls,
.log-panel,
.setup-panel,
.online-card,
.rules-box,
.room-banner,
.room-waiting-card,
.score-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.065), transparent 52%),
    var(--surface);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}

.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 13px 15px;
  background:
    linear-gradient(90deg, rgba(233, 184, 92, 0.11), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 60%),
    rgba(17, 24, 32, 0.94);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #111823;
  padding: 6px;
  object-fit: contain;
}

.eyebrow,
.topbar h1,
.log-panel h2,
.setup-panel h2 {
  margin: 0;
}

.eyebrow {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar h1 {
  margin-top: 1px;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 0.95;
  color: #fff8e8;
}

.icon-button {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #273143, #111823);
  color: var(--text);
  font-size: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.icon-button:hover {
  border-color: rgba(67, 199, 216, 0.55);
  color: #ffffff;
}

.icon-button.active {
  border-color: rgba(86, 214, 140, 0.7);
  box-shadow: 0 0 0 2px rgba(86, 214, 140, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.status-strip {
  grid-area: status;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.status-strip > div {
  min-width: 0;
  min-height: 68px;
  padding: 10px 12px;
  display: grid;
  align-content: center;
}

.status-strip span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.status-strip strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  color: #fff4d9;
  font-size: 18px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-wrap {
  grid-area: board;
  min-height: 0;
  padding: clamp(8px, 1.1vw, 14px);
  background:
    linear-gradient(180deg, rgba(242, 189, 92, 0.09), transparent 34%),
    linear-gradient(145deg, rgba(23, 31, 42, 0.97), rgba(7, 10, 15, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    inset 0 28px 80px rgba(255, 255, 255, 0.025),
    0 24px 70px rgba(0, 0, 0, 0.34);
  perspective: 1100px;
}

.board {
  width: 100%;
  min-height: 100%;
  display: grid;
  place-items: center;
}

.log-panel {
  grid-area: log;
  min-height: 0;
  padding: 12px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
}

.log-panel h2 {
  color: #fff8e8;
  font-size: 15px;
}

.log-panel ol {
  min-height: 0;
  margin: 0;
  padding: 0 0 0 18px;
  overflow: auto;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.45;
}

.log-panel li + li {
  margin-top: 8px;
}

.controls {
  grid-area: controls;
  padding: 10px 10px 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 180px) minmax(220px, 290px);
  align-items: stretch;
  gap: 10px;
  background:
    linear-gradient(90deg, rgba(67, 199, 216, 0.045), transparent 48%, rgba(242, 189, 92, 0.045)),
    var(--surface);
  overflow: visible;
}

.action-hint {
  grid-column: 1 / -1;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(242, 189, 92, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(242, 189, 92, 0.12), rgba(93, 200, 214, 0.08)),
    rgba(7, 12, 18, 0.64);
  color: #ffe8b6;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.action-hint::before {
  content: "!";
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--gold);
  color: #1d1308;
  font-size: 12px;
  font-weight: 1000;
}

.hand {
  min-width: 0;
  display: flex;
  justify-content: center;
  gap: 0;
  align-items: end;
  overflow-x: auto;
  overflow-y: visible;
  padding: 34px 20px 18px;
  scroll-snap-type: x proximity;
  perspective: 900px;
  isolation: isolate;
}

.hand.hand-locked {
  filter: saturate(0.92);
}

.hand.hand-locked .hand-slot {
  cursor: default;
  opacity: 1;
}

.hand.hand-locked::before {
  content: "Main visible - en attente";
  flex: 0 0 auto;
  align-self: center;
  margin-right: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
  white-space: nowrap;
}

.hand::-webkit-scrollbar,
.log-panel ol::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.hand::-webkit-scrollbar-thumb,
.log-panel ol::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(226, 211, 166, 0.22);
}

.turn-actions {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: minmax(46px, 1fr);
  gap: 8px;
}

.primary-button,
.secondary-button,
.mastery-button {
  min-height: 44px;
  border-radius: var(--radius);
  font-weight: 900;
  letter-spacing: 0;
  transition: transform 140ms ease, border-color 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.mastery-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.primary-button.is-loading,
.secondary-button.is-loading,
.mastery-button.is-loading {
  position: relative;
  color: transparent;
}

.primary-button.is-loading::after,
.secondary-button.is-loading::after,
.mastery-button.is-loading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: #fff8e8;
  animation: spin 720ms linear infinite;
}

.primary-button {
  border: 0;
  background: linear-gradient(180deg, #ffd777, var(--gold-2));
  color: #1f1308;
  box-shadow: 0 12px 28px rgba(201, 133, 44, 0.22);
}

.secondary-button {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #273143, #121923);
  color: var(--text);
}

.quit-game-button {
  border-color: rgba(251, 113, 133, 0.38);
  color: #fecdd3;
}

.secondary-button.mastery-available {
  border: 0;
  background: linear-gradient(135deg, #fff176 0%, #f59e0b 34%, #ec4899 68%, #8b5cf6 100%);
  color: #170b2e;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.22),
    0 0 24px rgba(245, 158, 11, 0.55),
    0 16px 34px rgba(236, 72, 153, 0.24);
  animation: mastery-button-glow 980ms ease-in-out infinite alternate;
}

.mastery-button {
  border: 0;
  background: linear-gradient(180deg, #aa94ff, #6552cc);
  color: #ffffff;
}

.center-slot:disabled,
.hand-slot:disabled,
.primary-button:disabled,
.secondary-button:disabled,
.mastery-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  transform: none;
}

.setup-panel {
  width: min(100%, 1180px);
  align-self: stretch;
  padding: 0;
  display: grid;
  gap: 14px;
  overflow: hidden;
}

.home-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 58%),
    linear-gradient(135deg, rgba(93, 200, 214, 0.13), transparent 38%),
    linear-gradient(315deg, rgba(233, 184, 92, 0.12), transparent 42%),
    rgba(11, 16, 23, 0.96);
}

.home-hero {
  position: relative;
  min-height: 330px;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 1.05fr);
  align-items: stretch;
  gap: 20px;
  padding: 24px;
  overflow: hidden;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.26)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 42px);
}

.home-hero-copy,
.home-card-stage {
  position: relative;
  z-index: 1;
}

.home-hero-copy {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: start;
}

.home-logo {
  width: 78px;
  height: 78px;
  border: 1px solid rgba(233, 184, 92, 0.32);
  border-radius: 18px;
  background: rgba(6, 10, 16, 0.66);
  padding: 10px;
  object-fit: contain;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.36),
    0 0 34px rgba(233, 184, 92, 0.16);
}

.home-kicker {
  margin-top: 18px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-panel .home-hero h2 {
  margin-top: 6px;
  font-size: clamp(48px, 7vw, 86px);
  line-height: 0.86;
  text-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
}

.home-hero p {
  max-width: 450px;
  margin-top: 14px;
  color: #d8e0e9;
  font-size: 15px;
}

.home-hero-actions {
  width: min(100%, 430px);
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 10px;
  margin-top: 22px;
}

.home-hero-actions .primary-button,
.home-hero-actions .secondary-button {
  min-height: 54px;
}

.home-card-stage {
  min-height: 300px;
  display: grid;
  place-items: center;
  perspective: 900px;
}

.hero-card {
  position: absolute;
  width: clamp(116px, 17vw, 188px);
  aspect-ratio: 0.714;
  border-radius: 13px;
  object-fit: cover;
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 239, 196, 0.18);
}

.hero-card-main {
  z-index: 3;
  width: clamp(150px, 22vw, 240px);
  transform: rotateX(6deg) translateY(-4px);
}

.hero-card-left {
  z-index: 2;
  transform: translateX(-52%) translateY(22px) rotateZ(-14deg) rotateY(28deg);
  filter: brightness(0.92);
}

.hero-card-right {
  z-index: 1;
  transform: translateX(54%) translateY(26px) rotateZ(13deg) rotateY(-26deg);
  filter: brightness(0.9);
}

.setup-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.setup-panel h2 {
  color: #fff8e8;
  font-size: 28px;
  line-height: 1;
}

.setup-panel p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.mode-switch {
  margin: 0 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(5, 8, 13, 0.45);
  padding: 5px;
}

.mode-switch button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.mode-switch button.active {
  border-color: rgba(233, 184, 92, 0.35);
  background:
    linear-gradient(180deg, rgba(233, 184, 92, 0.18), rgba(233, 184, 92, 0.08));
  color: #fff5d8;
}

.mode-switch button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.room-banner {
  margin: 0 14px;
  display: grid;
  grid-template-columns: minmax(160px, auto) 1fr;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  background:
    linear-gradient(90deg, rgba(242, 189, 92, 0.12), transparent),
    rgba(15, 20, 28, 0.84);
}

.room-banner strong,
.online-card-head strong,
.room-row strong,
.friend-row strong,
.invite-row strong,
.room-member-pill strong,
.lobby-seat strong,
.table-seat strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-banner strong {
  font-size: 13px;
  color: #fff6df;
}

.room-banner span,
.online-card-head span,
.helper-text,
.room-waiting-status span,
.room-waiting-card .helper-text,
.room-row small,
.friend-row small,
.invite-row small,
.empty-text,
.lobby-seat small,
.table-seat small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.32;
}

.room-error {
  margin: 0 14px;
  border: 1px solid rgba(231, 111, 97, 0.34);
  border-radius: var(--radius);
  background: rgba(231, 111, 97, 0.1);
  color: #ffc4bd;
  padding: 10px 12px;
  font-size: 12px;
}

.room-waiting-card {
  margin: 0 14px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background:
    linear-gradient(145deg, rgba(67, 199, 216, 0.1), transparent 40%),
    rgba(12, 17, 24, 0.9);
}

.room-waiting-card.launching {
  background:
    linear-gradient(145deg, rgba(242, 189, 92, 0.13), transparent 40%),
    rgba(12, 17, 24, 0.9);
}

.room-waiting-members,
.online-list,
.lobby-roster {
  display: grid;
  gap: 8px;
}

.room-waiting-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.room-ai-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.online-panel {
  padding: 0 14px 14px;
  display: grid;
  grid-template-columns: minmax(290px, 1.15fr) repeat(2, minmax(230px, 0.9fr));
  gap: 12px;
}

.matchmaking-card {
  position: relative;
  overflow: hidden;
  min-height: 310px;
  grid-row: span 2;
  background:
    linear-gradient(135deg, rgba(233, 184, 92, 0.18), transparent 42%),
    linear-gradient(210deg, rgba(93, 200, 214, 0.13), transparent 44%),
    rgba(13, 19, 28, 0.95);
}

.matchmaking-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(100deg, transparent 0 18%, rgba(255, 255, 255, 0.055) 18% 19%, transparent 19% 100%),
    linear-gradient(170deg, transparent 0 62%, rgba(255, 255, 255, 0.04) 62% 63%, transparent 63% 100%);
}

.matchmaking-card > * {
  position: relative;
  z-index: 1;
}

.matchmaking-visual {
  height: 142px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 0;
  perspective: 680px;
}

.matchmaking-visual img {
  width: 86px;
  aspect-ratio: 0.714;
  border: 1px solid rgba(255, 238, 190, 0.22);
  border-radius: 10px;
  object-fit: cover;
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.42),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.matchmaking-visual img:nth-child(1) {
  transform: rotateZ(-13deg) rotateY(24deg) translateX(18px) translateY(14px);
}

.matchmaking-visual img:nth-child(2) {
  z-index: 2;
  width: 104px;
  border-color: rgba(233, 184, 92, 0.58);
  transform: translateY(-6px);
}

.matchmaking-visual img:nth-child(3) {
  transform: rotateZ(13deg) rotateY(-24deg) translateX(-18px) translateY(14px);
}

.matchmaking-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.matchmaking-stats div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(5, 8, 13, 0.42);
  padding: 10px;
}

.matchmaking-stats strong,
.matchmaking-stats span {
  display: block;
}

.matchmaking-stats strong {
  color: #fff8e8;
  font-size: 22px;
  line-height: 1;
}

.matchmaking-stats span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-card,
.private-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 42%),
    rgba(14, 19, 27, 0.92);
}

.online-card {
  min-width: 0;
  padding: 11px;
  display: grid;
  align-content: start;
  gap: 9px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 38%),
    rgba(14, 19, 27, 0.9);
}

.online-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.online-card-head strong {
  color: #fff8e8;
  font-size: 13px;
}

.online-status {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
}

.online-status.online {
  background: rgba(86, 214, 140, 0.14);
  color: #9af1be;
}

.online-status.offline {
  background: rgba(231, 111, 97, 0.15);
  color: #ffb7ae;
}

.field-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.text-input,
.color-input {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(5, 8, 13, 0.78);
  color: var(--text);
  padding: 0 10px;
}

.color-input {
  padding: 4px;
}

.inline-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.room-row,
.friend-row,
.invite-row,
.room-member-pill,
.lobby-seat,
.table-seat {
  min-width: 0;
  display: grid;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.friend-row,
.invite-row,
.room-member-pill,
.lobby-seat {
  padding: 8px;
}

.room-row {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 6px;
}

.room-row.active {
  border-color: rgba(242, 189, 92, 0.74);
  box-shadow: 0 0 0 2px rgba(242, 189, 92, 0.13);
  background:
    linear-gradient(90deg, rgba(233, 184, 92, 0.13), transparent 65%),
    rgba(255, 255, 255, 0.045);
}

.room-row-main {
  min-width: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 6px 8px;
  text-align: left;
}

.room-row-main:hover {
  background: rgba(255, 255, 255, 0.045);
}

.room-row-main strong,
.room-row-main small,
.room-row-main code {
  display: block;
  min-width: 0;
}

.room-row-main code {
  margin-top: 4px;
  overflow: hidden;
  color: rgba(245, 236, 217, 0.58);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-row-join {
  justify-self: end;
  align-self: center;
  border: 1px solid rgba(242, 189, 92, 0.32);
  border-radius: 999px;
  background: rgba(242, 189, 92, 0.12);
  color: #fff0cb;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  padding: 6px 10px;
}

.selected-room-card {
  border: 1px solid rgba(93, 200, 214, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(93, 200, 214, 0.1), transparent 56%),
    rgba(5, 8, 13, 0.42);
  padding: 9px 10px;
}

.selected-room-card span,
.selected-room-card strong,
.selected-room-card small {
  display: block;
  min-width: 0;
}

.selected-room-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.selected-room-card strong {
  margin-top: 4px;
  overflow: hidden;
  color: #fff8e8;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-room-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.friend-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.room-member-pill,
.lobby-seat {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.invite-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.room-member-pill.ready {
  border-color: rgba(86, 214, 140, 0.32);
  background: rgba(86, 214, 140, 0.08);
}

.room-member-pill.ai {
  border-color: rgba(159, 135, 247, 0.32);
  background: rgba(159, 135, 247, 0.08);
}

.room-member-pill.self {
  box-shadow: 0 0 0 1px rgba(242, 189, 92, 0.24);
}

.seat-chip {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

.seat-avatar {
  --seat-color: var(--gold);
  position: relative;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px solid color-mix(in srgb, var(--seat-color) 78%, #ffffff 22%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.32), transparent 28%),
    linear-gradient(145deg, color-mix(in srgb, var(--seat-color) 62%, #111823 38%), #0c1119 72%);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.08),
    0 8px 20px rgba(0, 0, 0, 0.34);
  color: #fff8e8;
  font-size: 13px;
  font-weight: 1000;
}

.seat-avatar img,
.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.seat-avatar::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 10px;
  height: 10px;
  border: 2px solid #101720;
  border-radius: 50%;
  background: var(--seat-color);
}

.profile-avatar {
  --seat-color: var(--gold);
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid color-mix(in srgb, var(--seat-color) 72%, #ffffff 28%);
  border-radius: 50%;
  background: rgba(6, 10, 16, 0.72);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.34);
  overflow: visible;
}

.profile-avatar.small {
  width: 38px;
  height: 38px;
}

.profile-avatar.large {
  width: 70px;
  height: 70px;
}

.profile-preview {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(233, 184, 92, 0.09), transparent 58%),
    rgba(5, 8, 13, 0.42);
  padding: 10px;
}

.account-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  background: rgba(5, 8, 13, 0.36);
  padding: 10px;
}

.auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.auth-actions .secondary-button:last-child:nth-child(3) {
  grid-column: 1 / -1;
}

.profile-preview strong,
.profile-preview small {
  display: block;
  min-width: 0;
}

.profile-preview strong {
  overflow: hidden;
  color: #fff8e8;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-preview small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.coin-wallet {
  width: max-content;
  margin-top: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(233, 184, 92, 0.32);
  border-radius: 999px;
  background: rgba(233, 184, 92, 0.11);
  color: #ffe7a6;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.coin-wallet b {
  color: #fff4c7;
  font-size: 13px;
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
}

.avatar-picker button {
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(5, 8, 13, 0.66);
  padding: 3px;
  overflow: hidden;
}

.avatar-picker button.active {
  border-color: rgba(242, 189, 92, 0.86);
  box-shadow: 0 0 0 2px rgba(242, 189, 92, 0.18);
}

.avatar-picker img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.cosmetic-picker {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cosmetic-picker button {
  aspect-ratio: auto;
  display: grid;
  gap: 4px;
  justify-items: center;
  border-radius: 8px;
  padding: 6px 4px;
}

.cosmetic-picker img {
  width: 46px;
  height: 46px;
}

.cosmetic-picker strong,
.cosmetic-picker small,
.frame-option strong,
.frame-option small {
  display: block;
  color: #fff0cd;
  font-size: 10px;
  line-height: 1.15;
}

.cosmetic-picker small,
.frame-option small {
  color: var(--muted);
  font-size: 9px;
}

.cosmetic-picker .locked small,
.frame-option.locked small {
  color: #ffd677;
}

.frame-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.frame-option {
  min-height: 68px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: 1fr 1fr;
  align-items: center;
  gap: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(5, 8, 13, 0.66);
  color: var(--text);
  padding: 7px;
  text-align: left;
}

.frame-option .profile-avatar {
  grid-row: 1 / span 2;
}

.frame-option.active {
  border-color: rgba(233, 184, 92, 0.78);
  box-shadow: 0 0 0 2px rgba(233, 184, 92, 0.14);
}

.profile-avatar.frame-arcane,
.seat-avatar.frame-arcane {
  animation: frame-arcane-glow 1800ms ease-in-out infinite alternate;
}

.profile-avatar.frame-storm,
.seat-avatar.frame-storm {
  animation: frame-storm-glow 1250ms ease-in-out infinite alternate;
}

.profile-avatar.frame-champion,
.seat-avatar.frame-champion {
  animation: frame-champion-glow 1600ms ease-in-out infinite alternate;
}

.profile-avatar.frame-arcane::before,
.profile-avatar.frame-storm::before,
.profile-avatar.frame-champion::before,
.seat-avatar.frame-arcane::before,
.seat-avatar.frame-storm::before,
.seat-avatar.frame-champion::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  pointer-events: none;
}

.profile-avatar.frame-arcane::before,
.seat-avatar.frame-arcane::before {
  border: 2px solid rgba(155, 126, 255, 0.74);
}

.profile-avatar.frame-storm::before,
.seat-avatar.frame-storm::before {
  border: 2px solid rgba(85, 206, 255, 0.86);
}

.profile-avatar.frame-champion::before,
.seat-avatar.frame-champion::before {
  border: 2px solid rgba(255, 207, 83, 0.92);
}

@keyframes frame-arcane-glow {
  from { box-shadow: 0 0 0 3px rgba(159, 135, 247, 0.12), 0 0 10px rgba(159, 135, 247, 0.18); }
  to { box-shadow: 0 0 0 4px rgba(159, 135, 247, 0.28), 0 0 22px rgba(159, 135, 247, 0.54); }
}

@keyframes frame-storm-glow {
  from { box-shadow: 0 0 0 2px rgba(93, 200, 214, 0.14), 0 0 10px rgba(62, 187, 255, 0.28); }
  to { box-shadow: 0 0 0 5px rgba(93, 200, 214, 0.32), 0 0 26px rgba(62, 187, 255, 0.7); }
}

@keyframes frame-champion-glow {
  from { box-shadow: 0 0 0 3px rgba(233, 184, 92, 0.2), 0 0 12px rgba(233, 184, 92, 0.35); }
  to { box-shadow: 0 0 0 5px rgba(255, 214, 95, 0.4), 0 0 30px rgba(255, 190, 45, 0.74); }
}

.seat-remove {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  font-size: 18px;
}

.rules-box {
  margin: 0 14px 14px;
  padding: 10px 12px;
  background:
    linear-gradient(90deg, rgba(67, 199, 216, 0.09), transparent 70%),
    rgba(12, 17, 24, 0.88);
}

.rules-box strong,
.rules-box span {
  display: block;
}

.rules-box strong {
  color: #fff2ce;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.rules-box span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.lobby-actions {
  margin: 0 14px 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.lobby-roster {
  margin: 0 14px;
}

.lobby-start {
  min-width: 120px;
}

.poker-table {
  position: relative;
  width: min(100%, 1040px);
  height: clamp(430px, 59vh, 640px);
  min-height: 430px;
  border: 1px solid rgba(226, 211, 166, 0.24);
  border-radius: 34px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 42%, rgba(255, 255, 255, 0.11), transparent 36%),
    linear-gradient(145deg, rgba(20, 90, 69, 0.98), rgba(10, 49, 54, 0.98) 58%, #111720 100%);
  background-size: 18px 18px, 18px 18px, auto, auto;
  box-shadow:
    inset 0 0 0 10px rgba(67, 42, 25, 0.94),
    inset 0 0 0 16px rgba(226, 211, 166, 0.15),
    inset 0 -42px 68px rgba(0, 0, 0, 0.5),
    inset 0 34px 54px rgba(255, 255, 255, 0.045),
    inset 0 -26px 48px rgba(0, 0, 0, 0.34),
    inset 0 22px 42px rgba(255, 255, 255, 0.035),
    inset 0 0 80px rgba(0, 0, 0, 0.48),
    0 18px 0 rgba(39, 24, 16, 0.95),
    0 58px 96px rgba(0, 0, 0, 0.58);
  overflow: hidden;
  transform: rotateX(6deg);
  transform-style: preserve-3d;
}

.poker-table::before,
.poker-table::after {
  content: "";
  position: absolute;
  border-radius: 24px;
  pointer-events: none;
}

.poker-table::before {
  inset: 20px;
  border: 1px solid rgba(226, 211, 166, 0.18);
  box-shadow:
    inset 0 0 0 5px rgba(255, 255, 255, 0.025),
    inset 0 0 36px rgba(0, 0, 0, 0.28);
}

.poker-table::after {
  inset: 17% 24%;
  background:
    radial-gradient(circle, rgba(242, 189, 92, 0.13), transparent 52%),
    rgba(255, 255, 255, 0.025);
  filter: blur(0.1px);
}

.table-felt {
  position: absolute;
  z-index: 1;
  inset: 24% 15%;
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
  transform: translateZ(24px);
}

.table-title {
  display: flex;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.table-title strong {
  color: var(--text);
}

.table-center {
  display: grid;
  grid-template-columns: repeat(5, minmax(72px, 1fr));
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(226, 211, 166, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    rgba(3, 13, 16, 0.5);
  box-shadow:
    inset 0 0 28px rgba(0, 0, 0, 0.25),
    0 18px 34px rgba(0, 0, 0, 0.18);
  transform: rotateX(2deg);
}

@media (min-width: 821px) {
  .poker-table.center-expanded {
    height: clamp(560px, 76vh, 760px);
  }

  .poker-table.center-expanded .table-felt {
    inset: 15% 11%;
  }

  .poker-table.center-expanded .table-center {
    grid-template-columns: repeat(4, minmax(72px, 1fr));
  }

  .poker-table.center-expanded .table-center .game-card,
  .poker-table.center-expanded .table-center .card-back {
    min-height: 112px;
  }
}

.center-slot,
.hand-slot {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  padding: 0;
  color: var(--text);
  text-align: left;
  transform-style: preserve-3d;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.center-slot:hover,
.hand-slot:hover {
  border-color: rgba(67, 199, 216, 0.6);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.26);
  filter: brightness(1.035) saturate(1.04);
}

.center-slot:hover {
  transform: rotate(var(--slot-tilt)) scale(1.018);
}

.center-slot.actionable,
.hand-slot.actionable {
  border-color: rgba(242, 189, 92, 0.82);
  box-shadow:
    0 0 0 2px rgba(242, 189, 92, 0.18),
    0 18px 42px rgba(242, 189, 92, 0.14);
}

.center-slot.actionable {
  animation: playable-pulse 1180ms ease-in-out infinite alternate;
}

@keyframes playable-pulse {
  from {
    box-shadow:
      0 0 0 2px rgba(242, 189, 92, 0.12),
      0 16px 34px rgba(242, 189, 92, 0.12);
  }
  to {
    box-shadow:
      0 0 0 4px rgba(242, 189, 92, 0.26),
      0 22px 52px rgba(242, 189, 92, 0.22);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hand-slot {
  flex: 0 0 clamp(112px, 11vw, 152px);
  margin-inline: clamp(-34px, -2.8vw, -18px);
  scroll-snap-align: center;
  z-index: calc(20 + var(--hand-index));
  transform:
    translateY(var(--hand-y))
    rotate(calc(var(--hand-offset) * 5.4deg))
    rotateX(6deg);
  transform-origin: 50% 118%;
  filter: drop-shadow(0 20px 18px rgba(0, 0, 0, 0.24));
}

.hand-slot:hover {
  transform:
    translateY(calc(var(--hand-y) - 10px))
    rotate(calc(var(--hand-offset) * 4deg))
    rotateX(0deg)
    scale(1.035);
  z-index: 80;
}

.center-slot:disabled:hover {
  transform: rotate(var(--slot-tilt));
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  filter: none;
}

.hand-slot:disabled:hover,
.hand.hand-locked .hand-slot:hover {
  transform:
    translateY(var(--hand-y))
    rotate(calc(var(--hand-offset) * 5.4deg))
    rotateX(6deg);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: none;
  filter: drop-shadow(0 20px 18px rgba(0, 0, 0, 0.24));
  z-index: calc(20 + var(--hand-index));
}

.hand-slot.selected {
  transform:
    translateY(-34px)
    rotate(0deg)
    rotateX(0deg)
    scale(1.14);
  border-color: rgba(242, 189, 92, 0.95);
  box-shadow: 0 0 0 2px rgba(242, 189, 92, 0.22), 0 30px 70px rgba(242, 189, 92, 0.2);
  z-index: 90;
}

.table-seat {
  position: absolute;
  z-index: 3;
  width: clamp(156px, 17vw, 210px);
  min-height: 68px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 7px 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 52%),
    rgba(9, 14, 21, 0.74);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transform-style: preserve-3d;
}

.table-seat.active {
  border-color: rgba(242, 189, 92, 0.88);
  box-shadow: 0 0 0 2px rgba(242, 189, 92, 0.2), 0 14px 32px rgba(242, 189, 92, 0.08);
}

.table-seat.targetable {
  border-color: rgba(67, 199, 216, 0.76);
  box-shadow: 0 0 0 2px rgba(67, 199, 216, 0.15);
}

.table-seat.ready {
  border-color: rgba(86, 214, 140, 0.72);
  box-shadow: 0 0 0 2px rgba(86, 214, 140, 0.16);
}

.table-seat.ai {
  background:
    linear-gradient(135deg, rgba(159, 135, 247, 0.13), transparent 52%),
    rgba(9, 14, 21, 0.76);
}

.table-seat.folded {
  opacity: 0.5;
}

.table-seat.checked {
  border-color: rgba(86, 214, 140, 0.74);
  box-shadow: 0 0 0 2px rgba(86, 214, 140, 0.18), 0 16px 34px rgba(86, 214, 140, 0.12);
}

.table-seat.monster-zero {
  border-color: rgba(86, 214, 140, 0.92);
  box-shadow:
    0 0 0 3px rgba(86, 214, 140, 0.22),
    0 18px 42px rgba(86, 214, 140, 0.16);
}

.table-seat.monster-zero .seat-points em {
  color: #b9ffd0;
  font-weight: 1000;
}

.table-seat strong {
  font-size: 13px;
}

.table-seat small {
  display: block;
  margin-top: 2px;
}

.seat-profile {
  min-width: 0;
}

.seat-points {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 5px;
  margin-top: 5px;
  color: #fff1cd;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.level-track {
  display: block;
  width: min(100%, 108px);
  height: 5px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.level-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--aqua), var(--gold));
  box-shadow: 0 0 12px rgba(93, 200, 214, 0.32);
}

.profile-rewards,
.seat-rewards,
.mini-rewards {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.reward-badge {
  max-width: 100%;
  overflow: hidden;
  border: 1px solid rgba(242, 189, 92, 0.22);
  border-radius: 999px;
  background: rgba(242, 189, 92, 0.1);
  color: #ffe5aa;
  font-size: 9px;
  font-weight: 1000;
  line-height: 1;
  padding: 4px 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reward-badge.locked {
  border-color: rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
}

.seat-rewards {
  max-width: 130px;
}

.seat-rewards .reward-badge,
.mini-rewards .reward-badge {
  font-size: 8px;
  padding: 3px 5px;
}

.seat-points b {
  font-size: 17px;
  line-height: 0.9;
}

.seat-points em {
  overflow: hidden;
  color: var(--green);
  font-size: 10px;
  font-style: normal;
  text-overflow: ellipsis;
}

.check-badge {
  position: absolute;
  right: -9px;
  top: -13px;
  z-index: 2;
  min-width: 66px;
  border: 1px solid rgba(86, 214, 140, 0.86);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(132, 255, 179, 0.24), rgba(43, 134, 84, 0.94)),
    #173525;
  color: #ecfff3;
  padding: 5px 7px 4px;
  text-align: center;
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.24), 0 0 0 2px rgba(34, 197, 94, 0.12);
}

.check-badge b,
.check-badge small {
  display: block;
  line-height: 1;
}

.check-badge b {
  font-size: 11px;
  letter-spacing: 0;
}

.check-badge small {
  margin-top: 2px;
  color: #d7ffe3;
  font-size: 10px;
  font-weight: 1000;
}

.seat-0 {
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
}

.seat-1 {
  left: 5%;
  bottom: 17%;
}

.seat-2 {
  left: 5%;
  top: 17%;
}

.seat-3 {
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
}

.seat-4 {
  right: 5%;
  top: 17%;
}

.seat-5 {
  right: 5%;
  bottom: 17%;
}

.seat-6 {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.ai-turn-panel {
  width: 100%;
  min-height: 148px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(158, 134, 255, 0.12), transparent 42%),
    var(--surface-2);
  display: grid;
  place-content: center;
  gap: 6px;
  text-align: center;
}

.ai-turn-panel strong {
  font-size: 18px;
}

.ai-turn-panel span {
  color: var(--muted);
  font-size: 13px;
}

.game-card {
  min-height: 178px;
  border: 1px solid rgba(226, 211, 166, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(100deg, transparent 0 34%, rgba(255, 255, 255, 0.11) 42%, transparent 52%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 34%),
    #1b2432;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 -16px 28px rgba(0, 0, 0, 0.18),
    0 16px 34px rgba(0, 0, 0, 0.28);
  position: relative;
}

.table-center .game-card {
  min-height: 128px;
  transform: rotate(var(--slot-tilt));
}

.hidden-card {
  position: relative;
  background:
    radial-gradient(circle at 50% 38%, rgba(242, 189, 92, 0.18), transparent 30%),
    repeating-linear-gradient(135deg, #141b28, #141b28 10px, #0a101b 10px, #0a101b 20px);
}

.hidden-card::before {
  content: "ETHERYON";
  position: absolute;
  inset: 10px;
  z-index: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgba(226, 211, 166, 0.24);
  border-radius: var(--radius);
  color: rgba(246, 237, 216, 0.74);
  font-size: 12px;
  font-weight: 900;
}

.card-art {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.08), transparent 32%),
    #0f172a;
  display: block;
}

.card-back {
  position: relative;
  z-index: 1;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
}

.table-center .card-back {
  min-height: 128px;
}

.card-meta {
  padding: 8px;
  display: grid;
  gap: 4px;
}

.table-center .card-meta {
  padding: 7px;
}

.game-card strong {
  display: block;
  overflow-wrap: anywhere;
  color: #fff8e8;
  font-size: 12px;
  line-height: 1.15;
}

.table-center .game-card strong {
  font-size: 10px;
}

.game-card p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.table-center .game-card p {
  display: none;
}

.score-list {
  margin: 0;
  padding: 8px;
  display: grid;
  align-content: start;
  gap: 6px;
  background: rgba(11, 16, 24, 0.78);
  overflow: auto;
}

.score-row {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.score-row span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-row span:nth-child(2) small {
  display: block;
  overflow: hidden;
  color: var(--green);
  font-size: 10px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-row.active {
  color: var(--text);
  font-weight: 900;
}

.score-row.checked {
  color: #e9ffef;
}

.score-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.center-slot.exchange-target {
  animation: table-swap 650ms ease both;
  border-color: rgba(242, 189, 92, 0.9);
  box-shadow: 0 0 0 2px rgba(242, 189, 92, 0.2), 0 18px 46px rgba(242, 189, 92, 0.14);
}

.round-summary {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 50%;
  width: min(360px, 72%);
  transform: translate(-50%, -50%) translateZ(90px);
  border: 1px solid rgba(242, 189, 92, 0.36);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), transparent 42%),
    rgba(8, 13, 20, 0.9);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.44),
    0 0 0 2px rgba(242, 189, 92, 0.08);
  padding: 14px;
  backdrop-filter: blur(10px);
  text-align: center;
  animation: summary-pop 360ms ease both;
}

.round-summary > span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.round-summary > strong {
  display: block;
  margin-top: 3px;
  color: #fff8e8;
  font-size: 24px;
  line-height: 1;
}

.round-summary > small {
  display: block;
  margin: 7px 0 11px;
  color: var(--soft);
  font-size: 12px;
}

.round-summary-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 7px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  text-align: left;
}

.round-summary-row.winner {
  background: rgba(242, 189, 92, 0.12);
  color: #fff3d3;
  font-weight: 900;
}

.round-summary-row span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.round-summary-row small {
  display: block;
  color: var(--green);
  font-size: 10px;
  line-height: 1.1;
}

.summary-menu-button {
  width: 100%;
  margin-top: 12px;
}

.reveal-stage {
  position: absolute;
  z-index: 9;
  left: 50%;
  top: 50%;
  width: min(210px, 34%);
  transform: translate(-50%, -50%) translateZ(120px);
  display: grid;
  justify-items: center;
  gap: 7px;
  pointer-events: none;
  animation: reveal-pop 280ms ease both;
}

.reveal-stage > span {
  border: 1px solid rgba(242, 189, 92, 0.4);
  border-radius: 999px;
  background: rgba(8, 13, 20, 0.82);
  color: var(--gold);
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
}

.reveal-stage > strong {
  max-width: 100%;
  border-radius: 8px;
  background: rgba(8, 13, 20, 0.78);
  color: #fff8e8;
  padding: 5px 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.reveal-stage .game-card {
  min-height: 220px;
  transform: rotate(-1.5deg) scale(1.08);
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.48), 0 0 0 2px rgba(242, 189, 92, 0.16);
}

.hand-slot.exchange-received {
  animation: hand-receive 650ms ease both;
  border-color: rgba(67, 199, 216, 0.9);
  box-shadow: 0 0 0 2px rgba(67, 199, 216, 0.18), 0 20px 50px rgba(67, 199, 216, 0.12);
}

.hand-slot.exchange-source,
.table-seat.exchange-source {
  animation: exchange-source 650ms ease both;
}

.table-seat.check-flash {
  animation: check-flash 420ms ease both;
  border-color: rgba(242, 189, 92, 0.92);
  box-shadow: 0 0 0 2px rgba(242, 189, 92, 0.24), 0 18px 42px rgba(242, 189, 92, 0.18);
}

.table-seat.spell-target {
  animation: spell-target 700ms ease both;
  border-color: rgba(158, 134, 255, 0.92);
  box-shadow: 0 0 0 2px rgba(158, 134, 255, 0.26), 0 18px 42px rgba(158, 134, 255, 0.18);
}

.table-seat.effect-magic {
  animation: spell-target 620ms ease both;
  box-shadow: 0 0 0 2px rgba(158, 134, 255, 0.32), 0 0 34px rgba(158, 134, 255, 0.28);
}

.table-seat.effect-dragon {
  animation: dragon-impact 620ms ease both;
  border-color: rgba(248, 113, 113, 0.94);
}

.table-seat.effect-trap {
  animation: trap-impact 620ms ease both;
  border-color: rgba(86, 214, 140, 0.94);
}

.table-seat.effect-check {
  animation: check-flash 620ms ease both;
}

.secondary-button.check-pulse {
  animation: check-button 420ms ease both;
  border-color: rgba(242, 189, 92, 0.9);
  box-shadow: 0 0 0 2px rgba(242, 189, 92, 0.16), 0 14px 28px rgba(242, 189, 92, 0.12);
}

.guide-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 12, 0.74);
  backdrop-filter: blur(10px);
}

.guide-panel {
  width: min(100%, 720px);
  max-height: min(86vh, 760px);
  overflow: auto;
  border: 1px solid rgba(242, 189, 92, 0.34);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(242, 189, 92, 0.1), transparent 36%),
    linear-gradient(320deg, rgba(93, 200, 214, 0.1), transparent 42%),
    rgba(11, 16, 24, 0.96);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.54);
  padding: 18px;
}

.guide-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.guide-head span,
.guide-step small {
  color: var(--gold);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.guide-head h2 {
  margin: 4px 0 0;
  color: #fff8e8;
  font-size: 26px;
  line-height: 1;
}

.guide-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-weight: 1000;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.guide-step {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}

.guide-step strong {
  display: block;
  margin-top: 4px;
  color: #fff2ce;
}

.guide-step p {
  margin: 6px 0 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.45;
}

.guide-actions {
  display: flex;
  justify-content: end;
  gap: 8px;
  margin-top: 16px;
}

.divination-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(2, 6, 12, 0.72);
  backdrop-filter: blur(8px);
}

.divination-panel {
  position: relative;
  width: min(920px, 100%);
  border: 1px solid rgba(158, 134, 255, 0.42);
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 0, rgba(158, 134, 255, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%),
    rgba(9, 14, 22, 0.96);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
  padding: 18px;
  text-align: center;
}

.divination-panel > span {
  color: #c8bbff;
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.divination-panel > strong {
  display: block;
  margin-top: 4px;
  color: #fff8e8;
  font-size: 28px;
  line-height: 1;
}

.divination-panel > small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.divination-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  font-size: 20px;
}

.divination-hand {
  min-height: 210px;
  margin: 18px 0 14px;
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 0;
  overflow-x: auto;
  padding: 28px 28px 18px;
  perspective: 900px;
}

.divination-card {
  flex: 0 0 clamp(116px, 13vw, 154px);
  margin-inline: clamp(-30px, -2.4vw, -16px);
  transform:
    translateY(var(--hand-y))
    rotate(calc(var(--hand-offset) * 4.8deg))
    rotateX(4deg);
  transform-origin: 50% 116%;
  filter: drop-shadow(0 22px 18px rgba(0, 0, 0, 0.3));
}

.divination-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.divination-actions .primary-button:only-child {
  grid-column: 1 / -1;
}

.choice-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 7, 11, 0.74);
  backdrop-filter: blur(10px);
}

.choice-panel {
  position: relative;
  width: min(100%, 900px);
  max-height: min(88vh, 720px);
  overflow: hidden;
  border: 1px solid rgba(242, 189, 92, 0.22);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(93, 200, 214, 0.1), transparent 40%),
    linear-gradient(315deg, rgba(233, 184, 92, 0.11), transparent 42%),
    rgba(11, 16, 23, 0.97);
  box-shadow: 0 34px 90px rgba(0, 0, 0, 0.58);
  padding: 18px;
}

.choice-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  font-size: 20px;
}

.choice-panel > span,
.choice-panel > strong,
.choice-panel > small {
  display: block;
  padding-right: 42px;
}

.choice-panel > span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 1000;
  text-transform: uppercase;
}

.choice-panel > strong {
  margin-top: 5px;
  color: #fff8e8;
  font-size: 24px;
  line-height: 1;
}

.choice-panel > small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.choice-card-grid {
  max-height: min(62vh, 500px);
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 12px;
  overflow-y: auto;
  padding: 2px 4px 8px;
}

.choice-card-option {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  padding: 6px;
  text-align: left;
}

.choice-card-option:hover {
  border-color: rgba(242, 189, 92, 0.64);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
  filter: brightness(1.04);
}

.choice-card-option .game-card {
  min-height: 166px;
}

.choice-card-option > span {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: #fff1cd;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exchange-layer-global {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

.exchange-card-clone,
.magic-card-clone {
  position: absolute;
  pointer-events: none;
  transform-origin: center center;
  will-change: transform, opacity;
}

.exchange-card-clone {
  z-index: 31;
}

.magic-card-clone {
  z-index: 32;
  animation: magic-burst 700ms cubic-bezier(0.22, 0.8, 0.2, 1) both;
}

.exchange-card-clone .game-card,
.magic-card-clone .game-card {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.exchange-card-clone .card-art {
  height: auto;
}

.magic-card-clone .game-card {
  filter: saturate(1.15) brightness(1.18);
  box-shadow: 0 0 24px rgba(158, 134, 255, 0.35);
}

.exchange-card-clone.source,
.exchange-card-clone.target {
  animation: exchange-card-out 650ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes table-swap {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  45% {
    transform: translateY(-18px) scale(1.08) rotate(-2deg);
    filter: brightness(1.22);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes hand-receive {
  0% {
    transform: translateY(16px) scale(0.96);
    opacity: 0.72;
  }
  55% {
    transform: translateY(-18px) scale(1.05);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes exchange-source {
  0% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
  35% {
    transform: translateY(-10px) scale(1.03);
    filter: brightness(1.2);
  }
  100% {
    transform: translateY(0) scale(1);
    filter: brightness(1);
  }
}

@keyframes check-flash {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  40% {
    transform: scale(1.03);
    filter: brightness(1.18);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes check-button {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes mastery-button-glow {
  from {
    filter: brightness(1) saturate(1);
    box-shadow:
      0 0 0 2px rgba(255, 255, 255, 0.2),
      0 0 18px rgba(245, 158, 11, 0.45),
      0 14px 30px rgba(236, 72, 153, 0.2);
  }

  to {
    filter: brightness(1.18) saturate(1.2);
    box-shadow:
      0 0 0 3px rgba(255, 255, 255, 0.32),
      0 0 34px rgba(245, 158, 11, 0.72),
      0 18px 42px rgba(139, 92, 246, 0.34);
  }
}

@keyframes spell-target {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  35% {
    transform: scale(1.02);
    filter: brightness(1.18);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes dragon-impact {
  0% {
    transform: scale(1);
    filter: brightness(1);
    box-shadow: 0 0 0 rgba(248, 113, 113, 0);
  }
  30% {
    transform: scale(1.05) rotate(-1deg);
    filter: brightness(1.35) saturate(1.25);
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.22), 0 0 44px rgba(248, 113, 113, 0.34);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@keyframes trap-impact {
  0%,
  100% {
    transform: translateX(0);
    filter: brightness(1);
  }
  20% {
    transform: translateX(-4px);
    filter: brightness(1.2) hue-rotate(20deg);
    box-shadow: 0 0 0 3px rgba(86, 214, 140, 0.2), 0 0 34px rgba(86, 214, 140, 0.28);
  }
  40% {
    transform: translateX(4px);
  }
  60% {
    transform: translateX(-2px);
  }
}

@keyframes magic-burst {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.88);
  }
  12% {
    opacity: 1;
  }
  55% {
    transform: translate(calc(var(--dx) * 0.68), calc(var(--dy) * 0.68)) scale(1.06);
  }
  100% {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(1);
  }
}

@keyframes summary-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) translateZ(90px) scale(0.94);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) translateZ(90px) scale(1);
  }
}

@keyframes reveal-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -45%) translateZ(120px) scale(0.86);
  }

  to {
    opacity: 1;
    transform: translate(-50%, -50%) translateZ(120px) scale(1);
  }
}

@keyframes exchange-card-out {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.92);
  }
  15% {
    opacity: 1;
  }
  60% {
    transform: translate(calc(var(--dx) * 0.72), calc(var(--dy) * 0.72)) scale(1.05);
  }
  100% {
    opacity: 0.98;
    transform: translate(var(--dx), var(--dy)) scale(1);
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(420px, 1fr) auto auto;
    grid-template-areas:
      "topbar"
      "status"
      "board"
      "controls"
      "log";
  }

  .board-wrap {
    overflow: hidden;
    min-height: 420px;
  }

  .log-panel {
    max-height: 160px;
  }

  .is-setup .app-shell {
    grid-template-rows: auto minmax(620px, 1fr);
    grid-template-areas:
      "topbar"
      "board";
  }

  .home-hero {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.82fr);
  }

  .online-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    padding: max(9px, env(safe-area-inset-top)) 9px max(11px, env(safe-area-inset-bottom));
    gap: 10px;
  }

  .log-panel {
    display: none;
  }

  .topbar,
  .board-wrap,
  .controls,
  .log-panel {
    padding: 10px;
  }

  .controls {
    position: sticky;
    bottom: 0;
    z-index: 24;
    backdrop-filter: blur(14px);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .home-hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .home-card-stage {
    min-height: 230px;
    order: -1;
  }

  .home-logo {
    width: 62px;
    height: 62px;
  }

  .home-hero-actions,
  .online-panel {
    grid-template-columns: 1fr;
  }

  .matchmaking-card {
    grid-row: auto;
  }

  .status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
  }

  .status-strip > div {
    min-height: 58px;
    padding: 8px;
  }

  .status-strip span {
    font-size: 9px;
  }

  .controls {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .hand {
    justify-content: flex-start;
    padding: 10px 6px 6px;
  }

  .hand-slot {
    flex-basis: clamp(88px, 24vw, 118px);
    margin-inline: -10px;
  }

  .hand-slot .game-card {
    min-height: clamp(96px, 24vh, 120px);
  }

  .turn-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mastery-button {
    grid-column: 1 / -1;
  }

  .score-list {
    max-height: 104px;
  }

  .setup-heading,
  .room-banner {
    grid-template-columns: 1fr;
    display: grid;
  }

  .lobby-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lobby-start {
    width: 100%;
  }

  .poker-table {
    width: 100%;
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    overflow: visible;
    background:
      linear-gradient(145deg, rgba(20, 82, 65, 0.96), rgba(13, 43, 51, 0.98)),
      #101820;
    box-shadow:
      inset 0 0 0 5px rgba(59, 38, 25, 0.88),
      inset 0 0 0 8px rgba(226, 211, 166, 0.12),
      0 20px 46px rgba(0, 0, 0, 0.3);
    transform: none;
  }

  .poker-table::before,
  .poker-table::after {
    display: none;
  }

  .table-felt {
    position: relative;
    inset: auto;
    z-index: 1;
    order: -1;
    grid-column: 1 / -1;
    padding: 10px;
    border: 1px solid rgba(226, 211, 166, 0.12);
    border-radius: 10px;
    background:
      radial-gradient(circle at 50% 0, rgba(233, 184, 92, 0.14), transparent 38%),
      rgba(5, 22, 25, 0.42);
    transform: none;
  }

  .table-center {
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 6px;
    padding: 6px;
    transform: none;
  }

  .table-center .game-card {
    min-height: 110px;
  }

  .table-seat {
    position: relative;
    inset: auto;
    width: auto;
    max-width: none;
    transform: none;
    padding: 7px;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .round-summary {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    grid-column: 1 / -1;
    transform: none;
    order: -2;
    animation: none;
  }

  .reveal-stage {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    grid-column: 1 / -1;
    transform: none;
    order: -3;
    animation: none;
  }

  .reveal-stage .game-card {
    width: min(136px, 40vw);
    min-height: 164px;
  }

  .divination-actions {
    grid-template-columns: 1fr;
  }

  .divination-hand {
    justify-content: flex-start;
    padding-inline: 20px;
  }

  .divination-card {
    flex-basis: clamp(112px, 32vw, 148px);
    margin-inline: -20px;
  }

  .table-seat .seat-avatar {
    width: 34px;
    height: 34px;
    font-size: 10px;
  }

  .table-seat .seat-avatar::after {
    width: 8px;
    height: 8px;
  }

  .table-seat strong {
    font-size: 10px;
  }

  .table-seat small {
    font-size: 8px;
  }

  .seat-points {
    font-size: 9px;
  }

  .seat-points b {
    font-size: 12px;
  }

  .level-track,
  .seat-rewards {
    display: none;
  }

  .check-badge {
    right: -4px;
    top: -7px;
    min-width: 48px;
    padding: 3px 5px 2px;
  }

  .check-badge b {
    font-size: 8px;
  }

  .seat-0,
  .seat-1,
  .seat-2,
  .seat-3,
  .seat-4,
  .seat-5,
  .seat-6 {
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    transform: none;
  }

  .seat-0 {
    border-color: rgba(233, 184, 92, 0.45);
  }

  .hand {
    padding-top: 10px;
  }

  .hand-slot {
    flex-basis: clamp(82px, 28vw, 126px);
  }

  .hand-slot:hover,
  .hand-slot.selected {
    transform: translateY(-3px);
  }
}

@media (max-width: 520px) {
  .topbar {
    align-items: center;
    padding: 8px 10px;
  }

  .topbar h1 {
    font-size: 20px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .icon-button {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .status-strip strong {
    font-size: 15px;
  }

  .status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .status-strip > div:last-child {
    grid-column: 1 / -1;
  }

  .lobby-actions,
  .room-ai-actions,
  .inline-actions,
  .turn-actions {
    grid-template-columns: 1fr;
  }

  .poker-table {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .table-center {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hand-slot {
    flex-basis: clamp(72px, 22vw, 112px);
  }

  .hand-slot .game-card {
    min-height: 108px;
  }

  .game-card {
    min-height: 122px;
  }

  .table-center .game-card {
    min-height: 92px;
  }

  .score-list {
    max-height: 88px;
  }
}

@media (orientation: portrait) and (max-width: 900px) {
  body:not(.is-setup) {
    overflow: hidden;
  }

  body:not(.is-setup) .app-shell {
    height: 100dvh;
    min-height: 0;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    gap: 6px;
    padding: max(7px, env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
  }

  body:not(.is-setup) .topbar,
  body:not(.is-setup) .status-strip,
  body:not(.is-setup) .board-wrap,
  body:not(.is-setup) .controls {
    margin: 0;
  }

  body:not(.is-setup) .log-panel {
    display: none;
  }

  body:not(.is-setup) .board-wrap {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  body:not(.is-setup) .board,
  body:not(.is-setup) .poker-table {
    min-height: 0;
    height: 100%;
  }

  body:not(.is-setup) .poker-table {
    position: relative;
    display: block;
    padding: 0;
    border-radius: 6px;
  }

  body:not(.is-setup) .table-felt {
    position: absolute;
    inset: 18% 8%;
    margin: 0;
    padding: 4px;
    border: 0;
    background: rgba(2, 5, 10, 0.18);
    transform: none;
  }

  body:not(.is-setup) .table-center {
    grid-template-columns: repeat(5, minmax(36px, 1fr));
    gap: 4px;
    padding: 4px;
  }

  body:not(.is-setup) .table-center .game-card,
  body:not(.is-setup) .table-center .card-back {
    min-height: clamp(68px, 18vh, 96px);
  }

  body:not(.is-setup) .table-seat {
    position: absolute;
    width: clamp(82px, 15vw, 126px);
    min-height: 36px;
    padding: 4px;
    gap: 4px;
    transform: none;
  }

  body:not(.is-setup) .table-seat .seat-avatar {
    width: 25px;
    height: 25px;
  }

  body:not(.is-setup) .table-seat strong {
    font-size: 9px;
  }

  body:not(.is-setup) .table-seat small,
  body:not(.is-setup) .seat-points em,
  body:not(.is-setup) .seat-rewards,
  body:not(.is-setup) .level-track {
    display: none;
  }

  body:not(.is-setup) .seat-points {
    margin-top: 2px;
    font-size: 8px;
  }

  body:not(.is-setup) .seat-points b {
    font-size: 10px;
  }

  body:not(.is-setup) .controls {
    position: sticky;
    bottom: 0;
    z-index: 24;
    padding: 6px;
    gap: 5px;
    backdrop-filter: blur(14px);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.3);
  }

  body:not(.is-setup) .action-hint {
    min-height: 26px;
    font-size: 9px;
  }

  body:not(.is-setup) .hand {
    min-height: 0;
    justify-content: flex-start;
    align-items: end;
    padding: 6px 4px 4px;
  }

  body:not(.is-setup) .hand-slot {
    flex-basis: clamp(66px, 20vw, 96px);
    margin-inline: -7px;
  }

  body:not(.is-setup) .hand-slot .game-card {
    min-height: clamp(82px, 18vh, 104px);
  }

  body:not(.is-setup) .turn-actions {
    grid-auto-rows: 34px;
    gap: 4px;
  }

  body:not(.is-setup) .primary-button,
  body:not(.is-setup) .secondary-button,
  body:not(.is-setup) .mastery-button {
    min-height: 34px;
    font-size: 11px;
  }

  body:not(.is-setup) .score-list {
    max-height: 72px;
  }
}

/* Arena visual system */
body:not(.is-setup) {
  background:
    radial-gradient(circle at 50% 22%, rgba(65, 198, 245, 0.1), transparent 33%),
    radial-gradient(circle at 85% 45%, rgba(131, 86, 227, 0.1), transparent 28%),
    #060910;
}

.is-setup .board-wrap {
  padding: 0;
  border-color: rgba(135, 167, 205, 0.18);
  background: #080c16;
}

.home-panel {
  border: 0;
  background: rgba(7, 11, 18, 0.98);
}

.home-hero {
  min-height: clamp(400px, 48vh, 540px);
  background-image:
    linear-gradient(90deg, rgba(5, 8, 15, 0.95) 0%, rgba(5, 8, 15, 0.82) 37%, rgba(5, 8, 15, 0.22) 67%, rgba(5, 8, 15, 0.16)),
    linear-gradient(0deg, rgba(5, 8, 15, 0.8), transparent 42%),
    var(--hero-art);
  background-position: center, center, center right;
  background-size: cover;
  border-bottom: 1px solid rgba(102, 199, 240, 0.17);
}

.home-hero::before {
  inset: 0;
  height: auto;
  background:
    radial-gradient(circle at 75% 45%, rgba(115, 205, 255, 0.13), transparent 28%),
    linear-gradient(180deg, transparent 56%, rgba(5, 8, 15, 0.68));
}

.home-card-stage {
  opacity: 0;
  pointer-events: none;
}

.home-logo {
  border-color: rgba(111, 214, 255, 0.4);
  background: rgba(5, 10, 19, 0.7);
  box-shadow: 0 0 32px rgba(85, 201, 241, 0.18);
}

.home-panel .home-hero h2 {
  color: #ffffff;
  text-shadow: 0 4px 26px rgba(68, 185, 247, 0.2);
}

.arena-picker {
  margin: 2px 14px 0;
  display: grid;
  gap: 10px;
}

.arena-picker-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.arena-picker-title strong {
  color: #fff2cf;
  font-size: 15px;
}

.arena-picker-title span {
  color: var(--muted);
  font-size: 11px;
}

.arena-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.arena-option {
  position: relative;
  min-height: 112px;
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 2px;
  border: 1px solid rgba(130, 156, 191, 0.24);
  border-radius: 8px;
  overflow: hidden;
  padding: 10px;
  background:
    linear-gradient(0deg, rgba(5, 8, 15, 0.92), rgba(5, 8, 15, 0.06) 72%),
    var(--arena-preview) center / cover;
  color: var(--text);
  text-align: left;
}

.arena-option::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  border-radius: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.arena-option strong,
.arena-option small {
  position: relative;
  z-index: 1;
}

.arena-option strong {
  font-size: 13px;
}

.arena-option small {
  color: #c6d2e2;
  font-size: 11px;
}

.arena-option.active::before,
.arena-option:hover::before {
  border-color: rgba(89, 209, 255, 0.66);
  box-shadow: inset 0 0 28px rgba(66, 186, 234, 0.14);
}

.arena-option.active {
  box-shadow: 0 0 0 1px rgba(89, 209, 255, 0.2), 0 12px 26px rgba(5, 8, 15, 0.4);
}

.arena-option:disabled {
  cursor: default;
  opacity: 0.82;
}

body:not(.is-setup) .app-shell {
  width: min(100%, 1560px);
}

body:not(.is-setup) .board-wrap {
  padding: 0;
  border-color: rgba(102, 148, 185, 0.18);
  background: #050911;
  overflow: hidden;
}

.poker-table {
  width: 100%;
  max-width: 1260px;
  height: clamp(520px, 66vh, 720px);
  border: 0;
  border-radius: 8px;
  background-image:
    radial-gradient(ellipse at 50% 50%, transparent 38%, rgba(3, 6, 12, 0.3) 78%),
    linear-gradient(180deg, rgba(3, 7, 14, 0.16), rgba(3, 7, 14, 0.34)),
    var(--arena-art);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.45), 0 26px 68px rgba(0, 0, 0, 0.48);
  transform: none;
}

.poker-table::before {
  inset: 0;
  border: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 50%, transparent 38%, rgba(2, 5, 11, 0.33) 100%);
  box-shadow: inset 0 0 0 1px rgba(175, 202, 228, 0.1);
}

.poker-table::after {
  inset: 27% 19%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(58, 190, 237, 0.045), transparent 68%);
}

.arena-forge::after {
  background: radial-gradient(ellipse, rgba(249, 112, 38, 0.06), transparent 68%);
}

.table-felt {
  inset: 25% 16%;
  gap: 8px;
  transform: none;
}

.table-title {
  color: rgba(202, 220, 235, 0.74);
  text-shadow: 0 2px 12px #000;
}

.table-center {
  border-color: rgba(117, 183, 210, 0.18);
  background: rgba(4, 8, 14, 0.22);
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.26), 0 14px 40px rgba(0, 0, 0, 0.18);
}

.arena-forge .table-center {
  border-color: rgba(240, 126, 46, 0.16);
}

.table-seat {
  border-color: rgba(141, 176, 207, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), transparent 48%),
    rgba(4, 8, 15, 0.76);
  backdrop-filter: blur(12px);
}

.table-seat.active {
  border-color: rgba(98, 217, 255, 0.82);
  box-shadow: 0 0 0 1px rgba(98, 217, 255, 0.3), 0 0 30px rgba(67, 195, 238, 0.24);
}

.arena-forge .table-seat.active {
  border-color: rgba(255, 165, 79, 0.86);
  box-shadow: 0 0 0 1px rgba(255, 165, 79, 0.32), 0 0 30px rgba(238, 88, 28, 0.24);
}

.center-slot,
.hand-slot {
  border-color: rgba(164, 190, 216, 0.16);
  background: rgba(3, 6, 12, 0.34);
}

.hand-slot.selected {
  border-color: rgba(93, 216, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(93, 216, 255, 0.22), 0 22px 58px rgba(58, 189, 242, 0.25);
}

.arena-forge .center-slot.actionable {
  border-color: rgba(255, 172, 86, 0.82);
}

.exchange-card-clone,
.magic-card-clone {
  filter: drop-shadow(0 0 18px rgba(78, 203, 255, 0.42)) drop-shadow(0 18px 22px rgba(0, 0, 0, 0.48));
}

.exchange-card-clone::before,
.magic-card-clone::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border-radius: 18px;
  background: radial-gradient(circle, rgba(88, 207, 255, 0.22), transparent 68%);
  opacity: 0;
  animation: card-travel-glow 520ms ease both;
}

.exchange-card-clone.source,
.exchange-card-clone.target {
  animation-duration: 520ms;
}

.center-slot.exchange-target,
.hand-slot.exchange-received,
.hand-slot.exchange-source,
.table-seat.exchange-source {
  animation-duration: 520ms;
}

.reveal-stage::before {
  content: "";
  position: absolute;
  inset: 28px -30px 12px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(91, 208, 255, 0.34), rgba(103, 81, 224, 0.14) 44%, transparent 72%);
  animation: reveal-aura 720ms ease both;
}

.reveal-stage .game-card {
  animation: arena-card-reveal 460ms cubic-bezier(0.2, 0.88, 0.24, 1) both;
}

.secondary-button.mastery-available {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #fff4af, #ffbe45 33%, #f26b32 67%, #8d43e5);
}

.secondary-button.mastery-available::before {
  content: "";
  position: absolute;
  inset: -110% 34%;
  background: rgba(255, 255, 255, 0.42);
  transform: rotate(25deg);
  animation: mastery-sheen 1450ms ease-in-out infinite;
}

.special-effect {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  overflow: hidden;
  pointer-events: none;
  text-align: center;
  isolation: isolate;
  animation: none;
}

.special-effect::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at center, rgba(4, 7, 15, 0.1), rgba(2, 4, 9, 0.58) 78%);
}

.special-effect-art {
  position: absolute;
  inset: -8%;
  z-index: -1;
  background: center / cover no-repeat;
  mix-blend-mode: screen;
  opacity: 0.94;
  animation: none;
}

.special-storm .special-effect-art {
  background-image: url("./assets/effect-tempete-v1.webp?v=20260524-shop");
}

.special-fracture .special-effect-art {
  background-image: url("./assets/effect-fracture-v1.webp?v=20260524-shop");
}

.special-last-stand .special-effect-art {
  background-image: url("./assets/effect-dernier-combat-v1.webp?v=20260524-shop");
}

.special-mastery .special-effect-art {
  background-image: url("./assets/effect-maitrise-v1.webp?v=20260524-shop");
}

.special-effect span,
.special-effect strong,
.special-effect small {
  position: relative;
  text-shadow: 0 2px 16px #02040a, 0 0 24px rgba(4, 6, 11, 0.82);
}

.special-effect span {
  min-height: 18px;
  color: #d9e8f6;
  font-size: 13px;
  font-weight: 650;
  text-transform: uppercase;
}

.special-effect strong {
  color: #fff;
  font-size: clamp(27px, 5vw, 56px);
  line-height: 0.98;
  letter-spacing: 0;
}

.special-effect small {
  max-width: min(72vw, 470px);
  color: #e4edf6;
  font-size: clamp(13px, 1.5vw, 16px);
  font-weight: 600;
}

.special-storm strong {
  color: #c4e6ff;
  text-shadow: 0 2px 16px #02040a, 0 0 35px rgba(89, 159, 255, 0.86);
}

.special-fracture strong {
  color: #e2d1ff;
  text-shadow: 0 2px 16px #02040a, 0 0 35px rgba(151, 91, 255, 0.9);
}

.special-last-stand strong {
  color: #ffd8b4;
  text-shadow: 0 2px 16px #02040a, 0 0 35px rgba(255, 72, 27, 0.9);
}

.special-mastery strong {
  color: #fff1ad;
  text-shadow: 0 2px 16px #02040a, 0 0 38px rgba(255, 192, 54, 0.92);
}

.round-summary {
  animation: none;
}

@keyframes card-travel-glow {
  0%, 100% { opacity: 0; transform: scale(0.88); }
  28%, 64% { opacity: 1; transform: scale(1.06); }
}

@keyframes reveal-aura {
  from { opacity: 0; transform: scale(0.62); }
  35% { opacity: 1; transform: scale(1.12); }
  to { opacity: 0.32; transform: scale(1); }
}

@keyframes arena-card-reveal {
  from { opacity: 0; transform: rotateY(88deg) translateY(8px) scale(0.92); }
  55% { opacity: 1; transform: rotateY(-7deg) translateY(-5px) scale(1.12); }
  to { opacity: 1; transform: rotateY(0deg) scale(1.08); }
}

@keyframes mastery-sheen {
  0%, 45% { transform: translateX(-280%) rotate(25deg); }
  78%, 100% { transform: translateX(280%) rotate(25deg); }
}

@media (max-width: 820px) {
  .home-hero {
    min-height: 480px;
    padding: 22px 18px;
    align-content: end;
    background-image:
      linear-gradient(0deg, rgba(5, 8, 15, 0.98) 0%, rgba(5, 8, 15, 0.76) 36%, transparent 70%),
      var(--hero-art);
    background-position: center, 72% center;
  }

  .home-card-stage {
    display: none;
  }

  .arena-options {
    grid-template-columns: 1fr;
  }

  body:not(.is-setup) .app-shell {
    padding-inline: 0;
    gap: 7px;
  }

  body:not(.is-setup) .topbar,
  body:not(.is-setup) .status-strip,
  body:not(.is-setup) .controls {
    margin-inline: 8px;
  }

  body:not(.is-setup) .board-wrap {
    border: 0;
    border-radius: 0;
    min-height: min(62vh, 620px);
  }

  .poker-table {
    min-height: min(62vh, 620px);
    height: auto;
    border-radius: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    gap: 5px;
    padding: 8px;
    overflow: hidden;
    background-image:
      linear-gradient(180deg, rgba(2, 5, 10, 0.24), rgba(2, 5, 10, 0.34)),
      var(--arena-art-mobile);
    background-size: cover;
    background-position: center;
  }

  .poker-table::before {
    display: block;
    background: linear-gradient(180deg, rgba(3, 6, 12, 0.32), transparent 32%, rgba(3, 6, 12, 0.36));
  }

  .table-seat {
    position: relative;
    inset: auto;
    width: auto;
    min-height: 54px;
    padding: 5px;
    transform: none;
    z-index: 4;
  }

  .seat-0,
  .seat-1,
  .seat-2,
  .seat-3,
  .seat-4,
  .seat-5,
  .seat-6 {
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    transform: none;
  }

  .table-felt {
    position: relative;
    inset: auto;
    z-index: 2;
    grid-column: 1 / -1;
    order: 20;
    margin-top: clamp(54px, 12vh, 100px);
    padding: 6px;
    border: 0;
    background: rgba(2, 5, 10, 0.22);
  }

  .table-center {
    padding: 4px;
    background: rgba(2, 5, 10, 0.12);
  }

  .round-summary,
  .reveal-stage {
    grid-column: 1 / -1;
    order: 30;
    z-index: 9;
  }

  .special-effect {
    position: fixed;
    inset: 0;
    z-index: 72;
    gap: 6px;
  }

  .special-effect-art {
    inset: -3%;
    background-size: auto 62%;
  }

  .special-effect strong {
    padding-inline: 12px;
    font-size: clamp(26px, 9vw, 40px);
  }

  .reveal-stage .game-card {
    animation: none;
  }
}

@media (orientation: landscape) and (max-height: 560px) and (max-width: 1100px) {
  body:not(.is-setup) {
    overflow: hidden;
  }

  body:not(.is-setup) .app-shell {
    height: 100dvh;
    min-height: 0;
    padding: max(5px, env(safe-area-inset-top)) max(7px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
    grid-template-columns: minmax(0, 1fr) clamp(270px, 38vw, 370px);
    grid-template-rows: 39px minmax(0, 1fr);
    grid-template-areas:
      "status controls"
      "board controls";
    gap: 6px;
  }

  body:not(.is-setup) .topbar,
  body:not(.is-setup) .log-panel {
    display: none;
  }

  body:not(.is-setup) .status-strip {
    gap: 5px;
    margin: 0;
  }

  body:not(.is-setup) .status-strip > div {
    min-height: 39px;
    padding: 4px 8px;
    align-content: center;
  }

  body:not(.is-setup) .status-strip span {
    font-size: 8px;
  }

  body:not(.is-setup) .status-strip strong {
    margin-top: 1px;
    font-size: 13px;
  }

  body:not(.is-setup) .board-wrap {
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    border-radius: 6px;
  }

  body:not(.is-setup) .board,
  body:not(.is-setup) .poker-table {
    min-height: 0;
    height: 100%;
  }

  body:not(.is-setup) .poker-table {
    position: relative;
    display: block;
    padding: 0;
    border-radius: 6px;
    background-image:
      radial-gradient(ellipse at 50% 50%, transparent 35%, rgba(3, 6, 12, 0.34) 80%),
      linear-gradient(180deg, rgba(3, 7, 14, 0.12), rgba(3, 7, 14, 0.3)),
      var(--arena-art);
  }

  body:not(.is-setup) .table-felt {
    position: absolute;
    inset: 22% 13%;
    margin: 0;
    padding: 4px;
    transform: none;
    border: 0;
    background: rgba(2, 5, 10, 0.18);
  }

  body:not(.is-setup) .table-title {
    font-size: 8px;
  }

  body:not(.is-setup) .table-center {
    grid-template-columns: repeat(5, minmax(40px, 1fr));
    gap: 4px;
    padding: 4px;
  }

  body:not(.is-setup) .table-center .game-card,
  body:not(.is-setup) .table-center .card-back {
    min-height: clamp(76px, 23vh, 102px);
  }

  body:not(.is-setup) .table-center .card-meta {
    display: none;
  }

  body:not(.is-setup) .table-seat {
    position: absolute;
    width: clamp(94px, 17vw, 136px);
    min-height: 40px;
    padding: 4px;
    gap: 4px;
    grid-template-columns: auto minmax(0, 1fr);
    transform: none;
  }

  body:not(.is-setup) .table-seat .seat-avatar {
    width: 27px;
    height: 27px;
  }

  body:not(.is-setup) .table-seat strong {
    font-size: 9px;
  }

  body:not(.is-setup) .table-seat small,
  body:not(.is-setup) .seat-points em,
  body:not(.is-setup) .seat-rewards,
  body:not(.is-setup) .level-track {
    display: none;
  }

  body:not(.is-setup) .seat-points {
    margin-top: 2px;
    font-size: 8px;
  }

  body:not(.is-setup) .seat-points b {
    font-size: 11px;
  }

  body:not(.is-setup) .seat-0 {
    left: 50%;
    right: auto;
    top: auto;
    bottom: 5px;
    transform: translateX(-50%);
  }

  body:not(.is-setup) .seat-1 {
    left: 5px;
    right: auto;
    top: auto;
    bottom: 21%;
  }

  body:not(.is-setup) .seat-2 {
    left: 5px;
    right: auto;
    top: 18%;
    bottom: auto;
  }

  body:not(.is-setup) .seat-3 {
    left: 50%;
    right: auto;
    top: 5px;
    bottom: auto;
    transform: translateX(-50%);
  }

  body:not(.is-setup) .seat-4 {
    left: auto;
    right: 5px;
    top: 18%;
    bottom: auto;
  }

  body:not(.is-setup) .seat-5 {
    left: auto;
    right: 5px;
    top: auto;
    bottom: 21%;
  }

  body:not(.is-setup) .seat-6 {
    left: auto;
    right: 5px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
  }

  body:not(.is-setup) .controls {
    position: static;
    min-height: 0;
    height: 100%;
    margin: 0;
    padding: 5px;
    gap: 5px;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    overflow: hidden;
    backdrop-filter: none;
  }

  body:not(.is-setup) .action-hint {
    min-height: 28px;
    padding-inline: 5px;
    font-size: 10px;
  }

  body:not(.is-setup) .action-hint::before {
    width: 15px;
    height: 15px;
    font-size: 10px;
  }

  body:not(.is-setup) .hand {
    min-height: 0;
    justify-content: flex-start;
    align-items: end;
    padding: 8px 6px 4px;
  }

  body:not(.is-setup) .hand-slot {
    flex-basis: clamp(62px, 9vw, 84px);
    margin-inline: -8px;
  }

  body:not(.is-setup) .hand-slot .game-card {
    min-height: clamp(84px, 24vh, 108px);
  }

  body:not(.is-setup) .hand-slot .card-meta {
    display: none;
  }

  body:not(.is-setup) .turn-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 37px;
    gap: 5px;
  }

  body:not(.is-setup) .primary-button,
  body:not(.is-setup) .secondary-button,
  body:not(.is-setup) .mastery-button {
    min-height: 37px;
    font-size: 12px;
  }

  body:not(.is-setup) .mastery-button {
    grid-column: 1 / -1;
  }

  body:not(.is-setup) .score-list {
    max-height: 42px;
    overflow: auto;
  }

  body:not(.is-setup) .round-summary,
  body:not(.is-setup) .reveal-stage {
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(76%, 350px);
    transform: translate(-50%, -50%);
    z-index: 9;
  }

  body:not(.is-setup) .reveal-stage .game-card {
    min-height: 125px;
    width: 96px;
  }

  .is-setup .app-shell {
    min-height: 100dvh;
    height: auto;
  }

  .is-setup .home-hero {
    min-height: min(72vh, 360px);
  }
}

.target-choice-panel {
  max-width: min(440px, calc(100vw - 24px));
}

.target-choice-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.target-choice-option {
  min-height: 72px;
  border: 1px solid rgba(221, 206, 160, 0.18);
  border-radius: 10px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--seat-color) 18%, transparent), transparent 70%),
    rgba(12, 17, 24, 0.92);
  color: var(--text);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 12px;
  align-items: center;
  padding: 10px;
  text-align: left;
}

.target-choice-option:hover,
.target-choice-option:focus-visible {
  border-color: rgba(233, 184, 92, 0.56);
  transform: translateY(-1px);
}

.target-avatar {
  grid-row: 1 / 3;
  width: 48px;
  height: 48px;
  border: 2px solid color-mix(in srgb, var(--seat-color) 72%, white 8%);
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.24);
}

.target-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.target-choice-option strong,
.target-choice-option small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.target-choice-option strong {
  color: #fff8e8;
  font-size: 15px;
}

.target-choice-option small {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 820px) {
  .topbar {
    min-height: 54px;
    padding: 6px 8px;
    gap: 8px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-lockup h1 {
    font-size: 15px;
  }

  .brand-lockup .eyebrow,
  .landscape-button {
    display: none;
  }

  .topbar-actions {
    gap: 5px;
  }

  .topbar-actions .icon-button {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .home-hero-actions {
    grid-template-columns: 1fr 0.72fr 0.58fr;
  }

  .home-hero-actions .primary-button,
  .home-hero-actions .secondary-button {
    min-height: 48px;
    padding-inline: 10px;
    font-size: 12px;
  }

  .compact-mode-toggle {
    padding-inline: 8px;
  }
}

@media (max-width: 480px) {
  .home-hero-actions {
    grid-template-columns: 1fr 0.76fr;
  }

  .compact-mode-toggle {
    grid-column: 1 / -1;
  }
}

.multi-lobby-shell {
  padding: 0 14px 14px;
  display: grid;
  grid-template-columns: minmax(320px, 1.12fr) minmax(280px, 0.88fr);
  grid-template-areas:
    "primary join"
    "primary rooms"
    "profile rooms";
  gap: 12px;
}

.multi-primary-card,
.multi-side-card {
  min-width: 0;
  border: 1px solid rgba(221, 206, 160, 0.12);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 44%),
    rgba(14, 19, 27, 0.92);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.multi-primary-card {
  grid-area: primary;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 12px;
  background:
    linear-gradient(135deg, rgba(233, 184, 92, 0.16), transparent 42%),
    linear-gradient(220deg, rgba(93, 200, 214, 0.12), transparent 44%),
    rgba(13, 19, 28, 0.96);
}

.multi-side-card {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.join-card { grid-area: join; }
.rooms-card { grid-area: rooms; }
.profile-drawer { grid-area: profile; }

.multi-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.multi-card-head span,
.active-room-code span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}

.multi-card-head strong {
  display: block;
  margin-top: 3px;
  color: #fff8e8;
  font-size: 20px;
  line-height: 1.05;
}

.multi-primary-card > p {
  margin: 0;
  color: #d8e0e9;
  font-size: 13px;
  line-height: 1.45;
}

.active-room-code {
  display: grid;
  gap: 6px;
  border: 1px dashed rgba(233, 184, 92, 0.38);
  border-radius: 10px;
  background: rgba(5, 8, 13, 0.46);
  padding: 10px;
}

.active-room-code button {
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: rgba(233, 184, 92, 0.13);
  color: #fff0cb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 900;
  padding: 10px;
  text-align: left;
}

.room-progress-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 10px;
}

.room-progress-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.room-progress-strip strong {
  color: #9af1be;
  font-size: 12px;
  text-align: right;
}

.room-member-list.compact {
  display: grid;
  gap: 8px;
}

.room-ai-actions.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sticky-room-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.multi-primary-card:not(.has-room) .sticky-room-actions {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
}

.join-code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.join-code-row .primary-button {
  min-width: 108px;
}

.mini-icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(221, 206, 160, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--gold);
  font-weight: 1000;
}

.open-room-list {
  display: grid;
  gap: 8px;
  max-height: 420px;
  overflow: auto;
  padding-right: 2px;
}

.profile-drawer {
  display: block;
}

.profile-drawer summary {
  cursor: pointer;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
  list-style: none;
}

.profile-drawer summary::-webkit-details-marker {
  display: none;
}

.profile-drawer summary .profile-avatar {
  grid-row: 1 / 3;
}

.profile-drawer summary strong,
.profile-drawer summary small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-drawer summary strong {
  color: #fff8e8;
  font-size: 14px;
}

.profile-drawer summary small {
  color: var(--muted);
  font-size: 11px;
}

.profile-drawer[open] {
  display: grid;
  gap: 9px;
}

.inline-actions.single {
  grid-template-columns: 1fr;
}

.compact-auth {
  margin-top: 2px;
}

@media (max-width: 900px) {
  .multi-lobby-shell {
    padding: 0 10px 12px;
    grid-template-columns: 1fr;
    grid-template-areas:
      "primary"
      "join"
      "rooms"
      "profile";
  }

  .multi-card-head strong {
    font-size: 18px;
  }

  .sticky-room-actions {
    position: sticky;
    bottom: 8px;
    z-index: 6;
    grid-template-columns: 1fr 1fr;
    padding: 8px;
    border: 1px solid rgba(221, 206, 160, 0.12);
    border-radius: 10px;
    background: rgba(9, 12, 16, 0.88);
    backdrop-filter: blur(16px);
  }

  .sticky-room-actions .secondary-button:last-child:nth-child(3) {
    grid-column: 1 / -1;
  }

  .room-ai-actions.compact {
    grid-template-columns: 1fr;
  }

  .open-room-list {
    max-height: 320px;
  }
}

@media (max-width: 480px) {
  .join-code-row,
  .multi-primary-card:not(.has-room) .sticky-room-actions {
    grid-template-columns: 1fr;
  }

  .join-code-row .primary-button {
    min-width: 0;
  }

  .room-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .room-row-join {
    justify-self: stretch;
  }
}

.auth-required-banner {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(233, 184, 92, 0.34);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(233, 184, 92, 0.14), transparent 72%),
    rgba(5, 8, 13, 0.54);
  padding: 10px 12px;
}

.auth-required-banner strong,
.auth-required-banner span {
  display: block;
}

.auth-required-banner strong {
  color: #fff0cb;
  font-size: 13px;
}

.auth-required-banner span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.active-room-code button + button {
  margin-top: 6px;
  background: rgba(93, 200, 214, 0.12);
  color: #c9f7ff;
  font-family: inherit;
  font-size: 12px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0;
}
