:root {
  --ink: #102721;
  --muted: #64736e;
  --paper: #f5f0e5;
  --paper-deep: #ebe3d3;
  --felt: #0c4438;
  --felt-dark: #062d26;
  --jade: #16634f;
  --jade-light: #2b8369;
  --gold: #d6ae62;
  --gold-pale: #f1d79d;
  --red: #b6473e;
  --blue-team: #318f7a;
  --red-team: #c05b4f;
  --shadow: 0 22px 70px rgba(14, 40, 33, 0.2);
  --serif: "STSong", "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--paper);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 12% 10%, rgba(214, 174, 98, 0.19), transparent 27rem),
    linear-gradient(135deg, #faf7f0 0%, var(--paper) 47%, #ebe3d4 100%);
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(214, 174, 98, 0.6);
  outline-offset: 2px;
}

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

svg {
  display: block;
  width: 20px;
  fill: currentColor;
}

[hidden] {
  display: none !important;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

.ambient-one {
  width: 36rem;
  height: 36rem;
  right: -21rem;
  top: 12rem;
  border: 1px solid rgba(24, 91, 73, 0.1);
  box-shadow: inset 0 0 0 5rem rgba(24, 91, 73, 0.025), inset 0 0 0 10rem rgba(24, 91, 73, 0.025);
}

.ambient-two {
  width: 28rem;
  height: 28rem;
  left: -16rem;
  bottom: -9rem;
  border: 1px solid rgba(180, 132, 53, 0.12);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1240px, calc(100% - 56px));
  height: 92px;
  margin: 0 auto;
  position: relative;
  z-index: 20;
}

.brand,
.compact-brand {
  border: 0;
  background: none;
  cursor: pointer;
}

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

.brand-mark {
  position: relative;
  width: 42px;
  height: 52px;
  display: grid;
  place-items: center;
  color: var(--gold-pale);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 40%),
    var(--felt);
  border: 1px solid rgba(214, 174, 98, 0.5);
  border-radius: 4px 4px 13px 13px;
  box-shadow: 0 7px 18px rgba(6, 45, 38, 0.18);
  font-family: var(--serif);
  font-size: 23px;
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  margin-top: 37px;
  border: 1px solid var(--gold);
  transform: rotate(45deg);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1;
}

.brand-copy strong {
  font-family: var(--serif);
  font-size: 25px;
  letter-spacing: 0.14em;
}

.brand-copy small {
  margin-top: 7px;
  color: #7e877f;
  font-size: 9px;
  letter-spacing: 0.2em;
}

body.in-game .site-header {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.network-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  color: #456059;
  font-size: 12px;
  border: 1px solid rgba(19, 87, 69, 0.14);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.42);
}

.network-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4a9c75;
  box-shadow: 0 0 0 4px rgba(74, 156, 117, 0.12);
}

.network-pill.offline i {
  background: #ba584d;
  box-shadow: 0 0 0 4px rgba(186, 88, 77, 0.12);
}

.icon-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(16, 39, 33, 0.13);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background 180ms, transform 180ms;
}

.icon-button:hover {
  background: white;
  transform: translateY(-1px);
}

.ghost-button {
  height: 38px;
  padding: 0 17px;
  border: 1px solid rgba(16, 39, 33, 0.16);
  border-radius: 100px;
  background: transparent;
  cursor: pointer;
}

.account-button {
  max-width: 130px;
  height: 34px;
  padding: 0 13px;
  overflow: hidden;
  color: var(--jade);
  border: 1px solid rgba(22, 99, 79, 0.16);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.42);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.private-chat-entry {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 11px;
  color: #77613f;
  border: 1px solid rgba(138, 116, 78, 0.22);
  border-radius: 100px;
  background: rgba(255, 253, 248, 0.54);
  font-size: 9px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 180ms, border-color 180ms;
}

.private-chat-entry:hover {
  border-color: rgba(138, 116, 78, 0.42);
  background: rgba(255, 253, 248, 0.92);
}

.private-chat-entry svg {
  width: 14px;
}

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: screenIn 420ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.home-screen {
  width: min(1150px, calc(100% - 56px));
  min-height: calc(100vh - 124px);
  margin: 0 auto;
  padding: 36px 0 90px;
}

.home-screen.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  align-items: center;
  gap: clamp(38px, 7vw, 92px);
}

.game-hub-screen,
.account-screen {
  width: min(1150px, calc(100% - 56px));
  min-height: calc(100vh - 124px);
  margin: 0 auto;
  padding: 32px 0 90px;
}

.game-hub-screen.is-active {
  display: block;
}

.account-screen.is-active {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.game-hub-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(380px, 0.72fr);
  align-items: center;
  gap: clamp(50px, 8vw, 120px);
}

.home-screen > * {
  min-width: 0;
}

.portal-wordmark {
  display: inline-flex;
  align-items: center;
  margin-bottom: 22px;
  color: #846b40;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3em;
}

.portal-hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(54px, 6.4vw, 82px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.portal-hero h1 em {
  color: var(--jade);
  font-style: normal;
}

.portal-hero > p {
  max-width: 610px;
  margin: 26px 0 24px;
  color: #586760;
  font-size: 14px;
  line-height: 1.9;
}

.portal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.portal-actions .primary-button,
.portal-actions .secondary-button {
  width: auto;
  min-width: 150px;
  padding: 0 22px;
}

.portal-live-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 28px;
  color: #7b857f;
  font-size: 9px;
}

.portal-live-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.portal-live-meta i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4a9c75;
  box-shadow: 0 0 0 4px rgba(74, 156, 117, 0.12);
}

.portal-live-meta b {
  color: var(--jade);
}

.portal-player-card {
  position: relative;
  padding: 29px;
  overflow: hidden;
  border: 1px solid rgba(18, 56, 45, 0.13);
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(214, 174, 98, 0.16), transparent 15rem),
    rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.portal-player-card::after {
  content: "HG";
  position: absolute;
  right: 17px;
  bottom: -21px;
  color: rgba(22, 99, 79, 0.045);
  font-family: Georgia, serif;
  font-size: 94px;
  font-weight: 700;
  pointer-events: none;
}

.portal-player-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 18px 0;
}

.portal-avatar {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--gold-pale);
  border: 2px solid rgba(22, 99, 79, 0.16);
  border-radius: 50%;
  background: var(--jade);
  font-family: Georgia, serif;
  font-size: 24px;
}

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

.portal-player-head h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
}

.portal-player-head p {
  margin: 0;
  color: #8a938e;
  font-size: 9px;
}

.portal-player-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 18px;
  padding: 12px 0;
  border-top: 1px solid rgba(18, 56, 45, 0.08);
  border-bottom: 1px solid rgba(18, 56, 45, 0.08);
  color: #808a84;
  font-size: 8px;
}

.portal-player-stats span {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.portal-player-stats b {
  color: var(--jade);
  font-family: Georgia, serif;
  font-size: 18px;
  font-weight: 400;
}

.portal-player-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.portal-player-actions button {
  height: 34px;
  padding: 0 12px;
  color: var(--jade);
  border: 1px solid rgba(22, 99, 79, 0.17);
  border-radius: 100px;
  background: rgba(231, 240, 232, 0.7);
  font-size: 8px;
  cursor: pointer;
}

.portal-player-actions button:last-child {
  color: #785f34;
  border-color: rgba(138, 108, 54, 0.18);
  background: rgba(247, 237, 213, 0.72);
}

.portal-module-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.portal-module {
  min-height: 155px;
  position: relative;
  padding: 20px;
  overflow: hidden;
  color: var(--ink);
  border: 1px solid rgba(18, 56, 45, 0.1);
  border-radius: 17px;
  background: rgba(255, 253, 248, 0.68);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms, border-color 180ms, background 180ms;
}

.portal-module:hover {
  border-color: rgba(22, 99, 79, 0.24);
  background: rgba(255, 253, 248, 0.94);
  transform: translateY(-3px);
}

.portal-module.is-game {
  color: #f5ecd8;
  border-color: rgba(238, 205, 139, 0.18);
  background:
    radial-gradient(circle at 100% 0, rgba(238, 205, 139, 0.13), transparent 12rem),
    var(--felt);
}

.portal-module.is-blackjack {
  color: #f2eaff;
  border-color: rgba(203, 177, 255, 0.22);
  background:
    radial-gradient(circle at 100% 0, rgba(220, 195, 255, 0.18), transparent 12rem),
    linear-gradient(145deg, #49336f, #281c47);
}

.portal-module.is-blackjack p {
  color: rgba(242, 234, 255, 0.58);
}

.portal-module.is-blackjack small {
  color: #ddc7ff;
}

.portal-module-number {
  display: block;
  color: #a58b5e;
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: 0.12em;
}

.portal-module h3 {
  margin: 22px 0 7px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
}

.portal-module p {
  min-height: 34px;
  margin: 0;
  color: #76817b;
  font-size: 9px;
  line-height: 1.65;
}

.portal-module.is-game p {
  color: rgba(245, 236, 216, 0.52);
}

.portal-module small {
  display: block;
  margin-top: 14px;
  color: var(--jade);
  font-size: 8px;
}

.portal-module.is-game small {
  color: var(--gold-pale);
}

.subpage-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.subpage-heading h2 {
  margin: 7px 0 0;
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 600;
}

.subpage-heading .text-button {
  margin: 0;
}

.hero-kicker,
.eyebrow {
  color: #8a744e;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.hero-kicker {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 25px;
}

.hero-kicker span {
  width: 28px;
  height: 1px;
  background: var(--gold);
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(56px, 6.2vw, 84px);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.hero h1 em {
  color: var(--jade);
  font-style: normal;
}

.hero-description {
  width: min(540px, 100%);
  margin: 29px 0 25px;
  color: #55635e;
  font-size: 16px;
  line-height: 1.9;
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}

.feature-row span {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: #68736f;
  font-size: 11px;
}

.feature-row b {
  color: var(--jade);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.hero-cards {
  height: 132px;
  position: relative;
  margin: 42px 0 0 15px;
}

.display-card {
  width: 76px;
  height: 108px;
  position: absolute;
  padding: 8px;
  border-radius: 6px;
  background: #fffdf8;
  border: 1px solid rgba(16, 39, 33, 0.11);
  box-shadow: 0 12px 28px rgba(17, 50, 40, 0.15);
  font-family: Georgia, serif;
}

.display-card:nth-child(1) { left: 15px; transform: rotate(-10deg); }
.display-card:nth-child(2) { left: 75px; top: 4px; z-index: 2; color: var(--gold); background: var(--felt); border-color: var(--gold); transform: rotate(1deg); }
.display-card:nth-child(3) { left: 140px; transform: rotate(9deg); color: var(--red); }

.display-card span {
  display: block;
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}

.display-card i {
  display: block;
  margin-top: 1px;
  font-size: 17px;
  font-style: normal;
}

.display-card b {
  position: absolute;
  right: 7px;
  bottom: 7px;
  font-family: var(--serif);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.06em;
  writing-mode: vertical-rl;
}

.entry-card {
  position: relative;
  padding: 38px;
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid rgba(60, 75, 68, 0.13);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.entry-card::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(166, 135, 78, 0.11);
  border-radius: 18px;
  pointer-events: none;
}

.entry-heading {
  position: relative;
}

.entry-heading h2 {
  margin: 8px 0 8px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
}

.entry-heading p {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
}

.entry-form,
.join-form {
  position: relative;
}

.entry-form label,
.join-form label {
  display: block;
  margin: 0 0 8px;
  color: #52615b;
  font-size: 12px;
  font-weight: 600;
}

.input-wrap {
  position: relative;
}

.input-wrap span {
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
  color: #9ba39e;
  font-size: 10px;
}

input {
  width: 100%;
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  color: var(--ink);
  border: 1px solid rgba(23, 68, 55, 0.15);
  border-radius: 10px;
  background: rgba(248, 245, 237, 0.82);
  transition: border-color 180ms, box-shadow 180ms, background 180ms;
}

input::placeholder {
  color: #a5aaa7;
}

input:focus {
  border-color: rgba(25, 104, 82, 0.52);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(23, 100, 80, 0.06);
  outline: none;
}

.primary-button,
.secondary-button {
  height: 51px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 180ms, box-shadow 180ms, background 180ms;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #f8f0dc;
  border: 1px solid #0f493c;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.07), transparent 40%),
    var(--jade);
  box-shadow: 0 10px 24px rgba(14, 75, 60, 0.18);
}

.primary-button:hover {
  background-color: #1d735d;
  box-shadow: 0 14px 30px rgba(14, 75, 60, 0.24);
  transform: translateY(-1px);
}

.entry-form .primary-button {
  width: 100%;
  margin-top: 15px;
}

.visibility-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.visibility-choice label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(23, 68, 55, 0.12);
  border-radius: 9px;
  background: rgba(248, 245, 237, 0.6);
  cursor: pointer;
}

.visibility-choice label:has(input:checked) {
  border-color: rgba(22, 99, 79, 0.38);
  background: rgba(227, 239, 231, 0.85);
}

.visibility-choice input {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  padding: 0;
  accent-color: var(--jade);
}

.visibility-choice span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.visibility-choice b {
  color: #42544d;
  font-size: 10px;
}

.visibility-choice small {
  color: #929a95;
  font-size: 8px;
}

.secondary-button {
  padding: 0 20px;
  color: var(--jade);
  border: 1px solid rgba(22, 99, 79, 0.23);
  background: rgba(233, 240, 234, 0.85);
}

.secondary-button:hover {
  background: #e4eee8;
  transform: translateY(-1px);
}

.full-width {
  width: 100%;
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0;
  color: #9a9e99;
  font-size: 10px;
  white-space: nowrap;
}

.or-divider::before,
.or-divider::after {
  content: "";
  width: 100%;
  height: 1px;
  background: rgba(16, 39, 33, 0.09);
}

.join-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 9px;
  margin-bottom: 15px;
}

.join-row input {
  letter-spacing: 0.3em;
  font-size: 18px;
  font-weight: 700;
}

.join-row .secondary-button {
  height: 50px;
}

.entry-note {
  display: flex;
  align-items: center;
  gap: 9px;
  position: relative;
  margin-top: 18px;
  color: #929a95;
  font-size: 10px;
}

.online-users-card {
  grid-column: 1 / -1;
  margin-top: 25px;
  padding: 27px 31px 20px;
  border: 1px solid rgba(18, 56, 45, 0.12);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 18px 55px rgba(34, 57, 49, 0.09);
  backdrop-filter: blur(18px);
}

.profile-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  margin-top: 25px;
  padding: 27px 31px;
  border: 1px solid rgba(18, 56, 45, 0.12);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 18px 55px rgba(34, 57, 49, 0.09);
  backdrop-filter: blur(18px);
}

.profile-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.profile-avatar {
  width: 118px;
  height: 118px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--gold-pale);
  border: 2px solid rgba(22, 99, 79, 0.18);
  border-radius: 50%;
  background: var(--jade);
  box-shadow: 0 8px 24px rgba(24, 65, 53, 0.16);
  font-family: var(--serif);
  font-size: 38px;
}

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

