:root {
  --ink: #17201a;
  --muted: #627066;
  --paper: #f4eadc;
  --panel: #fff7e6;
  --felt: #263e56;
  --felt-dark: #101b28;
  --wood: #aeb8c3;
  --gold: #e9b949;
  --red: #c74343;
  --blue: #2e7ac9;
  --team-a: #e9b949;
  --team-b: #4aa3d8;
  --shadow: 0 24px 80px rgba(23, 32, 26, 0.28);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(135deg, #efe1c9 0%, #d7c2a9 42%, #9fb6a2 100%);
  background-size: 42px 42px, 42px 42px, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, #26384b, #101923);
  padding: 10px 13px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(23, 32, 26, 0.2), inset 0 1px 0 rgba(255,255,255,0.14);
}

button:hover:not(:disabled) {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

select {
  width: 100%;
  border: 1px solid rgba(23, 32, 26, 0.12);
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
  color: var(--ink);
}

.app-shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: 10px;
  width: min(1500px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px;
}

.auth-gate {
  display: grid;
  grid-column: 1 / -1;
  min-height: calc(100vh - 28px);
  place-items: center;
  border-radius: 12px;
  background:
    linear-gradient(115deg, rgba(8, 16, 26, 0.9), rgba(18, 54, 83, 0.7) 48%, rgba(115, 52, 34, 0.56)),
    image-set(url("assets/play-area-bg.png") 1x);
  background-position: center;
  background-size: cover;
  overflow: hidden;
  padding: 28px;
  position: relative;
}

.auth-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(233,185,73,0.3), transparent 24%),
    radial-gradient(circle at 86% 84%, rgba(74,163,216,0.24), transparent 28%),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: auto, auto, 46px 46px;
  pointer-events: none;
}

.auth-gate-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  grid-template-areas:
    "brand preview"
    "copy preview"
    "stats preview"
    "ad preview"
    "signin preview";
  gap: 18px 28px;
  width: min(1040px, 100%);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255,255,255,0.88), rgba(238,244,248,0.72));
  padding: 22px;
  box-shadow: 0 28px 90px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.72);
  backdrop-filter: blur(16px);
}

.auth-gate-brand {
  grid-area: brand;
  border-bottom-color: rgba(23, 32, 26, 0.14);
  padding-bottom: 12px;
}

.auth-gate-copy {
  grid-area: copy;
  display: grid;
  align-content: end;
  gap: 10px;
}

.auth-gate-copy span {
  color: #125078;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-gate-copy h2 {
  max-width: 560px;
  font-size: clamp(44px, 7vw, 78px);
  line-height: 0.95;
}

.auth-gate-copy p {
  color: var(--muted);
  max-width: 520px;
  font-size: 17px;
  line-height: 1.45;
}

.auth-table-preview {
  grid-area: preview;
  display: grid;
  min-height: 460px;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04)),
    rgba(11, 23, 35, 0.72);
  padding: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 18px 40px rgba(0,0,0,0.26);
}

.auth-table-surface {
  position: relative;
  display: grid;
  place-items: center;
  border: 10px solid rgba(185, 126, 38, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), transparent),
    url("assets/play-area-bg.png") center / cover;
  box-shadow:
    inset 0 0 0 2px rgba(7, 35, 68, 0.74),
    inset 0 18px 42px rgba(255,255,255,0.14),
    0 16px 30px rgba(0,0,0,0.24);
}

.auth-seat {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(255,255,255,0.86);
  padding: 5px 10px;
  color: #17202a;
  font-size: 11px;
  font-weight: 850;
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}

.auth-seat-top {
  top: 12px;
}

.auth-seat-bottom {
  bottom: 12px;
}

.auth-domino-chain {
  display: flex;
  align-items: center;
  gap: 0;
  transform: rotate(-9deg);
  filter: drop-shadow(0 12px 14px rgba(0,0,0,0.32));
}

.auth-domino {
  display: grid;
  grid-template-rows: 1fr 1fr;
  width: 34px;
  height: 68px;
  border: 1px solid rgba(25, 22, 18, 0.74);
  border-right-width: 2px;
  border-bottom-width: 3px;
  border-radius: 5px;
  background: linear-gradient(145deg, #fff, #f1eadf);
  overflow: hidden;
}

.auth-domino-horizontal {
  grid-template-rows: none;
  grid-template-columns: 1fr 1fr;
  width: 68px;
  height: 34px;
}

.auth-domino i {
  display: block;
  background:
    radial-gradient(circle at 30% 30%, #000 0 8%, transparent 9%),
    radial-gradient(circle at 70% 70%, #000 0 8%, transparent 9%),
    radial-gradient(circle at 50% 50%, #000 0 8%, transparent 9%);
}

.auth-domino-double i {
  background:
    radial-gradient(circle at 30% 24%, #000 0 8%, transparent 9%),
    radial-gradient(circle at 70% 24%, #000 0 8%, transparent 9%),
    radial-gradient(circle at 30% 76%, #000 0 8%, transparent 9%),
    radial-gradient(circle at 70% 76%, #000 0 8%, transparent 9%);
}

.auth-lounge-strip {
  grid-area: stats;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.landing-ad-slot {
  grid-area: ad;
}

.auth-lounge-strip div {
  border: 1px solid rgba(34,45,56,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.68);
  padding: 9px 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.78);
}

.auth-lounge-strip strong,
.auth-lounge-strip span {
  display: block;
}

.auth-lounge-strip strong {
  font-size: 18px;
  line-height: 1;
}

.auth-lounge-strip span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.auth-gate-signin {
  grid-area: signin;
  width: 100%;
  min-height: 48px;
  color: #17201a;
  background: linear-gradient(180deg, #fff, #f0f5f8);
  border: 1px solid rgba(34,45,56,0.14);
}

.side-panel {
  align-self: stretch;
  border: 1px solid rgba(122, 63, 36, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.72), rgba(255,247,230,0.9)),
    linear-gradient(135deg, rgba(233,185,73,0.08), rgba(16,106,76,0.1));
  padding: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(122, 63, 36, 0.18);
}

.mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(16, 24, 20, 0.24));
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
  line-height: 1;
}

[hidden] {
  display: none !important;
}

.brand-block p,
.status,
label,
.compact-stats span,
.score-card span,
.seat-meta span {
  color: var(--muted);
}

.panel-section {
  margin-top: 18px;
}

.panel-section label,
.panel-section h2 {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.score-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.score-card div,
.compact-stats div {
  border: 1px solid rgba(122, 63, 36, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,250,240,0.9));
  padding: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 6px 16px rgba(23, 32, 26, 0.06);
}

.score-card span,
.score-card strong {
  display: block;
}

.score-card strong {
  margin-top: 6px;
  font-size: 34px;
  line-height: 1;
}

.compact-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.compact-stats h2 {
  margin-bottom: 0;
}

.compact-stats div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-feed-panel {
  display: grid;
  gap: 8px;
}

.rail-panel {
  border: 1px solid rgba(34,45,56,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.72);
  padding: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 8px 18px rgba(23,32,26,0.08);
}

.game-feed {
  display: grid;
  gap: 7px;
  max-height: 180px;
  overflow: auto;
}

.game-feed-item {
  display: grid;
  gap: 2px;
  border: 1px solid rgba(34, 45, 56, 0.1);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(245, 250, 253, 0.78));
  padding: 8px 9px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.74), 0 5px 12px rgba(23, 32, 26, 0.06);
}

.game-feed-item strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
}

.game-feed-item span,
.game-feed-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.game-feed-item.pass {
  border-color: rgba(233, 185, 73, 0.44);
  background:
    linear-gradient(180deg, rgba(255, 241, 178, 0.88), rgba(255, 247, 221, 0.72));
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.76),
    0 0 0 2px rgba(233, 185, 73, 0.12),
    0 5px 12px rgba(23, 32, 26, 0.06);
}

.game-feed-item.end {
  border-color: rgba(74, 163, 216, 0.34);
}

.game-feed-empty {
  margin: 0;
  border: 1px dashed rgba(34, 45, 56, 0.18);
  border-radius: 7px;
  padding: 10px;
  background: rgba(255,255,255,0.5);
}

.tournament-board-table,
.tournament-board-fixtures {
  display: grid;
  gap: 4px;
}

.tournament-board-table {
  border: 1px solid rgba(34,45,56,0.1);
  border-radius: 7px;
  background: rgba(255,255,255,0.68);
  padding: 5px;
}

.tournament-board-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px 24px 24px 32px 34px;
  align-items: center;
  gap: 4px;
  color: var(--ink);
  font-size: 11px;
}

.tournament-board-row.heading {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
}

.tournament-board-row strong,
.tournament-board-match span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tournament-board-row span:not(:first-child) {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.tournament-board-match {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(34,45,56,0.08);
  border-radius: 7px;
  background: rgba(255,255,255,0.62);
  padding: 5px 7px;
  color: var(--muted);
  font-size: 11px;
}

.tournament-board-match.active {
  border-color: rgba(233,185,73,0.34);
  background: rgba(233,185,73,0.12);
  color: var(--ink);
}

.tournament-board-match strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.google-signin {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  color: var(--ink);
  background: linear-gradient(180deg, #fff, #eef4f8);
  border: 1px solid rgba(23, 32, 26, 0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 7px 18px rgba(23, 32, 26, 0.08);
}

.player-rail-card .google-signin {
  min-height: 32px;
  padding: 6px 8px;
  font-size: 12px;
}

.google-mark,
.signed-avatar {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #4285f4, #174ea6);
  font-weight: 850;
  overflow: hidden;
}

.signed-in-card {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  border: 1px solid rgba(23, 32, 26, 0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.74);
  padding: 6px;
}

.signed-in-card[hidden] {
  display: none;
}

.signed-in-card strong,
.signed-in-card span {
  display: block;
}

.signed-in-card span:not(.signed-avatar) {
  color: var(--muted);
  font-size: 10px;
}

.signed-in-card button {
  padding: 5px 7px;
  font-size: 10px;
}

.profile-setup {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(233, 185, 73, 0.42);
  border-radius: 8px;
  background: rgba(255, 248, 221, 0.82);
  padding: 7px;
}

.profile-setup[hidden] {
  display: none;
}

.profile-setup strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.15;
}

.profile-setup p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.profile-setup label {
  color: var(--ink);
  font-size: 11px;
  font-weight: 850;
}

.profile-setup .username-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.profile-setup input {
  min-width: 0;
  border: 1px solid rgba(34,45,56,0.14);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  padding: 7px 8px;
}

.profile-setup button {
  padding: 7px 8px;
}

.profile-setup .setup-note {
  border-left: 3px solid rgba(233, 185, 73, 0.72);
  padding-left: 8px;
}

.setup-avatar-picker {
  border-top: 1px solid rgba(34,45,56,0.08);
  padding-top: 8px;
}

.table-seat-card,
.player-rail-card,
.player-insights {
  border: 1px solid rgba(34, 45, 56, 0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.78);
  padding: 7px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.86), 0 7px 16px rgba(23, 32, 26, 0.07);
}

.table-seat-panel {
  position: sticky;
  top: 12px;
  z-index: 4;
}

.table-seat-card {
  display: grid;
  gap: 7px;
  border-color: rgba(233, 185, 73, 0.42);
  background:
    linear-gradient(180deg, rgba(255, 248, 221, 0.96), rgba(255,255,255,0.82));
}

.table-seat-card strong,
.player-profile-strip strong,
.player-insights strong {
  color: var(--ink);
}

.table-seat-card span,
.player-profile-strip span,
.player-insights span,
.rail-stat-grid span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.table-seat-card button {
  width: 100%;
  margin-top: 2px;
  padding: 8px 10px;
  font-size: 12px;
}

.table-seat-card button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.panel-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.panel-heading-row h2 {
  margin-bottom: 0;
}

.panel-heading-row span {
  border-radius: 999px;
  color: #184766;
  background: rgba(74, 163, 216, 0.16);
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.player-profile-strip {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  margin: 7px 0;
}

.player-profile-strip div {
  min-width: 0;
}

.player-profile-strip strong,
.player-profile-strip span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-rail-card label {
  margin-bottom: 5px;
  font-size: 11px;
}

.player-rail-card select {
  width: 100%;
  border: 1px solid rgba(34,45,56,0.14);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  padding: 8px 9px;
}

.rail-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 6px;
}

.rail-stat-grid div {
  border: 1px solid rgba(34,45,56,0.08);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(238,244,248,0.68));
  padding: 5px;
}

.rail-stat-grid strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1;
}

