@font-face {
  font-family: "Ma Shan Zheng";
  src: url("/assets/fonts/ma-shan-zheng-sc-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Noto Serif SC";
  src: url("/assets/fonts/noto-serif-sc-400.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Noto Serif SC";
  src: url("/assets/fonts/noto-serif-sc-600.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Noto Serif SC";
  src: url("/assets/fonts/noto-serif-sc-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --number-font: "Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", Arial, sans-serif;
  --ink: #080b09;
  --ink-soft: #0d1310;
  --ink-raised: #121915;
  --jade-deep: #092f23;
  --jade: #0d5239;
  --jade-bright: #2ea572;
  --gold-dark: #8f6a2e;
  --gold: #d9ad58;
  --gold-pale: #f0d38d;
  --paper: #f1e5cc;
  --mist: #b5b5aa;
  --line: rgba(217, 173, 88, 0.23);
  --line-soft: rgba(241, 229, 204, 0.1);
  --vermilion: #9e2929;
  --vermilion-bright: #c54239;
  --blue: #3d76ad;
  --success: #62b98c;
  --danger: #e66e65;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

html {
  color-scheme: dark;
  background: var(--ink);
}

body {
  overflow-x: hidden;
  color: var(--paper);
  background-color: var(--ink);
  background-image: url("/assets/oriental-night-background.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  font-family: "Noto Serif SC", "Songti SC", serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button,
summary {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--gold-pale);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

[v-cloak] {
  display: none;
}

.eyebrow,
.brand-kicker {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.25em;
}

.brand-lockup h1,
.mobile-brand span {
  margin: 0.35rem 0 0;
  color: var(--gold-pale);
  font-family: "Ma Shan Zheng", "STKaiti", cursive;
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-shadow: 0 4px 22px rgba(217, 173, 88, 0.18);
}

.primary-button,
.secondary-button,
.danger-button,
.icon-text-button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.72rem 1.15rem;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.primary-button {
  border-color: #edc978;
  color: #1b160c;
  background: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 8px 24px rgba(217, 173, 88, 0.13);
}

.primary-button:hover:not(:disabled) {
  background: var(--gold-pale);
  box-shadow: 0 10px 30px rgba(217, 173, 88, 0.22);
  transform: translateY(-1px);
}

.secondary-button {
  border-color: rgba(217, 173, 88, 0.38);
  color: var(--paper);
  background: rgba(9, 47, 35, 0.72);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--jade);
}

.danger-button {
  border-color: #d45e55;
  color: #fff2e6;
  background: var(--vermilion);
}

.icon-text-button {
  min-height: 38px;
  padding: 0.45rem 0.8rem;
  border-color: var(--line);
  color: var(--gold-pale);
  background: rgba(8, 11, 9, 0.46);
  font-size: 0.78rem;
}

.full-button {
  width: 100%;
}

.boot-screen {
  width: 100vw;
  height: 100vh;
  height: 100svh;
  display: grid;
  place-content: center;
  gap: 1rem;
  background: rgba(5, 8, 6, 0.88);
  text-align: center;
}

.boot-mark {
  width: 72px;
  height: 72px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto;
  color: var(--gold);
  font-size: 1.6rem;
  animation: breathe 1.8s ease-in-out infinite;
}

.boot-screen p {
  margin: 0;
  color: var(--mist);
  font-size: 0.86rem;
  letter-spacing: 0.18em;
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Auth */
.auth-screen {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(420px, 0.76fr);
  background: rgba(4, 7, 5, 0.2);
}

.auth-story {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(3rem, 7vw, 7.5rem);
  padding-bottom: clamp(3.4rem, 8vh, 6.5rem);
  border-right: 1px solid var(--line);
  position: relative;
}

.auth-story::before {
  content: "";
  position: absolute;
  inset: clamp(1.1rem, 2vw, 2rem);
  border: 1px solid rgba(217, 173, 88, 0.14);
  pointer-events: none;
}

.brand-lockup-large {
  margin-bottom: clamp(2.6rem, 8vh, 6.2rem);
}

.brand-lockup-large h1 {
  margin-top: 0.7rem;
  font-size: clamp(4rem, 8vw, 7.7rem);
  letter-spacing: 0.12em;
}

.brand-lockup-large p {
  margin: 1rem 0 0;
  color: rgba(241, 229, 204, 0.76);
  font-size: clamp(0.9rem, 1.35vw, 1.18rem);
  letter-spacing: 0.16em;
}

.story-note {
  width: min(590px, 90%);
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.25rem 0;
  border-top: 1px solid var(--line);
}

.story-index {
  color: var(--gold);
  font-family: "Ma Shan Zheng", cursive;
  font-size: 1.55rem;
}

.story-note strong {
  display: block;
  color: var(--paper);
  font-size: 0.96rem;
  letter-spacing: 0.08em;
}

.story-note p {
  margin: 0.38rem 0 0;
  color: rgba(181, 181, 170, 0.82);
  font-size: 0.78rem;
  line-height: 1.85;
}

.auth-panel {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(1.2rem, 4vw, 4rem);
  background: rgba(6, 11, 8, 0.9);
  backdrop-filter: blur(18px);
}

.auth-panel-inner {
  width: min(430px, 100%);
}

.mobile-brand {
  display: none;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 2.25rem;
  border-bottom: 1px solid var(--line-soft);
}

.auth-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0.75rem 0.25rem;
  color: rgba(181, 181, 170, 0.7);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  transition: color 160ms ease, border-color 160ms ease;
}

.auth-tabs button.active {
  border-bottom-color: var(--gold);
  color: var(--gold-pale);
}

.form-heading {
  margin-bottom: 1.9rem;
}

.form-heading h2 {
  margin: 0.45rem 0 0.45rem;
  color: var(--paper);
  font-family: "Ma Shan Zheng", cursive;
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.form-heading p {
  margin: 0;
  color: var(--mist);
  font-size: 0.8rem;
  line-height: 1.7;
}

.auth-form {
  animation: panelIn 360ms ease both;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.field {
  display: block;
  margin-bottom: 1.1rem;
}

.field > span {
  display: block;
  margin-bottom: 0.5rem;
  color: rgba(241, 229, 204, 0.8);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}

.input-wrap {
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border: 1px solid rgba(217, 173, 88, 0.22);
  border-radius: 8px;
  padding: 0 0.85rem;
  background: rgba(3, 7, 5, 0.68);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-wrap:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(217, 173, 88, 0.09);
}

.input-wrap > i {
  color: var(--gold);
  font-size: 0.9rem;
}

.input-wrap input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--paper);
  background: transparent;
  font-size: 0.88rem;
}

.input-wrap input::placeholder {
  color: rgba(181, 181, 170, 0.42);
}

.field-icon-button {
  width: 34px;
  height: 34px;
  border: 0;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--mist);
  background: transparent;
  cursor: pointer;
}

.form-error {
  margin: -0.2rem 0 1rem;
  color: #ef8e83;
  font-size: 0.76rem;
  line-height: 1.6;
}

.security-note {
  margin: 1.2rem 0 0;
  color: rgba(181, 181, 170, 0.58);
  font-size: 0.68rem;
  line-height: 1.7;
  text-align: center;
}

.security-note i {
  margin-right: 0.35rem;
  color: var(--gold-dark);
}

/* Lobby */
.lounge-screen {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  background: rgba(5, 8, 6, 0.72);
}

.lounge-rail,
.game-rail {
  min-height: 100vh;
  min-height: 100svh;
  border-right: 1px solid var(--line);
  padding: 2.15rem 1.75rem;
  display: flex;
  flex-direction: column;
  background: rgba(4, 13, 9, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: 18px 0 50px rgba(0, 0, 0, 0.18);
  position: relative;
  z-index: 3;
}

.lounge-rail .brand-lockup,
.game-rail .brand-lockup {
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--line);
}

.lounge-rail .brand-lockup h1,
.game-rail .brand-lockup h1 {
  font-size: 2rem;
}

.profile-summary {
  width: 100%;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  margin: 1.5rem 0 0.75rem;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.profile-summary img,
.game-user img {
  width: 58px;
  height: 58px;
  border: 2px solid var(--gold-dark);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.32);
}

.profile-summary span,
.game-user div {
  min-width: 0;
}

.profile-summary small,
.game-user small {
  display: block;
  color: var(--mist);
  font-size: 0.64rem;
}

.profile-summary strong,
.game-user strong {
  display: block;
  overflow: hidden;
  margin-top: 0.12rem;
  color: var(--paper);
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-summary em,
.game-user em {
  display: block;
  margin-top: 0.25rem;
  color: var(--gold);
  font-size: 0.66rem;
  font-style: normal;
}

.game-user small.account-total {
  margin-top: 0.18rem;
  color: rgba(212, 217, 210, 0.68);
  font-family: var(--number-font);
}

.profile-summary > i {
  color: var(--gold-dark);
  font-size: 0.8rem;
}

.profile-summary:disabled {
  cursor: default;
}

.wallet-summary {
  margin: 0 0 1rem;
  border: 1px solid rgba(217, 173, 88, 0.28);
  padding: 0.95rem;
  background:
    linear-gradient(145deg, rgba(217, 173, 88, 0.1), transparent 58%),
    rgba(5, 17, 12, 0.78);
  box-shadow: inset 0 0 0 4px rgba(217, 173, 88, 0.025);
}

.wallet-summary > span,
.wallet-summary > small {
  display: block;
  color: var(--mist);
  font-size: 0.6rem;
}

.wallet-summary > strong {
  display: block;
  margin: 0.15rem 0 0.25rem;
  color: var(--gold-pale);
  font-family: Georgia, serif;
  font-size: 1.75rem;
}

.wallet-summary .wallet-warning {
  color: var(--danger);
}

.wallet-summary > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.wallet-summary button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--gold-pale);
  background: rgba(9, 47, 35, 0.72);
  cursor: pointer;
  font-size: 0.65rem;
}

.wallet-summary button i {
  margin-right: 0.3rem;
}

.rail-stats {
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.rail-stats > div {
  min-height: 65px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line-soft);
}

.rail-stats > div:last-child {
  border-bottom: 0;
}

.rail-stats span {
  color: var(--mist);
  font-size: 0.68rem;
}

.rail-stats strong {
  color: var(--gold-pale);
  font-size: 0.82rem;
}

.rail-stats strong.positive {
  color: var(--success);
}

.rail-stats strong.negative {
  color: var(--danger);
}

.connection-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-dark);
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 10px rgba(98, 185, 140, 0.7);
}

.rail-actions {
  display: grid;
  gap: 0.2rem;
  margin: 0 0 1.25rem;
}

.rail-actions button,
.leave-table-button {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0 0.7rem;
  color: rgba(241, 229, 204, 0.72);
  background: transparent;
  cursor: pointer;
  font-size: 0.72rem;
  text-align: left;
  transition: color 160ms ease, background-color 160ms ease;
}

.rail-actions button {
  min-height: 50px;
  justify-content: center;
  gap: 0.9rem;
  padding: 0.25rem 0.7rem;
  font-size: 1.44rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-align: center;
}

.rail-actions button:hover,
.leave-table-button:hover {
  color: var(--gold-pale);
  background: rgba(217, 173, 88, 0.08);
}

.rail-actions i,
.leave-table-button i {
  color: var(--gold);
}

.rail-motto {
  margin: auto 0 0;
  padding-top: 1.5rem;
  color: rgba(181, 181, 170, 0.42);
  font-family: "Ma Shan Zheng", cursive;
  font-size: 1rem;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
}

.lounge-main {
  min-width: 0;
  padding: clamp(2rem, 4.5vw, 4.5rem) clamp(1.4rem, 5vw, 5.5rem);
  overflow: auto;
}

.lounge-header {
  max-width: 1180px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin: 0 auto 2.25rem;
}

.lounge-header h2 {
  margin: 0.4rem 0 0.4rem;
  font-family: "Ma Shan Zheng", cursive;
  font-size: clamp(2.7rem, 5vw, 4.7rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.15;
}

.lounge-header p {
  margin: 0;
  color: var(--mist);
  font-size: 0.8rem;
}

.mobile-account {
  display: none;
}

.house-pool-summary {
  width: min(1180px, 100%);
  min-height: 82px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.9rem;
  align-items: center;
  margin: -0.8rem auto 1.4rem;
  border: 1px solid rgba(217, 173, 88, 0.35);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: var(--paper);
  background:
    radial-gradient(circle at 10% 0%, rgba(217, 173, 88, 0.2), transparent 35%),
    linear-gradient(120deg, rgba(18, 53, 37, 0.96), rgba(6, 16, 12, 0.96));
  box-shadow: inset 0 0 0 4px rgba(217, 173, 88, 0.025);
  cursor: pointer;
  text-align: left;
}

.house-pool-summary:hover {
  border-color: rgba(241, 204, 126, 0.7);
}

.house-pool-emblem {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(217, 173, 88, 0.52);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold-pale);
  background: rgba(217, 173, 88, 0.12);
  box-shadow: 0 0 20px rgba(217, 173, 88, 0.12);
}

.house-pool-summary > span:nth-child(2) {
  display: grid;
  gap: 0.08rem;
}

.house-pool-summary small,
.house-pool-summary em {
  color: var(--mist);
  font-size: 0.63rem;
  font-style: normal;
}

.house-pool-summary strong {
  color: var(--gold-pale);
  font-family: var(--number-font);
  font-size: 1.65rem;
  font-weight: 900;
  line-height: 1;
}

.house-pool-summary em i {
  margin-left: 0.3rem;
  color: var(--gold);
}

.lobby-grid {
  max-width: 760px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  margin: 0 auto;
}

.wallet-entry-rule {
  min-height: 72px;
  border-left: 2px solid var(--gold);
  padding: 0.55rem 0.75rem;
  background: rgba(217, 173, 88, 0.06);
}

.wallet-entry-rule span,
.wallet-entry-rule small {
  display: block;
  color: var(--mist);
  font-size: 0.6rem;
}

.wallet-entry-rule strong {
  display: inline-block;
  margin: 0.15rem 0.35rem 0 0;
  color: var(--gold-pale);
  font-family: Georgia, serif;
  font-size: 1.35rem;
}

.buy-in-selector {
  margin-bottom: 1.15rem;
  border: 1px solid rgba(217, 173, 88, 0.2);
  border-radius: 10px;
  padding: 0.9rem;
  background: rgba(4, 10, 7, 0.62);
  position: relative;
  z-index: 1;
}

.buy-in-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.buy-in-totals > span {
  min-width: 0;
  border-left: 1px solid rgba(217, 173, 88, 0.22);
  padding-left: 0.55rem;
  color: var(--mist);
  font-size: 0.55rem;
}

.buy-in-totals > span:nth-child(2) {
  border-left-color: var(--gold);
}

.buy-in-totals strong {
  display: block;
  margin-top: 0.18rem;
  overflow: hidden;
  color: var(--paper);
  font-family: var(--number-font);
  font-size: 1rem;
  font-weight: 800;
  text-overflow: ellipsis;
}

.buy-in-totals > span:nth-child(2) strong {
  color: var(--gold);
}

.buy-in-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 118px;
  gap: 0.55rem;
}

.buy-in-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.38rem;
}