.profile-avatar-wrap .secondary-button {
  width: 118px;
  height: 34px;
  padding: 0;
  font-size: 9px;
}

.profile-avatar-wrap .text-button {
  margin-top: 0;
}

.profile-fields {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.profile-fields h2 {
  margin: 5px 0 8px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
}

.profile-stat-line {
  display: flex;
  gap: 18px;
  margin-bottom: 18px;
  color: #7e8883;
  font-size: 10px;
}

.profile-stat-line b {
  color: var(--jade);
  font-family: Georgia, serif;
  font-size: 16px;
  font-weight: 400;
}

.profile-fields label {
  margin-bottom: 7px;
  color: #5b6862;
  font-size: 10px;
}

.profile-fields input {
  height: 44px;
}

.profile-fields .primary-button {
  width: 180px;
  height: 41px;
  margin-top: 12px;
}

.profile-message {
  min-height: 15px;
  margin: 5px 0 0;
  color: #a05249;
  font-size: 9px;
}

.leaderboard-card,
.admin-users-card {
  grid-column: 1 / -1;
  margin-top: 14px;
  padding: 25px 31px 20px;
  border: 1px solid rgba(18, 56, 45, 0.12);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 18px 55px rgba(34, 57, 49, 0.09);
  backdrop-filter: blur(18px);
}

.leaderboard-list,
.admin-user-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 330px;
  overflow-y: auto;
}

.leaderboard-row,
.admin-user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 49px;
  padding: 8px 11px;
  border: 1px solid rgba(20, 70, 56, 0.08);
  border-radius: 10px;
  background: rgba(246, 244, 236, 0.7);
  font-size: 10px;
}

.leaderboard-rank {
  width: 25px;
  color: #b08a4f;
  font-family: Georgia, serif;
  font-size: 15px;
  text-align: center;
}

.mini-avatar {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #f1dfb6;
  border-radius: 50%;
  background: var(--jade);
  font-family: var(--serif);
  font-size: 11px;
}

.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--jade);
}

.leaderboard-person,
.admin-user-person {
  min-width: 0;
  flex: 1;
}

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

.leaderboard-person small,
.admin-user-person small {
  color: #8a938e;
  font-size: 8px;
}

.leaderboard-score {
  color: var(--jade);
  font-family: Georgia, serif;
  font-size: 17px;
}

.admin-user-place {
  max-width: 160px;
  overflow: hidden;
  color: #78837d;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-region-button {
  height: 29px;
  padding: 0 8px;
  color: var(--jade);
  border: 1px solid rgba(22, 99, 79, 0.18);
  border-radius: 7px;
  background: rgba(229, 239, 231, 0.7);
  font-size: 8px;
  cursor: pointer;
}

.admin-private-chat-button {
  height: 29px;
  padding: 0 8px;
  color: #7a5e31;
  border: 1px solid rgba(138, 108, 54, 0.2);
  border-radius: 7px;
  background: rgba(248, 238, 215, 0.72);
  font-size: 8px;
  white-space: nowrap;
  cursor: pointer;
}

.admin-private-chat-button.is-member {
  color: #6b736f;
  background: rgba(235, 236, 229, 0.72);
}

.private-chat-admin-hint {
  margin: 13px 0 0;
  color: #8a938e;
  font-size: 8px;
  line-height: 1.6;
}

.public-lobby-card {
  grid-column: 1 / -1;
  margin-top: 25px;
  padding: 27px 31px 23px;
  border: 1px solid rgba(18, 56, 45, 0.12);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 18px 55px rgba(34, 57, 49, 0.09);
  backdrop-filter: blur(18px);
}

.public-room-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  max-height: 245px;
  overflow-y: auto;
}

.public-room {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 13px;
  border: 1px solid rgba(20, 70, 56, 0.09);
  border-radius: 12px;
  background: rgba(246, 244, 236, 0.72);
}

.public-room-head,
.public-room-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.public-room-head strong {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-room-code {
  color: #ad8748;
  font-family: Georgia, serif;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.public-room-meta {
  color: #7a8580;
  font-size: 9px;
}

.public-room-button {
  height: 31px;
  margin-top: 1px;
  color: #f5eddd;
  border: 0;
  border-radius: 7px;
  background: var(--jade);
  font-size: 9px;
  cursor: pointer;
}

.public-room-button:disabled {
  color: #8b928e;
  background: rgba(22, 52, 43, 0.08);
}

.room-visibility-label {
  display: inline-flex;
  margin: 7px 0 0;
  padding: 3px 7px;
  color: #31725d;
  border-radius: 100px;
  background: rgba(49, 114, 93, 0.08);
  font-size: 8px;
}

.room-visibility-label.is-private {
  color: #8b6d3d;
  background: rgba(184, 144, 65, 0.09);
}

.online-users-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.online-users-heading h2 {
  margin: 5px 0 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
}

.online-users-heading h2 b {
  color: var(--jade);
  font-family: Georgia, serif;
  font-size: 17px;
  font-weight: 400;
}

.online-user-table {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 15px;
}

.online-user-row {
  display: grid;
  grid-template-columns: 31px minmax(90px, 1fr) minmax(120px, 1.4fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 49px;
  padding: 8px 12px;
  border: 1px solid rgba(20, 70, 56, 0.08);
  border-radius: 10px;
  background: rgba(246, 244, 236, 0.7);
  font-size: 10px;
}

.online-user-row.is-offline {
  opacity: 0.62;
}

.online-user-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6b9283;
}

.online-user-row.is-online .online-user-dot,
.online-user-dot.is-online {
  background: #39a175;
  box-shadow: 0 0 0 4px rgba(57, 161, 117, 0.1);
}

.online-user-name {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-user-place {
  overflow: hidden;
  color: #727e78;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-user-status {
  color: #56806f;
  font-size: 9px;
  white-space: nowrap;
}

.online-location-note {
  margin: 14px 0 0;
  color: #919894;
  font-size: 9px;
  line-height: 1.6;
}

.friends-card {
  grid-column: 1 / -1;
  margin-top: 14px;
  padding: 25px 31px 22px;
  border: 1px solid rgba(18, 56, 45, 0.12);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 18px 55px rgba(34, 57, 49, 0.09);
  backdrop-filter: blur(18px);
}

.friend-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 14px;
}

.friend-add-form input {
  height: 41px;
  font-size: 11px;
}

.friend-add-form button,
.friend-request button {
  min-width: 110px;
  color: #f5ecd9;
  border: 1px solid var(--jade);
  border-radius: 8px;
  background: var(--jade);
  font-size: 10px;
  cursor: pointer;
}

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

.friend-requests:not(:empty) {
  margin-bottom: 13px;
}

.friend-request,
.friend-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 45px;
  padding: 8px 10px;
  border: 1px solid rgba(20, 70, 56, 0.08);
  border-radius: 10px;
  background: rgba(246, 244, 236, 0.65);
  font-size: 10px;
}

.friend-request > span,
.friend-row > span:nth-child(2) {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-request small,
.friend-row small {
  display: block;
  margin-top: 3px;
  color: #8b938e;
  font-size: 8px;
}

.friend-request button {
  min-width: 38px;
  height: 28px;
  padding: 0 8px;
}

.friend-request button.reject {
  color: #9b5c54;
  border-color: rgba(155, 92, 84, 0.22);
  background: transparent;
}

.friend-remove {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  padding: 0;
  color: #909792;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 39, 33, 0.05);
  cursor: pointer;
}

.friend-empty {
  grid-column: 1 / -1;
  margin: 5px 0;
  color: #919893;
  font-size: 9px;
}

.access-log-card {
  grid-column: 1 / -1;
  margin-top: 14px;
  padding: 25px 31px 19px;
  border: 1px solid rgba(18, 56, 45, 0.12);
  border-radius: 20px;
  background: rgba(255, 253, 248, 0.78);
  box-shadow: 0 18px 55px rgba(34, 57, 49, 0.09);
  backdrop-filter: blur(18px);
}

.access-log-list {
  max-height: 300px;
  overflow-y: auto;
  border-top: 1px solid rgba(16, 39, 33, 0.07);
}

.access-log-row {
  display: grid;
  grid-template-columns: 128px 86px minmax(90px, 0.7fr) minmax(140px, 1fr) minmax(90px, 0.7fr);
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 7px 9px;
  border-bottom: 1px solid rgba(16, 39, 33, 0.06);
  font-size: 9px;
}

.access-log-time {
  color: #7b8580;
  font-family: Georgia, serif;
  white-space: nowrap;
}

.access-log-type {
  display: inline-flex;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 100px;
  background: rgba(22, 99, 79, 0.08);
  color: #397560;
  white-space: nowrap;
}

.access-log-type.visit {
  color: #8a6e3e;
  background: rgba(186, 147, 73, 0.1);
}

.access-log-type.failed {
  color: #a35148;
  background: rgba(170, 73, 62, 0.09);
}

.access-log-person,
.access-log-place,
.access-log-device {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.access-log-place,
.access-log-device {
  color: #77827c;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #58997c;
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  50% { box-shadow: 0 0 0 5px rgba(88, 153, 124, 0); }
  0%, 100% { box-shadow: 0 0 0 0 rgba(88, 153, 124, 0.3); }
}

/* Lobby */
.lobby-screen {
  width: min(1150px, calc(100% - 56px));
  margin: 0 auto;
  padding: 46px 0 80px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: clamp(34px, 4vw, 48px);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.room-code-panel {
  text-align: right;
}

.room-code-panel small {
  display: block;
  color: #89918b;
  font-size: 10px;
  letter-spacing: 0.18em;
}

.room-code-panel button {
  display: flex;
  align-items: baseline;
  gap: 13px;
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.room-code-panel strong {
  color: var(--jade);
  font-family: Georgia, serif;
  font-size: 34px;
  font-weight: 400;
  letter-spacing: 0.12em;
}

.room-code-panel span {
  color: #a07942;
  font-size: 10px;
}

.share-address-preview {
  max-width: 360px;
  margin: 7px 0 0 auto;
  overflow: hidden;
  color: #7d8983;
  font-size: 9px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-address-preview.is-warning {
  color: #a96b49;
}

.share-address-preview.is-ready {
  color: #28765f;
}

.lobby-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(310px, 0.74fr);
  gap: 22px;
}

.lobby-table-wrap,
.lobby-sidebar {
  border-radius: 22px;
  border: 1px solid rgba(18, 56, 45, 0.12);
  background: rgba(255, 253, 248, 0.74);
  box-shadow: 0 18px 60px rgba(36, 59, 51, 0.1);
}

.lobby-table-wrap {
  padding: 30px;
}

.mini-table {
  width: min(610px, 90%);
  aspect-ratio: 1.55;
  position: relative;
  margin: 4px auto 82px;
  border: 11px solid #7f5d34;
  border-radius: 50%;
  background:
    radial-gradient(circle at 48% 40%, rgba(255, 255, 255, 0.1), transparent 44%),
    repeating-radial-gradient(circle at center, transparent 0, transparent 3px, rgba(255, 255, 255, 0.016) 4px),
    var(--felt);
  box-shadow:
    inset 0 0 0 4px #b58b55,
    inset 0 0 0 7px #5c3f24,
    0 20px 32px rgba(22, 41, 35, 0.18);
}

.mini-table::before {
  content: "";
  position: absolute;
  inset: 10%;
  border: 1px solid rgba(217, 182, 118, 0.24);
  border-radius: 50%;
}

.mini-table-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -50%);
  color: rgba(241, 215, 157, 0.65);
}

.mini-table-mark span {
  width: 55px;
  height: 55px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(241, 215, 157, 0.35);
  transform: rotate(45deg);
  font-family: var(--serif);
  font-size: 27px;
}

.mini-table-mark span::first-letter {
  transform: rotate(-45deg);
}

.mini-table-mark small {
  margin-top: 19px;
  font-size: 7px;
  letter-spacing: 0.32em;
}

.lobby-seat {
  width: 134px;
  position: absolute;
  z-index: 3;
  transform: translate(-50%, -50%);
}

.lobby-seat-top { left: 50%; top: -34px; }
.lobby-seat-bottom { left: 50%; top: calc(100% + 32px); }
.lobby-seat-left { left: -42px; top: 50%; }
.lobby-seat-right { left: calc(100% + 42px); top: 50%; }

.lobby-seat-card {
  min-height: 65px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 1px solid rgba(22, 84, 67, 0.13);
  border-radius: 13px;
  background: #fffdf8;
  box-shadow: 0 8px 22px rgba(21, 51, 42, 0.12);
}

.lobby-seat-card.is-empty {
  border-style: dashed;
  box-shadow: none;
  background: rgba(250, 247, 239, 0.78);
}

.seat-avatar {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f4e6c5;
  background: var(--jade);
  font-family: var(--serif);
  font-size: 17px;
}

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

.seat-avatar.red {
  background: #a54b43;
}

.seat-avatar.empty {
  color: var(--gold);
  background: rgba(17, 86, 68, 0.06);
  border: 1px dashed rgba(17, 86, 68, 0.22);
}

.seat-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.seat-copy strong {
  max-width: 74px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.seat-copy small {
  color: #89918b;
  font-size: 9px;
}

.seat-remove {
  width: 23px;
  height: 23px;
  margin-left: auto;
  padding: 0;
  color: #969b97;
  border: 0;
  border-radius: 50%;
  background: rgba(16, 39, 33, 0.05);
  cursor: pointer;
}

.team-legend {
  display: flex;
  justify-content: center;
  gap: 27px;
  padding-top: 13px;
  border-top: 1px solid rgba(16, 39, 33, 0.08);
  color: #7b857f;
  font-size: 10px;
}

.team-legend span {
  display: flex;
  align-items: center;
  gap: 7px;
}

.team-dot,
.team-level i {
  width: 7px;
  height: 7px;
  display: inline-block;
  border-radius: 50%;
  background: var(--blue-team);
}

.team-dot.team-b,
.team-level.team-b i {
  background: var(--red-team);
}

.lobby-sidebar {
  padding: 26px;
}

.block-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.block-title h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
}

.block-title span {
  color: #9a9f9b;
  font-size: 11px;
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 17px 0 22px;
}

.player-list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(16, 39, 33, 0.06);
  font-size: 12px;
}

.player-list-row .mini-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #52a17d;
}

.player-list-row .mini-dot.red {
  background: #c9695c;
}

.player-list-row small {
  margin-left: auto;
  color: #969c98;
  font-size: 9px;
}

.owner-panel {
  padding: 17px;
  border: 1px solid rgba(22, 99, 79, 0.1);
  border-radius: 13px;
  background: rgba(234, 240, 233, 0.55);
}

.owner-panel p {
  margin: 0 0 13px;
  color: #78827d;
  font-size: 10px;
  line-height: 1.65;
}

.owner-panel .secondary-button {
  margin-bottom: 8px;
  height: 43px;
}

.owner-panel .primary-button {
  height: 46px;
}

.guest-panel {
  padding: 22px;
  text-align: center;
}

.waiting-ring {
  width: 24px;
  height: 24px;
  margin: 0 auto 12px;
  border: 2px solid rgba(22, 99, 79, 0.15);
  border-top-color: var(--jade);
  border-radius: 50%;
  animation: rotate 1s linear infinite;
}

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

.text-button {
  display: block;
  margin: 17px auto 0;
  padding: 5px 10px;
  border: 0;
  background: transparent;
  color: #858c87;
  font-size: 11px;
  cursor: pointer;
}

.danger-text {
  color: #a85a50;
}

/* Game board */
.game-screen {
  min-height: 100vh;
  margin-top: 0;
  padding-top: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.1), transparent 43%),
    linear-gradient(180deg, #0a382f 0%, #062d26 65%, #04251f 100%);
  color: #f4ecdc;
  overflow: hidden;
}

