:root {
  --ebony: #140c08;
  --ink: #1c120c;
  --wood: #3d2a1a;
  --ivory: #f4ead6;
  --sand: #e8d5b5;
  --gold: #d4a843;
  --gold-2: #f0d78c;
  --wine: #7a2e24;
  --mist: #cbb79a;
  --slate-900: #0b1220;
  --nav-h: 92px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "DM Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, #3a2418 0%, transparent 50%),
    radial-gradient(800px 400px at 100% 0%, #5a1f18 0%, transparent 40%),
    var(--ebony);
  color: var(--ivory);
}

h1, h2, .brand {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
}

.hidden { display: none !important; }

.app-shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 0 0 calc(var(--nav-h) + env(safe-area-inset-bottom));
}
.app-shell.is-table {
  max-width: min(560px, 100%);
  padding-bottom: 0.4rem;
}
.app-shell.is-table .main-header {
  min-height: 44px;
  padding: 0.3rem 0.65rem;
}
#screen-table.screen {
  padding: 0.35rem 0.45rem 0.55rem;
}

.table-topbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.35rem;
}
.table-titles {
  flex: 1;
  min-width: 0;
}
.table-titles strong {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-size: 0.98rem;
  line-height: 1.15;
}
.table-titles small {
  display: block;
  color: var(--mist);
  font-size: 0.68rem;
}
.table-turn {
  margin: 0;
  font-size: 0.72rem;
  color: var(--gold-2);
  white-space: nowrap;
}
.btn-leave-table {
  flex: 0 0 auto;
  max-width: 9.5rem;
  margin: 0;
  padding: 0.35rem 0.55rem;
  font-size: 0.68rem;
  line-height: 1.2;
  border-radius: 10px;
  border: 1px solid rgba(212, 168, 67, 0.45);
  background: rgba(40, 18, 12, 0.85);
  color: #f0d78c;
  cursor: pointer;
}
.btn-leave-table.is-forfeit {
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}
.leave-panel .leave-body {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--sand);
}
.leave-panel .leave-body p { margin: 0 0 0.55rem; }
.leave-panel .leave-list {
  margin: 0.4rem 0 0.7rem;
  padding: 0;
  list-style: none;
}
.leave-panel .leave-list li {
  margin: 0.28rem 0;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: rgba(12, 8, 6, 0.45);
}
.leave-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.leave-yes.is-danger {
  background: #8b1e1e;
  border-color: #f87171;
  color: #fff;
}
.leave-no.is-ok {
  border-color: rgba(74, 222, 128, 0.55);
  color: #bbf7d0;
}

.fs-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(212, 168, 67, 0.4);
  background: rgba(12, 8, 6, 0.72);
  color: var(--gold-2);
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.fs-btn:hover, .fs-btn[aria-pressed="true"] {
  background: rgba(212, 168, 67, 0.22);
}
.fs-ico { font-size: 1.05rem; line-height: 1; }
.board-stage .fs-btn-float {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 8;
}

.tool-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(212, 168, 67, 0.35);
  background: rgba(20, 12, 8, 0.55);
  color: var(--gold-2);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
}
.tool-btn:hover { background: rgba(212, 168, 67, 0.16); }

.train-slim {
  display: flex;
  gap: 0.4rem;
  margin: 0 0 0.4rem;
}
.train-slim .seg { max-width: none; flex: 1; }
.train-slim .seg button { font-size: 0.68rem; padding: 0.28rem 0.2rem; }

.train-tools {
  display: flex;
  justify-content: center;
  gap: 0.55rem;
  margin-top: 0.45rem;
}
.train-settings {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 0.35rem;
}
.train-settings .check { margin: 0; font-size: 0.78rem; }