.rail-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 6px;
}

.rail-action-grid button {
  min-height: 28px;
  border-radius: 7px;
  padding: 5px 6px;
  font-size: 10px;
}

.rail-filter-label {
  display: block;
  margin: 7px 0 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.player-rail-card select {
  padding: 6px 7px;
  font-size: 12px;
}

.player-insights {
  display: grid;
  gap: 7px;
}

.player-insights h2 {
  margin-bottom: 0;
}

.player-insights .insight-row,
.recent-results div {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  gap: 8px;
  align-items: center;
  border-top: 1px solid rgba(34,45,56,0.08);
  padding-top: 7px;
}

.player-insights strong {
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.admin-panel,
.admin-dialog {
  display: grid;
  gap: 9px;
  border-color: rgba(233, 185, 73, 0.38);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(246,249,251,0.9)),
    radial-gradient(circle at 100% 0%, rgba(233,185,73,0.2), transparent 42%);
}

.admin-panel[hidden] {
  display: none;
}

.admin-dialog:not([open]) {
  display: none;
}

.admin-dialog {
  width: min(620px, calc(100vw - 24px));
  max-height: min(720px, calc(100vh - 24px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  color: var(--ink);
  background: transparent;
}

.admin-dialog::backdrop {
  background: rgba(8, 14, 10, 0.34);
  backdrop-filter: blur(4px);
}

.admin-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(34,45,56,0.12);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(243,247,249,0.95));
  padding: 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.24);
}

.admin-card p,
.admin-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.admin-user-list {
  display: grid;
  gap: 8px;
  max-height: min(460px, 56vh);
  overflow: auto;
  padding-right: 4px;
}

.admin-user-card {
  display: grid;
  gap: 9px;
  border: 1px solid rgba(34,45,56,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.82);
  padding: 10px;
}

.admin-user-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.admin-user-head strong,
.admin-user-head span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-head span {
  color: var(--muted);
  font-size: 11px;
}

.admin-user-head button {
  min-height: 30px;
  border-radius: 7px;
  font-size: 11px;
  padding: 6px 8px;
}

.admin-permission-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.admin-permission-list label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.admin-mode-panel {
  display: grid;
  gap: 9px;
}

.admin-mode-panel[hidden] {
  display: none;
}

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

.admin-mode-actions button {
  min-height: 34px;
  border-radius: 7px;
  font-size: 12px;
  padding: 7px 6px;
}

.admin-mode-actions button.selected {
  color: #102016;
  background: linear-gradient(180deg, #ffeaa8, #e8b93c);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.68), 0 8px 18px rgba(50,37,9,0.14);
}

.admin-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.admin-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.admin-tool-grid button {
  min-height: 34px;
  border-radius: 7px;
  font-size: 11px;
  padding: 7px 6px;
}

.ad-slot {
  display: grid;
  gap: 3px;
  border: 1px solid rgba(25,117,180,0.16);
  border-left: 4px solid rgba(25,117,180,0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.88), rgba(239,247,251,0.78)),
    radial-gradient(circle at 100% 0%, rgba(233,185,73,0.2), transparent 36%);
  padding: 9px 10px;
  color: var(--ink);
}

.ad-slot[hidden] {
  display: none;
}

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

.ad-slot strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-slot img {
  width: 100%;
  max-height: 120px;
  border-radius: 7px;
  object-fit: cover;
  background: rgba(34,45,56,0.08);
}

.ad-slot em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.35;
}

.ad-slot a {
  color: #125078;
  font-size: 11px;
  font-weight: 900;
}

.lounge-ad-slot {
  margin-top: 4px;
}

.game-ad-slot {
  min-height: 92px;
  align-content: center;
}

.game-ad-slot img {
  max-height: 90px;
}

.ad-admin-panel {
  display: grid;
  gap: 10px;
}

.ad-admin-panel label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.ad-admin-panel label span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.ad-admin-panel input,
.ad-admin-panel textarea {
  width: 100%;
  border: 1px solid rgba(34,45,56,0.14);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  padding: 9px 10px;
}

.ad-admin-panel textarea {
  resize: vertical;
}

.ad-image-preview {
  border: 1px solid rgba(34,45,56,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.74);
  padding: 8px;
}

.ad-image-preview[hidden] {
  display: none;
}

.ad-image-preview img {
  display: block;
  width: 100%;
  max-height: 170px;
  border-radius: 7px;
  object-fit: cover;
}

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

.ad-placement-grid label {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(34,45,56,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.74);
  padding: 8px;
}

.ad-admin-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.site-notice-form {
  display: grid;
  gap: 10px;
}