.game-screen.is-active {
  display: flex;
  flex-direction: column;
}

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

.game-topbar {
  width: 100%;
  height: 62px;
  flex: 0 0 62px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 max(22px, env(safe-area-inset-left));
  position: relative;
  z-index: 10;
  border-bottom: 1px solid rgba(244, 236, 220, 0.09);
  background: rgba(3, 31, 26, 0.25);
}

.game-identity,
.game-top-actions,
.level-scoreboard {
  display: flex;
  align-items: center;
}

.game-identity {
  gap: 12px;
  color: rgba(244, 236, 220, 0.58);
  font-size: 10px;
}

.compact-brand {
  padding: 0;
  color: var(--gold-pale);
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.1em;
}

.topbar-separator {
  width: 1px;
  height: 15px;
  background: rgba(244, 236, 220, 0.15);
}

.game-identity b {
  color: rgba(244, 236, 220, 0.9);
  letter-spacing: 0.15em;
}

.level-scoreboard {
  gap: 18px;
}

.team-level {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(244, 236, 220, 0.65);
  font-size: 10px;
}

.team-level i {
  width: 6px;
  height: 6px;
}

.team-level b {
  min-width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  color: var(--gold-pale);
  border: 1px solid rgba(238, 205, 139, 0.18);
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 13px;
  font-weight: 400;
}

.round-label {
  padding: 0 16px;
  color: rgba(244, 236, 220, 0.45);
  border-left: 1px solid rgba(244, 236, 220, 0.09);
  border-right: 1px solid rgba(244, 236, 220, 0.09);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.round-label b {
  color: rgba(244, 236, 220, 0.82);
}

.game-top-actions {
  justify-content: flex-end;
  gap: 8px;
}

.game-top-actions .icon-button {
  color: rgba(244, 236, 220, 0.65);
  border-color: rgba(244, 236, 220, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.small-button {
  height: 32px;
  padding: 0 14px;
  color: rgba(244, 236, 220, 0.68);
  border: 1px solid rgba(244, 236, 220, 0.13);
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
  cursor: pointer;
}

.small-button.is-on {
  color: #153c31;
  background: var(--gold-pale);
  border-color: var(--gold-pale);
}

.mobile-rules {
  display: none;
}

.game-stage {
  width: min(1080px, 96vw);
  height: min(56vh, 470px);
  min-height: 330px;
  flex: 1 1 auto;
  position: relative;
  margin: 0 auto;
}

.game-table {
  position: absolute;
  left: 50%;
  top: 49%;
  width: min(680px, 68vw);
  aspect-ratio: 1.72;
  transform: translate(-50%, -50%);
  border: 10px solid #8b673c;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 45% 36%, rgba(75, 147, 121, 0.22), transparent 46%),
    repeating-radial-gradient(ellipse at center, transparent 0, transparent 4px, rgba(255, 255, 255, 0.014) 5px),
    #0e493b;
  box-shadow:
    inset 0 0 0 2px #c59a5d,
    inset 0 0 0 6px #543b22,
    inset 0 0 70px rgba(0, 0, 0, 0.25),
    0 30px 65px rgba(0, 0, 0, 0.34);
}

.game-table::after {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(235, 206, 150, 0.17);
  border-radius: 50%;
}

.table-watermark {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -50%);
  color: rgba(238, 205, 139, 0.12);
  pointer-events: none;
}

.table-watermark span {
  font-family: var(--serif);
  font-size: 78px;
  line-height: 1;
}

.table-watermark small {
  margin-top: 8px;
  font-size: 7px;
  letter-spacing: 0.5em;
}

.table-ring {
  position: absolute;
  inset: 20%;
  border: 1px solid rgba(238, 205, 139, 0.1);
  border-radius: 50%;
}

.center-play {
  min-width: 250px;
  min-height: 105px;
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.waiting-play {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(244, 236, 220, 0.46);
  font-size: 10px;
}

.waiting-play p {
  margin: 12px 0 0;
}

.turn-orbit {
  width: 28px;
  height: 28px;
  position: relative;
  border: 1px solid rgba(238, 205, 139, 0.16);
  border-radius: 50%;
  animation: rotate 5s linear infinite;
}

.turn-orbit::after {
  content: "";
  width: 5px;
  height: 5px;
  position: absolute;
  left: 1px;
  top: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.played-group {
  display: flex;
  align-items: center;
  justify-content: center;
}

.played-group .card {
  --fly-x: 0px;
  --fly-y: 95px;
  --fly-rotate: -5deg;
  animation: playCardIn 420ms cubic-bezier(0.18, 0.78, 0.24, 1) both;
  animation-delay: calc(var(--card-index) * 35ms);
}

.played-group.from-top .card {
  --fly-y: -95px;
  --fly-rotate: 5deg;
}

.played-group.from-left .card {
  --fly-x: -135px;
  --fly-y: 0px;
  --fly-rotate: 9deg;
}

.played-group.from-right .card {
  --fly-x: 135px;
  --fly-y: 0px;
  --fly-rotate: -9deg;
}

@keyframes playCardIn {
  from {
    opacity: 0;
    transform: translate(var(--fly-x), var(--fly-y)) scale(0.78) rotate(var(--fly-rotate));
  }
  to {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0);
  }
}

.played-group .card {
  width: 49px;
  height: 69px;
  margin-left: -19px;
  pointer-events: none;
}

.played-group .card:first-child {
  margin-left: 0;
}

.played-group .card .rank {
  font-size: 20px;
  font-weight: 700;
}

.played-group .card .suit {
  font-size: 18px;
}

.played-group .card .corner-bottom {
  font-size: 11px;
}

.play-label {
  position: absolute;
  top: calc(50% + 47px);
  padding: 5px 10px;
  color: var(--gold-pale);
  border: 1px solid rgba(238, 205, 139, 0.2);
  border-radius: 100px;
  background: rgba(5, 43, 35, 0.8);
  font-size: 9px;
  white-space: nowrap;
}

.player-position {
  position: absolute;
  z-index: 5;
}

.top-position {
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
}

.left-position {
  left: 1%;
  top: 52%;
  transform: translateY(-50%);
}

.right-position {
  right: 1%;
  top: 52%;
  transform: translateY(-50%);
}

.bottom-position {
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
}

.player-chip {
  min-width: 150px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  padding: 7px 10px;
  border: 1px solid rgba(244, 236, 220, 0.07);
  border-radius: 12px;
  background: rgba(4, 38, 31, 0.3);
  transition: background 180ms, border-color 180ms, box-shadow 180ms;
}

.left-position .player-chip,
.right-position .player-chip {
  min-width: 125px;
}

.top-position .player-chip,
.bottom-position .player-chip {
  flex-direction: column;
  gap: 4px;
  padding: 4px 12px;
}

.player-chip.is-turn {
  border-color: rgba(238, 205, 139, 0.39);
  background: rgba(214, 174, 98, 0.09);
  box-shadow: 0 0 0 4px rgba(214, 174, 98, 0.035);
  animation: turnBreath 1.8s ease-in-out infinite;
}

@keyframes turnBreath {
  50% {
    border-color: rgba(238, 205, 139, 0.7);
    box-shadow: 0 0 0 6px rgba(214, 174, 98, 0.08), 0 0 24px rgba(214, 174, 98, 0.12);
  }
}

.action-float {
  position: absolute;
  z-index: 18;
  left: 50%;
  top: 55%;
  padding: 8px 14px;
  color: #f3dfb3;
  border: 1px solid rgba(238, 205, 139, 0.24);
  border-radius: 100px;
  background: rgba(5, 40, 33, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  font-size: 10px;
  pointer-events: none;
  animation: passFloat 1.15s ease-out both;
}

.action-from-top { --action-x: 0px; --action-y: -120px; }
.action-from-bottom { --action-x: 0px; --action-y: 120px; }
.action-from-left { --action-x: -150px; --action-y: 0px; }
.action-from-right { --action-x: 150px; --action-y: 0px; }

@keyframes passFloat {
  0% {
    opacity: 0;
    transform: translate(calc(-50% + var(--action-x)), calc(-50% + var(--action-y))) scale(0.8);
  }
  24%, 72% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 20px)) scale(0.95);
  }
}

.finish-flash {
  width: min(390px, calc(100vw - 34px));
  position: fixed;
  z-index: 130;
  left: 50%;
  top: 46%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 28px 20px;
  color: #f8ecd1;
  border: 1px solid rgba(238, 205, 139, 0.45);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 5%, rgba(238, 205, 139, 0.16), transparent 55%),
    rgba(5, 43, 35, 0.96);
  box-shadow: 0 26px 75px rgba(0, 0, 0, 0.38), inset 0 0 0 6px rgba(238, 205, 139, 0.035);
  backdrop-filter: blur(14px);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.62);
  opacity: 0;
  animation: finishSlam 1.7s cubic-bezier(0.16, 0.82, 0.22, 1) both;
}

.finish-flash::before,
.finish-flash::after {
  content: "";
  width: 78%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(238, 205, 139, 0.54), transparent);
}

.finish-flash small {
  margin-bottom: 8px;
  color: rgba(238, 205, 139, 0.65);
  font-size: 9px;
  letter-spacing: 0.16em;
}