.screen {
  padding: 0.85rem 1rem 1.25rem;
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.65rem;
  min-height: 52px;
  padding: 0.45rem 0.75rem;
  margin: 0;
  background: rgba(12, 8, 6, 0.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(212, 168, 67, 0.16);
}
.header-brand {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 0;
  color: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
  min-width: 0;
  flex-shrink: 0;
}
.header-brand .crest {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  display: block;
  background: #0b1228;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 168, 67, 0.28);
}
.header-brand .brand {
  font-size: 0.98rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.header-end {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.header-account {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
}
.header-wallet {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.16rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 10, 18, 0.72);
  color: inherit;
  font: inherit;
  cursor: pointer;
  flex-shrink: 0;
}
.header-wallet:hover { border-color: rgba(212, 168, 67, 0.45); }
.hw-cash, .hw-virt {
  display: flex;
  align-items: center;
  gap: 0.18rem;
  white-space: nowrap;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}
.hw-cash {
  padding: 0.28rem 0.28rem 0.28rem 0.4rem;
  border-radius: 999px;
  background: rgba(212, 168, 67, 0.12);
  border: 1px solid rgba(212, 168, 67, 0.38);
  color: var(--gold-2);
}
.hw-virt {
  padding: 0.28rem 0.45rem 0.28rem 0.32rem;
  color: #c9e2ff;
}
.hw-ico { font-size: 0.68rem; }
.hw-plus {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--gold);
  color: #1a1208;
  font-size: 0.68rem;
  font-weight: 900;
  display: grid;
  place-items: center;
  line-height: 1;
}
.header-player {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.38rem;
  background: none;
  border: 0;
  color: inherit;
  padding: 0;
  cursor: pointer;
  min-width: 0;
}
.header-ava { position: relative; flex-shrink: 0; }
.header-player .avatar {
  width: 36px;
  height: 36px;
  font-size: 0.8rem;
}
.header-online {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border: 2px solid #140c08;
  border-radius: 50%;
}
.header-pseudo {
  font-weight: 700;
  font-size: 0.78rem;
  max-width: 4.6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.badge-virt {
  background: rgba(56, 120, 200, 0.18);
  border: 1px solid rgba(120, 180, 255, 0.42);
  color: #c9e2ff;
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #3d2a1a;
  border: 2px solid var(--gold);
  font-weight: 600;
  font-size: 0.85rem;
}
.avatar.lg { width: 64px; height: 64px; font-size: 1.2rem; }
.subnav {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
  margin: 0.6rem 0 0.85rem;
}
.subnav button {
  border: 1px solid rgba(212,168,67,0.25);
  background: transparent;
  color: var(--mist);
  border-radius: 999px;
  padding: 0.45rem 0.2rem;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}
.subnav button.is-on {
  background: rgba(212, 168, 67, 0.18);
  color: var(--gold-2);
}
.king-banner { display: grid; gap: 0.35rem; }
.king-row { display: flex; gap: 0.85rem; align-items: center; }
.crown-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.crown-title {
  margin: 0 0 0.15rem;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.king-cats {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 0.7rem;
  scrollbar-width: none;
}
.king-cats::-webkit-scrollbar { display: none; }
.king-cat {
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 14, 12, 0.9);
  color: var(--sand);
  border-radius: 12px;
  padding: 0.45rem 0.7rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}
.king-cat.is-on {
  background: linear-gradient(180deg, #f0d78c, #d4a843);
  color: #1a1208;
  border-color: transparent;
}
.king-seat {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(212, 168, 67, 0.42);
  border-radius: 18px;
  padding: 0.95rem 1rem 1rem;
  margin-bottom: 0.8rem;
  background: linear-gradient(165deg, rgba(212, 168, 67, 0.16), rgba(12, 8, 6, 0.96) 48%);
  box-shadow: 0 12px 28px rgba(212, 168, 67, 0.12);
}
.king-seat-glow {
  position: absolute;
  right: -1.4rem;
  top: -1.4rem;
  width: 6rem;
  height: 6rem;
  border-radius: 50%;
  background: rgba(212, 168, 67, 0.16);
  filter: blur(16px);
  pointer-events: none;
}
.king-seat-top, .king-id {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}
.king-id { align-items: center; }
.king-avatar-wrap { position: relative; }
.king-avatar {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 16px;
  border: 2px solid var(--gold);
  background: rgba(212, 168, 67, 0.18);
  color: var(--gold-2);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
}
.king-crown-badge {
  position: absolute;
  top: -0.45rem;
  right: -0.35rem;
  font-size: 1rem;
}
.king-id h3 { margin: 0.1rem 0 0.15rem; font-size: 1.15rem; }
.king-prize { text-align: right; }
.king-prize small {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mist);
}
.king-prize strong {
  font-size: 1.15rem;
  color: #7dcea0;
}
.king-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.75rem 0;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  background: rgba(6, 4, 8, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.king-stats small {
  display: block;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mist);
}
.king-stats b { font-size: 0.78rem; }
.crown-meter {
  flex: 1 1 100%;
  margin: 0.15rem 0 0;
  padding: 0.28rem 0.45rem 0.35rem;
  border-radius: 10px;
  background: rgba(12, 8, 6, 0.55);
  border: 1px solid rgba(212, 168, 67, 0.28);
}
.crown-meter span {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.62rem;
  color: #f0d78c;
}
.crown-meter-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.crown-meter-bar {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #d4a843, #f5d989);
  width: 0;
}
.hall-title {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sand);
}
.hall-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.6rem;
  margin-bottom: 0.4rem;
  border-radius: 12px;
  background: rgba(6, 4, 8, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.hall-row:last-child { margin-bottom: 0; }
.hall-who { display: flex; align-items: center; gap: 0.5rem; }
.hall-who strong { display: block; font-size: 0.82rem; }
.hall-who small { color: var(--mist); font-size: 0.68rem; }
.hall-row em {
  display: block;
  font-style: normal;
  color: #7dcea0;
  font-weight: 800;
  font-size: 0.78rem;
  text-align: right;
}
.hall-see {
  background: none;
  border: 0;
  color: var(--gold);
  font: inherit;
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
  padding: 0;
}
.user-profile {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.88rem;
}
.badge-cash {
  background: rgba(46, 140, 70, 0.16);
  border: 1px solid rgba(212, 168, 67, 0.55);
  color: var(--gold-2);
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
  font-size: 0.68rem;
  font-weight: 600;
  white-space: nowrap;
}
.btn-login-accent {
  width: auto;
  margin: 0;
  min-height: 44px;
  border-radius: 14px;
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
}
.countdown {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  color: var(--gold-2);
  margin: 0.35rem 0 0.8rem;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  overflow: visible;
  background: rgba(16, 10, 8, 0.72);
  backdrop-filter: blur(22px) saturate(1.15);
  -webkit-backdrop-filter: blur(22px) saturate(1.15);
  border-top: 1px solid rgba(212, 168, 67, 0.22);
  padding: 0.35rem 0.45rem calc(0.45rem + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.28);
}
.bottom-nav-inner {
  max-width: 28rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  text-align: center;
  overflow: visible;
}
.tab-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.18rem;
  background: none;
  border: 0;
  color: #8d7d6c;
  font: inherit;
  padding: 0.45rem 0.1rem 0.2rem;
  cursor: pointer;
  transition: color 0.18s ease, transform 0.18s ease;
}
.tab-item:hover { color: var(--gold-2); }
.tab-item.is-active {
  color: var(--gold);
  font-weight: 700;
}
.tab-item.is-active::before {
  content: "";
  position: absolute;
  top: 0.12rem;
  left: 50%;
  width: 14px;
  height: 3px;
  margin-left: -7px;
  border-radius: 99px;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(212, 168, 67, 0.85);
}
.tab-ico {
  display: grid;
  place-items: center;
  line-height: 1;
}
.tab-ico svg {
  width: 22px;
  height: 22px;
  display: block;
}
.tab-label {
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.03em;
  line-height: 1.2;
}
.tab-fab {
  margin-top: -1.15rem;
  padding-top: 0;
  gap: 0.22rem;
}
.tab-fab.is-active::before { display: none; }
.tab-fab-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  padding: 2px;
  background: linear-gradient(145deg, #f5e0a8, #c48a28);
  box-shadow:
    0 8px 20px rgba(212, 168, 67, 0.32),
    0 0 0 1px rgba(212, 168, 67, 0.15);
  display: block;
}
.tab-fab.is-active .tab-fab-ring {
  box-shadow:
    0 10px 24px rgba(212, 168, 67, 0.5),
    0 0 0 3px rgba(212, 168, 67, 0.18);
}
.tab-fab-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #120c08;
  display: grid;
  place-items: center;
  color: var(--gold-2);
}
.tab-fab-core svg { width: 22px; height: 22px; display: block; }
.tab-fab .tab-label { color: var(--gold); font-weight: 700; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  visibility: hidden;
}
.sheet.open {
  pointer-events: auto;
  visibility: visible;
}
.sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(8, 4, 2, 0.68);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(480px, 100%);
  transform: translate(-50%, 110%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  background: linear-gradient(180deg, #2a1b12, #140c08);
  border: 1px solid rgba(212, 168, 67, 0.28);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  padding: 0.85rem 1.35rem calc(1.5rem + env(safe-area-inset-bottom));
  max-height: 90dvh;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.sheet.open .sheet-panel { transform: translate(-50%, 0); }
.sheet.sheet-center .sheet-panel {
  bottom: auto;
  top: 50%;
  transform: translate(-50%, calc(-50% + 24px));
  border-radius: 20px;
  border-bottom: 1px solid rgba(212, 168, 67, 0.28);
  width: min(400px, calc(100% - 1.6rem));
  max-height: min(88dvh, 640px);
  padding: 1.15rem 1.35rem 1.4rem;
}
.sheet.sheet-center.open .sheet-panel { transform: translate(-50%, -50%); }
.sheet-chrome {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 2.25rem;
  margin: 0 0 0.15rem;
  flex-shrink: 0;
}
.sheet.sheet-center .sheet-chrome {
  justify-content: flex-end;
}
.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 99px;
  background: rgba(232, 213, 181, 0.38);
  margin: 0;
}
.sheet.sheet-center .sheet-handle { visibility: hidden; }
.sheet-close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.18);
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.sheet-close:hover,
.sheet-close:focus-visible {
  background: #334155;
  color: #f8fafc;
  outline: none;
}
.sheet-close:active { transform: translateY(-50%) scale(0.94); }
.sheet-close svg { display: block; }
.sheet-panel > .kicker { margin: 0; }
.sheet-panel > h2,
.sheet-panel .victory-title {
  margin: 0;
}
.sheet-panel > .muted,
.sheet-panel > p {
  margin: 0;
}
.sheet-panel form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0;
}
.sheet-panel label { margin: 0; }
.sheet-panel .row-2 { margin: 0; }
.sheet-panel input,
.sheet-panel select,
.sheet-panel textarea {
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: rgba(0, 0, 0, 0.34);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sheet-panel input:focus,
.sheet-panel select:focus,
.sheet-panel textarea:focus {
  outline: none;
  border-color: #fbbf24;
  box-shadow: 0 0 0 1px #fbbf24;
}
.sheet-panel input::placeholder,
.sheet-panel textarea::placeholder {
  color: rgba(203, 183, 154, 0.62);
}
.sheet-panel .btn {
  width: 100%;
  min-height: 48px;
  margin: 0;
  border-radius: 16px;
  padding: 0.75rem 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 20px rgba(212, 168, 67, 0.22);
  transition: filter 0.15s ease, transform 0.12s ease, background 0.15s ease, border-color 0.15s ease;
}
.sheet-panel .btn:hover:not(:disabled) { filter: brightness(1.08); }
.sheet-panel .btn:active:not(:disabled) { transform: scale(0.98); }
.sheet-panel .btn.ghost,
.sheet-panel .btn-secondary {
  min-height: 44px;
  background: rgba(15, 23, 42, 0.82);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.42);
  box-shadow: none;
  font-weight: 600;
}
.sheet-panel .btn.ghost:hover:not(:disabled),
.sheet-panel .btn-secondary:hover:not(:disabled) {
  background: rgba(30, 41, 59, 0.95);
  filter: none;
  border-color: rgba(251, 191, 36, 0.55);
}
.sheet-panel .check { margin: 0.15rem 0 0; }
.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}
.sheet-panel .btn.wine,
.sheet-panel .leave-yes.is-danger {
  box-shadow: 0 8px 18px rgba(127, 29, 29, 0.28);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.crest {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  background: #0b1228;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 168, 67, 0.35);
}
.brand small { display: block; color: var(--mist); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.65rem; }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(212, 168, 67, 0.22);
  border-radius: 18px;
  padding: 1.1rem;
  margin-bottom: 1rem;
  backdrop-filter: blur(10px);
}