.site-notice-form label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.site-notice-form label span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.site-notice-form input,
.site-notice-form select,
.site-notice-form textarea {
  width: 100%;
  border: 1px solid rgba(34,45,56,0.14);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  padding: 9px 10px;
}

.site-notice-form textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.4;
}

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

.site-notice-popup {
  width: min(430px, calc(100vw - 24px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  color: var(--ink);
  background: transparent;
}

.site-notice-popup::backdrop {
  background: rgba(8,14,10,0.38);
  backdrop-filter: blur(4px);
}

.site-notice-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(34,45,56,0.12);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(241,247,250,0.94)),
    radial-gradient(circle at 100% 0%, rgba(233,185,73,0.2), transparent 38%);
  padding: 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.24);
}

.site-notice-card p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.tournament-admin-dialog {
  width: min(920px, calc(100vw - 24px));
}

.tournament-admin-card {
  max-height: min(760px, calc(100dvh - 24px));
  overflow: auto;
}

.tournament-admin-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.86fr) minmax(300px, 1.14fr);
  gap: 12px;
}

.tournament-admin-form,
.tournament-admin-preview {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid rgba(34,45,56,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.72);
  padding: 10px;
}

.tournament-admin-form label {
  display: grid;
  gap: 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.tournament-admin-form label span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.tournament-admin-form input,
.tournament-admin-form select {
  width: 100%;
  border: 1px solid rgba(34,45,56,0.14);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  padding: 8px 9px;
}

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

.tournament-admin-summary div {
  min-width: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(244,248,250,0.82));
  padding: 8px;
}

.tournament-admin-summary span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.tournament-admin-summary strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
}

.tournament-admin-summary p {
  grid-column: 1 / -1;
}

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

.tournament-admin-controls {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tournament-admin-actions button,
.tournament-admin-controls button {
  min-height: 34px;
  border-radius: 7px;
  font-size: 11px;
  padding: 7px 8px;
}

.tournament-admin-bracket {
  display: grid;
  gap: 8px;
}

.tournament-admin-bracket h3 {
  margin: 0;
  font-size: 13px;
}

.bracket-preview {
  display: grid;
  gap: 6px;
  max-height: 280px;
  overflow: auto;
}

.bracket-preview.knockout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bracket-match {
  display: grid;
  gap: 3px;
  border-left: 4px solid #1975b4;
  border-radius: 7px;
  background: rgba(255,255,255,0.84);
  padding: 8px;
}

.bracket-match.final {
  border-left-color: #e8b93c;
}

.bracket-match.muted {
  border-left-color: rgba(34,45,56,0.22);
}

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

.bracket-match strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-picker {
  display: grid;
  gap: 6px;
}

.avatar-picker > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.avatar-options {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  gap: 6px;
}

.avatar-options button {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(23, 32, 26, 0.12);
  border-radius: 50%;
  color: var(--ink);
  background: linear-gradient(180deg, #fff, #f4eadc);
  padding: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
  font-weight: 850;
  overflow: hidden;
}

.avatar-options button.selected {
  color: #fff;
  background: linear-gradient(145deg, #fff6bf, #f0bd2b);
  box-shadow: 0 0 0 2px rgba(233, 185, 73, 0.72), 0 7px 16px rgba(23, 32, 26, 0.16);
}

.signed-avatar img,
.avatar-options button img,
.ranking-avatar img,
.presence-avatar img,
.player-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.button-row {
  display: flex;
  gap: 10px;
}

.button-row button {
  flex: 1;
}

.status {
  display: none;
}

.table-zone {
  display: grid;
  min-width: 0;
  place-items: stretch;
}

.game-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: 8px;
  align-items: stretch;
  min-height: calc(100vh - 28px);
}

.game-rail {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.game-rail-note {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(34,45,56,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.72);
  padding: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 8px 18px rgba(23,32,26,0.08);
}

.game-rail-note strong {
  color: var(--ink);
  font-size: 13px;
}

.game-rail-note span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.lounge-zone {
  display: grid;
  min-width: 0;
  place-items: stretch;
}

.lounge-zone[hidden],
.table-zone[hidden] {
  display: none;
}

.lounge-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  min-height: calc(100vh - 28px);
  overflow: hidden;
  border: 1px solid rgba(34, 45, 56, 0.1);
  border-radius: 14px;
  background:
    radial-gradient(circle at 16% 12%, rgba(74,163,216,0.16), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(233,185,73,0.18), transparent 24%),
    radial-gradient(circle at 72% 84%, rgba(119,220,164,0.16), transparent 28%),
    linear-gradient(145deg, #fff 0%, #f7fafc 58%, #eef4f8 100%);
  background-size: 28px 28px, 28px 28px, auto, auto;
  padding: 8px;
  box-shadow:
    var(--shadow),
    inset 0 0 0 5px rgba(255,255,255,0.66);
}

.lounge-shell::before {
  content: "";
  position: absolute;
  inset: -12% -8%;
  background:
    linear-gradient(135deg, transparent 0 42%, rgba(74,163,216,0.08) 42% 49%, transparent 49%),
    linear-gradient(45deg, transparent 0 56%, rgba(233,185,73,0.09) 56% 62%, transparent 62%);
  pointer-events: none;
}

.lounge-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255,255,255,0.72), transparent 24%),
    linear-gradient(300deg, rgba(74,163,216,0.09), transparent 30%);
  pointer-events: none;
}

.lounge-shell > * {
  position: relative;
  z-index: 1;
}

.lounge-header,
.tournament-lounge,
.lounge-tables,
.rankings-panel,
.presence-panel,
.chat-panel {
  border: 1px solid rgba(34, 45, 56, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,255,255,0.68));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.92), 0 12px 24px rgba(23, 32, 26, 0.08);
  backdrop-filter: blur(12px);
}

.lounge-header {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border-color: rgba(255,255,255,0.72);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(238,244,248,0.76)),
    linear-gradient(90deg, rgba(74,163,216,0.12), rgba(233,185,73,0.1));
  padding: 8px 10px;
}

.lounge-title-mark {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 8px;
  background:
    linear-gradient(135deg, transparent 0 34%, rgba(255, 205, 54, 0.9) 34% 45%, transparent 45%),
    linear-gradient(45deg, rgba(0,0,0,0.86), rgba(0,0,0,0.52) 44%, rgba(38, 143, 77, 0.86) 44% 72%, rgba(255, 205, 54, 0.9) 72%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.34), 0 8px 16px rgba(23,32,26,0.14);
}

.lounge-header span,
.section-title-row span,
.lounge-table-card span,
.six-love-result span,
.six-love-result em {
  color: var(--muted);
}

.lounge-header h2,
.section-title-row h3 {
  color: var(--ink);
}

.lounge-header h2 {
  margin-top: 2px;
  max-width: 720px;
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.12;
}

.lounge-tables,
.rankings-panel,
.presence-panel,
.chat-panel {
  display: grid;
  gap: 6px;
  padding: 7px;
}

.lounge-dashboard {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(258px, 0.32fr);
  gap: 7px;
  align-items: start;
  min-width: 0;
  min-height: 0;
}

.lounge-tables {
  align-content: start;
  min-height: 0;
}

.lounge-bottom-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  min-width: 0;
  min-height: 0;
}

.rankings-panel,
.presence-panel,
.lounge-chat {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  height: 150px;
}

.lounge-chat {
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 172px;
}

.rankings-list {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
}

.ranking-item {
  display: grid;
  grid-template-columns: 22px 24px minmax(0, 1fr) 48px 48px 36px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(34,45,56,0.08);
  border-radius: 7px;
  background: rgba(255,255,255,0.68);
  padding: 5px 7px;
  color: var(--ink);
  font-size: 12px;
}

.ranking-item:first-child {
  border-color: rgba(233,185,73,0.36);
  background:
    linear-gradient(90deg, rgba(233,185,73,0.16), rgba(255,255,255,0.72));
}

.rank-number {
  color: var(--muted);
  font-weight: 850;
  text-align: center;
}

.ranking-avatar {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #2c4f70, #101923);
  font-size: 11px;
  font-weight: 850;
  overflow: hidden;
}

.ranking-item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-item span:not(.ranking-avatar):not(.rank-number) {
  color: var(--muted);
  font-weight: 800;
  text-align: right;
}

.presence-list {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 0;
  overflow-y: auto;
}

.presence-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 56px 76px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(34,45,56,0.08);
  border-radius: 7px;
  background: rgba(255,255,255,0.78);
  padding: 5px 6px;
  color: var(--ink);
  font-size: 12px;
}

.presence-item.selected {
  border-color: rgba(233,185,73,0.34);
  background: rgba(255,255,255,0.94);
}