.finish-flash strong {
  max-width: 100%;
  overflow: hidden;
  font-family: var(--serif);
  font-size: clamp(22px, 5vw, 38px);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finish-flash span {
  margin: 6px 0 12px;
  color: var(--gold-pale);
  font-family: var(--serif);
  font-size: clamp(54px, 12vw, 86px);
  line-height: 1;
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.28);
}

.finish-flash.rival strong {
  color: #f0b5a9;
}

.finish-flash.is-leaving {
  animation: finishLeave 500ms ease-in both;
}

.emote-menu {
  width: 286px;
  position: fixed;
  z-index: 145;
  padding: 9px;
  color: #f4ecd9;
  border: 1px solid rgba(238, 205, 139, 0.2);
  border-radius: 14px;
  background: rgba(5, 36, 30, 0.97);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(14px);
  animation: chatPanelIn 160ms ease both;
}

.private-chat-backdrop {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(3, 22, 18, 0.62);
  backdrop-filter: blur(9px);
}

.private-chat-window {
  width: min(760px, calc(100vw - 32px));
  height: min(680px, calc(100dvh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #f3ead8;
  border: 1px solid rgba(238, 205, 139, 0.26);
  border-radius: 22px;
  background:
    radial-gradient(circle at 85% 5%, rgba(214, 174, 98, 0.11), transparent 18rem),
    linear-gradient(145deg, rgba(8, 49, 40, 0.99), rgba(4, 27, 23, 0.99));
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.46), inset 0 0 0 6px rgba(238, 205, 139, 0.025);
  animation: privateChatIn 220ms cubic-bezier(0.18, 0.82, 0.24, 1) both;
}

@keyframes privateChatIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.975);
  }
}

.private-chat-window > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 auto;
  padding: 23px 25px 18px;
  border-bottom: 1px solid rgba(244, 236, 220, 0.08);
}

.private-chat-window > header h2 {
  margin: 5px 0 0;
  color: #f5dfb0;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.private-chat-window > header button {
  width: 34px;
  height: 34px;
  padding: 0;
  color: rgba(244, 236, 220, 0.52);
  border: 1px solid rgba(244, 236, 220, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  font-size: 22px;
  cursor: pointer;
}

.private-chat-security {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 25px;
  color: rgba(244, 236, 220, 0.45);
  border-bottom: 1px solid rgba(244, 236, 220, 0.06);
  background: rgba(0, 0, 0, 0.08);
  font-size: 8px;
  letter-spacing: 0.04em;
}

.private-chat-security svg {
  width: 12px;
  color: var(--gold);
}

.private-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 19px 25px;
  scrollbar-color: rgba(238, 205, 139, 0.2) transparent;
}

.private-chat-message {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 14px;
}

.private-chat-message.is-self {
  flex-direction: row-reverse;
}

.private-chat-message .mini-avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border: 1px solid rgba(238, 205, 139, 0.12);
}

.private-chat-message-main {
  max-width: min(76%, 500px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.private-chat-message.is-self .private-chat-message-main {
  align-items: flex-end;
}

.private-chat-message-meta {
  color: rgba(244, 236, 220, 0.38);
  font-size: 8px;
}

.private-chat-message-text {
  padding: 9px 12px;
  color: rgba(248, 243, 232, 0.94);
  border: 1px solid rgba(244, 236, 220, 0.07);
  border-radius: 4px 12px 12px;
  background: rgba(255, 255, 255, 0.07);
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.private-chat-message.is-self .private-chat-message-text {
  color: #153d32;
  border-color: transparent;
  border-radius: 12px 4px 12px 12px;
  background: var(--gold-pale);
}

.private-chat-empty {
  margin: 30px 0;
  color: rgba(244, 236, 220, 0.32);
  font-size: 10px;
  text-align: center;
}

.private-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  padding: 14px 19px 18px;
  border-top: 1px solid rgba(244, 236, 220, 0.08);
}

.private-chat-form input {
  height: 43px;
  color: #f4ecdc;
  border-color: rgba(244, 236, 220, 0.12);
  background: rgba(255, 255, 255, 0.055);
}

.private-chat-form input::placeholder {
  color: rgba(244, 236, 220, 0.3);
}

.private-chat-form button {
  min-width: 72px;
  height: 43px;
  color: #173f34;
  border: 0;
  border-radius: 9px;
  background: var(--gold-pale);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.emote-menu header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 8px;
  color: rgba(244, 236, 220, 0.64);
  font-size: 9px;
}

.emote-menu header button {
  width: 23px;
  height: 23px;
  padding: 0;
  color: rgba(244, 236, 220, 0.5);
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.emote-options {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}

.emote-options button {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 7px 2px 6px;
  color: rgba(244, 236, 220, 0.7);
  border: 1px solid transparent;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.emote-options button:hover {
  border-color: rgba(238, 205, 139, 0.22);
  background: rgba(238, 205, 139, 0.08);
}

.emote-options span {
  font-size: 24px;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

.emote-options small {
  font-size: 7px;
}

.player-chip[data-emote-target] {
  cursor: pointer;
}

.player-chip.emote-hit {
  animation: emoteHit 460ms ease;
}

@keyframes emoteHit {
  20% { transform: translate(-5px, 2px) rotate(-1deg); }
  42% { transform: translate(5px, -1px) rotate(1deg); }
  64% { transform: translate(-3px, 0) rotate(-0.6deg); }
  82% { transform: translate(2px, 0); }
}

.emote-flyer {
  position: fixed;
  z-index: 150;
  left: 0;
  top: 0;
  font-size: 36px;
  pointer-events: none;
  filter: drop-shadow(0 7px 10px rgba(0, 0, 0, 0.3));
  will-change: transform;
}

.emote-impact {
  position: fixed;
  z-index: 151;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: emoteImpact 900ms cubic-bezier(0.15, 0.8, 0.24, 1) both;
}

.emote-impact span {
  font-size: 48px;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.3));
}

.emote-impact small {
  margin-top: 2px;
  padding: 3px 7px;
  color: #f3dfb3;
  border-radius: 100px;
  background: rgba(5, 35, 29, 0.84);
  font-size: 8px;
  white-space: nowrap;
}

@keyframes emoteImpact {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.35) rotate(-13deg); }
  24% { opacity: 1; transform: translate(-50%, -50%) scale(1.25) rotate(5deg); }
  44% { transform: translate(-50%, -50%) scale(1) rotate(0); }
  78% { opacity: 1; transform: translate(-50%, -55%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -90%) scale(0.85); }
}

@keyframes finishSlam {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.58) rotate(-4deg); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.05) rotate(1deg); }
  28%, 76% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes finishLeave {
  to { opacity: 0; transform: translate(-50%, -60%) scale(0.92); }
}


.player-chip.is-turn::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  right: 6px;
  top: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(214, 174, 98, 0.12);
}

.player-avatar {
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  position: relative;
  border: 1px solid rgba(238, 205, 139, 0.27);
  border-radius: 50%;
  color: var(--gold-pale);
  background: #124d40;
  font-family: var(--serif);
  font-size: 15px;
}

.player-avatar.rival {
  color: #f6d9d2;
  background: #7f403a;
  border-color: rgba(246, 217, 210, 0.22);
}

.player-avatar .online-dot {
  width: 7px;
  height: 7px;
  position: absolute;
  right: -1px;
  bottom: 1px;
  border: 1.5px solid #0a382f;
  border-radius: 50%;
  background: #66bc8d;
}

.player-avatar .online-dot.offline {
  background: #6d7470;
}

.player-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.top-position .player-info {
  align-items: center;
}

.player-info strong {
  max-width: 92px;
  overflow: hidden;
  color: rgba(248, 243, 231, 0.88);
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-info small {
  color: rgba(244, 236, 220, 0.4);
  font-size: 8px;
}

.opponent-cards {
  height: 38px;
  display: flex;
  align-items: center;
  position: relative;
}

.top-position .opponent-cards {
  height: 21px;
  margin-top: -1px;
}

.bottom-position .opponent-cards {
  display: none;
}

.card-back {
  width: 26px;
  height: 36px;
  margin-left: -17px;
  border: 1px solid rgba(230, 203, 147, 0.56);
  border-radius: 3px;
  background:
    linear-gradient(45deg, transparent 44%, rgba(220, 183, 112, 0.25) 45%, rgba(220, 183, 112, 0.25) 55%, transparent 56%),
    repeating-linear-gradient(45deg, #174f43 0, #174f43 2px, #0e3b32 2px, #0e3b32 4px);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
}

.top-position .card-back {
  height: 21px;
  width: 17px;
  margin-left: -12px;
  font-size: 0;
}

.card-back:first-child {
  margin-left: 0;
}

.card-count {
  min-width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  margin-left: 7px;
  color: var(--gold-pale);
  border: 1px solid rgba(238, 205, 139, 0.2);
  border-radius: 50%;
  background: rgba(5, 37, 31, 0.7);
  font-family: Georgia, serif;
  font-size: 10px;
}

.finish-rank {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 7;
  color: var(--gold-pale);
  font-family: var(--serif);
  white-space: nowrap;
  transform: translate(-50%, -50%) rotate(-7deg);
  font-size: 15px;
}

.turn-banner {
  position: absolute;
  left: 50%;
  bottom: 98px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  height: 27px;
  padding: 0 13px;
  color: rgba(244, 236, 220, 0.58);
  border: 1px solid rgba(244, 236, 220, 0.09);
  border-radius: 100px;
  background: rgba(5, 34, 28, 0.45);
  font-size: 9px;
  white-space: nowrap;
}

.turn-banner-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
}

.hand-zone {
  width: min(1180px, calc(100% - 26px));
  flex: 0 0 auto;
  margin: auto auto 0;
  padding: 0 0 max(14px, env(safe-area-inset-bottom));
  position: relative;
  z-index: 12;
}

.hand-meta {
  display: flex;
  justify-content: space-between;
  padding: 0 15px 5px;
  color: rgba(244, 236, 220, 0.42);
  font-size: 9px;
}

.hand-meta b {
  color: var(--gold-pale);
  font-weight: 500;
}

.hand-scroll {
  width: 100%;
  min-height: 106px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 19px 30px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(238, 205, 139, 0.2) transparent;
}

.hand {
  min-width: max-content;
  display: flex;
  align-items: flex-end;
  padding: 8px 33px 0;
}

.hand.is-dealing .card {
  animation: dealCardIn 430ms cubic-bezier(0.18, 0.8, 0.25, 1) both;
  animation-delay: calc(var(--deal-index) * 24ms);
}

@keyframes dealCardIn {
  from {
    opacity: 0;
    transform: translateY(90px) rotate(7deg) scale(0.82);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
  }
}

.card {
  width: 58px;
  height: 83px;
  flex: 0 0 58px;
  position: relative;
  margin-left: -27px;
  padding: 6px;
  color: #17201d;
  border: 1px solid rgba(22, 31, 27, 0.22);
  border-radius: 6px;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.8), transparent 25%),
    #fffdf8;
  box-shadow: 0 4px 9px rgba(0, 0, 0, 0.21);
  font-family: Georgia, "Times New Roman", serif;
  cursor: pointer;
  user-select: none;
  transition: transform 150ms ease, box-shadow 150ms ease, margin 150ms ease;
}

.card:first-child {
  margin-left: 0;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.29);
}

.card.is-selected {
  z-index: 5;
  margin-left: -18px;
  transform: translateY(-21px);
  box-shadow: 0 0 0 2px var(--gold), 0 12px 24px rgba(0, 0, 0, 0.35);
}

.card.is-selected + .card {
  margin-left: -18px;
}

.card.red {
  color: #b9403b;
}