.buy-in-preset {
  min-height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  color: var(--gold-pale);
  background: rgba(13, 36, 25, 0.72);
  cursor: pointer;
  font-family: var(--number-font);
  font-size: 0.72rem;
  font-weight: 800;
}

.buy-in-preset:hover,
.buy-in-preset.active {
  border-color: var(--gold);
  color: #1c160a;
  background: var(--gold);
}

.buy-in-preset:disabled {
  border-color: rgba(255, 255, 255, 0.06);
  color: rgba(212, 217, 210, 0.3);
  background: rgba(8, 13, 10, 0.4);
  cursor: not-allowed;
}

.buy-in-custom {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem;
}

.buy-in-custom span,
.buy-in-minimum {
  color: var(--mist);
  font-size: 0.56rem;
}

.buy-in-custom input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  outline: 0;
  padding: 0 0.45rem;
  color: var(--paper);
  background: rgba(4, 8, 6, 0.78);
  font-family: var(--number-font);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.buy-in-custom input:focus {
  border-color: var(--gold);
}

.buy-in-minimum {
  display: block;
  margin-top: 0.55rem;
  text-align: right;
}

.single-setting {
  grid-template-columns: minmax(0, 1fr);
}

.lobby-card {
  border: 1px solid var(--line);
  padding: clamp(1.4rem, 2.5vw, 2.1rem);
  background: rgba(10, 20, 14, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  position: relative;
}

.lobby-card::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(217, 173, 88, 0.08);
  pointer-events: none;
}

.card-heading {
  margin-bottom: 1.7rem;
  position: relative;
  z-index: 1;
}

.card-heading h3,
.section-heading h3,
.section-heading h2 {
  margin: 0;
  color: var(--paper);
  font-size: 1.12rem;
  letter-spacing: 0.08em;
}

.card-heading p {
  margin: 0.35rem 0 0;
  color: var(--mist);
  font-size: 0.7rem;
  line-height: 1.6;
}

.setting-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1.25rem;
  position: relative;
  z-index: 1;
}

.theme-selector {
  margin-top: 1.2rem;
  position: relative;
  z-index: 1;
}

.theme-selector-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.theme-selector-heading span,
.theme-selector-heading strong {
  font-size: 0.66rem;
}

.theme-selector-heading span {
  color: var(--mist);
}