.presence-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-column: 1 / -1;
  gap: 5px;
  padding-top: 2px;
}

.presence-actions button {
  min-width: 0;
  color: var(--ink);
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(34,45,56,0.1);
  padding: 5px 4px;
  box-shadow: none;
  font-size: 10px;
  line-height: 1;
}

.presence-avatar {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #62b6e5, #185582);
  font-size: 11px;
  font-weight: 850;
  overflow: hidden;
}

.presence-name {
  min-width: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.presence-name:not(:disabled) {
  cursor: pointer;
}

.presence-name:not(:disabled):hover {
  color: #0c6b42;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.presence-name:disabled {
  cursor: default;
}

.presence-rating {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  text-align: right;
}

.presence-item em {
  width: 100%;
  border-radius: 999px;
  color: #16693b;
  background: rgba(119,220,164,0.18);
  padding: 3px 6px;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
}

.tournament-lounge {
  display: grid;
  gap: 4px;
  border: 0;
  background: transparent;
  padding: 4px 0 0;
  box-shadow: none;
  backdrop-filter: none;
}

.tournament-note {
  margin: -1px 0 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.tournament-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.tournament-card {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(34,45,56,0.1);
  border-left: 4px solid rgba(233,185,73,0.8);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(248,251,252,0.72));
  padding: 6px;
}

.tournament-card.running {
  border-left-color: var(--blue);
}

.tournament-card-head,
.tournament-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.tournament-card-head strong,
.tournament-card-head span {
  display: block;
}

.tournament-card-head strong {
  color: var(--ink);
  font-size: 12px;
}

.tournament-card-head span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.tournament-card-head em {
  border-radius: 999px;
  color: #7d5b06;
  background: rgba(233,185,73,0.18);
  padding: 2px 6px;
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  white-space: nowrap;
}

.tournament-seats {
  display: grid;
  gap: 3px;
}

.tournament-card.size-4 .tournament-seats {
  grid-template-columns: 1fr;
}

.tournament-card.size-8 .tournament-seats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tournament-card:not(.size-4):not(.size-8) .tournament-seats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-height: 92px;
  overflow: auto;
}

.tournament-seats span {
  overflow: hidden;
  border-radius: 6px;
  color: var(--muted);
  background: rgba(34,45,56,0.06);
  padding: 3px 5px;
  font-size: 9px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tournament-seats span.filled {
  color: #16693b;
  background: rgba(119,220,164,0.18);
}

.tournament-actions button {
  min-height: 24px;
  border-radius: 7px;
  padding: 4px 7px;
  font-size: 10px;
}

.tournament-fixtures {
  display: grid;
  gap: 3px;
  border-top: 1px solid rgba(34,45,56,0.08);
  padding-top: 4px;
}

.tournament-fixtures div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.tournament-fixtures span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tournament-fixtures strong {
  color: var(--ink);
}

.tournament-fixtures em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}

.admin-tournament-info {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(25,117,180,0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(235,246,252,0.82)),
    radial-gradient(circle at 95% 0%, rgba(233,185,73,0.18), transparent 38%);
  padding: 9px;
}

.admin-tournament-info[hidden] {
  display: none;
}

.admin-tournament-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 4px 8px;
  align-items: center;
}

.admin-tournament-head div {
  min-width: 0;
}

.admin-tournament-info span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-tournament-info strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-tournament-info em {
  color: #15537a;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  text-align: right;
}

.admin-tournament-close {
  min-height: 26px;
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 10px;
  box-shadow: none;
}

.admin-tournament-info p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.admin-tournament-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.admin-tournament-flow span {
  border-radius: 999px;
  background: rgba(25,117,180,0.1);
  padding: 5px 6px;
  color: #15537a;
  text-align: center;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(34,45,56,0.08);
  padding-bottom: 4px;
}

.table-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-tools select {
  min-width: 102px;
  border: 1px solid rgba(34,45,56,0.12);
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  padding: 6px 8px;
  font-size: 12px;
}

.section-title-row h3 {
  margin: 0;
  font-size: 15px;
}

.six-love-board {
  display: flex;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  min-height: 22px;
  overflow: hidden;
  animation: results-ticker 36s linear infinite;
}

.six-love-board:has(.empty-state) {
  width: 100%;
  animation: none;
}

.six-love-board:hover {
  animation-play-state: paused;
}

.six-love-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  flex: 0 0 210px;
  min-width: 210px;
  border: 1px solid rgba(233,185,73,0.28);
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,250,240,0.78));
  padding: 2px 6px;
}

.six-love-result.latest {
  border-color: rgba(199,67,67,0.5);
  background:
    linear-gradient(180deg, rgba(255,235,235,0.96), rgba(255,255,255,0.78));
}

@keyframes results-ticker {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-50% - 4px));
  }
}

.six-love-result strong {
  color: var(--ink);
  overflow: hidden;
  font-size: 10px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.six-love-result em {
  color: var(--muted);
  font-size: 9px;
  font-style: normal;
  white-space: nowrap;
}

.table-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(112px, 1fr));
  gap: 4px;
}

.lounge-table-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 3px;
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.7));
  padding: 3px 5px 4px;
  box-shadow: 0 10px 20px rgba(23, 32, 26, 0.08), inset 0 1px 0 rgba(255,255,255,0.9);
}

.lounge-table-card::before {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 3px;
  border-radius: 0 999px 999px 0;
  background: rgba(34,45,56,0.16);
}

.lounge-table-card.waiting {
  border-color: rgba(233,185,73,0.68);
  background:
    linear-gradient(180deg, rgba(255,248,221,0.96), rgba(255,255,255,0.74));
}

.lounge-table-card.waiting::before {
  background: var(--gold);
}

.lounge-table-card.empty {
  border-color: rgba(119, 220, 164, 0.62);
  background:
    linear-gradient(180deg, rgba(229,255,239,0.96), rgba(255,255,255,0.74));
}

.lounge-table-card.empty::before {
  background: #77dca4;
}

.lounge-table-card.active {
  border-color: rgba(74,163,216,0.72);
  background:
    linear-gradient(180deg, rgba(222,243,255,0.96), rgba(255,255,255,0.74));
}

.lounge-table-card.active::before {
  background: var(--blue);
}