.card.wild {
  background:
    radial-gradient(circle at 75% 72%, rgba(214, 174, 98, 0.25), transparent 23%),
    linear-gradient(140deg, #fffef9, #fff6dc);
  border-color: #cba65d;
}

.card .rank {
  display: block;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.card .suit {
  display: block;
  margin-top: 1px;
  font-size: 17px;
  line-height: 1;
}

.card .corner-bottom {
  position: absolute;
  right: 6px;
  bottom: 5px;
  font-size: 12px;
  transform: rotate(180deg);
}

.card .wild-badge {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  color: rgba(160, 115, 42, 0.72);
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.card .joker-star {
  position: absolute;
  left: 50%;
  top: 53%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  opacity: 0.48;
}

.play-controls {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 3px;
}

.control-button {
  height: 42px;
  border-radius: 100px;
  cursor: pointer;
}

.pass-button,
.hint-button {
  min-width: 78px;
  color: rgba(244, 236, 220, 0.69);
  border: 1px solid rgba(244, 236, 220, 0.16);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
}

.hint-button {
  min-width: 66px;
  color: #d9b874;
  border-color: rgba(214, 174, 98, 0.22);
}

.play-button {
  min-width: 145px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #173f34;
  border: 1px solid var(--gold-pale);
  background: linear-gradient(145deg, #f4dfae, #cfaa64);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  font-weight: 600;
}

.play-button small {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(17, 61, 49, 0.1);
  font-size: 9px;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 25, 21, 0.67);
  backdrop-filter: blur(8px);
  animation: fadeIn 180ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
}

.modal {
  width: min(780px, 100%);
  max-height: min(88vh, 760px);
  position: relative;
  overflow-y: auto;
  padding: 40px;
  border: 1px solid rgba(214, 174, 98, 0.24);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.35);
}

.modal-close {
  width: 34px;
  height: 34px;
  position: absolute;
  right: 22px;
  top: 20px;
  padding: 0;
  color: #7c827d;
  border: 1px solid rgba(16, 39, 33, 0.13);
  border-radius: 50%;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal h2 {
  margin: 7px 0 25px;
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
}

.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.rules-grid article {
  padding: 18px;
  border: 1px solid rgba(16, 39, 33, 0.09);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
}

.rules-grid article > b {
  color: #bfa166;
  font-family: Georgia, serif;
  font-size: 11px;
  font-weight: 400;
}

.rules-grid h3 {
  margin: 7px 0 6px;
  font-family: var(--serif);
  font-size: 17px;
}

.rules-grid p,
.rules-footnote {
  margin: 0;
  color: #67726d;
  font-size: 11px;
  line-height: 1.85;
}

.rules-footnote {
  margin-top: 19px;
  padding-top: 17px;
  border-top: 1px solid rgba(16, 39, 33, 0.08);
  color: #929893;
}

.result-modal {
  width: min(460px, 100%);
  padding: 34px 40px 27px;
  text-align: center;
}

.access-backdrop {
  background:
    radial-gradient(circle at 50% 28%, rgba(33, 113, 88, 0.38), transparent 26rem),
    rgba(3, 25, 21, 0.9);
}

.access-modal {
  width: min(400px, 100%);
  padding: 38px 36px 29px;
  text-align: center;
}

.access-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
  color: var(--gold-pale);
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--felt);
  box-shadow: 0 0 0 7px rgba(22, 99, 79, 0.07);
  font-family: var(--serif);
  font-size: 27px;
}

.access-modal h2 {
  margin-bottom: 8px;
}

.access-modal > p {
  margin: 0 0 23px;
  color: #727c77;
  font-size: 11px;
  line-height: 1.7;
}

.access-modal form {
  text-align: left;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 20px;
  padding: 3px;
  border: 1px solid rgba(16, 39, 33, 0.09);
  border-radius: 10px;
  background: rgba(230, 233, 226, 0.68);
}

.auth-tabs button {
  height: 35px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #7d8781;
  font-size: 11px;
  cursor: pointer;
}

.auth-tabs button.is-active {
  color: var(--jade);
  background: #fffdf8;
  box-shadow: 0 3px 10px rgba(21, 49, 41, 0.08);
  font-weight: 600;
}

.access-modal label {
  display: block;
  margin-bottom: 8px;
  color: #55615c;
  font-size: 11px;
  font-weight: 600;
}

.access-modal input + label {
  margin-top: 13px;
}

.access-modal .primary-button {
  margin-top: 13px;
}

.access-modal small {
  display: block;
  margin-top: 16px;
  color: #9a9f9c;
  font-size: 9px;
}

.access-error {
  min-height: 16px;
  margin: 6px 0 -5px;
  color: #ad5148;
  font-size: 10px;
}

.result-emblem {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 15px;
  color: var(--gold-pale);
  border: 1px solid var(--gold);
  background: var(--jade);
  transform: rotate(45deg);
  font-family: var(--serif);
  font-size: 25px;
}

.result-emblem::first-letter {
  transform: rotate(-45deg);
}

.result-modal h2 {
  margin-bottom: 6px;
  font-size: 36px;
}

.result-modal > p {
  margin: 0 0 20px;
  color: #78817c;
  font-size: 12px;
}

.finish-order {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin: 19px 0;
}

.finish-person {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 58px;
}

.finish-person span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #f1e9d8;
  border-radius: 50%;
  background: var(--jade);
  font-family: var(--serif);
  font-size: 13px;
}

.finish-person.rival span {
  background: var(--red-team);
}

.finish-person small {
  max-width: 60px;
  overflow: hidden;
  color: #717b76;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finish-person b {
  color: #a98b53;
  font-family: Georgia, serif;
  font-size: 9px;
  font-weight: 400;
}

.level-upgrade {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 17px;
  border: 1px solid rgba(22, 99, 79, 0.11);
  border-radius: 10px;
  background: rgba(231, 239, 232, 0.6);
  font-size: 11px;
}

.level-upgrade strong {
  color: var(--jade);
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 400;
}

.result-ready-row {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin: 17px 0 11px;
  color: #8d958f;
  font-size: 9px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 105px;
  z-index: 200;
  max-width: min(420px, calc(100% - 30px));
  padding: 11px 17px;
  color: #f8f1e1;
  border: 1px solid rgba(238, 205, 139, 0.17);
  border-radius: 10px;
  background: rgba(5, 35, 29, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  font-size: 11px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 180ms, transform 180ms;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.reconnect-bar {
  position: fixed;
  left: 50%;
  top: 20px;
  z-index: 250;
  padding: 9px 15px;
  color: #f4e6c6;
  border: 1px solid rgba(214, 174, 98, 0.3);
  border-radius: 100px;
  background: rgba(94, 53, 36, 0.95);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -15px);
  transition: 180ms;
}

.reconnect-bar.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.chat-widget {
  width: 138px;
  position: fixed;
  right: 16px;
  bottom: 24px;
  z-index: 80;
  font-family: var(--sans);
}

body.in-game .chat-widget {
  top: 74px;
  bottom: auto;
}

.chat-toggle {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 0 11px;
  color: rgba(244, 236, 220, 0.78);
  border: 1px solid rgba(238, 205, 139, 0.2);
  border-radius: 100px;
  background: rgba(5, 38, 31, 0.88);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.16);
  font-size: 9px;
  cursor: pointer;
}

.chat-toggle svg {
  width: 15px;
}

.chat-toggle b {
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  color: #173f34;
  border-radius: 100px;
  background: var(--gold-pale);
  font-size: 8px;
}

.chat-panel {
  width: min(390px, calc(100vw - 24px));
  height: min(430px, calc(100dvh - 125px));
  display: flex;
  flex-direction: column;
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  margin-top: 0;
  overflow: hidden;
  color: #f2eadb;
  border: 1px solid rgba(238, 205, 139, 0.17);
  border-radius: 14px;
  background: rgba(5, 36, 30, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  transform-origin: top right;
  animation: chatPanelIn 180ms cubic-bezier(0.2, 0.8, 0.25, 1);
}

body.is-home .chat-widget.is-open {
  width: min(880px, calc(50vw - 32px));
  left: max(24px, calc(50% - 575px));
  right: auto;
  top: 145px;
  bottom: auto;
}

body.is-home .chat-widget.is-open .chat-toggle {
  display: none;
}

body.is-home .chat-widget.is-open .chat-panel {
  width: 100%;
  height: min(540px, calc(100dvh - 220px));
  position: relative;
  right: auto;
  top: auto;
}

@keyframes chatPanelIn {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.97);
  }
}

.chat-panel header {
  height: 37px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 37px;
  padding: 0 11px 0 13px;
  border-bottom: 1px solid rgba(244, 236, 220, 0.08);
  color: rgba(244, 236, 220, 0.76);
  font-size: 10px;
}

.chat-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
}

.chat-panel .chat-tabs button {
  width: auto;
  min-width: 43px;
  height: 25px;
  padding: 0 9px;
  color: rgba(244, 236, 220, 0.42);
  border: 0;
  border-radius: 100px;
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}

.chat-panel .chat-tabs button.is-active {
  color: var(--gold-pale);
  background: rgba(238, 205, 139, 0.1);
}

.chat-panel .chat-tabs button:disabled {
  opacity: 0.28;
}

.chat-panel header button {
  width: 25px;
  height: 25px;
  padding: 0;
  color: rgba(244, 236, 220, 0.5);
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: rgba(238, 205, 139, 0.18) transparent;
}

.chat-empty {
  margin: 18px 0;
  color: rgba(244, 236, 220, 0.32);
  font-size: 9px;
  text-align: center;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  margin-bottom: 9px;
  font-size: 9px;
}

.chat-message.is-self {
  flex-direction: row-reverse;
}

.chat-message-meta {
  color: rgba(244, 236, 220, 0.37);
  font-size: 7px;
}