.theme-selector-heading strong {
  color: var(--gold-pale);
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.theme-options > button {
  min-height: 58px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 0 0.4rem;
  align-items: center;
  padding: 0.5rem;
  color: var(--paper);
  background: rgba(4, 8, 6, 0.55);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.theme-options > button:hover,
.theme-options > button.active {
  border-color: var(--gold);
  background: rgba(217, 173, 88, 0.09);
  transform: translateY(-1px);
}

.theme-options > button > i {
  width: 16px;
  height: 32px;
  grid-row: 1 / 3;
  border-radius: 999px;
  background: linear-gradient(180deg, #d9ad58, #245e43);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.theme-options > button > span {
  align-self: end;
  font-size: 0.64rem;
  font-weight: 700;
}

.theme-options > button > small {
  align-self: start;
  color: var(--mist);
  font-size: 0.5rem;
}

.theme-options [data-theme-preview="british"] > i {
  background: repeating-linear-gradient(135deg, #183a2a 0 4px, #a38455 4px 6px);
}

.theme-options [data-theme-preview="ancient"] > i {
  background: linear-gradient(180deg, #d6a24b, #8e2025);
}

.theme-options [data-theme-preview="stadium"] > i {
  background: repeating-linear-gradient(90deg, #226737 0 4px, #3c9552 4px 8px);
}

.theme-options [data-theme-preview="battlefield"] > i {
  background: linear-gradient(180deg, #d66b32, #312924 66%, #141617);
}

.theme-options [data-theme-preview="scifi"] > i {
  background: linear-gradient(180deg, #62ddff, #5439a9 55%, #071427);
}

.compact-field {
  margin-bottom: 0;
}

.choice-row {
  min-height: 44px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  overflow: hidden;
}

.choice-row button {
  border: 0;
  border-right: 1px solid var(--line-soft);
  color: var(--mist);
  background: rgba(4, 8, 6, 0.55);
  cursor: pointer;
  font-size: 0.76rem;
}

.choice-row button:last-child {
  border-right: 0;
}

.choice-row button.active {
  color: #171207;
  background: var(--gold);
}

.blind-fields {
  min-height: 44px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.4rem;
  align-items: center;
}

.blind-fields input,
.add-chip-row input {
  width: 100%;
  min-width: 0;
  height: 44px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  outline: 0;
  color: var(--paper);
  background: rgba(4, 8, 6, 0.55);
  text-align: center;
}

.blind-fields input:focus,
.add-chip-row input:focus {
  border-color: var(--gold);
}

.blind-fields span {
  color: var(--gold-dark);
}

.advanced-settings {
  margin: 1.25rem 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  position: relative;
  z-index: 1;
}

.advanced-settings:not([open]) > :not(summary) {
  display: none;
}

.advanced-settings summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--mist);
  cursor: pointer;
  font-size: 0.7rem;
  list-style: none;
}

.advanced-settings summary::-webkit-details-marker {
  display: none;
}

.advanced-settings[open] summary i {
  transform: rotate(180deg);
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-bottom: 0.75rem;
}

.chip-list button {
  border: 1px solid rgba(217, 173, 88, 0.23);
  border-radius: 999px;
  padding: 0.33rem 0.6rem;
  color: var(--gold-pale);
  background: var(--jade-deep);
  cursor: pointer;
  font-size: 0.66rem;
}

.add-chip-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0 0 0.9rem;
}

.add-chip-row button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 0.85rem;
  color: var(--gold-pale);
  background: transparent;
  cursor: pointer;
  font-size: 0.7rem;
}

.create-room-button {
  position: relative;
  z-index: 1;
}

.room-code-field {
  display: block;
  margin: 0.7rem 0 1rem;
  position: relative;
  z-index: 1;
}

.room-code-field span {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--gold-dark);
  font-family: Georgia, serif;
  font-size: 0.62rem;
  letter-spacing: 0.23em;
}

.room-code-field input {
  width: 100%;
  height: 68px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  color: var(--gold-pale);
  background: rgba(3, 7, 5, 0.7);
  font-family: Georgia, serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-align: center;
  text-transform: uppercase;
}

.room-code-field input::placeholder {
  color: rgba(217, 173, 88, 0.2);
}

.room-code-field input:focus {
  border-color: var(--gold);
}

.privacy-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.7rem;
  align-items: start;
  margin-top: auto;
  padding-top: 1.5rem;
  color: var(--mist);
  font-size: 0.66rem;
  line-height: 1.65;
  position: relative;
  z-index: 1;
}

.privacy-note i {
  color: var(--success);
  font-size: 1rem;
}

.privacy-note strong {
  display: block;
  color: var(--paper);
}

.room-section {
  max-width: 1180px;
  margin: 2.25rem auto 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.section-heading h3,
.section-heading h2 {
  margin-top: 0.38rem;
}

.room-list {
  border-top: 1px solid var(--line);
}

.room-row {
  width: 100%;
  min-height: 74px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: 98px 1fr 1.25fr auto auto auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0 1rem;
  color: inherit;
  background: rgba(7, 14, 10, 0.72);
  cursor: pointer;
  text-align: left;
  transition: background-color 160ms ease, padding-left 160ms ease;
}

.room-row:hover {
  padding-left: 1.2rem;
  background: rgba(13, 47, 34, 0.82);
}

.room-id-block {
  color: var(--gold-pale);
  font-family: Georgia, serif;
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.room-host small,
.room-rule small {
  display: block;
  color: rgba(181, 181, 170, 0.56);
  font-size: 0.58rem;
}

.room-host strong,
.room-rule strong {
  display: block;
  overflow: hidden;
  margin-top: 0.2rem;
  color: var(--paper);
  font-size: 0.72rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-occupancy {
  color: var(--mist);
  font-size: 0.68rem;
  white-space: nowrap;
}

.room-occupancy i {
  margin-right: 0.3rem;
  color: var(--gold);
}

.room-state {
  border: 1px solid rgba(98, 185, 140, 0.28);
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  color: var(--success);
  background: rgba(98, 185, 140, 0.08);
  font-size: 0.6rem;
  white-space: nowrap;
}

.room-state.playing {
  border-color: rgba(217, 173, 88, 0.28);
  color: var(--gold);
  background: rgba(217, 173, 88, 0.08);
}

.room-join-label {
  border: 1px solid rgba(217, 173, 88, 0.35);
  border-radius: 999px;
  padding: 0.3rem 0.62rem;
  color: var(--gold-pale);
  background: rgba(217, 173, 88, 0.09);
  font-size: 0.6rem;
  font-weight: 700;
  white-space: nowrap;
}

.room-row > i {
  color: var(--gold-dark);
}

/* Game */
.game-screen {
  width: 100vw;
  height: 100vh;
  height: 100svh;
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  overflow: hidden;
  background: rgba(3, 6, 4, 0.66);
}

.game-rail {
  width: 284px;
  padding: 1.6rem 1.45rem 1.25rem;
  overflow: hidden;
}

.room-plaque {
  display: grid;
  grid-template-columns: 1fr auto;
  margin-top: 1.2rem;
  padding: 0 0 1.2rem;
  border-bottom: 1px solid var(--line);
}

.room-plaque span {
  grid-column: 1 / -1;
  color: var(--mist);
  font-size: 0.65rem;
}

.room-plaque strong {
  margin-top: 0.25rem;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 1.5rem;
  letter-spacing: 0.12em;
}

.room-plaque button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--gold-pale);
  background: transparent;
  cursor: pointer;
}

.game-user {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
  padding: 1.3rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.game-status {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.7rem 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.game-status span {
  color: var(--mist);
  font-size: 0.65rem;
}

.game-status strong {
  color: var(--paper);
  font-size: 0.78rem;
}

.gold-text {
  color: var(--gold) !important;
}

.sound-toggle {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  gap: 0.55rem;
  align-items: center;
  padding: 0;
  color: var(--mist);
  background: transparent;
  cursor: pointer;
  font-size: 0.62rem;
  text-align: left;
}

.sound-toggle i {
  color: var(--gold);
  font-size: 0.85rem;
}

.seat-roster {
  flex: 0 0 auto;
  max-height: 148px;
  min-height: 0;
  margin-top: 1rem;
  overflow: auto;
}

.seat-roster h2 {
  display: flex;
  justify-content: space-between;
  margin: 0 0 0.65rem;
  color: var(--mist);
  font-size: 0.65rem;
  font-weight: 400;
}

.seat-roster h2 span {
  color: var(--gold-dark);
}

.roster-row {
  min-height: 37px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto auto;
  gap: 0.45rem;
  align-items: center;
  border-bottom: 1px solid rgba(241, 229, 204, 0.05);
  font-size: 0.66rem;
}

.roster-row > i {
  color: var(--gold);
}

.roster-row > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roster-row em {
  border: 1px solid rgba(217, 173, 88, 0.24);
  border-radius: 999px;
  padding: 0.1rem 0.35rem;
  color: var(--gold);
  font-size: 0.52rem;
  font-style: normal;
}

.roster-row small {
  color: var(--success);
  font-size: 0.54rem;
}

.roster-row small.offline {
  color: var(--danger);
}

.action-history {
  min-height: 96px;
  flex: 1 1 auto;
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
  overflow: hidden;
}

.action-history > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.action-history h2 {
  margin: 0;
  color: var(--mist);
  font-size: 0.65rem;
  font-weight: 400;
}

.action-history > div > span {
  border: 1px solid rgba(98, 185, 140, 0.28);
  border-radius: 999px;
  padding: 0.1rem 0.35rem;
  color: var(--success);
  background: rgba(98, 185, 140, 0.08);
  font-size: 0.48rem;
  letter-spacing: 0.08em;
}

.action-history ol {
  display: grid;
  gap: 0.15rem;
  margin: 0.55rem 0 0;
  padding: 0;
  list-style: none;
}

.action-history li {
  min-height: 25px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 0.35rem;
  align-items: center;
  color: rgba(241, 229, 204, 0.82);
  font-size: 0.57rem;
}

.action-history li i {
  color: var(--gold-dark);
}

.action-history li span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-history > p {
  margin: 0.65rem 0 0;
  color: rgba(181, 181, 170, 0.62);
  font-size: 0.56rem;
  line-height: 1.6;
}

.leave-table-button {
  flex: 0 0 auto;
  margin-top: 0.75rem;
}

.table-stage[data-table-theme="chinese"] {
  --theme-accent: #d9ad58;
  --theme-glow: rgba(217, 173, 88, 0.34);
  --table-hue: 0deg;
  --table-wash: rgba(9, 82, 57, 0.02);
  background-image:
    linear-gradient(rgba(4, 6, 5, 0.08), rgba(4, 6, 5, 0.52)),
    url("/assets/oriental-night-background.png");
}

.table-stage[data-table-theme="british"] {
  --theme-accent: #c7aa78;
  --theme-glow: rgba(199, 170, 120, 0.3);
  --table-hue: -12deg;
  --table-wash: rgba(41, 55, 45, 0.3);
  background-image:
    linear-gradient(135deg, rgba(8, 20, 16, 0.9), rgba(19, 35, 27, 0.75)),
    repeating-linear-gradient(45deg, #0d2d20 0 24px, #163d2d 24px 48px, #684d31 48px 51px);
}

.table-stage[data-table-theme="ancient"] {
  --theme-accent: #e0ad54;
  --theme-glow: rgba(188, 48, 39, 0.42);
  --table-hue: 285deg;
  --table-wash: rgba(150, 34, 35, 0.32);
  background-image:
    radial-gradient(circle at 50% 22%, rgba(220, 159, 65, 0.26), transparent 28%),
    repeating-linear-gradient(90deg, transparent 0 72px, rgba(234, 183, 81, 0.08) 72px 74px),
    linear-gradient(155deg, #4c1117, #180a0e 55%, #08090b);
}

.table-stage[data-table-theme="stadium"] {
  --theme-accent: #7ee38d;
  --theme-glow: rgba(82, 222, 111, 0.35);
  --table-hue: 4deg;
  --table-wash: rgba(69, 164, 77, 0.2);
  background-image:
    radial-gradient(ellipse at 50% 82%, rgba(66, 160, 72, 0.48), transparent 48%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0 7%, transparent 7% 14%),
    linear-gradient(#07141c, #0d2630 45%, #112d20);
}

.table-stage[data-table-theme="battlefield"] {
  --theme-accent: #e48649;
  --theme-glow: rgba(232, 91, 40, 0.38);
  --table-hue: 300deg;
  --table-wash: rgba(140, 55, 28, 0.38);
  background-image:
    radial-gradient(circle at 20% 22%, rgba(240, 100, 39, 0.26), transparent 22%),
    radial-gradient(circle at 78% 42%, rgba(223, 72, 34, 0.18), transparent 30%),
    linear-gradient(160deg, #2e241e, #151819 50%, #090b0d);
}

.table-stage[data-table-theme="scifi"] {
  --theme-accent: #62ddff;
  --theme-glow: rgba(63, 207, 255, 0.38);
  --table-hue: 115deg;
  --table-wash: rgba(40, 119, 180, 0.42);
  background-image:
    radial-gradient(circle at 68% 26%, rgba(120, 77, 245, 0.3), transparent 22%),
    linear-gradient(rgba(47, 205, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 205, 255, 0.06) 1px, transparent 1px),
    linear-gradient(145deg, #07182b, #110d2b 58%, #04070f);
  background-size: auto, 42px 42px, 42px 42px, auto;
}

.table-stage {
  min-width: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 42px 28px 116px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  position: relative;
}

.table-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 24%, rgba(2, 5, 5, 0.48) 100%),
    rgba(4, 6, 5, 0.2);
  pointer-events: none;
}

.game-mobile-header {
  display: none;
}

.connection-banner {
  min-height: 38px;
  border: 1px solid rgba(197, 66, 57, 0.38);
  border-radius: 7px;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0.75rem;
  color: #ffd3cd;
  background: rgba(95, 20, 22, 0.92);
  box-shadow: var(--shadow);
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  z-index: 22;
}

.mobile-latest-action {
  display: none;
}

.table-copy {
  position: absolute;
  top: 18px;
  left: 28px;
  z-index: 5;
}

.table-copy span {
  display: block;
  color: var(--gold);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

.table-copy strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--paper);
  font-size: 0.78rem;
}

.table-theme-switcher {
  min-height: 34px;
  border: 1px solid rgba(241, 229, 204, 0.12);
  border-radius: 999px;
  display: flex;
  gap: 0.35rem;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background: rgba(4, 8, 8, 0.68);
  backdrop-filter: blur(9px);
  position: absolute;
  top: 16px;
  right: 26px;
  z-index: 7;
}

.table-theme-switcher > span {
  margin-right: 0.15rem;
  color: var(--mist);
  font-size: 0.52rem;
}

.table-theme-switcher > button {
  width: 22px;
  height: 22px;
  border: 1px solid transparent;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.table-theme-switcher > button.active {
  border-color: var(--theme-accent);
  box-shadow: 0 0 10px var(--theme-glow);
}

.table-theme-switcher i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.theme-purchase-confirm {
  width: min(300px, calc(100% - 32px));
  border: 1px solid rgba(217, 173, 88, 0.48);
  border-radius: 16px;
  display: grid;
  gap: 0.4rem;
  padding: 1rem;
  color: var(--paper);
  background: rgba(5, 13, 9, 0.97);
  box-shadow: var(--shadow);
  position: fixed;
  top: 62px;
  right: 24px;
  z-index: 45;
}

.theme-purchase-confirm > span {
  color: var(--mist);
  font-size: 0.6rem;
}

.theme-purchase-confirm > strong {
  color: var(--gold-pale);
  font-size: 1rem;
}

.theme-purchase-confirm > p {
  margin: 0 1.8rem 0.35rem 0;
  color: var(--mist);
  font-size: 0.66rem;
  line-height: 1.65;
}

.theme-purchase-confirm > button:last-child {
  min-height: 38px;
  border: 1px solid var(--gold);
  border-radius: 9px;
  color: #181106;
  background: var(--gold);
  cursor: pointer;
  font-weight: 800;
}

.theme-purchase-close {
  width: 30px;
  height: 30px;
  border: 0;
  display: grid;
  place-items: center;
  color: var(--mist);
  background: transparent;
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  cursor: pointer;
}

.poker-table {
  width: min(100%, 1240px);
  aspect-ratio: 8 / 5;
  max-height: calc(100svh - 150px);
  background-image: url("/assets/poker-table-empty-transparent.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  position: relative;
  z-index: 2;
  filter:
    drop-shadow(0 28px 34px rgba(0, 0, 0, 0.58))
    drop-shadow(0 0 24px var(--theme-glow, rgba(217, 173, 88, 0.22)));
}

.poker-table::before {
  content: "";
  border: 1px solid color-mix(in srgb, var(--theme-accent) 42%, transparent);
  border-radius: 50%;
  background: var(--table-wash);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.2);
  position: absolute;
  inset: 13.5% 9%;
  z-index: 1;
  pointer-events: none;
}

.community-cards {
  position: absolute;
  top: 43%;
  left: 50%;
  display: flex;
  gap: clamp(5px, 0.75vw, 10px);
  transform: translate(-50%, -50%);
  z-index: 4;
}

.playing-card {
  border: 1px solid rgba(21, 18, 12, 0.28);
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #171816;
  background: #f4f0e9;
  box-shadow: 0 5px 12px rgba(0, 0, 0, 0.34);
  position: relative;
  animation: cardDeal 420ms cubic-bezier(0.2, 0.82, 0.22, 1) both;
}

.hole-cards .playing-card {
  animation-delay: calc(var(--deal-index, 0) * 500ms);
}

.community-card {
  width: clamp(42px, 4.7vw, 66px);
  aspect-ratio: 0.72;
}

.playing-card.empty {
  border-color: rgba(217, 173, 88, 0.5);
  color: rgba(217, 173, 88, 0.24);
  background: rgba(6, 55, 38, 0.66);
  box-shadow: none;
}

.playing-card .card-corner {
  position: absolute;
  top: 5px;
  left: 6px;
  display: grid;
  justify-items: center;
  color: inherit;
  font-family: Georgia, serif;
  font-size: clamp(0.58rem, 1vw, 0.8rem);
  font-weight: 700;
  line-height: 1;
}

.playing-card .card-corner i {
  margin-top: 2px;
  font-size: 0.74em;
}

.card-suit-large {
  font-size: clamp(1.05rem, 2.1vw, 1.7rem);
}

.card-back-mark {
  font-size: clamp(0.9rem, 2vw, 1.5rem);
}

.playing-card:has(.bi-suit-heart-fill),
.playing-card:has(.bi-suit-diamond-fill) {
  color: #b82e32;
}

@keyframes cardDeal {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.pot-display {
  position: absolute;
  top: 55%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transform: translate(-50%, -50%);
  color: var(--gold-pale);
  font-family: Georgia, serif;
  font-size: clamp(0.72rem, 1.2vw, 0.98rem);
  font-weight: 700;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.8);
  z-index: 4;
}

.pot-display i {
  color: var(--gold);
}

.seat {
  width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  position: absolute;
  z-index: 6;
  transition: opacity 200ms ease, filter 200ms ease;
}

.seat.folded {
  opacity: 0.38;
  filter: grayscale(0.7);
}

.seat.offline {
  opacity: 0.58;
}

.seat-avatar {
  width: clamp(38px, 4.8vw, 58px);
  height: clamp(38px, 4.8vw, 58px);
  border: 2px solid rgba(217, 173, 88, 0.45);
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--paper);
  background: #101512;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  pointer-events: auto;
  font-size: clamp(0.88rem, 1.6vw, 1.2rem);
  position: relative;
}

.seat-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.seat.active .seat-avatar {
  border-color: var(--gold-pale);
  box-shadow: 0 0 0 3px rgba(217, 173, 88, 0.16), 0 0 28px rgba(217, 173, 88, 0.52);
  animation: seatPulse 1.6s ease-in-out infinite;
}

.seat.winner .seat-avatar {
  border-color: var(--success);
  box-shadow: 0 0 26px rgba(98, 185, 140, 0.56);
}

@keyframes seatPulse {
  50% {
    box-shadow: 0 0 0 5px rgba(217, 173, 88, 0.08), 0 0 34px rgba(217, 173, 88, 0.62);
  }
}

.seat-name {
  max-width: 90px;
  overflow: hidden;
  color: var(--paper);
  font-size: clamp(0.58rem, 1vw, 0.72rem);
  line-height: 1.3;
  text-overflow: ellipsis;
  text-shadow: 0 2px 5px #000;
  white-space: nowrap;
}

.seat-chips {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: clamp(0.58rem, 1vw, 0.72rem);
  text-shadow: 0 2px 5px #000;
}

.seat-reconnect {
  border: 1px solid rgba(197, 66, 57, 0.34);
  border-radius: 999px;
  padding: 0.1rem 0.35rem;
  color: #ffd0cb;
  background: rgba(95, 20, 22, 0.86);
  font-size: 0.48rem;
  white-space: nowrap;
}

.ai-badge,
.dealer-badge {
  position: absolute;
  display: grid;
  place-items: center;
  color: white;
  font-family: Arial, sans-serif;
  font-size: 0.46rem;
  font-weight: 800;
}

.ai-badge {
  top: -3px;
  right: -5px;
  width: 20px;
  height: 20px;
  border: 2px solid #0c1711;
  border-radius: 50%;
  background: var(--blue);
}

.dealer-badge {
  top: -5px;
  left: -6px;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: #221b0d;
  background: var(--gold-pale);
}

.hole-cards {
  display: flex;
  gap: 2px;
  margin-top: 2px;
}

.hole-card {
  width: clamp(26px, 3vw, 36px);
  aspect-ratio: 0.72;
  border-radius: 4px;
}

.seat.self .seat-avatar {
  width: clamp(48px, 5.3vw, 66px);
  height: clamp(48px, 5.3vw, 66px);
  order: 2;
}

.seat.self .hole-cards {
  order: 1;
}

.seat.self .seat-name {
  order: 3;
}

.seat.self .seat-chips {
  order: 4;
}

.seat.self .seat-reconnect {
  order: 5;
}

.seat.self .hole-card {
  width: clamp(38px, 4.2vw, 54px);
}

.seat.self .hole-card .card-corner {
  font-size: clamp(0.52rem, 0.9vw, 0.68rem);
}

.seat.self .hole-card .card-suit-large {
  font-size: clamp(0.9rem, 1.45vw, 1.2rem);
}

.hole-card .card-corner {
  top: 3px;
  left: 3px;
  font-size: clamp(0.4rem, 0.75vw, 0.58rem);
}

.hole-card .card-suit-large,
.hole-card .card-back-mark {
  font-size: clamp(0.72rem, 1.2vw, 0.98rem);
}

.seat-hand {
  margin-top: 2px;
  border: 1px solid rgba(217, 173, 88, 0.28);
  border-radius: 999px;
  padding: 0.12rem 0.42rem;
  color: var(--gold-pale);
  background: rgba(4, 8, 6, 0.82);
  font-size: 0.52rem;
}

.win-amount {
  color: #8bddb3;
  font-family: Georgia, serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-shadow: 0 2px 8px #000;
  animation: winUp 500ms ease both;
}

@keyframes winUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.seat-bet {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(217, 173, 88, 0.32);
  border-radius: 999px;
  padding: 0.22rem 0.48rem;
  color: var(--gold-pale);
  background: rgba(4, 8, 6, 0.8);
  font-family: Georgia, serif;
  font-size: clamp(0.52rem, 0.8vw, 0.66rem);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  z-index: 5;
}

.reaction-flight-layer {
  position: absolute;
  inset: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 15;
}

.reaction-flight {
  width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 227, 153, 0.48);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff5d1;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.42), transparent 18%),
    radial-gradient(circle, rgba(126, 27, 22, 0.96), rgba(45, 9, 8, 0.92));
  font-size: 1.65rem;
  box-shadow: 0 0 22px rgba(255, 185, 78, 0.58), 0 9px 20px rgba(0, 0, 0, 0.42);
  position: absolute;
  left: var(--from-x);
  top: var(--from-y);
  transform: translate(-50%, -50%);
  animation: reactionFly 1.35s cubic-bezier(0.2, 0.8, 0.28, 1) both;
  animation-delay: var(--flight-delay, 0ms);
}

.reaction-flight.reaction-poop {
  border-color: rgba(247, 205, 122, 0.72);
  background: radial-gradient(circle, rgba(126, 70, 27, 0.98), rgba(52, 26, 13, 0.96));
  animation-name: reactionFly, reactionPoopShake;
  animation-duration: 1.35s, 220ms;
  animation-delay: var(--flight-delay, 0ms), calc(1.05s + var(--flight-delay, 0ms));
  animation-iteration-count: 1, 2;
}

.reaction-flight.reaction-flower {
  background: radial-gradient(circle, rgba(156, 32, 70, 0.98), rgba(63, 11, 29, 0.95));
}

.reaction-flight.reaction-coffee {
  background: radial-gradient(circle, rgba(132, 79, 41, 0.98), rgba(45, 24, 13, 0.96));
}

.reaction-flight.reaction-praise {
  width: auto;
  min-width: 54px;
  border-radius: 999px;
  padding: 0 0.55rem;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

@keyframes reactionFly {
  0% {
    left: var(--from-x);
    top: var(--from-y);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.45) rotate(-12deg);
  }
  48% {
    opacity: 1;
    transform: translate(-50%, -150%) scale(1.25) rotate(8deg);
  }
  100% {
    left: var(--to-x);
    top: var(--to-y);
    opacity: 0.94;
    transform: translate(-50%, -50%) scale(0.92) rotate(0);
  }
}

@keyframes reactionPoopShake {
  0%,
  100% {
    margin-left: 0;
  }
  50% {
    margin-left: 8px;
  }
}

.reaction-menu {
  width: min(620px, calc(100% - 32px));
  border: 1px solid rgba(217, 173, 88, 0.48);
  border-radius: 24px;
  padding: 1.4rem;
  color: var(--paper);
  background:
    linear-gradient(140deg, rgba(20, 39, 28, 0.98), rgba(5, 12, 8, 0.98)),
    var(--deep);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), inset 0 1px rgba(255, 255, 255, 0.08);
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 60;
  transform: translate(-50%, -50%);
}

.reaction-menu-backdrop {
  border: 0;
  background: rgba(2, 6, 4, 0.68);
  backdrop-filter: blur(4px);
  position: fixed;
  inset: 0;
  z-index: 59;
}

.reaction-menu > .eyebrow {
  color: var(--gold-dark);
}

.reaction-menu > h2 {
  margin: 0.25rem 2.6rem 0.2rem 0;
  color: var(--gold-pale);
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
}

.reaction-menu > p {
  margin: 0 2.6rem 1rem 0;
  color: var(--mist);
  font-size: 0.72rem;
}

.reaction-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.04);
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.reaction-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
}

.reaction-choice {
  min-height: 112px;
  border: 1px solid rgba(217, 173, 88, 0.22);
  border-radius: 16px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.32rem;
  padding: 0.7rem 0.35rem;
  color: var(--paper);
  background: rgba(255, 255, 255, 0.035);
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.reaction-choice:hover:not(:disabled) {
  border-color: rgba(217, 173, 88, 0.7);
  background: rgba(217, 173, 88, 0.1);
  transform: translateY(-4px);
}

.reaction-choice:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.reaction-ring {
  display: none;
}

.reaction-ring-button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(217, 173, 88, 0.58);
  border-radius: 50%;
  display: grid;
  place-content: center;
  gap: 0;
  padding: 0;
  color: var(--paper);
  background: rgba(5, 13, 9, 0.96);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.48);
}