.table-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.table-card-top strong {
  color: var(--ink);
  overflow: hidden;
  font-size: 10px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-card-top strong span {
  color: var(--muted);
  font-weight: 850;
}

.table-card-top em {
  width: fit-content;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(34,45,56,0.08);
  padding: 2px 4px;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
}

.lounge-table-card.waiting .table-card-top em {
  background: rgba(233,185,73,0.22);
  color: #7d5b06;
}

.lounge-table-card.empty .table-card-top em {
  background: rgba(119,220,164,0.2);
  color: #16693b;
}

.lounge-table-card.active .table-card-top em {
  background: rgba(74,163,216,0.24);
  color: #185582;
}

.table-card-score {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.table-card-score div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  border-radius: 5px;
  background: rgba(34,45,56,0.05);
  padding: 1px 3px;
}

.table-card-score span {
  overflow: hidden;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-card-score strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
}

.lounge-table-card button {
  width: auto;
  color: var(--ink);
  background: linear-gradient(180deg, #fff, #eef4f8);
  padding: 3px 5px;
  font-size: 9px;
}

.table-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.table-card-actions .secondary-action {
  border: 1px solid rgba(34,45,56,0.1);
  background: rgba(255,255,255,0.78);
}

.lounge-table-card.setup-required {
  grid-column: 1 / -1;
}

.lounge-table-card.waiting button {
  background: linear-gradient(180deg, #ffe8a3, #e9b949);
}

.lounge-table-card.empty button {
  background: linear-gradient(180deg, #d7ffe6, #77dca4);
}

.lounge-table-card.active button {
  background: linear-gradient(180deg, #d9f1ff, #4aa3d8);
}

.lounge-chat {
  min-height: 0;
  background: #fff;
}

.lounge-chat .chat-messages {
  border: 1px solid rgba(34,45,56,0.1);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.lounge-chat .chat-message {
  background: #fff;
}

.lounge-chat .chat-message span {
  color: #17202a;
}

.game-chat {
  width: 100%;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  padding: 10px;
}

.game-chat .section-title-row {
  padding-bottom: 5px;
}

.chat-messages {
  display: grid;
  align-content: start;
  gap: 7px;
  min-height: 140px;
  max-height: 210px;
  overflow: auto;
}

.chat-messages.compact {
  min-height: 0;
  max-height: none;
}

.chat-message {
  display: grid;
  gap: 3px;
  width: fit-content;
  max-width: 86%;
  border: 1px solid rgba(34,45,56,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.72);
  padding: 8px 10px;
}

.chat-message.private {
  border-color: rgba(233,185,73,0.4);
  background: rgba(233,185,73,0.13);
}

.chat-message.table {
  border-color: rgba(74,163,216,0.32);
}

.chat-message strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
}

.chat-message span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.chat-compose {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 8px;
}

.game-chat .chat-compose {
  grid-template-columns: minmax(0, 1fr) auto;
}

.game-chat .chat-messages {
  display: flex;
  flex-direction: column;
  height: 126px;
  min-height: 126px;
  max-height: 126px;
  border: 1px solid rgba(34, 45, 56, 0.12);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  overflow-y: auto;
}

.game-chat .chat-message {
  flex: 0 0 auto;
  background: rgba(238, 244, 248, 0.92);
}

.game-chat .chat-message:first-child {
  margin-top: auto;
}

.game-chat .chat-message span {
  color: #17202a;
}

.quick-chat {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.quick-chat button {
  min-width: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #fff8dd, #f2d477);
  padding: 7px 8px;
  font-size: 12px;
}

.chat-compose input,
.chat-compose select {
  min-width: 0;
  border: 1px solid rgba(34,45,56,0.12);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255,255,255,0.76);
  padding: 10px 11px;
}

.chat-compose input::placeholder {
  color: var(--muted);
}

.chat-compose select {
  color: var(--ink);
}

.chat-compose button,
.audio-toggle {
  color: var(--ink);
  background: linear-gradient(180deg, #fff, #eef4f8);
}

.audio-toggle {
  padding: 7px 10px;
  font-size: 12px;
}

.table {
  position: relative;
  display: grid;
  grid-template-rows: minmax(64px, auto) minmax(0, 1fr) minmax(64px, auto);
  gap: 2px;
  width: min(100%, 1080px);
  min-height: 0;
  height: min(calc(100vh - 18px), 940px);
  border: 0;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(3, 18, 31, 0.06)),
    url("assets/play-area-bg.png");
  background-position: center;
  background-size: 100% 100%;
  box-shadow:
    var(--shadow),
    0 0 0 1px rgba(214, 229, 239, 0.62),
    0 12px 38px rgba(53, 73, 88, 0.22);
  padding: 6px;
}

.table::before {
  display: none;
}

.team-info-card {
  position: absolute;
  z-index: 8;
  width: 168px;
  border: 1px solid rgba(255,255,255,0.34);
  border-radius: 8px;
  color: #17201a;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(238, 244, 248, 0.88));
  padding: 6px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.86),
    0 10px 22px rgba(0,0,0,0.18);
  backdrop-filter: blur(6px);
}

.team-info-a {
  right: 12px;
  bottom: 12px;
  left: auto;
}

.team-info-b {
  top: 12px;
  right: auto;
  left: 12px;
}

.team-info-head {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}

.team-info-head .player-avatar {
  width: 22px;
  height: 22px;
  font-size: 10px;
}

.team-info-a .player-avatar {
  background: linear-gradient(145deg, #f1cf68, #9d6d15);
}

.team-info-b .player-avatar {
  background: linear-gradient(145deg, #62b6e5, #185582);
}

.team-info-head strong,
.team-info-head span {
  display: block;
}

.team-info-head strong {
  color: var(--ink);
  font-size: 11px;
  line-height: 1.05;
}

.team-info-head span {
  color: var(--muted);
  font-size: 9px;
}

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

.team-info-stats span {
  display: grid;
  gap: 1px;
  min-width: 0;
  border: 1px solid rgba(34, 45, 56, 0.08);
  border-radius: 5px;
  background: rgba(255,255,255,0.66);
  padding: 3px 4px;
  color: var(--ink);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.team-info-stats b {
  color: var(--muted);
  font-size: 7px;
  font-weight: 850;
  text-transform: uppercase;
}

.middle-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) 82px;
  gap: 2px;
  min-height: 0;
}

.seat {
  position: relative;
  display: grid;
  gap: 2px;
  min-width: 0;
}

.seat .hand {
  position: relative;
  z-index: 7;
}

.seat-north {
  align-content: end;
  padding-top: 42px;
}

.seat-south {
  align-content: start;
  padding-bottom: 42px;
}

.seat-north .seat-meta,
.seat-south .seat-meta {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 6;
  margin-inline: auto;
}

.seat-north .seat-meta {
  top: 0;
}

.seat-south .seat-meta {
  bottom: 0;
}

.seat-south .hand {
  order: -1;
}

.seat-north .hand {
  justify-self: center;
  margin-bottom: -58px;
}

.seat-south .hand {
  justify-self: center;
  margin-top: -58px;
}

.seat-west,
.seat-east {
  align-content: stretch;
}

.seat-west .seat-meta,
.seat-east .seat-meta {
  position: absolute;
  top: 0;
  z-index: 6;
}

.seat-west .seat-meta {
  left: 0;
}

.seat-east .seat-meta {
  right: 0;
}

.seat-west .hand,
.seat-east .hand {
  align-self: center;
}

.seat-west .hand {
  justify-self: end;
  margin-right: -54px;
}

.seat-east .hand {
  justify-self: start;
  margin-left: -54px;
}

.seat.active .seat-meta {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(233, 185, 73, 0.24), 0 10px 26px rgba(0,0,0,0.18);
}

.seat.active .hand {
  border-color: rgba(255, 225, 118, 0.64);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.04) 38%),
    radial-gradient(circle at 50% 0%, rgba(255, 230, 124, 0.38), transparent 62%),
    rgba(122, 91, 10, 0.54);
  box-shadow:
    inset 0 9px 18px rgba(72, 51, 0, 0.24),
    inset 0 -1px 0 rgba(255,255,255,0.18),
    0 0 0 3px rgba(233, 185, 73, 0.24),
    0 10px 22px rgba(0,0,0,0.18);
}

.seat.pose-choice .seat-meta {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.22), 0 10px 26px rgba(0,0,0,0.16);
}

.seat-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(34, 45, 56, 0.12);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 247, 230, 0.88);
  padding: 4px 7px;
  min-height: 28px;
  width: fit-content;
  backdrop-filter: blur(5px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.74), 0 5px 12px rgba(0,0,0,0.1);
}

.seat-north .seat-meta,
.seat-south .seat-meta {
  border-left: 4px solid rgba(233, 185, 73, 0.85);
}

.seat-east .seat-meta,
.seat-west .seat-meta {
  border-top: 4px solid rgba(74, 163, 216, 0.78);
}

.seat-east .seat-meta,
.seat-west .seat-meta {
  gap: 4px;
  padding: 6px 4px;
}

.seat-meta .player-avatar {
  grid-row: auto;
  width: 20px;
  height: 20px;
  font-size: 10px;
}

.player-identity {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 1px 5px;
  min-width: 0;
  align-items: center;
}

.player-avatar {
  grid-row: span 2;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, rgba(233, 185, 73, 0.42), rgba(31, 58, 82, 0.7));
  font-size: 11px;
  font-weight: 850;
  box-shadow: inset 1px 1px 2px rgba(255,255,255,0.2), 0 4px 10px rgba(0,0,0,0.18);
  overflow: hidden;
}

.seat-north .player-avatar,
.seat-south .player-avatar {
  background: linear-gradient(145deg, #f1cf68, #9d6d15);
}

.seat-east .player-avatar,
.seat-west .player-avatar {
  background: linear-gradient(145deg, #62b6e5, #185582);
}

.seat-name {
  align-self: end;
}

.seat-east .player-identity,
.seat-west .player-identity {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
}

.seat-east .player-avatar,
.seat-west .player-avatar {
  grid-row: auto;
}

.seat-meta strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.05;
}

.table .seat .seat-meta {
  display: none;
}

.seat-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 3px;
  min-width: 0;
}

.seat-east .seat-stats,
.seat-west .seat-stats {
  grid-template-columns: 1fr;
}

.seat-stats span {
  display: grid;
  gap: 0;
  min-width: 0;
  border: 1px solid rgba(34, 45, 56, 0.08);
  border-radius: 4px;
  background: rgba(255,255,255,0.58);
  padding: 2px 3px;
  color: var(--ink);
  font-size: 10px;
  line-height: 1;
  text-align: center;
}

.seat-stats b {
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
}