label { display: block; font-size: 0.78rem; color: var(--mist); margin: 0.6rem 0 0.3rem; }
input, select {
  width: 100%;
  border: 1px solid rgba(232, 213, 181, 0.2);
  background: rgba(0,0,0,0.28);
  color: var(--ivory);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  font: inherit;
}
.btn {
  width: 100%;
  margin-top: 0.85rem;
  border: 0;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--ebony);
}
.btn.ghost {
  background: transparent;
  color: var(--gold-2);
  border: 1px solid rgba(212,168,67,0.4);
}
.btn.wine { background: linear-gradient(180deg, #a34438, var(--wine)); color: #fff; }
.btn.is-busy, .btn:disabled {
  opacity: 0.72;
  cursor: wait;
}
.wallet-phone-hint { margin: 0.2rem 0 0.55rem; font-size: 0.72rem; }
.field-error {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  line-height: 1.35;
  color: #fca5a5;
}

.linkish { background: none; border: 0; color: var(--gold-2); cursor: pointer; font: inherit; margin-top: 0.8rem; }

.balances { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.bal { padding: 0.9rem; border-radius: 14px; background: rgba(0,0,0,0.25); }
.bal span { display: block; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mist); }
.bal strong { font-size: 1.15rem; }

.wallet-vip { margin: 0.35rem 0 0.2rem; }
.bal-cash {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(212, 168, 67, 0.22), #1a120c 58%, #0e0a08);
  border: 1px solid rgba(212, 168, 67, 0.42);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(240, 215, 140, 0.12);
}
.bal-virt {
  background: linear-gradient(145deg, rgba(56, 132, 220, 0.22), #0c1220 58%, #080c14);
  border: 1px solid rgba(96, 165, 250, 0.38);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(147, 197, 253, 0.12);
}
.bal-ico { font-size: 1.15rem; margin-bottom: 0.35rem; }
.bal-cash > span:nth-of-type(2) { color: var(--gold-2); font-weight: 700; }
.bal-virt > span:nth-of-type(2) { color: #93c5fd; font-weight: 700; }
.bal-amt { margin: 0.35rem 0 0; display: flex; align-items: baseline; gap: 0.28rem; flex-wrap: wrap; }
.bal-amt strong { font-size: 1.45rem; font-weight: 800; letter-spacing: -0.03em; }
.bal-cash .bal-amt strong { color: var(--gold-2); }
.bal-virt .bal-amt strong { color: #e8f1ff; }
.bal-amt em { font-style: normal; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; }
.bal-cash .bal-amt em { color: var(--gold); }
.bal-virt .bal-amt em { color: #60a5fa; }

.wallet-tabs {
  background: rgba(8, 10, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.28rem;
  gap: 0.22rem;
}
.wallet-tabs button {
  border-radius: 10px;
  border: 0;
  padding: 0.55rem 0.2rem;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.wallet-tabs button.is-on {
  background: var(--gold);
  color: #1a1208;
}

.wallet-panel .field-label {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.78rem;
  color: var(--mist);
}
.wallet-panel .field-label strong {
  color: var(--gold-2);
  font-weight: 700;
}
.op-orange:not(.is-on) {
  border-color: rgba(249, 115, 22, 0.35);
}
.op-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0.35rem 0 0.85rem;
}
.op-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 3.35rem;
  padding: 0.55rem 0.4rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(8, 8, 12, 0.55);
  color: var(--mist);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.op-card strong { font-size: 0.78rem; }
.op-card.is-on { transform: translateY(-1px); }
.op-mtn.is-on {
  background: rgba(255, 204, 0, 0.12);
  border: 2px solid #facc15;
  color: #fde047;
}
.op-orange.is-on {
  background: rgba(249, 115, 22, 0.14);
  border: 2px solid #f97316;
  color: #fdba74;
}
.op-mark {
  display: grid;
  place-items: center;
  min-width: 2.4rem;
  height: 1.45rem;
  border-radius: 5px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.op-mark-mtn { background: #ffcc00; color: #1a1a1a; }
.op-mark-om { background: #ff7900; color: #fff; }

.amt-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin: 0.55rem 0 0.95rem;
}
.amt-chip {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--sand);
  border-radius: 10px;
  padding: 0.48rem 0.15rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}
.amt-chip.is-on {
  border-color: rgba(212, 168, 67, 0.7);
  background: rgba(212, 168, 67, 0.18);
  color: var(--gold-2);
}

.wallet-secure {
  margin: 0.7rem 0 0.15rem;
  text-align: center;
  font-size: 0.72rem;
  color: var(--mist);
  line-height: 1.4;
}
.wallet-rule { font-size: 0.78rem; margin: 0.15rem 0 0.85rem; }
.dep-recap {
  list-style: none;
  margin: 0.35rem 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.dep-recap li {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.dep-recap li span {
  font-size: 0.78rem;
  color: var(--mist);
  line-height: 1.35;
}
.dep-recap li strong {
  font-size: 0.92rem;
  color: var(--ivory);
  text-align: right;
  white-space: nowrap;
}
.dep-recap-total {
  border-color: rgba(212, 168, 67, 0.45) !important;
  background: rgba(212, 168, 67, 0.12) !important;
}
.dep-recap-total strong { color: var(--gold-2); font-size: 1.02rem; }
#btn-deposit-confirm { margin-top: 0.15rem; }
.dep-track {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.4;
  text-align: center;
  background: rgba(212, 168, 67, 0.12);
  border: 1px solid rgba(212, 168, 67, 0.35);
  color: var(--gold-2);
}
.dep-track.is-ok {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}
.dep-track.is-err {
  background: rgba(185, 28, 28, 0.16);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fecaca;
}
#modal-deposit-confirm.is-tracking .sheet-backdrop { pointer-events: none; }
.wd-available {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.95rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid rgba(212, 168, 67, 0.28);
}
.wd-available span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--mist); }
.wd-available strong { color: var(--gold-2); }

.hero-solo {
  position: relative;
  overflow: hidden;
  padding: 1.25rem 1.15rem 1.2rem;
  margin-bottom: 1.15rem;
  border-radius: 20px;
  border: 1px solid rgba(212, 168, 67, 0.32);
  background:
    radial-gradient(420px 160px at 90% -20%, rgba(240, 215, 140, 0.22), transparent 55%),
    linear-gradient(165deg, #3d2a1a 0%, #1c120c 55%, #140c08 100%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}
.hero-solo h2 {
  margin: 0.15rem 0 0.4rem;
  font-size: 1.55rem;
}
.hero-solo .btn { margin-top: 0.95rem; }

.train-banner {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0.2rem 0 1.05rem;
  padding: 1.05rem 1.1rem 1.1rem;
  border-radius: 18px;
  border: 1px solid rgba(96, 165, 250, 0.5);
  background:
    radial-gradient(320px 140px at 100% -10%, rgba(59, 130, 246, 0.32), transparent 58%),
    linear-gradient(165deg, #101a2e 0%, #0a101c 55%, #080c14 100%);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(147, 197, 253, 0.16);
}
.train-banner-copy .kicker { color: #93c5fd; margin-bottom: 0.15rem; }
.train-banner h2 {
  margin: 0 0 0.3rem;
  font-size: 1.32rem;
  line-height: 1.15;
}
.train-banner .muted { margin: 0; font-size: 0.82rem; }
.train-banner-cta {
  margin: 0;
  background: linear-gradient(180deg, #60a5fa, #2563eb) !important;
  color: #f8fbff !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

.lobby-subnav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin: 0.15rem 0 1.05rem;
  padding: 0.4rem;
  border-radius: 18px;
  background: rgba(12, 14, 22, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.subtab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  min-height: 3.35rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 8, 14, 0.85);
  color: #b8a992;
  border-radius: 13px;
  padding: 0.45rem 0.15rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.subtab-ico { font-size: 1.05rem; line-height: 1; }
.subtab-btn:hover {
  color: var(--gold-2);
  border-color: rgba(212, 168, 67, 0.28);
  background: rgba(24, 20, 16, 0.95);
}
.subtab-btn.is-on {
  background: linear-gradient(180deg, #f0d78c, #d4a843);
  color: #1a1208;
  border-color: rgba(245, 224, 168, 0.55);
  box-shadow: 0 8px 18px rgba(212, 168, 67, 0.32), 0 0 0 1px rgba(212, 168, 67, 0.15);
  transform: translateY(-1px);
}
.lobby-pane .kicker { margin: 0.85rem 0 0.4rem; }
.lobby-pane > .btn { margin-bottom: 0.35rem; }

.stake-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}
.stake-card {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  padding: 0.8rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 10, 14, 0.55);
  text-align: left;
}
.stake-card.is-cash { border-color: rgba(212, 168, 67, 0.32); }
.stake-card.is-vip {
  border-color: rgba(212, 168, 67, 0.55);
  background: linear-gradient(160deg, rgba(212, 168, 67, 0.16), rgba(12, 8, 6, 0.9));
  box-shadow: 0 8px 22px rgba(212, 168, 67, 0.12);
}
.stake-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.3rem;
}
.stake-amt {
  margin: 0.15rem 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.25rem;
}
.stake-amt em { font-style: normal; font-size: 0.7rem; color: var(--gold); }
.stake-card .muted { font-size: 0.72rem; margin: 0 0 0.35rem; }
.stake-card .btn { width: 100%; margin: 0; padding: 0.5rem; font-size: 0.75rem; }
.stake-card.is-custom {
  border: 2px dashed rgba(212, 168, 67, 0.55);
  background: linear-gradient(160deg, rgba(212, 168, 67, 0.14), rgba(10, 8, 12, 0.92));
  cursor: pointer;
  justify-content: space-between;
  min-height: 100%;
}
.stake-card.is-custom .stake-amt { color: var(--gold-2); font-size: 1.05rem; }
.stake-card.is-custom:hover .btn {
  background: var(--gold);
  color: #1a1208;
}

.tourney-hero {
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(212, 168, 67, 0.55);
  border-radius: 18px;
  padding: 0.95rem 1rem 1rem;
  margin-bottom: 0.85rem;
  background: linear-gradient(155deg, rgba(212, 168, 67, 0.22), rgba(16, 10, 8, 0.96) 42%, #0a0706);
  box-shadow: 0 12px 28px rgba(212, 168, 67, 0.16);
}
.tourney-hero-glow {
  position: absolute;
  right: -1.2rem;
  top: -1.2rem;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  background: rgba(212, 168, 67, 0.18);
  filter: blur(18px);
  pointer-events: none;
}
.tourney-hero h3 {
  position: relative;
  margin: 0.35rem 0 0.2rem;
  font-size: 1.15rem;
  line-height: 1.2;
}
.tourney-hero-top,
.tourney-hero-foot,
.tourney-mini-top,
.tourney-mini-foot,
.tourney-section-head,
.tourney-gauge-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.tourney-hero-foot { margin-top: 0.75rem; }
.tourney-hero-foot .btn { width: auto; min-width: 7.5rem; margin: 0; padding: 0.62rem 1.1rem; }
.tourney-pill {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 99px;
}
.tourney-pill-gold { background: var(--gold); color: #1a1208; }
.tourney-eta {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold-2);
  background: rgba(212, 168, 67, 0.1);
  border: 1px solid rgba(212, 168, 67, 0.22);
  padding: 0.18rem 0.45rem;
  border-radius: 8px;
  white-space: nowrap;
}
.tourney-buyin { margin: 0; font-weight: 800; font-size: 0.95rem; }
.tourney-buyin em { font-style: normal; font-size: 0.65rem; color: var(--gold); }
.tourney-buyin-label {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mist);
}
.tourney-gauge { margin: 0.65rem 0 0.15rem; }
.tourney-gauge-sm { margin: 0.45rem 0 0.55rem; }
.tourney-gauge-meta {
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 0.28rem;
}
.tourney-gauge-meta span { color: var(--mist); }
.tourney-gauge-meta strong { color: var(--gold-2); }
.tourney-bar {
  height: 8px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(6, 4, 8, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.tourney-bar i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #b8892e, #f0d78c);
}
.tourney-section-head {
  margin: 0.35rem 0 0.55rem;
}
.tourney-section-head h4 {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
}
.tourney-live-dot {
  font-size: 0.62rem;
  font-weight: 800;
  color: #7dcea0;
}
.tourney-live-dot::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 0.3rem;
  border-radius: 50%;
  background: #3ecf8e;
  box-shadow: 0 0 8px #3ecf8e;
  vertical-align: middle;
}
.tourney-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
.tourney-mini {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0.75rem;
  background: rgba(12, 10, 14, 0.72);
}
.tourney-mini h5 { margin: 0.2rem 0 0.15rem; font-size: 0.92rem; }
.tourney-mini .muted { font-size: 0.7rem; margin: 0; }
.tourney-mini.is-vip {
  border-color: rgba(212, 168, 67, 0.38);
  background: linear-gradient(165deg, rgba(212, 168, 67, 0.12), rgba(12, 8, 6, 0.92));
}
.tourney-mini.is-league { border-color: rgba(129, 140, 248, 0.28); }
.tourney-tag {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  color: #d8d0c4;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}
.tourney-tag.is-gold { background: rgba(212, 168, 67, 0.18); color: var(--gold-2); }
.tourney-tag.is-indigo { background: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
.tourney-pot { font-size: 0.62rem; font-weight: 800; color: var(--gold); }
.tourney-mini-foot {
  margin-top: auto;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.tourney-mini-foot .btn { width: auto; margin: 0; padding: 0.38rem 0.7rem; font-size: 0.7rem; }
.tourney-status { font-size: 0.62rem !important; }

.priv-hero {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  border-radius: 16px;
  border: 1px solid rgba(62, 207, 142, 0.28);
  background: linear-gradient(110deg, rgba(16, 64, 42, 0.55), rgba(12, 10, 14, 0.92));
}
.priv-hero h3 { margin: 0 0 0.15rem; font-size: 0.98rem; }
.priv-hero .muted { margin: 0; font-size: 0.72rem; }
.priv-hero-ico {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  background: rgba(62, 207, 142, 0.16);
  border: 1px solid rgba(62, 207, 142, 0.35);
  flex-shrink: 0;
}
.priv-block {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0.9rem 0.95rem 1rem;
  margin-bottom: 0.75rem;
  background: rgba(12, 10, 14, 0.72);
}
.priv-block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.55rem;
  margin-bottom: 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.priv-block-head h4 {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.priv-block-head h4.is-emerald { color: #7dcea0; }
.priv-label {
  margin: 0.55rem 0 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sand);
}
.priv-split, .priv-amts, .priv-colors {
  display: grid;
  gap: 0.45rem;
}
.priv-split { grid-template-columns: 1fr 1fr; }
.priv-amts { grid-template-columns: repeat(4, 1fr); }
.priv-colors { grid-template-columns: 1fr 1fr 1fr; }
.priv-choice, .priv-amt, .priv-color {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(18, 14, 12, 0.9);
  color: var(--ivory);
  border-radius: 12px;
  padding: 0.55rem 0.3rem;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.priv-choice.is-on, .priv-amt.is-on, .priv-color.is-on {
  border-color: rgba(212, 168, 67, 0.75);
  background: rgba(212, 168, 67, 0.12);
  color: var(--gold-2);
}
.priv-color {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  padding: 0.6rem 0.25rem;
}
.piece-dot {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  display: block;
}
.piece-dot.is-white {
  background: #f4ead6;
  border: 1px solid #d4a843;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.piece-dot.is-black {
  background: #140c08;
  border: 1px solid #5a4636;
}
.piece-dice { font-size: 0.95rem; line-height: 1; }
.priv-code-wrap { position: relative; margin-bottom: 0.65rem; }
.priv-code-wrap input {
  width: 100%;
  padding-right: 5.2rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 800;
  color: var(--gold-2);
}
.priv-paste {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: var(--sand);
  border-radius: 8px;
  padding: 0.32rem 0.5rem;
  font-size: 0.65rem;
  font-weight: 800;
  cursor: pointer;
}
.btn-emerald {
  background: linear-gradient(180deg, #3ecf8e, #1f9a62) !important;
  color: #062016 !important;
}
.priv-wait {
  border: 1px solid rgba(212, 168, 67, 0.4);
  border-radius: 16px;
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(160deg, rgba(212, 168, 67, 0.14), rgba(12, 10, 14, 0.9));
}
.priv-wait-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
}
.priv-wait .invite-code { font-size: 1.25rem; margin: 0.35rem 0 0.55rem; }
.priv-wait-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
.priv-wait-actions .btn { margin: 0; padding: 0.5rem 0.4rem; font-size: 0.72rem; }

.quest-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.86rem;
}
.quest-row:last-child { border-bottom: 0; }
.quest-row.is-done { color: #9fe0b4; }
.invite-code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 1.6rem;
  letter-spacing: 0.18em;
  text-align: center;
  color: var(--gold-2);
  margin: 0.4rem 0 0.6rem;
}

.lobby-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.2rem 0 0.9rem;
}
.section-title {
  margin: 0;
  font-size: 1.2rem;
}
.btn-create-table {
  width: auto;
  margin: 0;
  flex-shrink: 0;
  padding: 0.65rem 0.9rem;
  font-size: 0.82rem;
}

.lobby-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 400px) {
  .lobby-grid { grid-template-columns: 1fr 1fr; }
}
.lobby-card {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(212, 168, 67, 0.2);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  text-align: left;
}
.lobby-card.is-vip {
  border-color: rgba(212, 168, 67, 0.5);
  box-shadow: 0 8px 20px rgba(212, 168, 67, 0.12);
}
.lobby-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.4rem;
}
.lobby-host {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
}
.chip {
  border-radius: 999px;
  padding: 0.15rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.chip-cash {
  background: rgba(34, 120, 70, 0.28);
  color: #9fe0b4;
  border: 1px solid rgba(80, 200, 120, 0.4);
}
.chip-virt {
  background: rgba(40, 90, 180, 0.28);
  color: #b9d4ff;
  border: 1px solid rgba(120, 170, 255, 0.4);
}
.lobby-stake {
  margin: 0.15rem 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  color: var(--gold-2);
}
.lobby-gain {
  margin: 0;
  font-size: 0.75rem;
  color: var(--mist);
}
.lobby-card .btn {
  margin-top: auto;
  width: 100%;
  padding: 0.55rem 0.7rem;
  font-size: 0.8rem;
}
.lobby-empty {
  grid-column: 1 / -1;
  padding: 1.4rem 1rem;
  text-align: center;
  color: var(--mist);
  border: 1px dashed rgba(212, 168, 67, 0.28);
  border-radius: 16px;
}

.lobby-row, .tx {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 0;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
#tx-list .tx {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.12rem 0.6rem;
  cursor: default;
}
#tx-list .tx em {
  grid-column: 1 / -1;
  font-style: normal;
  font-size: 0.72rem;
  color: var(--mist);
}
.muted { color: var(--mist); }
.kicker { letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.7rem; color: var(--gold); margin-bottom: 0.2rem; }

.board-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(240, 215, 140, 0.18), transparent 55%),
    linear-gradient(165deg, #4a2c1a 0%, #1a0f0a 55%, #120c08 100%);
  border-radius: 10px;
  border: 6px solid #1a0f0a;
  box-shadow:
    inset 0 0 0 1.5px rgba(212, 168, 67, 0.55),
    0 18px 40px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(212, 168, 67, 0.08);
  overflow: hidden;
}
.board-stage.is-royal .board-wrap {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(245, 200, 90, 0.28), transparent 55%),
    linear-gradient(165deg, #2a1a0c 0%, #0a0706 52%, #1a1208 100%);
  border: 7px solid #c9a227;
  box-shadow:
    inset 0 0 0 2px rgba(255, 236, 180, 0.45),
    0 18px 48px rgba(0, 0, 0, 0.55),
    0 0 48px rgba(212, 168, 67, 0.22);
}
.royal-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 0.45rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(61, 36, 12, 0.95), rgba(12, 8, 6, 0.92));
  border: 1px solid rgba(212, 168, 67, 0.45);
  color: #f0d78c;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.royal-ribbon strong { font-size: 0.72rem; letter-spacing: 0.14em; }
.royal-ribbon-mark { font-size: 1rem; }
.royal-pill {
  font-size: 0.58rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(212, 168, 67, 0.22);
  border: 1px solid rgba(212, 168, 67, 0.45);
  color: #fde68a;
  letter-spacing: 0.08em;
}
.royal-pill.is-soft {
  background: rgba(255, 255, 255, 0.06);
  color: #e8d3a7;
  border-color: rgba(255, 255, 255, 0.12);
}
.royal-spark {
  position: absolute;
  width: 10%;
  height: 10%;
  pointer-events: none;
  z-index: 4;
}
.royal-spark::after {
  content: '';
  position: absolute;
  left: 45%;
  top: 45%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8dc 0%, #f0d78c 40%, #b8862a 100%);
  box-shadow: 0 0 8px #facc15;
  animation: royal-spark-fly 0.85s ease-out forwards;
}
@keyframes royal-spark-fly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx, 12px), var(--dy, -24px)) scale(0.2); opacity: 0; }
}
.settings-stack {
  flex-wrap: wrap;
  align-items: flex-start;
}
.settings-stack .skin-seg {
  width: 100%;
  max-width: none;
  margin: 0.15rem 0 0.25rem;
}
.skin-seg button {
  flex: 1;
  font-size: 0.72rem;
}

.training-bar {
  display: none;
}
.train-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}
.train-row > span {
  font-size: 0.75rem;
  color: var(--mist);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.seg {
  display: flex;
  flex: 1;
  max-width: 16rem;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(212, 168, 67, 0.28);
}
.seg button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--mist);
  font: inherit;
  font-size: 0.75rem;
  padding: 0.4rem 0.35rem;
  cursor: pointer;
}
.seg button.is-on {
  background: rgba(212, 168, 67, 0.22);
  color: var(--gold-2);
  font-weight: 600;
}
.train-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
}
.train-toggles .check { margin-top: 0.15rem; font-size: 0.82rem; }
.train-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.65rem;
}
.train-actions .btn { margin: 0; }
.train-note { margin: 0.55rem 0 0; font-size: 0.75rem; }

.board-stage { position: relative; }
.training-end {
  position: absolute;
  inset: 0.4rem;
  border-radius: 16px;
  background: rgba(12, 8, 6, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.1rem;
  z-index: 12;
}
.training-end h2 { margin: 0 0 0.4rem; }
.training-end p { margin: 0 0 0.9rem; color: var(--sand); }
.training-end .btn { margin-top: 0.45rem; }

#toast {
  position: fixed;
  left: 50%;
  top: 1rem;
  transform: translate(-50%, -120%);
  background: var(--ivory);
  color: var(--ink);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  opacity: 0;
  transition: 0.25s ease;
  z-index: 80;
  max-width: 90%;
  pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#toast.is-error { background: #f3d0c8; color: #5a1d16; }
#toast.is-ok { background: #d8f0d0; color: #1a3d18; }

.notif-wrap { position: relative; }
.notif-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 8, 6, 0.65);
  color: inherit;
  font-size: 1.05rem;
  cursor: pointer;
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.notif-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(22rem, 86vw);
  max-height: 22rem;
  padding: 0.75rem;
  border-radius: 16px;
  background: #141018;
  border: 1px solid rgba(212, 168, 67, 0.28);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  z-index: 60;
}
.notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.notif-read-all {
  border: 0;
  background: none;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}
.notif-list { max-height: 16rem; overflow: auto; display: grid; gap: 0.4rem; }
.notif-empty { margin: 0; color: var(--mist); font-size: 0.8rem; }
.notif-item {
  display: grid;
  gap: 0.15rem;
  text-align: left;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 12px;
  border: 0;
  border-left: 3px solid #64748b;
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  cursor: pointer;
}
.notif-item.is-unread { background: rgba(212, 168, 67, 0.1); }
.notif-item.is-tx { border-left-color: #10b981; }
.notif-item.is-game { border-left-color: #f0d78c; }
.notif-item.is-sec { border-left-color: #e11d48; }
.notif-item.is-sys { border-left-color: #64748b; }
.notif-item strong { font-size: 0.78rem; }
.notif-item span { font-size: 0.72rem; color: var(--sand); }
.notif-item small { font-size: 0.62rem; color: var(--mist); }
.report-btn {
  display: block;
  margin: 0.45rem auto 0;
  background: none;
  border: 0;
  color: var(--mist);
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
}

.auth-feedback {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.35;
}
.auth-feedback.is-error {
  background: rgba(163, 68, 56, 0.28);
  color: #f3d0c8;
  border: 1px solid rgba(243, 208, 200, 0.35);
}
.auth-feedback.is-ok {
  background: rgba(90, 140, 80, 0.28);
  color: #d8f0d0;
  border: 1px solid rgba(216, 240, 208, 0.3);
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.8rem;
  font-size: 0.9rem;
}
.check input { width: auto; }

.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.stat-card {
  padding: 0.85rem;
  border-radius: 14px;
  background: rgba(0,0,0,0.28);
}
.stat-card span {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
}
.stat-card p {
  margin: 0.35rem 0 0;
  font-size: 1.15rem;
  font-family: "Fraunces", Georgia, serif;
}
.stat-card p.is-king { color: var(--gold-2); }
.king-badge-banner {
  margin-top: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 168, 67, 0.35);
  background: rgba(212, 168, 67, 0.08);
  color: var(--gold-2);
  font-size: 0.88rem;
}

.victory-panel { text-align: center; }
.victory-title {
  margin: 0.15rem 0 0.35rem;
  font-size: 1.55rem;
  line-height: 1.2;
  animation: victory-pop 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.victory-gain {
  margin: 0.2rem 0 0.65rem;
  font-family: "Fraunces", Georgia, serif;
  font-size: 2rem;
  color: #facc15;
  text-shadow: 0 0 18px rgba(250, 204, 21, 0.55);
  animation: victory-bounce 0.9s ease infinite alternate;
}
@keyframes victory-pop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes victory-bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-6px); }
}

.avatar { position: relative; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-emoji { font-size: 1.15em; line-height: 1; }
.avatar.lg .avatar-emoji { font-size: 1.85rem; }
.avatar-edit {
  position: relative;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
}
.avatar-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  font-size: 11px;
  display: grid;
  place-items: center;
  border: 2px solid #140c08;
  z-index: 1;
}
.title-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.4rem;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  font-size: 0.78rem;
  font-weight: 600;
}
.title-badge.is-king {
  background: rgba(212, 168, 67, 0.28);
  color: var(--gold-2);
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.avatar-pick {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid rgba(212, 168, 67, 0.25);
  background: rgba(0, 0, 0, 0.28);
  font-size: 1.55rem;
  cursor: pointer;
}
.avatar-pick.is-on {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.35);
}
.match-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.86rem;
}
.match-row:last-child { border-bottom: 0; }
.dot-win { color: #4ade80; font-weight: 700; }
.dot-loss { color: #f87171; font-weight: 700; }
.logout-quiet {
  width: 100%;
  margin: 1.6rem 0 0.5rem;
  background: rgba(163, 68, 56, 0.12) !important;
  color: #f0a8a0;
  border: 1px solid rgba(163, 68, 56, 0.4);
}

.settings-list {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(8, 10, 18, 0.45);
  margin: 0.35rem 0 0.55rem;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 0.9rem;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.settings-row:last-child { border-bottom: 0; }
.settings-btn { cursor: pointer; }
.settings-btn:hover { background: rgba(255, 255, 255, 0.04); }
.settings-copy {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.settings-copy strong, .settings-copy span { display: block; }
.settings-copy .muted { font-size: 0.75rem; margin-top: 0.12rem; }
.settings-ico { font-size: 1.15rem; width: 1.4rem; text-align: center; }
.settings-chev { color: var(--mist); font-size: 0.9rem; flex-shrink: 0; }

.switch {
  position: relative;
  display: inline-flex;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-ui {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #3f3f46;
  transition: 0.2s ease;
}
.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: 0.2s ease;
}
.switch input:checked + .switch-ui { background: var(--gold); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }

.board-wrap { position: relative; }
.tchatche-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.tchatche-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tchatche-layer.is-souffrance {
  background: radial-gradient(circle at 50% 40%, rgba(180, 40, 20, 0.45), rgba(10, 6, 4, 0.55));
}
.tchatche-layer.is-souffrance.is-loser {
  background: radial-gradient(circle at 50% 40%, rgba(220, 50, 20, 0.65), rgba(8, 4, 2, 0.72));
}
.tchatche-banner {
  position: absolute;
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  z-index: 5;
  min-width: 70%;
  text-align: center;
  padding: 0.55rem 0.8rem 0.65rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(40, 22, 12, 0.94), rgba(18, 10, 6, 0.96));
  border: 1px solid rgba(212, 168, 67, 0.55);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  animation: tchatche-pop 0.45s ease;
}
.tchatche-banner strong {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--gold-2);
}
.tchatche-banner small {
  display: block;
  margin-top: 0.15rem;
  color: var(--mist);
  font-size: 0.72rem;
}
.tchatche-emo { font-size: 1.6rem; display: block; line-height: 1.1; }
.tchatche-sandale {
  position: absolute;
  right: -20%;
  top: 28%;
  font-size: 5.5rem;
  animation: tchatche-slap 0.7s ease-out forwards;
  filter: drop-shadow(0 8px 8px rgba(0,0,0,0.5));
}
.tchatche-boom {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  font-size: 4.2rem;
  animation: tchatche-boom 0.8s ease-out;
}
.tchatche-prise {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  font-size: 2.6rem;
  animation: tchatche-boom 0.55s ease-out;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.4));
}
.tchatche-bolt,
.tchatche-stop,
.tchatche-glow {
  position: absolute;
  width: 10%;
  height: 10%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.62rem;
  font-weight: 700;
  pointer-events: none;
}
.tchatche-bolt { font-size: 1.4rem; animation: tchatche-flash 0.9s ease; }
.tchatche-stop {
  background: rgba(180, 20, 20, 0.88);
  color: #fff;
  border-radius: 4px;
  letter-spacing: 0.06em;
  animation: tchatche-blink 0.4s steps(2) 6;
}
.tchatche-glow {
  border-radius: 50%;
  box-shadow: 0 0 18px 8px rgba(250, 204, 21, 0.75);
  animation: tchatche-saiyan 0.9s ease-in-out infinite alternate;
}
.tchatche-taunts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  margin: 0.45rem 0 0.15rem;
}
.tchatche-chip {
  border: 1px solid rgba(212, 168, 67, 0.35);
  background: rgba(20, 12, 8, 0.7);
  color: var(--ivory);
  font: inherit;
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  cursor: pointer;
}
.tchatche-chip:active { transform: scale(0.96); }
.tchatche-shake { animation: tchatche-shake 0.55s ease; }
@keyframes tchatche-pop {
  0% { transform: translateX(-50%) scale(0.6); opacity: 0; }
  70% { transform: translateX(-50%) scale(1.08); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); }
}
@keyframes tchatche-slap {
  0% { transform: translate(0, 0) rotate(-20deg); }
  55% { transform: translate(-120%, 18%) rotate(-55deg); }
  100% { transform: translate(-70%, 40%) rotate(-10deg); opacity: 0.2; }
}
@keyframes tchatche-boom {
  0% { transform: translate(-50%, -50%) scale(0.3); opacity: 0; }
  40% { transform: translate(-50%, -50%) scale(1.25); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.6); opacity: 0; }
}
@keyframes tchatche-flash {
  0%, 100% { opacity: 0.2; transform: scale(0.7); }
  40% { opacity: 1; transform: scale(1.3); }
}
@keyframes tchatche-blink {
  50% { opacity: 0.15; }
}
@keyframes tchatche-saiyan {
  from { box-shadow: 0 0 10px 4px rgba(250, 204, 21, 0.45); }
  to { box-shadow: 0 0 26px 12px rgba(255, 240, 120, 0.95); }
}
@keyframes tchatche-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px) rotate(-0.6deg); }
  40% { transform: translateX(6px) rotate(0.6deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .tchatche-shake, .tchatche-sandale, .tchatche-boom, .tchatche-banner { animation: none; }
}

.clock-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
  margin: 0 0 0.45rem;
}
@media (min-width: 520px) {
  .clock-bar {
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
  }
  .clock-bar #clock-opp { order: 1; }
  .clock-bar #btn-clock-pause { order: 2; align-self: center; }
  .clock-bar #clock-me { order: 3; }
}
.clock-seat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: 14px;
  background: rgba(12, 8, 6, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.clock-seat.is-me { border-color: rgba(16, 185, 129, 0.28); }
.clock-seat.is-active { box-shadow: inset 0 0 0 1px rgba(212, 168, 67, 0.35); }
.clock-seat.is-urgent .clock-digits {
  color: #f87171;
  animation: clock-blink 0.7s steps(2) infinite;
}
.clock-seat.is-bank .clock-digits {
  color: #fbbf24;
  animation: clock-blink 0.9s ease infinite;
}
.clock-who { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.clock-who strong { display: block; font-size: 0.82rem; }
.clock-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #64748b;
  flex-shrink: 0;
}
.clock-dot.is-me, .clock-seat.is-active .clock-dot { background: #10b981; }
.clock-bank {
  margin: 0.1rem 0 0;
  font-size: 0.68rem;
  color: #fbbf24;
  font-weight: 700;
}
.clock-time-wrap { text-align: right; }
.clock-label {
  display: block;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist);
}
.clock-digits {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 1.35rem;
  font-weight: 800;
  color: #34d399;
  line-height: 1.1;
}
.clock-pause {
  align-self: center;
  border: 1px solid rgba(212, 168, 67, 0.4);
  background: rgba(40, 24, 10, 0.9);
  color: var(--gold-2);
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
  cursor: pointer;
}
.clock-notice {
  text-align: center;
  font-size: 0.72rem;
  color: var(--gold-2);
  margin: 0 0 0.35rem;
  min-height: 1em;
}
@keyframes clock-blink {
  50% { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .clock-seat.is-urgent .clock-digits,
  .clock-seat.is-bank .clock-digits { animation: none; }
}

body.is-immersive {
  overflow: hidden;
}
body.is-immersive .main-header,
body.is-immersive .bottom-nav {
  display: none !important;
}
body.is-immersive .app-shell {
  max-width: 100%;
  min-height: 100dvh;
  padding: 0;
}
body.is-immersive #screen-table.screen,
#screen-table:fullscreen,
#screen-table:-webkit-full-screen {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  height: 100%;
  padding: 0.4rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom));
  background:
    radial-gradient(900px 500px at 50% -10%, #3a2418 0%, transparent 55%),
    var(--ebony);
  user-select: none;
  -webkit-user-select: none;
}
body.is-immersive .board-stage,
#screen-table:fullscreen .board-stage,
#screen-table:-webkit-full-screen .board-stage {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
body.is-immersive .board-wrap,
#screen-table:fullscreen .board-wrap,
#screen-table:-webkit-full-screen .board-wrap {
  width: min(96vw, 90dvh);
  max-width: min(920px, 100%);
  margin: 0 auto;
}
body.is-immersive .clock-bar {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.35rem;
}
body.is-immersive .clock-seat {
  flex: 1 1 42%;
  padding: 0.32rem 0.5rem;
}
body.is-immersive .clock-digits { font-size: 1.08rem; }
body.is-immersive .clock-pause { width: 100%; }
body.is-immersive .tchatche-taunts { margin-top: 0.25rem; }