.reaction-ring-button > span {
  font-size: 1rem;
  line-height: 1;
}

.reaction-ring-button > strong {
  color: var(--gold-pale);
  font-family: var(--number-font);
  font-size: 0.52rem;
  font-weight: 900;
  line-height: 1;
}

.reaction-choice > span {
  font-size: 1.8rem;
  line-height: 1;
}

.reaction-choice > strong {
  font-size: 0.74rem;
  font-weight: 700;
}

.reaction-choice > small {
  color: var(--gold);
  font-size: 0.62rem;
}

.reaction-choice-flower > div {
  display: flex;
  gap: 0.22rem;
  margin-top: 0.1rem;
}

.reaction-choice-flower > div button {
  min-width: 29px;
  border: 1px solid rgba(217, 173, 88, 0.32);
  border-radius: 999px;
  padding: 0.18rem 0.28rem;
  color: var(--gold-pale);
  background: rgba(217, 173, 88, 0.08);
  font-size: 0.58rem;
}

.reaction-choice-flower > div button:hover:not(:disabled) {
  background: rgba(217, 173, 88, 0.22);
}

.big-hand-celebration {
  width: min(530px, calc(100% - 32px));
  display: grid;
  justify-items: center;
  color: #fff3bf;
  text-align: center;
  text-shadow: 0 3px 14px #000, 0 0 32px rgba(255, 165, 46, 0.8);
  position: fixed;
  top: 18%;
  left: 50%;
  z-index: 55;
  transform: translateX(-50%);
  pointer-events: none;
  animation: celebrationReveal 4.2s ease both;
}

.big-hand-celebration::before,
.big-hand-celebration::after {
  content: "";
  width: 150px;
  height: 150px;
  border: 3px solid rgba(255, 218, 120, 0.75);
  border-radius: 50%;
  position: absolute;
  top: -42px;
  z-index: -1;
  animation: celebrationRing 1s ease-out infinite;
}

.big-hand-celebration::after {
  animation-delay: 0.34s;
}

.big-hand-celebration strong {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: clamp(2.5rem, 7vw, 5.7rem);
  letter-spacing: 0.18em;
}

.big-hand-celebration span {
  margin-top: 0.4rem;
  font-size: clamp(0.86rem, 2vw, 1.2rem);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.big-hand-celebration > small {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.28em;
}

.big-hand-celebration > p {
  margin: 0.5rem 0 0;
  font-size: clamp(0.86rem, 2vw, 1.2rem);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.celebration-bomb {
  width: 168px;
  height: 168px;
  display: grid;
  place-items: center;
  position: absolute;
  top: -52px;
  z-index: -1;
}

.celebration-bomb > i {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff2a8 0 8%, #f4a438 9% 31%, #b1241b 32% 62%, #42100d 63%);
  box-shadow: 0 0 32px #f26e2e, 0 0 80px rgba(255, 177, 55, 0.72);
  animation: bombPulse 520ms ease-in-out infinite alternate;
}

.celebration-bomb > span {
  --particle-angle: calc(var(--particle-index) * 20deg);
  width: 8px;
  height: 28px;
  border-radius: 999px;
  background: linear-gradient(#fffbd0, #ff9e31, transparent);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(var(--particle-angle)) translateY(-88px);
  transform-origin: center;
  animation: bombParticle 850ms ease-out infinite;
  animation-delay: calc(var(--particle-index) * -45ms);
}

@keyframes bombPulse {
  to {
    transform: scale(1.15);
    filter: brightness(1.3);
  }
}

@keyframes bombParticle {
  0% {
    opacity: 0;
    scale: 0.35;
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    scale: 1.35;
  }
}

@keyframes celebrationReveal {
  0% {
    opacity: 0;
    transform: translate(-50%, 38px) scale(0.55);
    filter: blur(10px);
  }
  12%,
  72% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
    filter: blur(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -22px) scale(1.08);
  }
}

@keyframes celebrationRing {
  from {
    opacity: 0.9;
    transform: scale(0.5);
  }
  to {
    opacity: 0;
    transform: scale(1.9);
  }
}

.turn-timer {
  width: 82px;
  height: 82px;
  border: 5px solid rgba(217, 173, 88, 0.26);
  border-top-color: var(--gold);
  border-radius: 50%;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--gold-pale);
  background: rgba(7, 13, 9, 0.94);
  box-shadow: 0 0 0 3px rgba(217, 173, 88, 0.12), 0 12px 30px rgba(0, 0, 0, 0.45);
  position: absolute;
  right: 28px;
  bottom: 120px;
  z-index: 8;
}

.turn-timer span {
  font-family: Georgia, serif;
  font-size: 1.65rem;
  line-height: 1;
}

.turn-timer small {
  margin-top: 0.12rem;
  color: var(--mist);
  font-size: 0.55rem;
}

.turn-timer.urgent {
  border-color: rgba(197, 66, 57, 0.35);
  border-top-color: var(--vermilion-bright);
  color: #ffb0a8;
  animation: urgent 750ms ease-in-out infinite;
}

@keyframes urgent {
  50% {
    transform: scale(1.04);
  }
}

.waiting-panel,
.rebuy-panel,
.result-panel {
  width: min(520px, calc(100% - 48px));
  border: 1px solid rgba(217, 173, 88, 0.35);
  padding: 1.55rem 1.7rem;
  background: rgba(5, 13, 9, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  position: absolute;
  left: 50%;
  bottom: 126px;
  transform: translateX(-50%);
  text-align: center;
  z-index: 10;
}

.waiting-panel h2,
.rebuy-panel h2,
.result-panel h2 {
  margin: 0.45rem 0;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 1.85rem;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.waiting-panel p,
.rebuy-panel p,
.result-panel p {
  margin: 0.3rem 0 1rem;
  color: var(--mist);
  font-size: 0.7rem;
  line-height: 1.7;
}

.waiting-panel p strong {
  color: var(--gold);
  font-family: Georgia, serif;
  letter-spacing: 0.12em;
}

.waiting-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

.rebuy-panel {
  width: min(560px, calc(100% - 48px));
}

.rebuy-panel h2 {
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.rebuy-panel .rebuy-last-result {
  margin-bottom: 0.75rem;
}

.rebuy-balance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.rebuy-balance > span {
  border: 1px solid rgba(217, 173, 88, 0.15);
  border-radius: 7px;
  padding: 0.5rem;
  color: var(--mist);
  background: rgba(217, 173, 88, 0.04);
  font-size: 0.55rem;
}

.rebuy-balance strong {
  display: block;
  margin-top: 0.2rem;
  color: var(--gold-pale);
  font-family: var(--number-font);
  font-size: 0.85rem;
  font-weight: 800;
}

.rebuy-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  gap: 0.55rem;
}

.rebuy-settling {
  min-height: 52px;
  display: flex;
  gap: 0.55rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(217, 173, 88, 0.18);
  border-radius: 8px;
  color: var(--gold-pale);
  background: rgba(217, 173, 88, 0.05);
  font-size: 0.68rem;
}

.rebuy-settling i {
  color: var(--gold);
}

.rebuy-submit {
  width: 100%;
  min-height: 42px;
  margin-top: 0.65rem;
}

.rebuy-secondary-actions {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.rebuy-secondary-actions button {
  min-height: 34px;
  padding: 0.4rem 0.65rem;
  font-size: 0.62rem;
}

.waiting-actions .primary-button,
.waiting-actions .secondary-button,
.waiting-actions .ready-button,
.rebuy-panel .primary-button,
.rebuy-panel .secondary-button,
.result-panel .primary-button,
.result-panel .secondary-button,
.result-panel .ready-button {
  min-height: 40px;
  padding: 0.55rem 0.9rem;
  font-size: 0.7rem;
}

.ready-button {
  border: 1px solid rgba(98, 185, 140, 0.52);
  border-radius: 6px;
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
  color: #e8fff2;
  background: #17603f;
  cursor: pointer;
  font-weight: 700;
}

.ready-button:disabled,
.waiting-actions button:disabled,
.result-actions button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.ready-button.is-ready {
  border-color: rgba(98, 185, 140, 0.68);
  background: #1a714a;
  box-shadow: 0 0 0 3px rgba(98, 185, 140, 0.08);
}

.result-panel .ready-summary {
  margin-bottom: 0.65rem;
  color: var(--gold-pale);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

.ai-management {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.7rem;
}

.ai-management button {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.28rem 0.52rem;
  color: var(--mist);
  background: transparent;
  cursor: pointer;
  font-size: 0.6rem;
}

.result-list {
  display: grid;
  gap: 0.3rem;
  margin: 0.8rem 0;
}

.result-list > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line-soft);
  padding: 0.35rem 0;
  color: var(--mist);
  font-size: 0.66rem;
}

.result-list strong {
  color: var(--gold-pale);
}

.action-dock {
  min-height: 98px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  background: rgba(4, 8, 6, 0.96);
  backdrop-filter: blur(16px);
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 12;
}

.action-content {
  width: min(920px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 0.85rem;
}

.action-button {
  min-height: 64px;
  border: 1px solid transparent;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  cursor: pointer;
  font-weight: 700;
  transition: transform 130ms ease, filter 130ms ease, border-color 130ms ease;
}

.action-button:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

.fold-action,
.allin-action {
  border-color: #c44b44;
  color: #fff0e8;
  background: #7d191c;
}

.check-action,
.call-action {
  border-color: #638b70;
  color: #f0eadc;
  background: #174b34;
}

.raise-action {
  width: 100%;
  border-color: #efc970;
  color: #171207;
  background: var(--gold);
}

.allin-action {
  background: var(--vermilion);
}

.raise-zone {
  position: relative;
}

.raise-popover {
  width: 250px;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  background: #0b1510;
  box-shadow: var(--shadow);
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
}

.raise-popover > div {
  display: flex;
  justify-content: space-between;
  color: var(--mist);
  font-size: 0.7rem;
}

.raise-popover strong {
  color: var(--gold);
  font-family: Georgia, serif;
}

.raise-popover input {
  width: 100%;
  accent-color: var(--gold);
}

.raise-popover button {
  min-height: 36px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  color: #171207;
  background: var(--gold);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
}

.waiting-turn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--mist);
  font-size: 0.75rem;
}

.waiting-turn i {
  color: var(--gold);
  animation: spinHalf 1.8s ease-in-out infinite;
}

@keyframes spinHalf {
  50% {
    transform: rotate(180deg);
  }
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 5, 3, 0.82);
  backdrop-filter: blur(10px);
  animation: backdropIn 160ms ease both;
}

@keyframes backdropIn {
  from {
    opacity: 0;
  }
}

.modal-card {
  width: min(520px, 100%);
  max-height: calc(100vh - 2rem);
  max-height: calc(100svh - 2rem);
  border: 1px solid rgba(217, 173, 88, 0.4);
  padding: clamp(1.35rem, 3vw, 2.2rem);
  overflow: auto;
  background: #0a130e;
  box-shadow: var(--shadow);
  position: relative;
  animation: modalIn 220ms ease both;
}

.join-table-modal {
  width: min(520px, 100%);
}

.join-table-modal h2 {
  margin: 0.42rem 0 0;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 2rem;
  font-weight: 400;
}

.join-table-copy {
  max-width: 420px;
  margin: 0.5rem 2.5rem 1rem 0;
  color: var(--mist);
  font-size: 0.72rem;
  line-height: 1.75;
}

.join-modal-room-code {
  margin-bottom: 0.9rem;
}

.join-modal-buy-in {
  margin-bottom: 0.9rem;
}

.join-modal-confirm {
  margin-top: 0.9rem;
}

.house-pool-modal {
  width: min(560px, 100%);
}

.house-pool-modal h2 {
  margin: 0.42rem 0 0.35rem;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.house-pool-intro {
  max-width: 440px;
  margin: 0 2.5rem 1rem 0;
  color: var(--mist);
  font-size: 0.68rem;
  line-height: 1.75;
}

.house-pool-balance {
  min-height: 86px;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  border: 1px solid rgba(217, 173, 88, 0.32);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  background:
    linear-gradient(135deg, rgba(217, 173, 88, 0.14), transparent 58%),
    rgba(4, 12, 8, 0.76);
}

.house-pool-balance span {
  color: var(--parchment);
  font-size: 0.72rem;
}

.house-pool-balance span i {
  margin-right: 0.45rem;
  color: var(--gold);
}

.house-pool-balance strong {
  color: var(--gold-pale);
  font-family: var(--number-font);
  font-size: 2.15rem;
  font-weight: 900;
}

.house-pool-balance-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.house-pool-clear-button {
  min-height: 34px;
  border: 1px solid rgba(230, 110, 101, 0.72);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.68rem;
  color: #ffe8e4;
  background: rgba(125, 34, 28, 0.5);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.house-pool-clear-button:hover:not(:disabled) {
  border-color: var(--danger);
  background: rgba(174, 48, 40, 0.72);
  transform: translateY(-1px);
}

.house-pool-clear-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.house-pool-ledger {
  display: grid;
  gap: 0.45rem;
  margin-top: 1rem;
}

.house-pool-ledger-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
  padding: 0.35rem 0;
}

.house-pool-ledger-row > span {
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.house-pool-ledger-row strong {
  color: var(--paper);
  font-size: 0.72rem;
}

.house-pool-ledger-row small {
  overflow: hidden;
  color: var(--mist);
  font-size: 0.57rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.house-pool-ledger-row em {
  color: var(--parchment);
  font-family: var(--number-font);
  font-size: 0.88rem;
  font-style: normal;
  font-weight: 900;
}

.house-pool-ledger-row em.positive {
  color: var(--success);
}

.house-pool-ledger-row em.negative {
  color: var(--danger);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.modal-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-soft);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--mist);
  background: transparent;
  cursor: pointer;
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.wallet-modal {
  width: min(680px, 100%);
}

.wallet-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: flex-start;
  padding-right: 2.2rem;
}

.wallet-modal-head h2 {
  margin: 0.35rem 0;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 2rem;
  font-weight: 400;
}

.wallet-modal-head p {
  max-width: 430px;
  margin: 0;
  color: var(--mist);
  font-size: 0.68rem;
  line-height: 1.7;
}

.wallet-balance {
  min-width: 122px;
  border-left: 1px solid var(--line);
  padding-left: 1rem;
  text-align: right;
}

.wallet-balance span,
.wallet-balance strong {
  display: block;
}

.wallet-balance span {
  color: var(--mist);
  font-size: 0.58rem;
}

.wallet-balance strong {
  margin-top: 0.2rem;
  color: var(--gold-pale);
  font-family: Georgia, serif;
  font-size: 1.7rem;
}

.wallet-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 1.4rem 0 1rem;
  border-bottom: 1px solid var(--line);
}

.wallet-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 0.7rem;
  color: var(--mist);
  background: transparent;
  cursor: pointer;
}