.hand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 326px;
  max-width: 100%;
  height: 90px;
  min-height: 90px;
  gap: 5px;
  padding: 5px;
  border-radius: 8px;
  border: 1px solid rgba(225, 238, 247, 0.2);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.01) 38%),
    radial-gradient(circle at 50% 0%, rgba(74, 163, 216, 0.16), transparent 58%),
    rgba(5, 12, 20, 0.68);
  box-shadow:
    inset 0 9px 18px rgba(0, 0, 0, 0.34),
    inset 0 -1px 0 rgba(255,255,255,0.08),
    0 8px 16px rgba(0,0,0,0.16);
  overflow: auto;
  backdrop-filter: blur(3px);
}

.hand.vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 90px;
  max-width: 90px;
  min-width: 90px;
  height: 326px;
  min-height: 326px;
  max-height: 326px;
}

.hand.vertical .count-chip,
.hand.vertical .hidden-hand {
  flex: 0 0 auto;
}

.board-wrap {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-width: 0;
  place-items: center;
}

.share-table-button {
  position: absolute;
  right: 18px;
  bottom: 18px;
  z-index: 18;
  min-height: 32px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,0.94), rgba(239,247,251,0.86));
  color: #102016;
  padding: 7px 12px;
  font-size: 11px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.18);
}

.draw-pile {
  position: absolute;
  inset: 28px;
  z-index: 4;
  border-radius: 8px;
  pointer-events: none;
}

.draw-pile.hidden {
  display: none;
}

.board {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: min(100%, calc(100vh - 140px), 920px);
  aspect-ratio: 1;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  padding: 28px;
  background: transparent;
  box-shadow: none;
}

.result-dialog {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(250px, calc(100vw - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  background: transparent;
}

.result-dialog::backdrop {
  background: transparent;
}

.profile-dialog {
  width: min(430px, calc(100vw - 24px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  color: var(--ink);
  background: transparent;
}

.profile-dialog::backdrop {
  background: rgba(8, 14, 10, 0.34);
  backdrop-filter: blur(4px);
}

.profile-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(34,45,56,0.12);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(241,246,248,0.92)),
    radial-gradient(circle at 85% 0%, rgba(233,185,73,0.18), transparent 42%);
  padding: 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.24);
}

.profile-preview {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(34,45,56,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.72);
  padding: 9px;
}

.profile-preview-avatar {
  width: 42px;
  height: 42px;
}

.profile-preview strong,
.profile-preview span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-preview span {
  color: var(--muted);
  font-size: 12px;
}

.profile-edit-section {
  display: grid;
  gap: 8px;
  border-top: 1px solid rgba(34,45,56,0.08);
  padding-top: 12px;
}

.profile-edit-section h3 {
  margin: 0;
  font-size: 13px;
}

.profile-edit-section p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.profile-avatar-picker .avatar-options {
  grid-template-columns: repeat(8, 34px);
}

.upload-avatar-control {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}

.upload-avatar-control input,
.profile-edit-section select {
  width: 100%;
  border: 1px solid rgba(34,45,56,0.14);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  padding: 9px 10px;
}

.profile-dialog-actions {
  display: flex;
  justify-content: end;
}

.stats-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: min(780px, calc(100dvh - 24px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  color: var(--ink);
  background: transparent;
}

.stats-dialog::backdrop {
  background: rgba(8, 14, 10, 0.36);
  backdrop-filter: blur(4px);
}

.stats-card {
  display: grid;
  gap: 12px;
  max-height: min(780px, calc(100dvh - 24px));
  overflow: auto;
  border: 1px solid rgba(34,45,56,0.12);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.97), rgba(244,248,250,0.94)),
    radial-gradient(circle at 8% 0%, rgba(25,117,180,0.12), transparent 38%),
    radial-gradient(circle at 95% 10%, rgba(233,185,73,0.18), transparent 42%);
  padding: 14px;
  box-shadow: 0 22px 54px rgba(0,0,0,0.26);
}

.stats-dialog-content {
  display: grid;
  gap: 10px;
}

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

.stats-summary-grid div,
.stats-rival-grid div {
  min-width: 0;
  border: 1px solid rgba(34,45,56,0.1);
  border-radius: 8px;
  background: rgba(255,255,255,0.76);
  padding: 9px;
}

.stats-summary-grid span,
.stats-rival-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.stats-summary-grid strong,
.stats-rival-grid strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--ink);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stats-rival-grid strong {
  font-size: 13px;
}

.stats-section {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(34,45,56,0.08);
  border-radius: 8px;
  background: rgba(255,255,255,0.58);
  padding: 10px;
}

.stats-section h3 {
  margin: 0;
  font-size: 13px;
}

.form-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 24px;
  align-items: center;
}

.form-strip span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 950;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.32);
}

.form-strip .win {
  background: #0f8f61;
}

.form-strip .loss {
  background: #b03232;
}

.form-strip em,
.stats-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.stats-result-list {
  display: grid;
  gap: 6px;
  max-height: 190px;
  overflow: auto;
}

.stats-result-row {
  display: grid;
  gap: 2px;
  border-left: 4px solid rgba(34,45,56,0.18);
  border-radius: 7px;
  background: rgba(255,255,255,0.72);
  padding: 8px 9px;
}

.stats-result-row.win {
  border-left-color: #0f8f61;
}

.stats-result-row.loss {
  border-left-color: #b03232;
}

.stats-result-row strong {
  font-size: 13px;
}

.stats-result-row span {
  color: var(--muted);
  font-size: 12px;
}

.result-card {
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.84), rgba(255,247,230,0.78));
  padding: 10px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.result-card h2 {
  margin-bottom: 4px;
  font-size: 14px;
}

.result-card p {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.result-counts {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.result-counts div {
  display: flex;
  justify-content: space-between;
  border: 1px solid rgba(23, 32, 26, 0.1);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.result-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.result-actions button {
  flex: 1;
  min-width: 0;
}

.secondary-action {
  color: var(--ink);
  background: #fff;
  border: 1px solid rgba(23, 32, 26, 0.12);
}

.board-end {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 3;
  width: 34%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
}

.board-end-left {
  left: 0;
}

.board-end-right {
  right: 0;
}

.board.choose-left .board-end-left,
.board.choose-right .board-end-right {
  opacity: 1;
  pointer-events: auto;
}

.board.choose-left .board-end-left {
  background: linear-gradient(90deg, rgba(233, 185, 73, 0.18), transparent);
}

.board.choose-right .board-end-right {
  background: linear-gradient(270deg, rgba(233, 185, 73, 0.18), transparent);
}

.move-controls {
  display: flex;
  align-items: center;
  align-self: end;
  justify-content: center;
  gap: 10px;
}

.move-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  height: 42px;
  padding: 0 13px;
  background: linear-gradient(145deg, #2b3a30, #101813);
}

.pose-chooser {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 12;
  transform: translate(-50%, -50%);
  display: grid;
  gap: 10px;
  width: min(calc(100% - 56px), 420px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), transparent),
    rgba(16, 31, 46, 0.92);
  padding: 12px;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255,255,255,0.12);
}

.pose-chooser[hidden] {
  display: none;
}

.pose-chooser strong {
  font-size: 13px;
  text-transform: uppercase;
}

.pose-chooser span {
  color: rgba(255,255,255,0.74);
  font-size: 13px;
}

.pose-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pose-actions button {
  min-width: 0;
  background: linear-gradient(180deg, #fff, #f4eadc);
  color: var(--ink);
}

.domino,
.back-tile {
  width: 48px;
  height: 96px;
  border-radius: 6px;
  padding: 0;
  flex: 0 0 auto;
  color: inherit;
  appearance: none;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease;
}

.domino {
  width: 37px;
  height: 74px;
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: 1fr 1fr;
  overflow: hidden;
  border: 1px solid rgba(28, 25, 20, 0.78);
  border-right-width: 2px;
  border-bottom-width: 3px;
  background:
    radial-gradient(circle at 30% 18%, rgba(255,255,255,0.98), transparent 25%),
    linear-gradient(145deg, #ffffff 0%, #fbfaf6 54%, #f1eadf 100%);
  box-shadow:
    inset 3px 3px 4px rgba(255, 255, 255, 0.9),
    inset -3px -4px 5px rgba(95, 82, 63, 0.18),
    0 2px 0 rgba(162, 150, 128, 0.52),
    0 11px 17px rgba(0, 0, 0, 0.32);
}

.domino::before {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  z-index: 0;
  height: 11px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(96, 83, 64, 0.2));
  pointer-events: none;
}

.domino::after {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: 1;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.34) 0 14%, transparent 32%),
    linear-gradient(315deg, rgba(255,255,255,0.12), transparent 28%);
  mix-blend-mode: screen;
  opacity: 0.7;
  pointer-events: none;
}