.quartier-freeze {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 10, 6, 0.62);
  backdrop-filter: blur(5px);
  pointer-events: auto;
}
.quartier-freeze-card {
  width: min(90%, 18rem);
  text-align: center;
  padding: 1.15rem 1rem 1.25rem;
  border-radius: 22px;
  background: linear-gradient(180deg, #3a2410 0%, #120a06 100%);
  border: 2px solid rgba(212, 168, 67, 0.65);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.quartier-freeze-count {
  font-family: "Fraunces", Georgia, serif;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--gold-2, #f0d78c);
  margin-bottom: 0.35rem;
}
.quartier-freeze-card h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #f0d78c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.quartier-freeze-card p {
  margin: 0.4rem 0 0;
  color: var(--sand, #e8d7c0);
  font-size: 0.85rem;
}
.grace-overlay {
  position: absolute;
  inset: 0;
  z-index: 19;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 16, 28, 0.72);
  backdrop-filter: blur(5px);
}
.grace-overlay.hidden { display: none; }
.grace-card {
  width: min(92%, 20rem);
  text-align: center;
  padding: 1.2rem 1.05rem 1.3rem;
  border-radius: 22px;
  background: linear-gradient(180deg, #2a2410 0%, #0c1018 100%);
  border: 2px solid rgba(251, 191, 36, 0.7);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.grace-count {
  font-family: "Fraunces", Georgia, serif;
  font-size: 2.5rem;
  line-height: 1;
  color: #fbbf24;
  margin-bottom: 0.4rem;
}
.grace-card h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #f0d78c;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.grace-card p {
  margin: 0.45rem 0 0;
  color: #e8d7c0;
  font-size: 0.86rem;
  line-height: 1.35;
}
.anti-jeu-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(120, 8, 12, 0.55);
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.anti-jeu-card {
  width: min(92%, 20rem);
  text-align: center;
  padding: 1.15rem 1.1rem 1.2rem;
  border-radius: 22px;
  background: linear-gradient(180deg, #4a1018 0%, #14080a 100%);
  border: 2px solid #fb7185;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  animation: anti-jeu-pop 0.4s ease;
}
.anti-jeu-badge {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 0.55rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.85rem;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.55);
}
.anti-jeu-card h2 {
  margin: 0;
  color: #fb7185;
  font-size: 1.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.anti-jeu-kicker {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fecdd3;
  animation: anti-jeu-blink 0.55s steps(2) 6;
}
.anti-jeu-sub {
  margin: 0.25rem 0 0;
  font-size: 0.7rem;
  color: var(--mist);
}
.anti-jeu-tip {
  margin-top: 0.7rem;
  padding: 0.5rem 0.55rem;
  border-radius: 12px;
  font-size: 0.7rem;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.4);
  border: 1px solid rgba(248, 113, 113, 0.35);
}
@keyframes anti-jeu-pop {
  0% { transform: scale(0.7); opacity: 0; }
  70% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes anti-jeu-blink {
  50% { opacity: 0.2; }
}
@media (prefers-reduced-motion: reduce) {
  .anti-jeu-card, .anti-jeu-kicker { animation: none; }
}

/* Direct & Régie hub */
.live-hub-head {
  margin: 0 0 1rem;
}
.live-hub-head h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
}
.live-hub-sub {
  margin: 0.45rem 0 0.9rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--mist);
}
.live-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  -webkit-overflow-scrolling: touch;
}
.live-pill {
  flex: 0 0 auto;
  margin: 0;
  width: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(23, 23, 23, 0.85);
  color: var(--sand);
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
}
.live-pill.is-on {
  background: var(--gold);
  border-color: var(--gold);
  color: #1a1208;
}
.live-catalog {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.live-empty {
  margin: 0;
  padding: 1.75rem 1rem;
  text-align: center;
  color: var(--mist);
  background: #171717;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 0.75rem;
}
.live-empty strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ivory);
  font-size: 0.95rem;
}
.live-card {
  background: #171717;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.75rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}
.live-card-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.live-badge-on {
  background: rgba(185, 28, 28, 0.28);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.4);
}
.live-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: live-pulse 1.4s ease-out infinite;
}
.live-badge-cash {
  background: rgba(212, 168, 67, 0.16);
  color: var(--gold-2);
  border: 1px solid rgba(212, 168, 67, 0.4);
}
.live-badge-virt {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.4);
}
.live-viewers {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--mist);
  font-weight: 700;
}
.live-duel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.45rem;
  text-align: center;
}
.live-duel strong {
  font-size: 0.98rem;
  line-height: 1.2;
  word-break: break-word;
}
.live-duel em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}
.live-table-code {
  margin: 0;
  text-align: center;
  font-size: 0.72rem;
  color: #a3a3a3;
}
.live-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.live-watch {
  width: 100%;
  margin: 0;
}
.live-regie {
  position: relative;
}
.live-regie-toggle {
  width: 100%;
  margin: 0;
}
.live-regie-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 0.35rem);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.35rem;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.75rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}
.live-regie-menu a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  color: var(--ivory);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
}
.live-regie-menu a:hover,
.live-regie-menu a:focus {
  background: rgba(255, 255, 255, 0.06);
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

.lobby-seats {
  display: flex;
  gap: 0.35rem;
  margin: 0.35rem 0 0.15rem;
}
.lobby-ava {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(240, 215, 140, 0.35);
}
.lobby-ava-letter,
.lobby-ava-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255,255,255,0.08);
  color: var(--gold-2);
}
.lobby-ava-empty { opacity: 0.55; }