.wallet-tabs button.active {
  border-bottom-color: var(--gold);
  color: var(--gold-pale);
}

.wallet-form {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.2rem;
}

.wallet-explain,
.password-required {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0.8rem 0 1rem;
  border: 1px solid rgba(217, 173, 88, 0.2);
  padding: 0.75rem;
  color: var(--mist);
  background: rgba(217, 173, 88, 0.055);
  font-size: 0.66rem;
  line-height: 1.7;
}

.wallet-explain i,
.password-required i {
  color: var(--gold);
}

.cashout-amount {
  margin-bottom: 1rem;
  border: 1px solid rgba(158, 41, 41, 0.35);
  padding: 1rem;
  background: rgba(158, 41, 41, 0.08);
}

.cashout-amount span,
.cashout-amount strong,
.cashout-amount small {
  display: block;
}

.cashout-amount span,
.cashout-amount small {
  color: var(--mist);
  font-size: 0.64rem;
}

.cashout-amount strong {
  margin: 0.25rem 0;
  color: #ffd4c7;
  font-family: Georgia, serif;
  font-size: 1.8rem;
}

.confirm-check {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  margin: 1rem 0;
  color: var(--paper);
  font-size: 0.68rem;
}

.confirm-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--vermilion);
}

.wallet-history {
  margin-top: 1.1rem;
}

.wallet-history h3 {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
}

.wallet-empty {
  border: 1px dashed var(--line-soft);
  padding: 1rem;
  color: var(--mist);
  font-size: 0.66rem;
  text-align: center;
}

.wallet-history-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
}

.wallet-history-row > i {
  color: var(--gold);
}

.wallet-history-row strong,
.wallet-history-row small {
  display: block;
}

.wallet-history-row strong {
  font-size: 0.7rem;
}

.wallet-history-row small {
  margin-top: 0.15rem;
  color: var(--mist);
  font-size: 0.56rem;
}

.wallet-history-row em,
.admin-request-row > em {
  border-radius: 999px;
  padding: 0.22rem 0.5rem;
  color: var(--mist);
  background: rgba(181, 181, 170, 0.08);
  font-size: 0.56rem;
  font-style: normal;
  white-space: nowrap;
}

.status-pending {
  color: var(--gold-pale) !important;
  background: rgba(217, 173, 88, 0.12) !important;
}

.status-approved,
.status-completed {
  color: var(--success) !important;
  background: rgba(98, 185, 140, 0.11) !important;
}

.status-rejected {
  color: var(--danger) !important;
  background: rgba(230, 110, 101, 0.1) !important;
}

.modal-profile-head {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 1rem;
  align-items: center;
  padding-right: 2.5rem;
}

.modal-profile-head img {
  width: 78px;
  height: 78px;
  border: 2px solid var(--gold-dark);
  border-radius: 50%;
  object-fit: cover;
}

.modal-profile-head h2 {
  margin: 0.35rem 0 0;
  font-size: 1.45rem;
}

.modal-profile-head p {
  margin: 0.25rem 0 0;
  color: var(--mist);
  font-size: 0.68rem;
}

.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.profile-stat-grid > div {
  padding: 1rem 0.6rem;
  border-right: 1px solid var(--line-soft);
  text-align: center;
}

.profile-stat-grid > div:last-child {
  border-right: 0;
}

.profile-stat-grid span {
  display: block;
  color: var(--mist);
  font-size: 0.58rem;
}

.profile-stat-grid strong {
  display: block;
  margin-top: 0.3rem;
  color: var(--gold-pale);
  font-family: Georgia, serif;
  font-size: 1.08rem;
}

.password-form h3 {
  margin: 0 0 1rem;
  font-size: 0.85rem;
}

.password-required strong {
  display: block;
  color: var(--gold-pale);
}

.admin-dashboard {
  width: min(1180px, 100%);
  margin: 0 auto;
  border: 1px solid rgba(217, 173, 88, 0.28);
  border-radius: 12px;
  padding: clamp(1rem, 2.2vw, 1.55rem);
  background:
    linear-gradient(145deg, rgba(217, 173, 88, 0.07), transparent 38%),
    rgba(5, 16, 11, 0.88);
  box-shadow: 0 22px 58px rgba(0, 0, 0, 0.24);
}

.admin-dashboard .section-heading {
  align-items: center;
}

.admin-dashboard .section-heading .primary-button {
  min-height: 40px;
  font-size: 0.68rem;
}

.admin-dashboard-heading {
  margin-bottom: 0;
}

.admin-audit-workspace,
.admin-audit-panel {
  margin-top: 1rem;
}

.admin-audit-panel {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

.admin-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0.95rem 0 0.4rem;
  border-bottom: 1px solid var(--line);
}

.admin-tabs button {
  min-height: 44px;
  border: 0;
  border-bottom: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem;
  color: var(--mist);
  background: transparent;
  cursor: pointer;
  font-size: 0.68rem;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.admin-tabs button:hover,
.admin-tabs button.active {
  border-bottom-color: var(--gold);
  color: var(--gold-pale);
  background: rgba(217, 173, 88, 0.07);
}

.admin-tabs button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -4px;
}

.admin-tabs button em {
  min-width: 1.15rem;
  min-height: 1.15rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: #161006;
  background: var(--gold);
  font-size: 0.56rem;
  font-style: normal;
  font-weight: 900;
}

.admin-tab-panel:focus-visible {
  outline: 1px solid rgba(217, 173, 88, 0.5);
  outline-offset: 4px;
}

.admin-token {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 34px;
  gap: 0.7rem;
  align-items: center;
  margin: 0.7rem 0;
  border: 1px solid rgba(98, 185, 140, 0.28);
  padding: 0.7rem;
  background: rgba(98, 185, 140, 0.08);
}

.admin-token span {
  color: var(--mist);
  font-size: 0.62rem;
}

.admin-token strong {
  overflow: hidden;
  color: var(--success);
  font-family: Georgia, serif;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-token button {
  width: 34px;
  height: 34px;
  border: 0;
  color: var(--success);
  background: transparent;
  cursor: pointer;
}

.reset-token {
  border-color: rgba(217, 173, 88, 0.28);
  background: rgba(217, 173, 88, 0.08);
}

.reset-token strong,
.reset-token button {
  color: var(--gold-pale);
}

.admin-user-list {
  margin-top: 1rem;
  border-top: 1px solid var(--line);
}

.admin-user-list > .admin-subheading {
  padding-top: 0.85rem;
}

.house-pool-card {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem 1rem;
  align-items: center;
  border: 1px solid rgba(217, 173, 88, 0.28);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  background:
    linear-gradient(135deg, rgba(217, 173, 88, 0.12), rgba(85, 25, 23, 0.08)),
    rgba(8, 12, 16, 0.44);
}

.house-pool-card h3 {
  margin: 0.2rem 0;
  font-size: 0.95rem;
}

.house-pool-card p {
  margin: 0;
  color: var(--mist);
  font-size: 0.58rem;
}

.house-pool-card > strong {
  color: var(--gold-pale);
  font-family: var(--display-font);
  font-size: clamp(1.65rem, 5vw, 2.4rem);
}

.house-pool-entries {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.25rem;
  border-top: 1px solid var(--line-soft);
  padding-top: 0.6rem;
}

.house-pool-entries span {
  color: var(--mist);
  font-size: 0.56rem;
}

.win-probability {
  min-width: 98px;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 58%, transparent);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.05rem 0.45rem;
  margin-top: 4px;
  padding: 0.34rem 0.45rem;
  color: var(--paper);
  background: rgba(4, 9, 9, 0.88);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.36);
  pointer-events: auto;
}