.domino.horizontal {
  width: 74px;
  height: 37px;
  grid-template-rows: none;
  grid-template-columns: 1fr 1fr;
}

.board-domino {
  position: absolute;
  z-index: 2;
  width: 37px;
  height: 74px;
  transform: none;
  transform-origin: top left;
  box-shadow:
    inset 3px 3px 4px rgba(255, 255, 255, 0.86),
    inset -3px -4px 5px rgba(95, 82, 63, 0.18),
    0 2px 0 rgba(162, 150, 128, 0.52),
    0 8px 13px rgba(0, 0, 0, 0.3);
}

.board-domino.horizontal {
  width: 74px;
  height: 37px;
}

.board-domino:not(.horizontal) .half:first-child {
  border-bottom-color: rgba(24, 23, 20, 0.7);
}

.board-domino.horizontal .half:first-child {
  border-right-color: rgba(24, 23, 20, 0.7);
}

.board-domino .pip {
  width: 6px;
  height: 6px;
}

.board-domino .pip-grid {
  inset: 5px;
}

.domino.selected {
  transform: translateY(-10px);
  box-shadow: 0 0 0 3px var(--gold), 0 14px 24px rgba(0, 0, 0, 0.26);
}

.domino.playable {
  box-shadow: 0 0 0 3px rgba(233, 185, 73, 0.85), 0 14px 24px rgba(0, 0, 0, 0.24);
}

.domino.face-down,
.back-tile {
  overflow: hidden;
  border: 1px solid rgba(247, 218, 122, 0.72);
  border-right-width: 2px;
  border-bottom-width: 3px;
  background:
    radial-gradient(circle at 35% 22%, rgba(255,255,255,0.28), transparent 24%),
    linear-gradient(145deg, rgba(255,255,255,0.14), transparent 42%),
    linear-gradient(135deg, rgba(244, 191, 38, 0.18), transparent 42%),
    linear-gradient(145deg, #071009, #102816 46%, #071009);
  box-shadow:
    inset 1px 1px 2px rgba(255,255,255,0.34),
    inset -2px -3px 4px rgba(0,0,0,0.28),
    0 2px 0 rgba(5, 20, 10, 0.9),
    0 9px 16px rgba(0,0,0,0.28);
}

.domino.face-down::before,
.back-tile::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(247, 218, 122, 0.48);
  border-radius: 2px;
  background:
    url("assets/jamino-back-mark.svg") center / 82% auto no-repeat,
    linear-gradient(135deg, rgba(255,255,255,0.17), transparent 44%);
  box-shadow: inset 0 0 0 1px rgba(244, 191, 38, 0.16);
}

.back-tile::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 4px;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent 38%);
  pointer-events: none;
}

.back-tile {
  position: absolute;
  cursor: pointer;
  pointer-events: auto;
  z-index: 5;
  translate: -50% -50%;
}

.back-tile:hover {
  transform: translateY(-6px) rotate(var(--r));
  box-shadow: 0 12px 22px rgba(0,0,0,0.3);
}

.back-tile.drawing-source {
  opacity: 0.18;
  pointer-events: none;
}

.draw-ghost {
  position: fixed;
  z-index: 1000;
  translate: none;
  pointer-events: none;
  transform-origin: center;
  transition:
    transform 420ms cubic-bezier(.2, .8, .2, 1),
    opacity 420ms ease,
    box-shadow 420ms ease;
  box-shadow: 0 18px 34px rgba(0,0,0,0.38);
}

.draw-ghost.landing {
  opacity: 0.72;
  box-shadow: 0 9px 18px rgba(0,0,0,0.22);
}

.half {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  background:
    radial-gradient(circle at 42% 30%, rgba(255,255,255,0.45), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,0.18), rgba(92, 72, 45, 0.06));
}

.domino:not(.horizontal) .half:first-child {
  border-bottom: 2px solid rgba(24, 23, 20, 0.72);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.34);
}

.domino.horizontal .half:first-child {
  border-right: 2px solid rgba(24, 23, 20, 0.72);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.34);
}

.domino.horizontal .pip-grid {
  transform: rotate(90deg);
}

.pip {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 54%, #030303 0 48%, #000 72%, #171717 100%);
  box-shadow:
    inset 1px 2px 3px rgba(0,0,0,0.96),
    inset -1px -1px 1px rgba(255,255,255,0.08),
    0 -1px 1px rgba(0,0,0,0.58),
    0 1px 1px rgba(255,255,255,0.58),
    0 0 0 1px rgba(0,0,0,0.38);
  transform: translate(-50%, -50%);
}

.pip.red {
  background:
    radial-gradient(circle at 48% 54%, #030303 0 48%, #000 72%, #171717 100%);
}

.pip::after {
  content: "";
  position: absolute;
  inset: 1px 2px auto 2px;
  height: 2px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.34), rgba(255,255,255,0));
  opacity: 0.42;
}

.pip-grid {
  position: absolute;
  inset: 4px;
}

.hand .pip {
  width: 8px;
  height: 8px;
}

.hand .pip-grid {
  inset: 3px;
}

.pip[data-pos="tl"] {
  left: 14%;
  top: 14%;
}

.pip[data-pos="tc"] {
  left: 50%;
  top: 14%;
}

.pip[data-pos="tr"] {
  left: 86%;
  top: 14%;
}

.pip[data-pos="ml"] {
  left: 14%;
  top: 50%;
}

.pip[data-pos="c"] {
  left: 50%;
  top: 50%;
}

.pip[data-pos="mr"] {
  left: 86%;
  top: 50%;
}

.pip[data-pos="bl"] {
  left: 14%;
  top: 86%;
}

.pip[data-pos="bc"] {
  left: 50%;
  top: 86%;
}

.pip[data-pos="br"] {
  left: 86%;
  top: 86%;
}

.count-chip {
  display: grid;
  min-width: 72px;
  min-height: 72px;
  place-items: center;
  border: 2px solid rgba(255,255,255,0.75);
  border-radius: 8px;
  color: #fff;
  background: rgba(23, 32, 26, 0.52);
  font-weight: 850;
}

.hidden-hand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 6px;
  padding: 4px;
}