.active-game-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  max-width: 480px;
  margin: 0 auto;
  padding: 0.55rem 0.75rem;
  background: #2a1810;
  border-bottom: 1px solid rgba(212, 168, 67, 0.45);
  color: var(--ivory);
  font-size: 0.82rem;
}
.active-game-bar.hidden { display: none !important; }
.active-game-bar .btn {
  width: auto;
  margin: 0;
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}
body.has-active-game .app-shell {
  padding-top: 0;
}

.pwa-install {
  position: sticky;
  top: 0;
  z-index: 38;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 480px;
  margin: 0 auto;
  padding: 0.65rem 0.75rem;
  background: linear-gradient(180deg, #1c140e 0%, #120c08 100%);
  border-bottom: 1px solid rgba(212, 168, 67, 0.38);
  color: var(--ivory);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.pwa-install.hidden { display: none !important; }
.pwa-install-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(212, 168, 67, 0.35);
}
.pwa-install-copy {
  flex: 1;
  min-width: 0;
}
.pwa-install-copy strong {
  display: block;
  font-size: 0.86rem;
  line-height: 1.25;
  color: var(--gold-2);
}
.pwa-install-copy span {
  display: block;
  font-size: 0.72rem;
  color: var(--mist);
  margin-top: 0.12rem;
}
.pwa-install-ios {
  color: var(--ivory) !important;
  margin-top: 0.28rem !important;
}
.pwa-install .btn {
  width: auto;
  margin: 0;
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  flex-shrink: 0;
}
.pwa-install-dismiss {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--mist);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.pwa-install-dismiss:hover { background: rgba(255, 255, 255, 0.14); color: var(--ivory); }
body:has(.app-shell.is-table) .pwa-install {
  display: none !important;
}
@media (min-width: 720px) {
  .pwa-install {
    border-radius: 0 0 14px 14px;
    border: 1px solid rgba(212, 168, 67, 0.28);
    border-top: 0;
  }
}
@media (max-width: 420px) {
  .pwa-install {
    flex-wrap: wrap;
    row-gap: 0.45rem;
  }
  .pwa-install-copy {
    flex: 1 1 calc(100% - 88px);
  }
  .pwa-install .btn {
    order: 4;
    flex: 1 1 auto;
    min-height: 44px;
  }
}

.tourney-board-panel {
  max-height: min(92dvh, 40rem);
  overflow: auto;
}
.tb-h { margin: 0.85rem 0 0.35rem; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: #d4a843; }
.tb-card {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(212, 168, 67, 0.18);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  margin: 0.4rem 0;
}
.tb-card strong { display: block; font-size: 0.92rem; }
.tb-card .muted { margin: 0.15rem 0 0; font-size: 0.72rem; }
.tb-plan { display: flex; flex-direction: column; gap: 0.35rem; }
.tb-plan-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}
.tb-bracket { display: flex; flex-direction: column; gap: 0.7rem; }
.tb-round strong { font-size: 0.68rem; letter-spacing: 0.05em; text-transform: uppercase; color: #d4a843; }
.tb-match {
  display: flex;
  justify-content: space-between;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.78rem;
  padding: 0.4rem 0.45rem;
  margin-top: 0.28rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.tb-match.is-mine { border-color: rgba(212, 168, 67, 0.55); background: rgba(212, 168, 67, 0.08); }
.tb-match.is-live { border-color: rgba(80, 200, 120, 0.45); }
.tb-st { font-size: 0.65rem; color: #9aa8b8; white-space: nowrap; }

.check { align-items: flex-start; }
.check .inline-legal {
  display: inline;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--gold);
}
.legal-scroll {
  max-height: 52dvh;
  overflow: auto;
  margin: 0;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(212, 168, 67, 0.16);
  font-size: 0.88rem;
  line-height: 1.45;
  color: #e8dcc8;
}
.legal-tabs {
  display: flex;
  gap: 0.45rem;
  margin: 0.35rem 0 0.65rem;
}
.legal-tab {
  flex: 1;
  border: 1px solid rgba(250, 204, 21, 0.28);
  background: rgba(0, 0, 0, 0.28);
  color: #e8dcc8;
  border-radius: 12px;
  padding: 0.55rem 0.4rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.legal-tab.is-on {
  background: linear-gradient(180deg, #facc15, #eab308);
  color: #0f172a;
  border-color: transparent;
}
.legal-doc a { color: var(--gold); }
.legal-box {
  background: rgba(250, 204, 21, 0.08);
  border-left: 4px solid #facc15;
  padding: 0.75rem 0.85rem;
  margin: 0.85rem 0;
  border-radius: 0 12px 12px 0;
}
.btn.danger {
  background: linear-gradient(180deg, #c45c52, #8f2f28);
  color: #fff;
}
.settings-row.danger strong { color: #f0b4ad; }
.field-err {
  color: #f0b4ad;
  font-size: 0.82rem;
  margin: 0.35rem 0 0;
}