.win-probability span {
  align-self: center;
  color: var(--mist);
  font-size: 0.47rem;
}

.win-probability strong {
  color: var(--theme-accent);
  font-family: Georgia, serif;
  font-size: 0.78rem;
}

.win-probability small {
  grid-column: 2;
  justify-self: center;
  color: rgba(241, 229, 204, 0.88);
  font-size: 0.56rem;
  font-weight: 800;
  line-height: 1.05;
  white-space: nowrap;
}

.seat.self .win-probability {
  order: 6;
}

.seat.self .seat-hand {
  order: 6;
}

.house-pool-tables {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.5rem;
  border-top: 1px solid var(--line-soft);
  padding-top: 0.7rem;
}

.house-pool-tables .admin-subheading {
  margin-bottom: 0;
}

.house-pool-tables > p {
  color: var(--mist);
  font-size: 0.58rem;
}

.house-pool-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.8rem;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 0.55rem 0.65rem;
  background: rgba(4, 7, 6, 0.3);
}

.house-pool-table-row > span {
  display: grid;
  gap: 0.1rem;
}

.house-pool-table-row > span:not(:first-child) {
  min-width: 4.1rem;
  text-align: right;
}

.house-pool-table-row strong {
  color: var(--parchment);
  font-size: 0.64rem;
}

.house-pool-table-row > span:last-child strong {
  color: var(--gold-pale);
}

.house-pool-table-row small {
  color: var(--mist);
  font-size: 0.5rem;
}

.admin-request-section {
  margin-top: 1.2rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}

.dissolved-table-summary {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1.1rem;
  border: 1px solid rgba(217, 173, 88, 0.28);
  border-radius: 9px;
  padding: 0.9rem 1rem;
  background:
    linear-gradient(125deg, rgba(217, 173, 88, 0.1), rgba(85, 25, 23, 0.08)),
    rgba(8, 12, 16, 0.42);
}

.dissolved-table-summary h3 {
  margin: 0.15rem 0;
  font-family: var(--display-font);
  font-size: 1rem;
}

.dissolved-table-summary p,
.dissolved-table-summary > div:last-child span {
  margin: 0;
  color: var(--mist);
  font-size: 0.56rem;
}

.dissolved-table-summary > div:last-child {
  display: grid;
  gap: 0.1rem;
  min-width: 8rem;
  text-align: right;
}

.dissolved-table-summary > div:last-child strong {
  color: var(--gold-pale);
  font-family: var(--display-font);
  font-size: 1.8rem;
}

.admin-subheading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 0.5rem;
}

.admin-subheading h3 {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
}

.admin-subheading > span {
  color: var(--gold);
  font-size: 0.62rem;
}

.admin-request-row {
  min-height: 66px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  gap: 0.65rem;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
}

.admin-request-row > img,
.admin-avatar img {
  width: 34px;
  height: 34px;
  border: 1px solid var(--gold-dark);
  border-radius: 50%;
  object-fit: cover;
}

.admin-request-row strong,
.admin-request-row small {
  display: block;
}

.admin-request-row strong {
  font-size: 0.7rem;
}

.admin-request-row small {
  margin-top: 0.15rem;
  color: var(--mist);
  font-size: 0.56rem;
}

.admin-request-row > div {
  display: flex;
  gap: 0.35rem;
}

.admin-request-row button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 0.55rem;
  cursor: pointer;
  font-size: 0.58rem;
}

.approve-button {
  color: var(--success);
  background: rgba(98, 185, 140, 0.08);
}

.reject-button {
  color: var(--danger);
  background: rgba(230, 110, 101, 0.08);
}

.admin-user-row {
  min-height: 68px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  gap: 0.65rem;
  align-items: center;
  border-bottom: 1px solid var(--line-soft);
}

.admin-avatar {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold);
  overflow: hidden;
}

.admin-user-row > span:nth-child(2) {
  min-width: 0;
}

.admin-user-row strong,
.admin-user-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-row strong {
  font-size: 0.76rem;
}

.admin-user-row small {
  margin-top: 0.18rem;
  color: var(--mist);
  font-size: 0.58rem;
}

.admin-user-status {
  min-width: 58px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  border: 1px solid;
  border-radius: 999px;
  padding: 0 0.65rem;
  font-size: 0.58rem;
  font-weight: 800;
  white-space: nowrap;
}

.admin-user-status i {
  font-size: 0.42rem;
}

.admin-user-status.active {
  color: var(--success);
  border-color: rgba(98, 185, 140, 0.4);
  background: rgba(98, 185, 140, 0.1);
}

.admin-user-status.disabled {
  color: var(--danger);
  border-color: rgba(230, 110, 101, 0.4);
  background: rgba(230, 110, 101, 0.1);
}

.admin-user-row button {
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  padding: 0 0.6rem;
  color: var(--mist);
  background: transparent;
  cursor: pointer;
  font-size: 0.6rem;
}

.admin-user-row button i {
  margin-right: 0.3rem;
  color: var(--gold);
}

.admin-user-row button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.admin-user-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.admin-password-backdrop {
  z-index: 120;
}

.admin-password-modal {
  width: min(460px, 100%);
}

.admin-password-modal h2 {
  margin: 0.45rem 2.4rem 0 0;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 1.85rem;
  font-weight: 400;
}

.admin-password-modal > p {
  margin: 0.55rem 2.4rem 1.15rem 0;
  color: var(--mist);
  font-size: 0.7rem;
  line-height: 1.7;
}

.admin-password-modal .password-form {
  border-top: 1px solid var(--line-soft);
  padding-top: 1rem;
}

.confirm-modal {
  width: min(430px, 100%);
  text-align: center;
}

.confirm-modal > i {
  color: var(--gold);
  font-size: 2rem;
}

.confirm-modal h2 {
  margin: 0.8rem 0 0.4rem;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 1.8rem;
  font-weight: 400;
}

.confirm-modal p {
  margin: 0 0 1.4rem;
  color: var(--mist);
  font-size: 0.72rem;
  line-height: 1.75;
}

.confirm-modal > div {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
}

.toast {
  min-height: 44px;
  max-width: min(420px, calc(100vw - 2rem));
  border: 1px solid rgba(98, 185, 140, 0.35);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  color: #d8f4e5;
  background: rgba(10, 52, 36, 0.97);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
  position: fixed;
  top: 1rem;
  left: 50%;
  z-index: 200;
  transform: translateX(-50%);
  font-size: 0.72rem;
  animation: toastIn 220ms ease both;
}

.toast.error {
  border-color: rgba(230, 110, 101, 0.42);
  color: #ffe2dc;
  background: rgba(91, 24, 25, 0.98);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, -10px);
  }
}