.hidden-hand.vertical {
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.hidden-tile {
  position: relative;
  flex: 0 0 auto;
  width: 37px;
  height: 74px;
  border: 1px solid rgba(247, 218, 122, 0.68);
  border-right-width: 2px;
  border-bottom-width: 3px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 35% 22%, rgba(255,255,255,0.28), transparent 24%),
    linear-gradient(145deg, rgba(255,255,255,0.14), transparent 42%),
    linear-gradient(135deg, rgba(244, 191, 38, 0.18), transparent 42%),
    linear-gradient(145deg, #071009, #102816 46%, #071009);
  box-shadow:
    inset 1px 1px 2px rgba(255,255,255,0.34),
    inset -2px -3px 4px rgba(0,0,0,0.28),
    0 2px 0 rgba(8, 27, 44, 0.9),
    0 8px 12px rgba(0,0,0,0.24);
}

.hidden-hand.vertical .hidden-tile {
  width: 74px;
  height: 37px;
}

.hidden-tile::after {
  content: "";
  position: absolute;
  inset: 8px 5px;
  border: 1px solid rgba(247, 218, 122, 0.45);
  border-radius: 2px;
  background:
    url("assets/jamino-back-mark.svg") center / 92% auto no-repeat,
    linear-gradient(135deg, rgba(255,255,255,0.14), transparent 44%);
}

.hidden-count {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 8px;
  color: #fff;
  background: rgba(23, 32, 26, 0.72);
  font-size: 13px;
  font-weight: 850;
}

.hidden-hand.vertical .hidden-count {
  top: 4px;
  right: 4px;
  bottom: auto;
  left: auto;
  transform: none;
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .side-panel {
    order: 0;
    padding: 10px;
  }

  .side-panel > .brand-block {
    padding-bottom: 10px;
  }

  .side-panel .brand-block h1 {
    font-size: 22px;
  }

  .player-rail-card,
  .table-seat-panel {
    margin-top: 10px;
  }

  .player-insights {
    display: none;
  }

  .lounge-shell {
    order: 1;
    min-height: 680px;
    padding: 10px;
  }

  .lounge-header {
    align-items: stretch;
    flex-direction: column;
    padding: 12px;
  }

  .lounge-dashboard {
    grid-template-columns: 1fr;
  }

  .table-list {
    grid-template-columns: repeat(3, minmax(104px, 1fr));
  }

  .six-love-result {
    flex-basis: 190px;
    min-width: 190px;
  }

  .lounge-table-card {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .lounge-bottom-row {
    grid-template-columns: 1fr;
  }

  .rankings-panel,
  .presence-panel,
  .lounge-chat {
    height: 300px;
  }

  .ranking-item {
    grid-template-columns: 22px 24px minmax(0, 1fr) 48px 48px 36px;
  }

  .chat-compose,
  .game-chat .chat-compose {
    grid-template-columns: 1fr;
  }

  .game-chat {
    width: min(100%, 360px);
  }

  .game-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .game-rail {
    justify-items: center;
  }

  .app-shell.is-game-screen {
    gap: 0;
    padding: 0;
  }

  .app-shell.is-game-screen .side-panel {
    display: none;
  }

  .app-shell.is-game-screen .table-zone {
    order: 0;
  }

  .app-shell.is-game-screen .game-shell {
    min-height: 100dvh;
  }

  .app-shell.is-game-screen .game-rail {
    display: none;
  }

  .table {
    grid-template-rows: minmax(64px, auto) minmax(430px, 1fr) minmax(64px, auto);
    min-height: calc(100vh - 16px);
    border: 0;
    border-radius: 8px;
    padding: 6px;
    gap: 2px;
  }

  .app-shell.is-game-screen .table {
    width: 100vw;
    min-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }

  .app-shell.is-game-screen .team-info-card {
    width: auto;
    min-width: 62px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    padding: 0;
    box-shadow: none;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.82);
  }

  .app-shell.is-game-screen .team-info-a {
    right: 50%;
    bottom: 6px;
    transform: translateX(50%);
  }

  .app-shell.is-game-screen .team-info-b {
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
  }

  .app-shell.is-game-screen .team-info-head {
    display: none;
  }

  .app-shell.is-game-screen .team-info-stats {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .app-shell.is-game-screen .team-info-stats span {
    border: 0;
    background: transparent;
    padding: 0;
    color: #fff;
    font-size: 10px;
    white-space: nowrap;
  }

  .app-shell.is-game-screen .team-info-stats span:nth-child(n + 2) {
    display: none;
  }

  .app-shell.is-game-screen .team-info-stats b {
    display: inline;
    margin-right: 4px;
    font-size: 8px;
    color: rgba(255,255,255,0.74);
  }

  .middle-row {
    grid-template-columns: 26px minmax(0, 1fr) 26px;
    gap: 2px;
  }

  .team-info-card {
    width: 150px;
    padding: 6px;
  }

  .team-info-a {
    bottom: 8px;
    right: 8px;
    left: auto;
  }

  .team-info-b {
    top: 8px;
    right: auto;
    left: 8px;
  }

  .team-info-head {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 5px;
    margin-bottom: 5px;
  }

  .team-info-head .player-avatar {
    width: 24px;
    height: 24px;
  }

  .team-info-head strong {
    font-size: 12px;
  }

  .team-info-head span {
    font-size: 10px;
  }

  .team-info-stats {
    gap: 3px;
  }

  .team-info-stats span {
    padding: 3px 4px;
    font-size: 11px;
  }

  .seat-meta {
    display: inline-flex;
    gap: 2px;
    justify-content: center;
    min-height: 28px;
    padding: 5px 3px;
    font-size: 11px;
  }

  .seat-north .seat-meta,
  .seat-south .seat-meta {
    width: fit-content;
  }

  .seat-north {
    padding-top: 22px;
  }

  .seat-south {
    padding-bottom: 26px;
  }

  .seat-north .hand {
    margin-bottom: -20px;
  }

  .seat-south .hand {
    margin-top: -24px;
  }

  .seat-west .hand {
    margin-right: -14px;
  }

  .seat-east .hand {
    margin-left: -14px;
  }

  .seat-east .seat-meta,
  .seat-west .seat-meta {
    gap: 4px;
    padding: 5px 3px;
  }

  .app-shell.is-game-screen .seat-north {
    padding-top: 18px;
  }

  .app-shell.is-game-screen .seat-north .hand {
    height: 94px;
    min-height: 94px;
    margin-bottom: -22px;
  }

  .app-shell.is-game-screen .hand .pip {
    width: 8px;
    height: 8px;
  }

  .app-shell.is-game-screen .hand .pip-grid {
    inset: 4px;
  }

  .seat-stats {
    gap: 3px;
  }

  .seat-stats span {
    padding: 2px 3px;
    font-size: 10px;
  }

  .seat-stats b {
    font-size: 8px;
  }

  .hand {
    width: 340px;
    max-width: 100%;
    height: 94px;
    min-height: 94px;
    padding: 5px;
    gap: 5px;
  }

  .app-shell.is-game-screen .seat-north .hand {
    padding: 3px;
  }

  .app-shell.is-game-screen .seat-west .hand,
  .app-shell.is-game-screen .seat-east .hand {
    width: 48px;
    max-width: 48px;
    min-width: 48px;
    height: 260px;
    min-height: 260px;
    max-height: 260px;
    padding: 3px;
  }

  .app-shell.is-game-screen .hidden-tile {
    width: 24px;
    height: 48px;
    border-radius: 4px;
  }

  .app-shell.is-game-screen .hidden-hand.vertical .hidden-tile {
    width: 48px;
    height: 24px;
  }

  .app-shell.is-game-screen .hidden-count {
    display: none;
  }

  .board {
    width: min(100%, calc(100dvh - 104px), 920px);
    padding: 14px;
  }

  .count-chip {
    min-width: 38px;
    min-height: 50px;
  }

  .domino,
  .back-tile {
    width: 42px;
    height: 84px;
  }

  .hidden-tile {
    width: 42px;
    height: 84px;
  }

  .domino.horizontal {
    width: 84px;
    height: 42px;
  }

  .board-domino {
    width: 36px;
    height: 72px;
  }

  .board-domino.horizontal {
    width: 72px;
    height: 36px;
  }

  .board-domino .pip {
    width: 5px;
    height: 5px;
  }

  .hidden-hand.vertical .hidden-tile {
    width: 84px;
    height: 42px;
  }

  .hand.vertical {
    flex-direction: column;
    width: 94px;
    max-width: 94px;
    min-width: 94px;
    height: 340px;
    min-height: 340px;
    max-height: 340px;
  }

  .app-shell.is-game-screen.is-complete .domino,
  .app-shell.is-game-screen.is-complete .back-tile {
    width: 36px;
    height: 72px;
  }

  .app-shell.is-game-screen.is-complete .domino.horizontal {
    width: 72px;
    height: 36px;
  }

  .app-shell.is-game-screen.is-complete .hand .pip {
    width: 6px;
    height: 6px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    gap: 8px;
  }

  .auth-gate {
    min-height: calc(100vh - 16px);
    padding: 10px;
  }

  .auth-gate-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "preview"
      "copy"
      "stats"
      "ad"
      "signin";
    gap: 18px;
    padding: 18px;
  }

  .auth-table-preview {
    min-height: 260px;
    padding: 10px;
  }

  .auth-gate-copy h2 {
    font-size: 42px;
  }

  .auth-gate-copy p {
    font-size: 15px;
  }

  .auth-lounge-strip {
    grid-template-columns: 1fr;
  }

  .ad-placement-grid {
    grid-template-columns: 1fr;
  }

  .signed-in-card {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .signed-in-card button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .rail-stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rail-stat-grid div {
    padding: 6px 5px;
  }

  .rail-stat-grid strong {
    font-size: 14px;
  }

  .profile-avatar-picker .avatar-options {
    grid-template-columns: repeat(4, 34px);
  }

  .stats-summary-grid,
  .stats-rival-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-card {
    padding: 10px;
  }

  .tournament-admin-layout,
  .tournament-admin-grid,
  .tournament-admin-summary,
  .tournament-admin-actions,
  .tournament-admin-controls,
  .bracket-preview.knockout,
  .admin-tournament-flow,
  .admin-tournament-head {
    grid-template-columns: 1fr;
  }

  .admin-tournament-info em {
    text-align: left;
  }

  .lounge-header h2 {
    font-size: 30px;
  }

  .section-title-row,
  .table-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .table-list {
    grid-template-columns: 1fr;
  }

  .lounge-table-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .table-card-actions {
    justify-content: stretch;
  }

  .table-card-actions button {
    flex: 1;
  }

  .rankings-panel,
  .presence-panel,
  .lounge-chat {
    height: 280px;
  }

  .ranking-item {
    grid-template-columns: 22px 24px minmax(0, 1fr) 48px;
  }

  .ranking-item span:nth-last-child(-n + 2) {
    display: none;
  }

  .presence-item {
    grid-template-columns: 24px minmax(0, 1fr) 50px 68px;
  }

  .presence-item em {
    padding-inline: 5px;
  }
}