.chat-message-main {
  max-width: 88%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.chat-message.is-self .chat-message-main {
  align-items: flex-end;
}

.chat-message .mini-avatar {
  width: 27px;
  height: 27px;
  flex-basis: 27px;
  margin-top: 1px;
  font-size: 9px;
}

.chat-message-text {
  max-width: 100%;
  padding: 7px 9px;
  border-radius: 4px 10px 10px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 243, 232, 0.9);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.chat-message.is-self .chat-message-text {
  color: #163e33;
  border-radius: 10px 4px 10px 10px;
  background: var(--gold-pale);
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  padding: 9px;
  border-top: 1px solid rgba(244, 236, 220, 0.08);
}

.chat-room-share {
  align-self: center;
  margin-bottom: 7px;
  padding: 4px 9px;
  color: rgba(238, 205, 139, 0.72);
  border: 1px solid rgba(238, 205, 139, 0.16);
  border-radius: 100px;
  background: transparent;
  font-size: 8px;
  cursor: pointer;
}

.chat-friends-view {
  flex: 1;
  min-height: 0;
  padding: 9px;
}

.chat-friend-directory,
.chat-friend-conversation {
  height: 100%;
  min-height: 0;
}

.chat-friend-add {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  margin-bottom: 8px;
}

.chat-friend-add input {
  height: 31px;
  padding: 0 8px;
  color: #f5eddd;
  border-color: rgba(244, 236, 220, 0.11);
  background: rgba(255, 255, 255, 0.06);
  font-size: 9px;
}

.chat-friend-add button {
  padding: 0 9px;
  color: #173f34;
  border: 0;
  border-radius: 7px;
  background: var(--gold-pale);
  font-size: 8px;
  cursor: pointer;
}

.chat-friend-scroll {
  height: calc(100% - 39px);
  overflow-y: auto;
}

.chat-friends-view .friend-request,
.chat-friends-view .friend-row {
  min-height: 39px;
  margin-bottom: 5px;
  padding: 6px 7px;
  color: #f2eadb;
  border-color: rgba(244, 236, 220, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.chat-friends-view .friend-request small,
.chat-friends-view .friend-row small {
  color: rgba(244, 236, 220, 0.37);
}

.chat-friends-view .friend-remove {
  color: rgba(244, 236, 220, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.friend-chat-open {
  height: 25px;
  flex: 0 0 auto;
  padding: 0 7px;
  color: var(--gold-pale);
  border: 1px solid rgba(238, 205, 139, 0.2);
  border-radius: 100px;
  background: rgba(238, 205, 139, 0.06);
  font-size: 7px;
  cursor: pointer;
}

.chat-friends-view .friend-row {
  gap: 5px;
}

.chat-friend-conversation {
  display: flex;
  flex-direction: column;
}

.chat-friend-conversation > header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex: 0 0 42px;
  padding: 0 3px 7px;
  color: #f5eddd;
  border-bottom: 1px solid rgba(244, 236, 220, 0.08);
}

.chat-friend-conversation > header > button {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  color: var(--gold-pale);
  border: 0;
  background: transparent;
  font-size: 25px;
  cursor: pointer;
}

.chat-friend-conversation > header > span:last-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.chat-friend-conversation > header strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-friend-conversation > header small {
  margin-top: 2px;
  color: rgba(244, 236, 220, 0.35);
  font-size: 7px;
}

.friend-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 2px 4px;
}

.friend-chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px;
  flex: 0 0 auto;
  padding-top: 7px;
  border-top: 1px solid rgba(244, 236, 220, 0.08);
}

.friend-chat-form input {
  height: 31px;
  padding: 0 8px;
  color: #f5eddd;
  border-color: rgba(244, 236, 220, 0.11);
  background: rgba(255, 255, 255, 0.06);
  font-size: 9px;
}

.friend-chat-form button {
  padding: 0 9px;
  color: #173f34;
  border: 0;
  border-radius: 7px;
  background: var(--gold-pale);
  font-size: 8px;
  cursor: pointer;
}

.friend-message-popup {
  width: min(390px, calc(100vw - 28px));
  position: fixed;
  z-index: 160;
  right: 16px;
  bottom: 72px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 13px 13px 15px;
  color: #f5ecdc;
  border: 1px solid rgba(238, 205, 139, 0.25);
  border-radius: 15px;
  background:
    radial-gradient(circle at 100% 0, rgba(227, 197, 132, 0.12), transparent 11rem),
    rgba(7, 42, 34, 0.97);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(16px);
  animation: friendMessagePopupIn 320ms cubic-bezier(0.16, 0.84, 0.26, 1) both;
}

.friend-message-popup .mini-avatar {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  font-size: 12px;
}

.friend-message-popup-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.friend-message-popup-copy small {
  color: rgba(238, 205, 139, 0.68);
  font-size: 7px;
  letter-spacing: 0.12em;
}

.friend-message-popup-copy strong {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-message-popup-copy > span {
  overflow: hidden;
  color: rgba(245, 236, 220, 0.62);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-message-popup-copy em {
  color: rgba(245, 236, 220, 0.38);
  font-size: 7px;
  font-style: normal;
}

.friend-message-popup-close {
  width: 23px;
  height: 23px;
  position: absolute;
  right: 7px;
  top: 5px;
  padding: 0;
  color: rgba(245, 236, 220, 0.42);
  border: 0;
  background: transparent;
  font-size: 15px;
  cursor: pointer;
}

.friend-message-popup-open {
  height: 31px;
  padding: 0 11px;
  color: #173f34;
  border: 0;
  border-radius: 8px;
  background: var(--gold-pale);
  font-size: 8px;
  font-weight: 700;
  cursor: pointer;
}

@keyframes friendMessagePopupIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-public-room {
  min-width: 180px;
  margin-top: 4px;
  padding: 7px 9px;
  color: var(--gold-pale);
  border: 1px solid rgba(238, 205, 139, 0.2);
  border-radius: 8px;
  background: rgba(238, 205, 139, 0.08);
  font-size: 9px;
  text-align: left;
  cursor: pointer;
}

.chat-form input {
  height: 33px;
  padding: 0 10px;
  color: #f5eddd;
  border-color: rgba(244, 236, 220, 0.11);
  background: rgba(255, 255, 255, 0.06);
  font-size: 9px;
}

.chat-form input::placeholder {
  color: rgba(244, 236, 220, 0.3);
}

.chat-form button {
  padding: 0 11px;
  color: #173f34;
  border: 0;
  border-radius: 8px;
  background: var(--gold-pale);
  font-size: 9px;
  cursor: pointer;
}

.blackjack-screen {
  --bj-ink: #241b3a;
  --bj-purple: #5b438e;
  --bj-deep: #2f214f;
  --bj-pale: #e8dcff;
  --bj-gold: #e3c584;
  width: min(1150px, calc(100% - 56px));
  min-height: calc(100vh - 124px);
  margin: 0 auto;
  padding: 32px 0 90px;
}

.blackjack-heading .eyebrow {
  color: #8269ad;
}

.blackjack-heading h2 {
  color: var(--bj-deep);
}

.blackjack-lobby-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(350px, 0.75fr);
  align-items: center;
  gap: clamp(42px, 7vw, 90px);
}

.blackjack-hero-card {
  min-height: 460px;
  position: relative;
  overflow: hidden;
  padding: 45px 48px;
  color: #f4ecff;
  border: 1px solid rgba(221, 202, 255, 0.2);
  border-radius: 30px;
  background:
    radial-gradient(circle at 100% 0, rgba(227, 197, 132, 0.14), transparent 21rem),
    linear-gradient(145deg, #513a7d, #261a43);
  box-shadow: 0 28px 75px rgba(44, 27, 82, 0.28);
}

.blackjack-hero-card::after {
  content: "21";
  position: absolute;
  right: -14px;
  bottom: -67px;
  color: rgba(255, 255, 255, 0.045);
  font-family: Georgia, serif;
  font-size: 238px;
  line-height: 1;
}

.blackjack-suit-mark {
  position: absolute;
  right: 37px;
  top: 30px;
  color: rgba(227, 197, 132, 0.32);
  font-family: Georgia, serif;
  font-size: 46px;
}

.blackjack-hero-card .eyebrow {
  color: #d5bcef;
}

.blackjack-hero-card h1 {
  position: relative;
  margin: 36px 0 23px;
  font-family: var(--serif);
  font-size: clamp(48px, 6vw, 77px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.blackjack-hero-card h1 em {
  color: #e4cc95;
  font-style: normal;
}

.blackjack-hero-card > p {
  max-width: 590px;
  position: relative;
  margin: 0;
  color: rgba(245, 238, 255, 0.66);
  font-size: 12px;
  line-height: 1.9;
}

.blackjack-rule-strip {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  position: relative;
  margin-top: 31px;
  padding-top: 22px;
  border-top: 1px solid rgba(245, 238, 255, 0.1);
  color: rgba(245, 238, 255, 0.55);
  font-size: 8px;
}

.blackjack-rule-strip b {
  margin-right: 5px;
  color: #e4cc95;
  font-family: Georgia, serif;
  font-size: 14px;
}

.blackjack-entry-card {
  padding: 33px;
  border: 1px solid rgba(84, 59, 129, 0.16);
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 22px 62px rgba(58, 38, 95, 0.14);
  backdrop-filter: blur(18px);
}

.blackjack-entry-card .eyebrow {
  color: #8067a8;
}

.blackjack-entry-card h2 {
  margin: 9px 0 23px;
  color: var(--bj-deep);
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
}

.blackjack-visibility {
  margin: 0 0 14px;
}

.blackjack-primary-button {
  width: 100%;
  height: 49px;
  color: #fff8e8;
  border: 1px solid #44316f;
  border-radius: 10px;
  background: linear-gradient(135deg, #674ca0, #402c6c);
  box-shadow: 0 11px 26px rgba(58, 38, 95, 0.2);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.blackjack-entry-card label {
  display: block;
  margin-bottom: 7px;
  color: #5b5267;
  font-size: 9px;
}

.blackjack-join-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 7px;
}

.blackjack-join-row input {
  font-family: Georgia, serif;
  font-size: 19px;
  letter-spacing: 0.25em;
}

.blackjack-join-row .secondary-button {
  height: 50px;
  padding: 0;
  color: var(--bj-deep);
  border-color: rgba(84, 59, 129, 0.2);
  background: rgba(235, 226, 250, 0.72);
}

.blackjack-tables-card {
  margin-top: 29px;
  padding: 26px 30px 22px;
  border: 1px solid rgba(84, 59, 129, 0.14);
  border-radius: 21px;
  background: rgba(255, 253, 248, 0.76);
  box-shadow: 0 18px 55px rgba(58, 38, 95, 0.1);
}

.blackjack-leaderboard-card {
  margin-top: 13px;
  padding: 24px 30px 20px;
  border: 1px solid rgba(84, 59, 129, 0.13);
  border-radius: 21px;
  background:
    linear-gradient(135deg, rgba(245, 238, 255, 0.8), rgba(255, 253, 248, 0.76));
  box-shadow: 0 18px 55px rgba(58, 38, 95, 0.08);
}

.blackjack-leaderboard-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
}

.blackjack-leaderboard-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 47px;
  padding: 8px 11px;
  border: 1px solid rgba(84, 59, 129, 0.09);
  border-radius: 11px;
  background: rgba(248, 244, 255, 0.75);
}

.blackjack-leaderboard-rank {
  width: 23px;
  color: #8060b1;
  font-family: Georgia, serif;
  font-size: 14px;
  text-align: center;
}

.blackjack-leaderboard-person {
  min-width: 0;
  flex: 1;
}

.blackjack-leaderboard-person strong,
.blackjack-leaderboard-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blackjack-leaderboard-person strong {
  font-size: 10px;
}

.blackjack-leaderboard-person small {
  margin-top: 3px;
  color: #8d849a;
  font-size: 8px;
}

.blackjack-leaderboard-points {
  color: #5c3d8e;
  font-family: Georgia, serif;
  font-size: 17px;
}

.blackjack-table-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  max-height: 310px;
  overflow-y: auto;
}

.blackjack-table-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(84, 59, 129, 0.1);
  border-radius: 12px;
  background: rgba(246, 241, 251, 0.7);
}

.blackjack-table-row > span {
  min-width: 0;
  flex: 1;
}

.blackjack-table-row strong,
.blackjack-table-row small {
  display: block;
}

.blackjack-table-row small {
  margin-top: 3px;
  color: #8b8297;
  font-size: 8px;
}

.blackjack-table-code {
  color: #6a4d99;
  font-family: Georgia, serif;
  font-size: 14px;
}

.blackjack-table-row button {
  height: 31px;
  padding: 0 10px;
  color: #f8f0ff;
  border: 0;
  border-radius: 8px;
  background: #644a96;
  font-size: 8px;
  cursor: pointer;
}

.blackjack-table-screen {
  min-height: 100dvh;
  color: #f4ecff;
  background:
    radial-gradient(circle at 18% 8%, rgba(162, 126, 224, 0.16), transparent 28rem),
    radial-gradient(circle at 88% 80%, rgba(227, 197, 132, 0.1), transparent 24rem),
    linear-gradient(145deg, #211636, #100c1c 72%);
}

body.in-blackjack .site-header {
  display: none;
}

.blackjack-topbar {
  height: 64px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(226, 207, 255, 0.09);
  background: rgba(16, 11, 28, 0.8);
}

.blackjack-identity,
.blackjack-top-metrics,
.blackjack-top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.blackjack-identity .compact-brand {
  color: #eadcff;
  font-family: var(--serif);
  font-size: 19px;
}

.blackjack-identity > span,
.blackjack-top-metrics {
  color: rgba(242, 233, 255, 0.54);
  font-size: 9px;
}

.blackjack-identity b,
.blackjack-top-metrics b {
  color: #ebd69f;
  font-family: Georgia, serif;
  font-size: 14px;
}

.blackjack-top-actions {
  justify-content: flex-end;
}

.blackjack-top-actions button {
  height: 31px;
  padding: 0 11px;
  color: rgba(245, 236, 255, 0.72);
  border: 1px solid rgba(226, 207, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 8px;
  cursor: pointer;
}

.blackjack-stage {
  min-height: calc(100dvh - 255px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.blackjack-table-surface {
  width: min(980px, calc(100vw - 40px));
  height: min(510px, calc(100dvh - 300px));
  min-height: 390px;
  position: relative;
  border: 9px solid rgba(225, 205, 255, 0.08);
  border-radius: 48%;
  background:
    radial-gradient(ellipse at center, rgba(96, 68, 151, 0.34), transparent 60%),
    linear-gradient(145deg, #382657, #201638);
  box-shadow: 0 35px 100px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(231, 209, 255, 0.13);
}

.blackjack-dealer-mark {
  width: 112px;
  height: 112px;
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #e8d8ff;
  border: 1px solid rgba(227, 197, 132, 0.25);
  border-radius: 50%;
  background: rgba(32, 20, 54, 0.9);
  box-shadow: 0 0 0 13px rgba(226, 207, 255, 0.025);
  transform: translate(-50%, -50%);
}

.blackjack-dealer-mark span {
  color: #e4cc95;
  font-size: 24px;
}

.blackjack-dealer-mark strong {
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 13px;
}

.blackjack-dealer-mark small {
  margin-top: 3px;
  color: rgba(232, 216, 255, 0.4);
  font-size: 7px;
}

.blackjack-seat {
  width: 165px;
  min-height: 98px;
  position: absolute;
  padding: 10px;
  border: 1px solid rgba(226, 207, 255, 0.11);
  border-radius: 14px;
  background: rgba(25, 16, 43, 0.88);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  transform: translate(-50%, -50%);
}

.blackjack-seat.is-turn {
  border-color: rgba(227, 197, 132, 0.55);
  box-shadow: 0 0 0 3px rgba(227, 197, 132, 0.08), 0 15px 35px rgba(0, 0, 0, 0.26);
}

.blackjack-seat.is-winner {
  border-color: rgba(227, 197, 132, 0.72);
  animation: blackjackWinnerGlow 1.6s ease-in-out infinite;
}

.blackjack-seat.is-turn {
  animation: blackjackTurnPulse 1.4s ease-in-out infinite;
}

.blackjack-seat.just-busted {
  animation: blackjackBustShake 520ms ease both;
}

.blackjack-seat.is-empty {
  opacity: 0.42;
}

.blackjack-seat-head {
  display: flex;
  align-items: center;
  gap: 7px;
}

.blackjack-seat-head .mini-avatar {
  width: 27px;
  height: 27px;
  flex-basis: 27px;
  font-size: 9px;
}

.blackjack-seat-name {
  min-width: 0;
  flex: 1;
}

.blackjack-seat-name strong,
.blackjack-seat-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blackjack-seat-name strong {
  font-size: 9px;
}

.blackjack-seat-name small {
  margin-top: 2px;
  color: rgba(238, 227, 255, 0.4);
  font-size: 7px;
}

.blackjack-seat-score {
  color: #e6ce96;
  font-family: Georgia, serif;
  font-size: 20px;
}

.blackjack-cards {
  display: flex;
  min-height: 49px;
  align-items: flex-end;
  margin-top: 7px;
  padding-left: 9px;
}

.blackjack-card {
  width: 35px;
  height: 49px;
  position: relative;
  margin-left: -9px;
  padding: 4px;
  overflow: hidden;
  color: #1d1727;
  border-radius: 5px;
  background: #fffdf7;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
  font-family: Georgia, serif;
  font-weight: 700;
}

.blackjack-card.red {
  color: #b54343;
}

.blackjack-card b,
.blackjack-card i {
  display: block;
  font-style: normal;
  line-height: 1;
}

.blackjack-card b {
  font-size: 11px;
}

.blackjack-card i {
  margin-top: 1px;
  font-size: 9px;
}

.blackjack-card em {
  position: absolute;
  right: 3px;
  bottom: 3px;
  font-size: 12px;
  font-style: normal;
}

.blackjack-card.hidden {
  color: transparent;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.07) 0 3px, transparent 3px 7px),
    linear-gradient(145deg, #5e438e, #2e204a);
  border: 1px solid rgba(232, 216, 255, 0.18);
}

.blackjack-card.hidden::after {
  content: "♠";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(238, 220, 255, 0.28);
  font-size: 15px;
}

.blackjack-card.is-entering {
  animation: blackjackCardIn 480ms cubic-bezier(0.16, 0.84, 0.26, 1) both;
  animation-delay: calc(var(--blackjack-card-order, 0) * 80ms);
}

.blackjack-card.is-revealed {
  animation: blackjackCardReveal 620ms cubic-bezier(0.16, 0.84, 0.26, 1) both;
}

.blackjack-seat-badges {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 5px;
  color: rgba(238, 227, 255, 0.43);
  font-size: 7px;
}

.blackjack-seat-badges b {
  color: #e6ce96;
}

.blackjack-message {
  margin-top: 14px;
  color: rgba(239, 228, 255, 0.62);
  font-size: 10px;
  text-align: center;
}

.blackjack-table-surface.is-dealing {
  animation: blackjackTableDeal 820ms ease-out both;
}

.blackjack-table-surface.is-dealing::after {
  content: "";
  position: absolute;
  inset: 14%;
  border: 1px solid rgba(232, 214, 255, 0.42);
  border-radius: 45%;
  animation: blackjackDealRing 820ms ease-out both;
  pointer-events: none;
}

.blackjack-pot-bump,
#blackjackPot.is-bumping {
  animation: blackjackPotBump 520ms cubic-bezier(0.16, 0.84, 0.26, 1) both;
}

.blackjack-result-panel.is-revealing {
  animation: blackjackResultReveal 680ms cubic-bezier(0.16, 0.84, 0.26, 1) both;
}

.blackjack-particle {
  position: absolute;
  z-index: 25;
  left: 50%;
  top: 44%;
  color: #efd493;
  font-family: Georgia, serif;
  font-size: 17px;
  pointer-events: none;
  will-change: transform, opacity;
  animation: blackjackParticleFly 850ms cubic-bezier(0.12, 0.76, 0.2, 1) both;
}

.blackjack-particle.win {
  color: #e6c8ff;
  font-size: 14px;
}

@keyframes blackjackCardIn {
  from {
    opacity: 0;
    transform: translateY(-48px) rotate(-9deg) scale(0.62);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
  }
}

@keyframes blackjackCardReveal {
  from {
    opacity: 0.25;
    transform: rotateY(90deg) translateX(16px);
  }
  to {
    opacity: 1;
    transform: rotateY(0) translateX(0);
  }
}

@keyframes blackjackTurnPulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(227, 197, 132, 0.08), 0 15px 35px rgba(0, 0, 0, 0.26);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(227, 197, 132, 0.18), 0 18px 42px rgba(0, 0, 0, 0.3);
  }
}

@keyframes blackjackWinnerGlow {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(227, 197, 132, 0.12), 0 14px 35px rgba(0, 0, 0, 0.24);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(227, 197, 132, 0.2), 0 18px 44px rgba(0, 0, 0, 0.32);
  }
}

@keyframes blackjackBustShake {
  0%, 100% { transform: translate(-50%, -50%) rotate(0); }
  18% { transform: translate(calc(-50% - 7px), -50%) rotate(-2deg); }
  36% { transform: translate(calc(-50% + 7px), -50%) rotate(2deg); }
  54% { transform: translate(calc(-50% - 4px), -50%) rotate(-1deg); }
  72% { transform: translate(calc(-50% + 3px), -50%) rotate(1deg); }
}

@keyframes blackjackTableDeal {
  0% { box-shadow: 0 35px 100px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(231, 209, 255, 0.13); }
  40% { box-shadow: 0 35px 100px rgba(0, 0, 0, 0.38), inset 0 0 55px rgba(227, 197, 132, 0.15); }
  100% { box-shadow: 0 35px 100px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(231, 209, 255, 0.13); }
}

@keyframes blackjackDealRing {
  from { opacity: 0.75; transform: scale(0.72); }
  to { opacity: 0; transform: scale(1.16); }
}

@keyframes blackjackPotBump {
  0%, 100% { transform: scale(1); color: #ebd69f; }
  35% { transform: scale(1.34); color: #fff1bd; }
}

@keyframes blackjackResultReveal {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes blackjackParticleFly {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--particle-x)), calc(-50% + var(--particle-y))) scale(1.15) rotate(24deg); }
}

.blackjack-seat.pos-left { left: 8%; top: 50%; }
.blackjack-seat.pos-right { left: 92%; top: 50%; }
.blackjack-seat.pos-top { left: 50%; top: 10%; }
.blackjack-seat.pos-bottom { left: 50%; top: 90%; }
.blackjack-seat.pos-top-left { left: 22%; top: 16%; }
.blackjack-seat.pos-top-right { left: 78%; top: 16%; }
.blackjack-seat.pos-bottom-left { left: 22%; top: 84%; }
.blackjack-seat.pos-bottom-right { left: 78%; top: 84%; }

.blackjack-control-panel {
  min-height: 155px;
  padding: 16px 22px 20px;
  border-top: 1px solid rgba(226, 207, 255, 0.09);
  background: rgba(14, 9, 25, 0.72);
}

.blackjack-my-metrics {
  display: flex;
  justify-content: center;
  gap: 28px;
  color: rgba(239, 228, 255, 0.5);
  font-size: 8px;
}

.blackjack-my-metrics b {
  margin-left: 5px;
  color: #ebd69f;
  font-family: Georgia, serif;
  font-size: 16px;
}

.blackjack-action-buttons {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 13px;
}

.blackjack-action-buttons button {
  min-width: 118px;
  height: 45px;
  padding: 0 17px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.blackjack-action-buttons button small {
  display: block;
  margin-top: 2px;
  opacity: 0.6;
  font-size: 7px;
  font-weight: 400;
}

.blackjack-hit-button,
.blackjack-start-button,
.blackjack-next-button {
  color: #211734;
  border: 1px solid #e3c584;
  background: #e7cf98;
}

.blackjack-add-ai-button {
  color: #eadcff;
  border: 1px solid rgba(194, 166, 239, 0.25);
  background: rgba(124, 91, 178, 0.22);
}

.blackjack-stand-button {
  color: #efe4ff;
  border: 1px solid rgba(226, 207, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
}

.blackjack-waiting-copy {
  align-self: center;
  color: rgba(239, 228, 255, 0.4);
  font-size: 9px;
}

.blackjack-result-panel {
  max-width: 720px;
  margin: 14px auto 0;
  padding: 11px 14px;
  color: rgba(244, 235, 255, 0.68);
  border: 1px solid rgba(227, 197, 132, 0.17);
  border-radius: 10px;
  background: rgba(227, 197, 132, 0.05);
  font-size: 9px;
  line-height: 1.7;
  text-align: center;
}

.rotate-hint {
  display: none;
}

.rotate-hint {
  display: none;
}

@media (max-width: 900px) {
  .home-screen.is-active {
    grid-template-columns: minmax(0, 1fr);
    gap: 50px;
    padding-top: 22px;
  }

  .game-hub-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 50px;
  }

  .blackjack-lobby-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 35px;
  }

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

  .hero {
    text-align: center;
  }

  .hero-kicker,
  .feature-row {
    justify-content: center;
  }

  .hero-description {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cards {
    width: 235px;
    margin-left: auto;
    margin-right: auto;
  }

  .lobby-layout {
    grid-template-columns: 1fr;
  }

  .lobby-sidebar {
    order: -1;
  }

  .lobby-seat {
    width: 120px;
  }

  .lobby-seat-left { left: -18px; }
  .lobby-seat-right { left: calc(100% + 18px); }
}

@media (max-width: 720px) {
  .site-header {
    width: calc(100% - 28px);
    height: 72px;
  }

  .brand-mark {
    width: 34px;
    height: 42px;
    font-size: 19px;
  }

  .brand-mark::after {
    margin-top: 31px;
    width: 4px;
    height: 4px;
  }

  .brand-copy strong {
    max-width: 95px;
    overflow: hidden;
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-copy small,
  .network-pill,
  .ghost-button {
    display: none;
  }

  .account-button {
    max-width: 70px;
    font-size: 9px;
  }

  .brand {
    gap: 8px;
  }

  .header-actions {
    gap: 5px;
  }

  .private-chat-entry {
    width: 34px;
    justify-content: center;
    padding: 0;
  }

  .private-chat-entry span {
    display: none;
  }

  .home-screen,
  .game-hub-screen,
  .account-screen,
  .blackjack-screen,
  .lobby-screen {
    width: calc(100% - 28px);
  }

  .home-screen {
    min-height: calc(100vh - 90px);
    padding: 10px 0 45px;
  }

  .game-hub-screen,
  .account-screen,
  .blackjack-screen {
    padding-top: 18px;
  }

  .portal-hero h1 {
    font-size: clamp(45px, 13vw, 62px);
  }

  .portal-hero > p {
    margin-top: 20px;
    font-size: 12px;
    line-height: 1.8;
  }

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

  .portal-actions .primary-button,
  .portal-actions .secondary-button {
    width: 100%;
  }

  .portal-live-meta {
    gap: 10px 15px;
    margin-top: 20px;
  }

  .portal-player-card {
    padding: 22px 19px;
  }

  .portal-module-grid {
    gap: 8px;
  }

  .portal-module {
    min-height: 139px;
    padding: 15px;
  }

  .portal-module h3 {
    margin-top: 16px;
    font-size: 19px;
  }

  .portal-module p {
    min-height: 43px;
  }

  .subpage-heading {
    align-items: flex-start;
  }

  .subpage-heading h2 {
    font-size: 31px;
  }

  .subpage-heading .text-button {
    flex: 0 0 auto;
    padding: 0 8px;
    font-size: 9px;
  }

  .blackjack-hero-card {
    min-height: 390px;
    padding: 34px 25px;
    border-radius: 23px;
  }

  .blackjack-hero-card h1 {
    font-size: clamp(43px, 12vw, 60px);
  }

  .blackjack-entry-card,
  .blackjack-tables-card {
    padding: 22px 18px;
  }

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

  .blackjack-leaderboard-card {
    padding: 20px 16px 16px;
  }

  .blackjack-leaderboard-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .blackjack-topbar {
    height: 52px;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 0 10px;
  }

  .blackjack-identity {
    gap: 7px;
  }

  .blackjack-identity .compact-brand {
    font-size: 15px;
  }

  .blackjack-identity > span {
    display: none;
  }

  .blackjack-top-metrics {
    display: none;
  }

  .blackjack-top-actions {
    gap: 5px;
  }

  .blackjack-top-actions button {
    padding: 0 8px;
    font-size: 7px;
  }

  .blackjack-stage {
    min-height: calc(100dvh - 245px);
    padding: 8px;
  }

  .blackjack-table-surface {
    width: calc(100vw - 16px);
    height: min(470px, calc(100dvh - 265px));
    min-height: 350px;
    border-width: 5px;
    border-radius: 35%;
  }

  .blackjack-dealer-mark {
    width: 82px;
    height: 82px;
  }

  .blackjack-dealer-mark span {
    font-size: 17px;
  }

  .blackjack-dealer-mark strong {
    font-size: 10px;
  }

  .blackjack-seat {
    width: 116px;
    min-height: 84px;
    padding: 7px;
  }

  .blackjack-seat.pos-left { left: 17%; }
  .blackjack-seat.pos-right { left: 83%; }

  .blackjack-seat-score {
    font-size: 16px;
  }

  .blackjack-card {
    width: 28px;
    height: 40px;
    margin-left: -9px;
  }

  .blackjack-card b {
    font-size: 9px;
  }

  .blackjack-card em {
    font-size: 9px;
  }

  .blackjack-message {
    margin-top: 7px;
    font-size: 8px;
  }

  .blackjack-control-panel {
    min-height: 170px;
    padding: 12px 10px 16px;
  }

  .blackjack-my-metrics {
    gap: 16px;
  }

  .blackjack-action-buttons button {
    min-width: 104px;
    height: 42px;
  }

  .hero h1 {
    font-size: clamp(46px, 13vw, 64px);
  }

  .hero-description {
    margin-top: 22px;
    font-size: 13px;
  }

  .feature-row {
    gap: 12px;
  }

  .feature-row span {
    font-size: 9px;
  }

  .hero-cards {
    height: 110px;
    margin-top: 30px;
  }

  .display-card {
    width: 65px;
    height: 92px;
  }

  .display-card:nth-child(1) { left: 13px; }
  .display-card:nth-child(2) { left: 64px; }
  .display-card:nth-child(3) { left: 116px; }

  .entry-card {
    padding: 27px 22px;
  }

  .online-users-card {
    padding: 22px 16px 17px;
  }

  .public-lobby-card {
    padding: 22px 16px 17px;
  }

  .public-room-list {
    grid-template-columns: 1fr;
    max-height: 280px;
  }

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

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

  .online-user-row {
    grid-template-columns: 31px minmax(80px, 1fr) minmax(90px, 1.3fr) auto;
    padding: 8px;
  }

  .friends-card {
    padding: 22px 16px 18px;
  }

  .profile-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 22px 18px;
  }

  .profile-avatar-wrap {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .profile-avatar {
    width: 76px;
    height: 76px;
    font-size: 25px;
  }

  .profile-avatar-wrap .secondary-button {
    width: auto;
    padding: 0 13px;
  }

  .leaderboard-card,
  .admin-users-card {
    padding: 22px 16px 17px;
  }

  .leaderboard-list,
  .admin-user-list {
    grid-template-columns: 1fr;
  }

  .admin-user-row {
    flex-wrap: wrap;
  }

  .admin-user-person {
    min-width: 120px;
  }

  .admin-user-place {
    flex: 1 1 120px;
    max-width: none;
  }

  .friend-requests,
  .friend-list {
    grid-template-columns: 1fr;
  }

  .access-log-card {
    padding: 22px 16px 17px;
  }

  .access-log-row {
    grid-template-columns: 105px 70px minmax(75px, 0.8fr) minmax(90px, 1fr);
  }

  .access-log-device {
    display: none;
  }

  .lobby-screen {
    padding-top: 25px;
  }

  .section-heading {
    align-items: flex-start;
  }

  .section-heading h2 {
    font-size: 32px;
  }

  .room-code-panel strong {
    font-size: 24px;
  }

  .room-code-panel span {
    display: none;
  }

  .share-address-preview {
    max-width: 210px;
  }

  .lobby-table-wrap {
    padding: 25px 13px 18px;
  }

  .mini-table {
    width: 75%;
  }

  .lobby-seat {
    width: 92px;
  }

  .lobby-seat-top { top: -41px; }
  .lobby-seat-bottom { top: calc(100% + 39px); }
  .lobby-seat-left { left: -10px; }
  .lobby-seat-right { left: calc(100% + 10px); }

  .lobby-seat-card {
    min-height: 53px;
    padding: 7px;
    gap: 6px;
  }

  .seat-avatar {
    width: 29px;
    height: 29px;
    font-size: 13px;
  }

  .seat-copy strong {
    max-width: 46px;
    font-size: 10px;
  }

  .seat-copy small,
  .seat-remove {
    display: none;
  }

  .team-legend {
    gap: 12px;
    font-size: 8px;
  }

  .game-topbar {
    height: 52px;
    flex-basis: 52px;
    grid-template-columns: 1fr auto;
    padding: 0 12px;
  }

  body.is-home .chat-widget.is-open {
    width: auto;
    left: 12px;
    right: 12px;
    top: 82px;
  }

  body.is-home .chat-widget.is-open .chat-panel {
    height: min(520px, calc(100dvh - 150px));
  }

  .game-identity {
    gap: 7px;
  }

  .game-identity > span:last-child,
  .topbar-separator {
    display: none;
  }

  .level-scoreboard {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .team-level {
    gap: 4px;
    font-size: 8px;
  }

  .round-label {
    padding: 0 7px;
    font-size: 7px;
    white-space: nowrap;
  }

  .game-identity .compact-brand {
    font-size: 15px;
  }

  .game-top-actions .small-button {
    padding: 0 10px;
  }

  .mobile-rules {
    display: grid;
  }

  .game-stage {
    width: 100%;
    height: 43vh;
    min-height: 300px;
    max-height: 440px;
  }

  .game-table {
    width: 85vw;
    border-width: 7px;
  }

  .table-watermark span {
    font-size: 55px;
  }

  .top-position {
    top: 3px;
  }

  .left-position {
    left: -6px;
  }

  .right-position {
    right: -6px;
  }

  .bottom-position {
    bottom: -1px;
  }

  .player-chip,
  .left-position .player-chip,
  .right-position .player-chip {
    min-width: 91px;
    gap: 7px;
    padding: 5px 7px;
  }

  .top-position .player-chip,
  .bottom-position .player-chip {
    min-width: 105px;
  }

  .player-avatar {
    width: 29px;
    height: 29px;
    font-size: 12px;
  }

  .player-info strong {
    max-width: 51px;
    font-size: 9px;
  }

  .opponent-cards {
    display: none;
  }

  .top-position .opponent-cards {
    display: flex;
  }

  .card-count {
    min-width: 20px;
    height: 20px;
    margin-left: 4px;
    font-size: 8px;
  }

  .center-play {
    min-width: 180px;
  }

  .played-group .card {
    width: 39px;
    height: 56px;
    margin-left: -17px;
  }

  .turn-banner {
    bottom: 58px;
  }

  .hand-zone {
    width: 100%;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .hand-meta {
    padding: 0 17px 2px;
  }

  .hand-scroll {
    min-height: 94px;
    justify-content: flex-start;
    padding: 16px 20px 3px;
  }

  .hand {
    padding-right: 28px;
  }

  .card {
    width: 52px;
    height: 75px;
    flex-basis: 52px;
    margin-left: -28px;
  }

  .card.is-selected {
    margin-left: -18px;
  }

  .card.is-selected + .card {
    margin-left: -18px;
  }

  .card .rank { font-size: 19px; }
  .card .suit { font-size: 17px; }
  .card .corner-bottom { font-size: 10px; }

  .play-controls {
    gap: 7px;
    padding: 0 10px;
  }

  .pass-button,
  .hint-button {
    min-width: 62px;
  }

  .play-button {
    min-width: 122px;
  }

  .modal {
    padding: 29px 20px;
  }

  .modal h2 {
    font-size: 29px;
  }

  .rules-grid {
    grid-template-columns: 1fr;
  }

  .result-modal {
    padding: 29px 22px 23px;
  }
}

@media (max-height: 680px) and (min-width: 721px) {
  .game-stage {
    height: 390px;
    min-height: 290px;
  }

  .game-table {
    width: 550px;
  }

  .hand-scroll {
    min-height: 91px;
    padding-top: 11px;
  }

  .card {
    height: 73px;
    width: 52px;
    flex-basis: 52px;
  }
}

@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;
  }
}

@media (orientation: portrait) and (max-width: 900px) and (pointer: coarse) {
  body.in-game .rotate-hint {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    z-index: 180;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto 24px;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    color: #f4ead6;
    border: 1px solid rgba(238, 205, 139, 0.22);
    border-radius: 13px;
    background: rgba(5, 39, 32, 0.94);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px);
  }

  body.in-game .rotate-hint[hidden] {
    display: none !important;
  }

  .rotate-device svg {
    width: 26px;
    color: var(--gold-pale);
    animation: rotateNudge 2.4s ease-in-out infinite;
  }

  .rotate-hint span:nth-child(2) {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .rotate-hint strong {
    font-family: var(--serif);
    font-size: 12px;
    font-weight: 600;
  }

  .rotate-hint small {
    color: rgba(244, 234, 214, 0.57);
    font-size: 8px;
  }

  .rotate-hint button {
    height: 31px;
    padding: 0 10px;
    color: #183f34;
    border: 0;
    border-radius: 8px;
    background: var(--gold-pale);
    font-size: 9px;
    white-space: nowrap;
  }

  .rotate-hint .rotate-close {
    width: 24px;
    padding: 0;
    color: rgba(244, 234, 214, 0.55);
    background: transparent;
    font-size: 18px;
  }

  @keyframes rotateNudge {
    0%, 65%, 100% { transform: rotate(0); }
    78% { transform: rotate(-90deg); }
  }
}

@media (orientation: landscape) and (max-height: 820px) and (max-width: 1400px) {
  .site-header {
    width: calc(100% - 24px);
    height: 54px;
  }

  .brand-mark {
    width: 32px;
    height: 39px;
    font-size: 17px;
  }

  .brand-copy strong {
    font-size: 19px;
  }

  .home-screen.is-active {
    width: calc(100% - 24px);
    min-height: auto;
    grid-template-columns: minmax(0, 1fr) minmax(310px, 0.78fr);
    align-items: start;
    gap: 22px;
    padding: 8px 0 24px;
  }

  .hero {
    text-align: left;
  }

  .hero-kicker {
    justify-content: flex-start;
    margin-bottom: 12px;
  }

  .hero h1 {
    font-size: clamp(42px, 7vw, 56px);
  }

  .hero-description {
    margin: 13px 0;
    font-size: 11px;
    line-height: 1.6;
  }

  .feature-row {
    justify-content: flex-start;
    gap: 12px;
  }

  .hero-cards {
    display: none;
  }

  .entry-card {
    padding: 20px 22px;
  }

  .entry-heading h2 {
    font-size: 24px;
  }

  .entry-heading p {
    margin-bottom: 16px;
  }

  .entry-form .primary-button {
    margin-top: 10px;
  }

  .or-divider {
    margin: 13px 0;
  }

  .online-users-card {
    margin-top: 0;
    padding: 18px 20px 14px;
  }

  .lobby-screen {
    width: calc(100% - 24px);
    padding: 13px 0 24px;
  }

  .section-heading {
    margin-bottom: 12px;
  }

  .section-heading h2 {
    font-size: 28px;
  }

  .lobby-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.72fr);
    gap: 12px;
  }

  .lobby-table-wrap {
    padding: 17px 16px 14px;
  }

  .mini-table {
    width: min(430px, 74%);
    margin-bottom: 58px;
  }

  .lobby-sidebar {
    order: 0;
    padding: 17px;
  }

  .game-screen {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .rotate-hint {
    display: none !important;
  }

  .game-topbar {
    height: 44px;
    flex-basis: 44px;
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  .game-stage {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
  }

  .game-table {
    top: 48%;
    width: min(67vw, calc((100dvh - 158px) * 1.72));
    min-width: 285px;
    border-width: 6px;
  }

  .table-watermark span {
    font-size: 48px;
  }

  .top-position {
    top: 2px;
  }

  .left-position {
    left: 2.5%;
    top: 51%;
  }

  .right-position {
    right: 2.5%;
    top: 51%;
  }

  .bottom-position {
    bottom: 0;
  }

  .player-chip,
  .left-position .player-chip,
  .right-position .player-chip {
    min-width: 104px;
    gap: 6px;
    padding: 4px 7px;
  }

  .top-position .player-chip,
  .bottom-position .player-chip {
    min-width: 112px;
  }

  .top-position .opponent-cards,
  .left-position .opponent-cards,
  .right-position .opponent-cards {
    display: none;
  }

  .player-avatar {
    width: 27px;
    height: 27px;
    font-size: 11px;
  }

  .player-info strong {
    max-width: 62px;
    font-size: 9px;
  }

  .player-info small {
    font-size: 7px;
  }

  .card-count {
    min-width: 18px;
    height: 18px;
    margin-left: 2px;
    font-size: 7px;
  }

  .top-position .opponent-cards {
    display: flex;
    height: 17px;
    margin-top: 0;
  }

  .top-position .card-back {
    width: 14px;
    height: 17px;
    margin-left: -10px;
  }

  .center-play {
    min-width: 160px;
    min-height: 80px;
  }

  .played-group .card {
    width: 38px;
    height: 54px;
    margin-left: -15px;
  }

  .played-group .card .rank { font-size: 14px; }
  .played-group .card .suit { font-size: 13px; }

  .play-label {
    top: calc(50% + 34px);
    padding: 3px 8px;
    font-size: 7px;
  }

  .turn-banner {
    bottom: 72px;
    height: 23px;
    padding: 0 10px;
    font-size: 8px;
  }

  .action-float {
    padding: 6px 11px;
    font-size: 8px;
  }

  .finish-flash {
    top: 44%;
    padding: 13px 22px 11px;
  }

  .finish-flash span {
    margin: 3px 0 7px;
    font-size: clamp(42px, 11vh, 68px);
  }

  .hand-zone {
    width: 100%;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 94px;
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "meta controls"
      "hand controls";
    margin: 0;
    padding: 0 max(8px, env(safe-area-inset-right)) max(5px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .hand-meta {
    grid-area: meta;
    padding: 0 8px 1px;
    font-size: 7px;
  }

  .hand-scroll {
    grid-area: hand;
    min-height: 74px;
    height: 74px;
    padding: 7px 12px 0;
  }

  .hand {
    padding: 2px 20px 0;
  }

  .card {
    width: 48px;
    height: 68px;
    flex-basis: 48px;
    margin-left: -21px;
    padding: 5px;
  }

  .card.is-selected {
    margin-left: -14px;
    transform: translateY(-14px);
  }

  .card.is-selected + .card {
    margin-left: -14px;
  }

  .card .rank { font-size: 17px; }
  .card .suit { font-size: 15px; }
  .card .corner-bottom { font-size: 9px; }
  .card .wild-badge { font-size: 7px; }

  .play-controls {
    grid-area: controls;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    margin: 0;
    padding: 0;
  }

  .control-button {
    width: 88px;
    min-width: 0;
    height: 31px;
  }

  .play-button {
    min-width: 0;
  }

  .pass-button,
  .hint-button {
    min-width: 0;
    font-size: 9px;
  }

  .play-button {
    font-size: 10px;
  }

  .mobile-rules {
    display: grid;
  }

  .game-top-actions .small-button {
    height: 28px;
  }

  .game-top-actions .icon-button {
    width: 30px;
    height: 30px;
  }

  body.in-game .chat-widget {
    top: 50px;
    right: 8px;
  }

  .chat-widget {
    top: 65px;
    right: 8px;
  }

  .chat-panel {
    width: min(370px, calc(100vw - 16px));
    height: min(360px, calc(100dvh - 88px));
  }

  .friend-message-popup {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 58px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px 10px 12px 12px;
  }

  .private-chat-backdrop {
    padding: 8px;
  }

  .private-chat-window {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    border-radius: 16px;
  }

  .private-chat-window > header {
    padding: 18px 17px 14px;
  }

  .private-chat-window > header h2 {
    font-size: 23px;
  }

  .private-chat-security {
    padding: 8px 17px;
  }

  .private-chat-messages {
    padding: 14px 13px;
  }

  .private-chat-message-main {
    max-width: 82%;
  }

  .private-chat-form {
    padding: 10px 11px 12px;
  }

  .chat-toggle {
    height: 29px;
    padding: 0 9px;
    font-size: 8px;
  }

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