/* Tablet */
@media (max-width: 1080px) {
  .auth-screen {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 0.82fr);
  }

  .story-note {
    width: 100%;
  }

  .lounge-screen {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .lounge-rail {
    padding: 1.6rem 1.25rem;
  }

  .game-screen {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .game-rail {
    width: 230px;
    padding: 1.2rem 1rem;
  }

  .setting-grid {
    grid-template-columns: 1fr;
  }

  .buy-in-controls {
    grid-template-columns: 1fr;
  }

  .buy-in-custom {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .theme-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .room-row {
    grid-template-columns: 90px 1fr auto auto auto auto;
  }

  .room-rule {
    display: none;
  }
}

/* Mobile */
@media (max-width: 760px) {
  body {
    background-attachment: scroll;
  }

  .auth-screen {
    display: block;
    background: rgba(4, 9, 6, 0.72);
  }

  .auth-story {
    display: none;
  }

  .auth-panel {
    min-height: 100vh;
    min-height: 100svh;
    align-items: start;
    padding: max(1.2rem, env(safe-area-inset-top)) 1.2rem max(1.2rem, env(safe-area-inset-bottom));
    background: rgba(5, 12, 8, 0.83);
  }

  .auth-panel-inner {
    width: 100%;
    max-width: 430px;
    margin: 0 auto;
  }

  .mobile-brand {
    display: grid;
    justify-items: center;
    margin: 1rem 0 1.7rem;
  }

  .mobile-brand span {
    font-size: 2.5rem;
  }

  .mobile-brand small {
    margin-top: 0.3rem;
    color: var(--gold-dark);
    font-family: Georgia, serif;
    font-size: 0.54rem;
    letter-spacing: 0.25em;
  }

  .auth-tabs {
    margin-bottom: 1.65rem;
  }

  .form-heading h2 {
    font-size: 2.1rem;
  }

  .lounge-screen {
    display: block;
    min-height: 100svh;
  }

  .lounge-rail {
    display: none;
  }

  .lounge-main {
    padding: max(1.15rem, env(safe-area-inset-top)) 1rem max(1.6rem, env(safe-area-inset-bottom));
  }

  .lounge-header {
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.4rem;
  }

  .lounge-header h2 {
    margin-top: 0.3rem;
    font-size: clamp(1.35rem, 5.2vw, 1.75rem);
    letter-spacing: 0.04em;
    white-space: nowrap;
  }

  .lounge-header p {
    display: none;
  }

  .mobile-account {
    display: flex;
    align-items: center;
    gap: 0.45rem;
  }

  .mobile-account > img {
    display: none;
  }

  .mobile-account span {
    display: none;
  }

  .mobile-account button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--gold);
    background: rgba(5, 12, 8, 0.7);
  }

  .mobile-account .mobile-balance {
    width: auto;
    min-width: 92px;
    height: 44px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.42rem;
    border-color: rgba(217, 173, 88, 0.42);
    border-radius: 12px;
    padding: 0.3rem 0.62rem;
    background:
      linear-gradient(145deg, rgba(217, 173, 88, 0.14), transparent 65%),
      rgba(5, 17, 12, 0.92);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  }

  .mobile-account .mobile-logout {
    width: 56px;
    grid-template-columns: auto auto;
    gap: 0.24rem;
    border-radius: 10px;
    color: var(--paper);
  }

  .mobile-account .mobile-logout span {
    display: inline;
    font-size: 0.62rem;
  }

  .house-pool-summary {
    min-height: 66px;
    gap: 0.65rem;
    margin: -0.45rem auto 1rem;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
  }

  .house-pool-emblem {
    width: 38px;
    height: 38px;
  }

  .house-pool-summary strong {
    font-size: 1.42rem;
  }

  .house-pool-summary em {
    max-width: 4rem;
    text-align: right;
  }

  .mobile-account .mobile-balance > i {
    color: var(--gold);
    font-size: 0.8rem;
  }

  .mobile-account .mobile-balance span {
    display: block;
    min-width: 0;
    text-align: right;
  }

  .mobile-account .mobile-balance small {
    display: block;
    color: var(--mist);
    font-size: 0.46rem;
    line-height: 1;
    white-space: nowrap;
  }

  .mobile-account .mobile-balance strong {
    display: block;
    margin-top: 0.08rem;
    color: var(--gold-pale);
    font-family: var(--number-font);
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
  }

  .lobby-grid {
    grid-template-columns: 1fr;
  }

  .lobby-card {
    padding: 1.25rem;
  }

  .wallet-modal-head {
    display: block;
  }

  .wallet-balance {
    margin-top: 0.9rem;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 0.7rem 0 0;
    text-align: left;
  }

  .admin-request-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    padding: 0.55rem 0;
  }

  .admin-request-row > div {
    grid-column: 2 / -1;
  }

  .admin-user-row {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 0.45rem 0;
  }

  .admin-user-status {
    grid-column: 2;
    justify-self: start;
  }

  .admin-user-actions {
    grid-column: 2;
    flex-wrap: wrap;
  }

  .setting-grid {
    grid-template-columns: 1fr;
  }

  .room-section {
    margin-top: 1.6rem;
  }

  .room-row {
    grid-template-columns: 80px minmax(0, 1fr) auto;
    gap: 0.55rem;
    padding: 0 0.6rem;
  }

  .room-occupancy,
  .room-state,
  .room-row > i {
    display: none;
  }

  .game-screen {
    display: block;
    height: 100svh;
  }

  .game-rail {
    display: none;
  }

  .table-stage {
    height: 100svh;
    padding: 58px 0 108px;
    align-items: center;
  }

  .game-mobile-header {
    height: 52px;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr auto 34px 34px;
    gap: 0.5rem;
    align-items: center;
    padding: env(safe-area-inset-top) 0.75rem 0;
    background: rgba(4, 10, 7, 0.93);
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 20;
  }

  .game-mobile-header > div {
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  .game-mobile-header small {
    color: var(--mist);
    font-size: 0.55rem;
  }

  .game-mobile-header strong {
    color: var(--gold);
    font-family: Georgia, serif;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
  }

  .game-mobile-header span {
    color: var(--mist);
    font-size: 0.58rem;
  }

  .game-mobile-header button {
    width: 32px;
    height: 32px;
    border: 0;
    display: grid;
    place-items: center;
    color: var(--gold);
    background: transparent;
  }

  .table-copy {
    top: 63px;
    left: 12px;
  }

  .table-theme-switcher {
    top: 58px;
    right: 12px;
    gap: 0.16rem;
    padding: 0.25rem;
  }

  .table-theme-switcher > span {
    display: none;
  }

  .table-theme-switcher > button {
    width: 21px;
    height: 21px;
  }

  .connection-banner {
    width: calc(100% - 24px);
    top: 59px;
    justify-content: center;
    padding: 0.45rem 0.6rem;
    font-size: 0.58rem;
    text-align: center;
  }

  .mobile-latest-action {
    max-width: calc(100% - 136px);
    border: 1px solid rgba(217, 173, 88, 0.18);
    border-radius: 999px;
    display: flex;
    gap: 0.35rem;
    align-items: center;
    padding: 0.3rem 0.55rem;
    color: rgba(241, 229, 204, 0.82);
    background: rgba(4, 10, 7, 0.76);
    position: absolute;
    top: 92px;
    right: 12px;
    font-size: 0.52rem;
    z-index: 8;
  }

  .mobile-latest-action i {
    flex: 0 0 auto;
    color: var(--gold);
  }

  .mobile-latest-action span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .poker-table {
    width: 118vw;
    max-width: none;
    max-height: calc(100svh - 170px);
    flex: 0 0 auto;
  }

  .seat {
    width: 67px;
  }

  .seat-avatar {
    width: 36px;
    height: 36px;
  }

  .seat-name,
  .seat-chips {
    max-width: 66px;
    font-size: 0.52rem;
  }

  .community-card {
    width: clamp(34px, 10vw, 43px);
  }

  .playing-card .card-corner {
    top: 3px;
    left: 4px;
    font-size: 0.5rem;
  }

  .card-suit-large {
    font-size: 1rem;
  }

  .pot-display {
    top: 56%;
    font-size: 0.62rem;
  }

  .hole-card {
    width: 24px;
  }

  .seat.self .seat-avatar {
    width: 42px;
    height: 42px;
  }

  .seat.self {
    gap: 3px;
    transform: translate(-50%, calc(-50% + 24px));
  }

  .seat.self .hole-cards {
    margin-top: 0;
    margin-bottom: 5px;
  }

  .seat.self .hole-card {
    width: 30px;
  }

  .seat.self .win-probability {
    min-width: 78px;
    margin-top: 6px;
    padding: 0.28rem 0.38rem;
    font-size: 0.5rem;
  }

  .reaction-menu-backdrop {
    background: rgba(2, 6, 4, 0.28);
    backdrop-filter: none;
  }

  .reaction-menu {
    width: 1px;
    height: 1px;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    top: var(--reaction-anchor-y);
    left: var(--reaction-anchor-x);
    transform: none;
    overflow: visible;
  }

  .reaction-menu > .eyebrow,
  .reaction-menu > h2,
  .reaction-menu > p,
  .reaction-menu > .reaction-close,
  .reaction-menu > .reaction-grid,
  .reaction-menu > .reaction-mute-button {
    display: none;
  }

  .reaction-ring {
    display: block;
    width: 1px;
    height: 1px;
    position: relative;
  }

  .reaction-ring-button {
    position: absolute;
    top: -20px;
    left: -20px;
    transform: translate(var(--ring-x), var(--ring-y));
    transition: transform 150ms ease, border-color 150ms ease;
  }

  .reaction-ring-button:active:not(:disabled) {
    border-color: var(--gold-pale);
    transform:
      translate(var(--ring-x), var(--ring-y))
      scale(0.92);
  }

  .big-hand-celebration {
    top: 15%;
  }

  .big-hand-celebration strong {
    font-size: clamp(2rem, 13vw, 3.3rem);
  }

  .seat-bet {
    padding: 0.14rem 0.3rem;
    font-size: 0.46rem;
  }

  .seat-bet.self {
    transform: translate(-50%, calc(-50% + 24px));
  }

  .turn-timer {
    width: 58px;
    height: 58px;
    border-width: 4px;
    right: 12px;
    bottom: 112px;
  }

  .turn-timer span {
    font-size: 1.15rem;
  }

  .waiting-panel,
  .rebuy-panel,
  .result-panel {
    width: calc(100% - 24px);
    bottom: 116px;
    padding: 1.1rem;
  }

  .waiting-panel {
    width: min(calc(100% - 32px), 360px);
    bottom: 88px;
    padding: 0.7rem 0.8rem;
  }

  .waiting-panel h2,
  .rebuy-panel h2,
  .result-panel h2 {
    font-size: 1.45rem;
  }

  .waiting-panel h2 {
    margin: 0.25rem 0;
    font-size: 1.05rem;
  }

  .waiting-panel > .eyebrow {
    font-size: 0.52rem;
    letter-spacing: 0.16em;
  }

  .waiting-panel p {
    margin: 0.2rem 0 0.55rem;
    font-size: 0.58rem;
    line-height: 1.5;
  }

  .waiting-panel .waiting-actions {
    flex-wrap: nowrap;
  }

  .waiting-panel .waiting-actions button {
    min-height: 36px;
    padding: 0.38rem 0.5rem;
    font-size: 0.64rem;
  }

  .theme-purchase-confirm {
    width: min(calc(100% - 24px), 340px);
    border-radius: 14px;
    padding: 0.8rem;
    top: auto;
    right: 12px;
    bottom: 92px;
  }

  .waiting-actions {
    gap: 0.4rem;
  }

  .rebuy-controls {
    grid-template-columns: 1fr;
  }

  .rebuy-panel .buy-in-custom {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .rebuy-balance > span {
    padding: 0.4rem 0.25rem;
  }

  .waiting-actions .primary-button,
  .waiting-actions .secondary-button,
  .waiting-actions .ready-button,
  .result-actions .primary-button,
  .result-actions .secondary-button,
  .result-actions .ready-button {
    flex: 1 1 100px;
    padding: 0.45rem 0.55rem;
  }

  .action-dock {
    min-height: 98px;
    padding: 0.6rem 0.55rem max(0.6rem, env(safe-area-inset-bottom));
  }

  .action-content {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
  }

  .action-button {
    min-height: 56px;
    flex-direction: column;
    gap: 0.18rem;
    padding: 0.35rem 0.2rem;
    font-size: 0.68rem;
  }

  .action-button i {
    font-size: 0.78rem;
  }

  .raise-popover {
    width: min(250px, 85vw);
    left: auto;
    right: -50px;
    transform: none;
  }

  .modal-card {
    max-height: calc(100svh - 1.5rem);
    padding: 1.2rem;
  }

  .join-table-backdrop {
    align-items: end;
    padding: 0;
  }

  .join-table-modal {
    width: 100%;
    max-height: min(88svh, 720px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
    padding: 1.15rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  }

  .house-pool-backdrop {
    align-items: end;
    padding: 0;
  }

  .house-pool-modal {
    width: 100%;
    max-height: min(88svh, 720px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
    padding: 1.15rem max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  }

  .join-table-modal h2 {
    font-size: 1.65rem;
  }

  .join-table-copy {
    margin-right: 2rem;
    font-size: 0.66rem;
  }

  .admin-dashboard {
    border-radius: 10px;
    padding: 0.85rem;
  }

  .admin-dashboard .section-heading {
    display: block;
  }

  .admin-dashboard .section-heading .primary-button {
    margin-top: 1rem;
  }

  .admin-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .admin-tabs button {
    flex: 0 0 auto;
    min-width: max-content;
    padding-right: 0.8rem;
    padding-left: 0.8rem;
  }

  .admin-user-row {
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 0.45rem 0;
  }

  .admin-user-status {
    grid-column: 2;
    justify-self: start;
  }

  .admin-user-actions {
    grid-column: 2;
    justify-content: flex-end;
    justify-self: stretch;
  }

  .dissolved-table-summary {
    align-items: flex-end;
    gap: 0.7rem;
    padding: 0.75rem 0.8rem;
  }

  .dissolved-table-summary > div:last-child {
    min-width: 6.2rem;
  }

  .dissolved-table-summary > div:last-child strong {
    font-size: 1.5rem;
  }

  .house-pool-table-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .house-pool-table-row > span:last-child {
    grid-column: 2;
  }
}

@media (max-width: 390px) {
  .lounge-header h2 {
    font-size: 1.35rem;
  }

  .room-code-field input {
    height: 60px;
    font-size: 1.45rem;
  }

  .poker-table {
    width: 126vw;
  }

  .seat-avatar {
    width: 34px;
    height: 34px;
  }

  .community-cards {
    gap: 3px;
  }

  .community-card {
    width: 33px;
  }

  .action-button {
    font-size: 0.6rem;
  }

  .theme-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .theme-options > button {
    min-height: 58px;
    padding: 0.55rem;
  }

  .reaction-menu > h2 {
    font-size: 1rem;
  }
}

/* Phase 7: dealer, replay, ledgers and legible numeric system */
.seat-chips,
.pot-display,
.seat-bet,
.turn-timer,
.win-probability,
.wallet-balance,
.room-code-field input,
.game-mobile-header strong,
.house-pool-card > strong,
.house-pool-table-row strong,
.cashout-amount strong,
.profile-stat-grid strong,
.raise-popover strong,
.dealer-tip-options button,
.chip-ledger-row em,
.chip-ledger-row > small {
  font-family: var(--number-font);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.seat-chips {
  font-size: clamp(0.72rem, 1.15vw, 1.02rem);
}

.pot-display {
  font-size: clamp(0.82rem, 1.4vw, 1.15rem);
}

.seat-bet {
  font-size: clamp(0.66rem, 1.05vw, 0.92rem);
}

.turn-timer span {
  font-family: var(--number-font);
  font-size: 1.85rem;
  font-weight: 900;
}

.win-probability strong {
  font-family: var(--number-font);
  font-size: clamp(0.96rem, 1.4vw, 1.25rem);
  font-weight: 900;
}

.wallet-balance strong,
.house-pool-card > strong {
  font-size: clamp(1.85rem, 3vw, 2.55rem);
}

.equity-mode-selector {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.5rem;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  margin: 0.8rem 0;
  padding: 0.62rem;
  background: rgba(5, 13, 9, 0.55);
}

.equity-mode-selector > div {
  display: grid;
  gap: 0.12rem;
}

.equity-mode-selector span,
.equity-mode-selector button {
  font-size: 0.62rem;
}

.equity-mode-selector strong {
  color: var(--gold-pale);
  font-size: 0.72rem;
}

.equity-mode-selector small {
  color: var(--mist);
  font-size: 0.58rem;
  line-height: 1.45;
}

.equity-mode-selector button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.38rem 0.58rem;
  color: var(--mist);
  background: transparent;
  cursor: pointer;
}

.equity-mode-selector button.active {
  border-color: var(--gold);
  color: #1b160c;
  background: var(--gold);
}

.dealer-stage {
  width: clamp(220px, 26vw, 360px);
  height: clamp(140px, 18vw, 220px);
  position: absolute;
  top: -10%;
  left: 50%;
  transform: translateX(-50%);
  perspective: 960px;
  pointer-events: none;
  z-index: 3;
}

.dealer-character {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  padding: 0;
  color: var(--paper);
  background: transparent;
  cursor: pointer;
  position: relative;
  pointer-events: auto;
  transform-style: preserve-3d;
  transition: transform 220ms ease, filter 220ms ease;
}

.dealer-character::after {
  content: "";
  height: 24%;
  border: 1px solid color-mix(in srgb, var(--theme-accent) 42%, transparent);
  border-radius: 50% 50% 12px 12px / 34% 34% 12px 12px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--theme-accent) 34%, #23180e),
      rgba(8, 12, 10, 0.96) 22%,
      rgba(3, 7, 6, 0.9)
    );
  box-shadow:
    inset 0 3px 0 rgba(255, 255, 255, 0.08),
    0 18px 30px rgba(0, 0, 0, 0.42);
  position: absolute;
  right: 7%;
  bottom: 0;
  left: 7%;
  transform: translateZ(42px) rotateX(66deg);
  transform-origin: center bottom;
  z-index: 3;
}

.dealer-aura {
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      color-mix(in srgb, var(--theme-accent) 26%, transparent),
      transparent 68%
    );
  filter: blur(4px);
  position: absolute;
  inset: 4% 14% 8%;
  transform: translateZ(-18px);
  opacity: 0.82;
  animation: dealerAura 4.6s ease-in-out infinite;
}

.dealer-character > img {
  width: 88%;
  height: 106%;
  object-fit: contain;
  object-position: center bottom;
  filter:
    drop-shadow(0 22px 18px rgba(0, 0, 0, 0.58))
    drop-shadow(0 0 14px var(--theme-glow));
  position: absolute;
  top: -10%;
  left: 6%;
  transform: translateZ(36px) scale(1.03);
  transition: transform 240ms ease, filter 240ms ease;
  z-index: 2;
}

.dealer-character > img:not([data-dealer-theme="chinese"]) {
  width: 100%;
  height: 118%;
  object-position: center top;
  top: -10%;
  left: 0;
}

.dealer-character > img[data-dealer-theme="british"] {
  -webkit-mask-image: linear-gradient(#000 0 65%, rgba(0, 0, 0, 0.86) 74%, transparent 92%);
  mask-image: linear-gradient(#000 0 65%, rgba(0, 0, 0, 0.86) 74%, transparent 92%);
}

.dealer-character > img[data-dealer-theme="ancient"] {
  -webkit-mask-image: linear-gradient(#000 0 74%, rgba(0, 0, 0, 0.9) 82%, transparent 98%);
  mask-image: linear-gradient(#000 0 74%, rgba(0, 0, 0, 0.9) 82%, transparent 98%);
}

.dealer-character > img[data-dealer-theme="stadium"] {
  -webkit-mask-image: linear-gradient(#000 0 68%, rgba(0, 0, 0, 0.88) 76%, transparent 94%);
  mask-image: linear-gradient(#000 0 68%, rgba(0, 0, 0, 0.88) 76%, transparent 94%);
}

.dealer-character > img[data-dealer-theme="battlefield"] {
  -webkit-mask-image: linear-gradient(#000 0 82%, rgba(0, 0, 0, 0.9) 90%, transparent 100%);
  mask-image: linear-gradient(#000 0 82%, rgba(0, 0, 0, 0.9) 90%, transparent 100%);
}

.dealer-character > img[data-dealer-theme="scifi"] {
  -webkit-mask-image: linear-gradient(#000 0 70%, rgba(0, 0, 0, 0.88) 79%, transparent 95%);
  mask-image: linear-gradient(#000 0 70%, rgba(0, 0, 0, 0.88) 79%, transparent 95%);
}

.dealer-character:hover,
.dealer-character:focus-visible,
.dealer-stage.tip-open .dealer-character {
  outline: 0;
  transform: translateY(-3px) rotateX(1.5deg);
}

.dealer-character:hover > img,
.dealer-character:focus-visible > img,
.dealer-stage.tip-open .dealer-character > img {
  filter:
    drop-shadow(0 26px 20px rgba(0, 0, 0, 0.62))
    drop-shadow(0 0 23px var(--theme-glow));
  transform: translateZ(48px) scale(1.055);
}

.dealer-identity {
  min-width: 72px;
  display: grid;
  justify-items: start;
  text-align: left;
  text-shadow: 0 2px 8px #000;
  position: absolute;
  bottom: 8%;
  left: 10%;
  transform: translateZ(64px);
  z-index: 5;
}

.dealer-identity strong {
  color: var(--theme-accent);
  font-family: "Ma Shan Zheng", cursive;
  font-size: clamp(1.04rem, 1.8vw, 1.62rem);
  font-weight: 400;
  line-height: 1;
}

.dealer-tip-hint {
  border: 1px solid color-mix(in srgb, var(--theme-accent) 44%, transparent);
  border-radius: 999px;
  display: flex;
  gap: 0.3rem;
  align-items: center;
  padding: 0.3rem 0.55rem;
  color: var(--gold-pale);
  background: rgba(3, 8, 7, 0.72);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
  position: absolute;
  right: 9%;
  bottom: 8%;
  transform: translateZ(66px);
  font-size: clamp(0.46rem, 0.6vw, 0.58rem);
  z-index: 5;
}

.dealer-tip-hint i {
  color: var(--theme-accent);
}

.dealer-tip-popover {
  width: min(300px, 72vw);
  border: 1px solid color-mix(in srgb, var(--theme-accent) 56%, transparent);
  border-radius: 14px;
  padding: 0.68rem;
  color: var(--paper);
  background:
    linear-gradient(145deg, rgba(4, 11, 9, 0.97), rgba(14, 24, 20, 0.94));
  backdrop-filter: blur(16px);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.58),
    0 0 24px var(--theme-glow);
  position: absolute;
  top: 24%;
  bottom: auto;
  left: calc(100% + 0.45rem);
  transform: none;
  pointer-events: auto;
  z-index: 12;
}

.dealer-tip-close {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--mist);
  background: rgba(5, 12, 10, 0.94);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.42);
  cursor: pointer;
  position: absolute;
  top: -10px;
  right: -10px;
}

.dealer-tip-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.3rem;
}

.dealer-tip-options button {
  border: 1px solid color-mix(in srgb, var(--theme-accent) 46%, transparent);
  border-radius: 9px;
  display: grid;
  justify-items: center;
  gap: 0.18rem;
  min-height: 38px;
  padding: 0.42rem 0.18rem;
  color: var(--gold-pale);
  background: rgba(8, 15, 12, 0.72);
  cursor: pointer;
  font-family: var(--number-font);
  font-size: clamp(0.7rem, 0.9vw, 0.82rem);
  font-weight: 800;
  transition: transform 160ms ease, background-color 160ms ease;
}

.dealer-tip-options button:hover:not(:disabled) {
  color: #181106;
  background: var(--theme-accent);
  transform: translateY(-2px);
}

.dealer-tip-options button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.dealer-response {
  width: max-content;
  max-width: 260px;
  border: 1px solid rgba(255, 126, 169, 0.45);
  border-radius: 999px;
  margin: 0;
  padding: 0.48rem 0.7rem;
  color: #ffe2ec;
  background: rgba(123, 23, 67, 0.94);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  font-size: 0.62rem;
  animation: dealerKiss 3.2s ease both;
  pointer-events: none;
  z-index: 14;
}

.dealer-tip-enter-active,
.dealer-tip-leave-active {
  transition: opacity 170ms ease, transform 170ms ease;
}

.dealer-tip-enter-from,
.dealer-tip-leave-to {
  opacity: 0;
  transform: translateY(8px) scale(0.96);
}

.dealer-stage.dealing .dealer-character > img {
  animation: dealerDealGesture 430ms cubic-bezier(0.2, 0.8, 0.22, 1);
}

@keyframes dealerAura {
  0%, 100% { opacity: 0.58; transform: translateZ(-18px) scale(0.96); }
  50% { opacity: 0.9; transform: translateZ(-18px) scale(1.05); }
}

@keyframes dealerDealGesture {
  0% { transform: translateZ(36px) scale(1.03) translateY(0); }
  45% { transform: translateZ(66px) scale(1.075) translateY(7px); }
  100% { transform: translateZ(36px) scale(1.03) translateY(0); }
}

@keyframes dealerKiss {
  0% { opacity: 0; transform: translate(-50%, 14px) scale(0.82); }
  12%, 80% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -8px) scale(1.05); }
}

.reaction-mute-button {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  margin-top: 0.65rem;
  padding: 0.55rem;
  color: var(--mist);
  background: rgba(5, 12, 9, 0.72);
  cursor: pointer;
}

.hand-replay-modal,
.admin-ledger-modal {
  width: min(760px, calc(100vw - 30px));
}

.replay-stage {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  text-align: center;
}

.replay-progress {
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(241, 229, 204, 0.1);
}

.replay-progress span {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-pale));
  transition: width 300ms ease;
}

.replay-board {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.replay-stage > strong {
  color: var(--gold-pale);
  font-size: 1rem;
}

.replay-stage > p {
  margin: 0;
  color: var(--mist);
  font-family: var(--number-font);
  font-weight: 700;
}

.replay-player-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
}

.replay-player-list span {
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 0.4rem 0.65rem;
  color: var(--paper);
  font-family: var(--number-font);
  font-size: 0.68rem;
}

.replay-player-list small {
  margin-left: 0.3rem;
  color: var(--danger);
}

.chip-ledger-list {
  display: grid;
  gap: 0.55rem;
  max-height: 52vh;
  overflow: auto;
}

.chip-ledger-list > p {
  margin: 0 0 0.4rem;
  color: var(--mist);
  font-size: 0.68rem;
}

.chip-ledger-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  background: rgba(5, 12, 9, 0.58);
}

.chip-ledger-row span {
  display: grid;
  gap: 0.18rem;
}

.chip-ledger-row span small,
.chip-ledger-row > small {
  color: var(--mist);
  font-size: 0.6rem;
}

.chip-ledger-row em {
  color: var(--danger);
  font-style: normal;
  font-size: 0.9rem;
}

.chip-ledger-row em.positive {
  color: var(--success);
}

.admin-reaction-settings {
  border-top: 1px solid var(--line-soft);
  margin-top: 1rem;
  padding-top: 1rem;
}

.admin-reaction-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto auto auto;
  gap: 0.55rem;
  align-items: end;
  border-bottom: 1px solid var(--line-soft);
  padding: 0.65rem 0;
}

.admin-reaction-row > span,
.admin-reaction-row label {
  display: grid;
  gap: 0.2rem;
  color: var(--mist);
  font-size: 0.6rem;
}

.admin-reaction-row input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  color: var(--paper);
  background: rgba(3, 8, 6, 0.76);
}

.admin-reaction-row button {
  min-height: 34px;
  border: 1px solid var(--gold);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  color: #1b160c;
  background: var(--gold);
  cursor: pointer;
  font-weight: 800;
}

.reaction-audit-list {
  margin-top: 0.8rem;
  color: var(--mist);
  font-size: 0.62rem;
}

.reaction-audit-list p {
  margin: 0.35rem 0;
}

.table-receipt-modal {
  width: min(92vw, 520px);
  border: 1px solid rgba(226, 183, 83, 0.46);
}

.table-receipt-modal h2 {
  margin: 0.45rem 0 1rem;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 2rem;
  font-weight: 400;
}

.receipt-settling {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  border: 1px dashed var(--line);
  color: var(--gold-pale);
  background: rgba(217, 173, 88, 0.05);
}

.receipt-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.6rem;
  color: var(--mist);
  font-size: 0.66rem;
}

.receipt-rows {
  display: grid;
  gap: 10px;
}

.receipt-rows > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.14);
}

.receipt-rows em {
  color: var(--mist);
  font-style: normal;
}

.receipt-rows strong {
  color: var(--paper);
  font-family: var(--number-font);
  font-size: 1rem;
  font-weight: 800;
}

.receipt-rows .receipt-net strong {
  color: var(--success);
}

.receipt-balance {
  color: var(--gold-pale);
  font-size: 1.2rem;
}

.receipt-balance strong {
  color: var(--gold-pale);
  font-size: 1.35rem;
}

.receipt-note {
  margin: 1rem 0 0;
  color: var(--mist);
  font-size: 0.64rem;
  line-height: 1.7;
}

.profile-modal {
  width: min(880px, 100%);
}

.profile-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 1.25rem 0;
}

.profile-tabs button,
.history-toolbar button,
.history-filter-bar button {
  min-height: 38px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 0.45rem 0.65rem;
  color: var(--mist);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.profile-tabs button.active,
.history-toolbar button.active,
.history-filter-bar button.active {
  border-color: rgba(217, 173, 88, 0.58);
  color: var(--gold-pale);
  background: rgba(217, 173, 88, 0.1);
}

.history-toolbar {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  color: var(--mist);
  font-size: 0.64rem;
}

.history-toolbar > div,
.history-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.history-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.history-stat-grid > div:nth-child(4n) {
  border-right: 0;
}

.history-session-list,
.highlight-hand-grid {
  display: grid;
  gap: 12px;
  max-height: min(58vh, 620px);
  overflow: auto;
}

.history-session-row {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  color: var(--paper);
  background: rgba(5, 12, 9, 0.58);
  cursor: pointer;
  text-align: left;
}

.history-session-row span,
.highlight-hand-card > span {
  display: grid;
  gap: 0.25rem;
}

.history-session-row small,
.highlight-hand-card small {
  color: var(--mist);
  font-size: 0.62rem;
}

.history-session-row > i {
  color: var(--gold);
  font-size: 1.1rem;
}

.history-hands-panel {
  display: grid;
  gap: 0.85rem;
}

.highlight-hand-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.highlight-hand-card {
  display: grid;
  gap: 0.7rem;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 0.9rem;
  background:
    linear-gradient(135deg, rgba(217, 173, 88, 0.075), transparent 55%),
    rgba(5, 12, 9, 0.58);
}

.highlight-hand-card > span:nth-child(2) {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.highlight-hand-card > span:nth-child(2) strong {
  color: var(--gold-pale);
  font-family: var(--number-font);
}

.highlight-hand-card > div {
  display: flex;
  gap: 0.45rem;
}

.highlight-hand-card button {
  min-height: 34px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 0.35rem 0.65rem;
  color: var(--mist);
  background: transparent;
  cursor: pointer;
}

.highlight-hand-card button.active {
  border-color: var(--gold-dark);
  color: var(--gold-pale);
}

.show-muck-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0.8rem 0;
  border: 1px solid rgba(217, 173, 88, 0.28);
  border-radius: 10px;
  padding: 0.8rem;
  background: rgba(217, 173, 88, 0.06);
}

.show-muck-choice p {
  grid-column: 1 / -1;
  margin: 0;
}

.replay-own-cards {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
}

.replay-own-cards > span {
  margin-right: 0.35rem;
  color: var(--mist);
  font-size: 0.64rem;
}

.replay-own-cards .hole-card {
  width: 44px;
}

@media (max-width: 760px) {
  .receipt-backdrop,
  .profile-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .table-receipt-modal,
  .profile-modal {
    width: 100%;
    max-width: none;
    max-height: 92dvh;
    border-radius: 24px 24px 0 0;
    overflow: auto;
  }

  .profile-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-stat-grid,
  .highlight-hand-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .history-session-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .history-session-row > span:nth-child(2) {
    grid-column: 1 / -1;
  }

  .show-muck-choice {
    margin: 12px 0;
  }

  .dealer-stage {
    width: 220px;
    height: 150px;
    top: -16%;
  }

  .dealer-character > img {
    width: 88%;
    height: 105%;
    top: -12%;
    left: 6%;
  }

  .dealer-character > img:not([data-dealer-theme="chinese"]) {
    width: 100%;
    height: 112%;
    top: -10%;
    left: 0;
  }

  .dealer-identity {
    bottom: 3%;
    left: 7%;
  }

  .dealer-tip-hint {
    right: 5%;
    bottom: 3%;
  }

  .dealer-tip-popover {
    width: 176px;
    top: 20%;
    bottom: auto;
    left: 57%;
    transform: none;
  }

  .dealer-tip-enter-from,
  .dealer-tip-leave-to {
    transform: translateY(8px) scale(0.96);
  }

  .admin-reaction-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: end;
  }

  .admin-reaction-row > span {
    grid-column: 1 / -1;
  }

  .chip-ledger-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .chip-ledger-row > small {
    grid-column: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
