:root {
  color-scheme: dark;
  --ink: #f8efe0;
  --muted: #d7c0a0;
  --line: rgba(255, 246, 222, 0.28);
  --wood-a: #9a5a2f;
  --wood-b: #d29a5d;
  --wood-c: #5c3323;
  --gold: #f3c65d;
  --red: #833c32;
  --blue: #8bd6ff;
  --black: #161519;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.45);
  --screen-background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px) 0 0 / 86px 100%,
    linear-gradient(115deg, rgba(92, 51, 35, 0.12), rgba(255, 238, 188, 0.06)),
    repeating-linear-gradient(90deg, #9a5a2f 0 38px, #d29a5d 39px 78px, #b87642 79px 122px);
  --board-frame: #4d2719;
  --board-background:
    linear-gradient(90deg, rgba(32, 18, 13, 0.34) 0 49.4%, rgba(255, 231, 165, 0.5) 49.8% 50.2%, rgba(32, 18, 13, 0.34) 50.6%),
    linear-gradient(180deg, rgba(255, 244, 205, 0.16), rgba(54, 27, 18, 0.2)),
    repeating-linear-gradient(90deg, #72401f 0 28px, #a86638 29px 54px, #d6a363 55px 86px, #8b512d 87px 118px);
  --board-inset-background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.07), transparent 20%, transparent 80%, rgba(0, 0, 0, 0.14)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 46px);
  --point-light: linear-gradient(180deg, #fff0bd, #c99a55);
  --point-dark: linear-gradient(180deg, #764229, #b77743);
  --bar-background: linear-gradient(90deg, rgba(45, 21, 13, 0.98), rgba(255, 223, 132, 0.98) 34% 58%, rgba(45, 21, 13, 0.98));
  --bar-cap-background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.5), transparent 24%),
    linear-gradient(180deg, #ffe192, #9f7331 72%, #5c3417);
  --tray-background: linear-gradient(90deg, rgba(63, 31, 20, 0.65), rgba(211, 147, 79, 0.62));
  --checker-dark-shine: rgba(255, 255, 255, 0.28);
  --checker-dark-center: #46454d;
  --checker-dark-mid: #161519;
  --checker-dark-edge: #050507;
  --checker-light-shine: #ffffff;
  --checker-light-center: #ffffff;
  --checker-light-mid: #ddecf6;
  --checker-light-edge: #a9c7e2;
  --lobby-bg-a: #fff8e8;
  --lobby-bg-b: #e7f7f4;
  --lobby-bg-c: #f7dec3;
  --lobby-surface: rgba(255, 255, 255, 0.78);
  --lobby-surface-strong: rgba(255, 253, 247, 0.94);
  --lobby-ink: #29343c;
  --lobby-muted: #6d777e;
  --lobby-accent: #de7748;
  --lobby-accent-rgb: 222, 119, 72;
  --lobby-accent-2: #259f9a;
  --lobby-accent-2-rgb: 37, 159, 154;
  --lobby-accent-soft: #f6c786;
  --lobby-shadow: 0 24px 70px rgba(87, 66, 45, 0.2);
}

[data-board-theme="emerald"] {
  --lobby-bg-a: #f1fbf3;
  --lobby-bg-b: #dff3e9;
  --lobby-bg-c: #f7e9bf;
  --lobby-accent: #2e8c67;
  --lobby-accent-rgb: 46, 140, 103;
  --lobby-accent-2: #b78635;
  --lobby-accent-2-rgb: 183, 134, 53;
  --lobby-accent-soft: #d9bc68;
  --screen-background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 86px 100%,
    linear-gradient(135deg, rgba(203, 170, 94, 0.13), transparent 42%),
    repeating-linear-gradient(90deg, #183e32 0 42px, #225443 43px 84px, #173a30 85px 126px);
  --board-frame: #301d14;
  --board-background:
    linear-gradient(90deg, rgba(8, 24, 18, 0.4) 0 49.4%, rgba(214, 181, 94, 0.5) 49.8% 50.2%, rgba(8, 24, 18, 0.4) 50.6%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(1, 18, 12, 0.2)),
    #18513f;
  --board-inset-background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.05), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 42px);
  --point-light: linear-gradient(180deg, #f2ddb0, #c6a24c);
  --point-dark: linear-gradient(180deg, #662f27, #9d4b36);
  --bar-background: linear-gradient(90deg, #22150e, #d0a84f 36% 64%, #22150e);
  --bar-cap-background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.45), transparent 24%),
    linear-gradient(180deg, #e4c46e, #8c6727 72%, #412a10);
  --tray-background: linear-gradient(90deg, rgba(10, 42, 31, 0.8), rgba(199, 160, 72, 0.52));
}

[data-board-theme="midnight"] {
  --lobby-bg-a: #f0f3ff;
  --lobby-bg-b: #e1effb;
  --lobby-bg-c: #eee4fb;
  --lobby-accent: #4a62b2;
  --lobby-accent-rgb: 74, 98, 178;
  --lobby-accent-2: #8c5da8;
  --lobby-accent-2-rgb: 140, 93, 168;
  --lobby-accent-soft: #a8bce9;
  --screen-background:
    radial-gradient(circle at 18% 12%, rgba(116, 175, 255, 0.12), transparent 30%),
    linear-gradient(115deg, rgba(8, 20, 44, 0.4), rgba(35, 56, 96, 0.16)),
    repeating-linear-gradient(90deg, #101c36 0 42px, #172848 43px 84px, #0e1930 85px 126px);
  --board-frame: #0b1222;
  --board-background:
    linear-gradient(90deg, rgba(4, 9, 23, 0.46) 0 49.4%, rgba(191, 212, 235, 0.46) 49.8% 50.2%, rgba(4, 9, 23, 0.46) 50.6%),
    linear-gradient(180deg, rgba(161, 200, 255, 0.1), rgba(3, 8, 23, 0.28)),
    #172c50;
  --board-inset-background:
    linear-gradient(90deg, rgba(153, 197, 255, 0.08), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.2)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 42px);
  --point-light: linear-gradient(180deg, #dceafb, #92aed0);
  --point-dark: linear-gradient(180deg, #6b387d, #a7587d);
  --bar-background: linear-gradient(90deg, #080f20, #abc5df 36% 64%, #080f20);
  --bar-cap-background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.6), transparent 24%),
    linear-gradient(180deg, #dceafb, #7895b5 72%, #2c405a);
  --tray-background: linear-gradient(90deg, rgba(5, 13, 31, 0.78), rgba(127, 161, 199, 0.54));
}

[data-board-theme="sandstone"] {
  --lobby-bg-a: #fff7ea;
  --lobby-bg-b: #fbe8dc;
  --lobby-bg-c: #f6d6bd;
  --lobby-accent: #c9684d;
  --lobby-accent-rgb: 201, 104, 77;
  --lobby-accent-2: #b68a40;
  --lobby-accent-2-rgb: 182, 138, 64;
  --lobby-accent-soft: #e3b66d;
  --screen-background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.22), transparent 36%),
    linear-gradient(225deg, rgba(154, 77, 48, 0.13), transparent 40%),
    repeating-linear-gradient(90deg, #c99a62 0 42px, #e1bd86 43px 84px, #bf8753 85px 126px);
  --board-frame: #70442c;
  --board-background:
    linear-gradient(90deg, rgba(90, 47, 28, 0.18) 0 49.4%, rgba(107, 70, 48, 0.5) 49.8% 50.2%, rgba(90, 47, 28, 0.18) 50.6%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(120, 67, 35, 0.08)),
    #d9b27b;
  --board-inset-background:
    radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.16), transparent 62%),
    repeating-linear-gradient(90deg, rgba(105, 59, 35, 0.06) 0 1px, transparent 1px 42px);
  --point-light: linear-gradient(180deg, #fff2ce, #e5c67f);
  --point-dark: linear-gradient(180deg, #9c4434, #c96549);
  --bar-background: linear-gradient(90deg, #6d422a, #f3d498 36% 64%, #6d422a);
  --bar-cap-background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.65), transparent 24%),
    linear-gradient(180deg, #ffe4ae, #bb8150 72%, #704329);
  --tray-background: linear-gradient(90deg, rgba(109, 66, 42, 0.62), rgba(246, 211, 153, 0.68));
}

[data-checker-set="ruby-pearl"] {
  --checker-dark-shine: rgba(255, 224, 213, 0.42);
  --checker-dark-center: #b94139;
  --checker-dark-mid: #781f25;
  --checker-dark-edge: #320b12;
  --checker-light-shine: #ffffff;
  --checker-light-center: #fffdf4;
  --checker-light-mid: #eadabd;
  --checker-light-edge: #b99a75;
}

[data-checker-set="sapphire-gold"] {
  --checker-dark-shine: rgba(207, 230, 255, 0.44);
  --checker-dark-center: #3576c8;
  --checker-dark-mid: #173d81;
  --checker-dark-edge: #071833;
  --checker-light-shine: #fff8d3;
  --checker-light-center: #fbe6a0;
  --checker-light-mid: #d1a23f;
  --checker-light-edge: #7d5418;
}

[data-checker-set="mint-graphite"] {
  --checker-dark-shine: rgba(255, 255, 255, 0.32);
  --checker-dark-center: #555f68;
  --checker-dark-mid: #262c32;
  --checker-dark-edge: #0b0e11;
  --checker-light-shine: #effff9;
  --checker-light-center: #baf1d7;
  --checker-light-mid: #69c59d;
  --checker-light-edge: #287858;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(243, 198, 93, 0.2), transparent 34%),
    linear-gradient(225deg, rgba(139, 214, 255, 0.14), transparent 40%),
    #17110d;
  color: var(--ink);
}

button {
  font: inherit;
  color: inherit;
}

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

.app-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  padding: clamp(18px, 3vw, 42px);
  background: var(--screen-background);
}

.screen::after {
  content: "";
  position: absolute;
  inset: 12px;
  pointer-events: none;
  border: 1px solid rgba(255, 240, 202, 0.35);
  border-radius: 22px;
  box-shadow: inset 0 0 0 2px rgba(92, 51, 35, 0.25), inset 0 0 48px rgba(43, 19, 11, 0.38);
}

.screen.is-active {
  display: flex;
}

.menu-screen {
  isolation: isolate;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.2vh, 22px);
  overflow: hidden auto;
  padding-block: clamp(18px, 3vh, 34px);
  color: #fff8ed;
  background:
    linear-gradient(90deg, rgba(8, 12, 18, 0.34), rgba(9, 16, 25, 0.08) 30%, rgba(9, 16, 25, 0.12) 70%, rgba(7, 11, 17, 0.38)),
    linear-gradient(180deg, rgba(5, 10, 17, 0.2), rgba(5, 10, 17, 0.24) 52%, rgba(5, 9, 14, 0.7)),
    url("assets/breaklobby-home-office-v2.png") center / cover no-repeat;
}

.menu-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 22%, rgba(var(--lobby-accent-rgb), 0.2), transparent 30%),
    radial-gradient(circle at 86% 26%, rgba(var(--lobby-accent-2-rgb), 0.2), transparent 30%),
    linear-gradient(110deg, rgba(255, 215, 139, 0.06), transparent 42%, rgba(111, 206, 231, 0.06));
  opacity: 1;
}

.menu-screen::after {
  border-color: rgba(255, 231, 188, 0.24);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.09),
    inset 0 0 95px rgba(2, 8, 15, 0.32);
}

.top-rail {
  position: absolute;
  top: 22px;
  left: 7vw;
  right: 7vw;
  display: flex;
  justify-content: space-between;
  z-index: 1;
  opacity: 0.92;
  filter: saturate(0.96);
}

.backgammon-mode-rail {
  position: absolute;
  top: 22px;
  left: 7vw;
  right: 7vw;
  z-index: 0;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  opacity: 0.92;
}

.top-rail span,
.backgammon-mode-rail span,
.checker {
  width: clamp(34px, 4vw, 54px);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow:
    inset 0 5px 9px rgba(255, 255, 255, 0.34),
    inset 0 -9px 15px rgba(0, 0, 0, 0.42),
    0 9px 18px rgba(0, 0, 0, 0.3);
}

.menu-screen .top-rail span {
  width: clamp(28px, 3.35vw, 46px);
  border: 3px solid rgba(255, 246, 218, 0.44);
  box-shadow:
    inset 0 4px 8px rgba(255, 255, 255, 0.36),
    inset 0 -8px 13px rgba(0, 0, 0, 0.28),
    0 8px 18px rgba(0, 0, 0, 0.34);
}

.top-rail span:nth-child(odd),
.backgammon-mode-rail span:nth-child(odd),
.checker.dark {
  background:
    radial-gradient(circle at 34% 24%, var(--checker-dark-shine) 0 9%, transparent 18%),
    radial-gradient(circle at 50% 48%, var(--checker-dark-center) 0 16%, var(--checker-dark-mid) 55%, var(--checker-dark-edge) 100%);
}

.top-rail span:nth-child(even),
.backgammon-mode-rail span:nth-child(even),
.checker.light {
  background:
    radial-gradient(circle at 34% 24%, var(--checker-light-shine) 0 10%, transparent 19%),
    radial-gradient(circle at 50% 48%, var(--checker-light-center) 0 14%, var(--checker-light-mid) 56%, var(--checker-light-edge) 100%);
}

.brand {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1120px, 94vw);
  justify-items: center;
  text-align: center;
  margin-top: clamp(28px, 4.5vh, 58px);
}

.brand-title-row {
  position: relative;
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

h1,
h2 {
  margin: 0;
}

.brand-logo-heading {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: min(640px, 78vw);
  aspect-ratio: 4 / 1;
  border: 1px solid rgba(255, 214, 134, 0.36);
  border-radius: 26px;
  background: rgba(4, 5, 7, 0.76);
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.36),
    0 0 0 1px rgba(255, 240, 195, 0.08) inset,
    0 0 42px rgba(221, 166, 74, 0.14);
}

.brand-logo-heading::before,
.brand-logo-heading::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.brand-logo-heading::before {
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 235, 185, 0.06), transparent 34%),
    radial-gradient(circle at 50% 100%, rgba(226, 170, 72, 0.1), transparent 52%);
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.34);
}

.brand-logo-heading::after {
  top: -45%;
  left: -18%;
  width: 18%;
  height: 190%;
  z-index: 2;
  background: linear-gradient(90deg, transparent, rgba(255, 235, 178, 0.28), transparent);
  transform: rotate(18deg);
  filter: blur(2px);
  animation: brand-shimmer 6.5s ease-in-out infinite;
}

.brand-logo-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 54%;
  filter: saturate(0.98) contrast(1.05) brightness(1.04);
}

.brand-domain {
  flex: 0 0 auto;
  padding: 7px 17px;
  border: 1px solid rgba(255, 204, 112, 0.42);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(20, 16, 15, 0.9), rgba(46, 31, 22, 0.86));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  color: #ffe0a1;
  font-size: clamp(0.72rem, 1.2vw, 0.92rem);
  font-weight: 850;
  letter-spacing: 0.055em;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.brand-domain:hover,
.brand-domain:focus-visible {
  border-color: var(--lobby-accent);
  color: var(--lobby-accent);
  transform: translateY(-2px);
}

.brand-tagline {
  margin: 6px 0 0;
  color: #fff6e8;
  font-size: clamp(0.78rem, 1.5vw, 1.08rem);
  font-weight: 800;
  letter-spacing: 0.13em;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.82);
}

.brand-benefits {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(18px, 4vw, 48px);
  max-width: 92vw;
  margin-top: 9px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  background: rgba(6, 15, 25, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}

.brand-benefits span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 248, 235, 0.86);
  font-size: clamp(0.72rem, 1.15vw, 0.9rem);
}

.brand-benefits i {
  display: grid;
  width: 28px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background: rgba(var(--lobby-accent-rgb), 0.18);
  color: #ffe0a0;
  font-size: 0.95rem;
  font-style: normal;
}

.brand-benefits b {
  font-weight: 850;
}

@keyframes brand-shimmer {
  0%,
  68% {
    left: -24%;
    opacity: 0;
  }
  76% {
    opacity: 0.86;
  }
  92%,
  100% {
    left: 112%;
    opacity: 0;
  }
}

.brand-glow {
  position: absolute;
  inset: 26% 5% -18%;
  z-index: -1;
  background:
    radial-gradient(circle at 40% 50%, rgba(var(--lobby-accent-rgb), 0.24), transparent 48%),
    radial-gradient(circle at 70% 50%, rgba(var(--lobby-accent-2-rgb), 0.2), transparent 48%);
  filter: blur(38px);
}

.auth-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(680px, 92vw);
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(9, 20, 33, 0.86), rgba(14, 24, 35, 0.72));
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px) saturate(1.18);
}

.auth-panel strong,
.auth-panel small,
.auth-kicker {
  display: block;
}

.auth-copy {
  min-width: 0;
}

.auth-kicker {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
  color: var(--lobby-accent);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.auth-status-dot {
  width: 8px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #d79b55;
  box-shadow: 0 0 0 4px rgba(215, 155, 85, 0.12);
}

.auth-panel.is-active-account .auth-status-dot {
  background: #63cb78;
  box-shadow: 0 0 0 4px rgba(99, 203, 120, 0.14), 0 0 12px rgba(99, 203, 120, 0.5);
}

.auth-panel.is-pending-account .auth-status-dot {
  background: #f1bb54;
  box-shadow: 0 0 0 4px rgba(241, 187, 84, 0.14);
}

.auth-panel small {
  margin-top: 3px;
  color: rgba(235, 242, 245, 0.72);
  font-size: 0.82rem;
}

.auth-actions,
.voice-actions {
  display: flex;
  gap: 8px;
}

.auth-actions button,
.voice-actions button,
.modal-primary {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 239, 204, 0.44);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--lobby-accent-2), color-mix(in srgb, var(--lobby-accent-2) 72%, #183c3c));
  box-shadow: 0 10px 22px rgba(var(--lobby-accent-2-rgb), 0.2);
  color: #fff8e8;
  font-weight: 900;
  cursor: pointer;
}

.auth-actions #openSignup,
.auth-actions #openAdmin {
  background: linear-gradient(180deg, var(--lobby-accent), color-mix(in srgb, var(--lobby-accent) 72%, #5b2f28));
}

.auth-actions button[hidden] {
  display: none;
}

.menu-access-lock {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(760px, 92vw);
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 13px;
  padding: 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(8, 18, 30, 0.86);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #fff7ea;
  backdrop-filter: blur(16px);
}

.menu-access-lock[hidden] {
  display: none;
}

.menu-access-lock-icon {
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: rgba(var(--lobby-accent-rgb), 0.12);
  color: var(--lobby-accent);
}

.menu-access-lock strong,
.menu-access-lock small {
  display: block;
}

.menu-access-lock small {
  margin-top: 3px;
  color: rgba(235, 242, 245, 0.72);
  line-height: 1.35;
}

body.is-auth-locked .mode-grid,
body.is-auth-locked .game-library-grid,
body.is-auth-locked .dock {
  pointer-events: none;
  user-select: none;
  opacity: 0.28;
  filter: grayscale(0.82);
}

body.is-auth-locked .mode-card {
  transform: none;
}

body.is-auth-locked .game-library-card {
  transform: none;
}

body.is-auth-locked .player-card {
  display: none;
}

.game-library-grid {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1120px, 92vw);
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 18px;
}

.game-library-card,
.game-library-slot {
  position: relative;
  min-height: 188px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.game-library-card {
  display: flex;
  align-items: flex-end;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(var(--lobby-accent-2-rgb), 0.03) 4%, rgba(22, 25, 32, 0.9) 100%),
    url("assets/backgammon-library-card.jpg") center 53% / cover no-repeat;
  color: #fff8e8;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.game-library-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(120deg, rgba(var(--lobby-accent-rgb), 0.22), transparent 48%),
    radial-gradient(circle at 50% 42%, transparent 22%, rgba(17, 8, 13, 0.3) 100%);
}

.game-library-card:hover,
.game-library-card:focus-visible {
  transform: translateY(-6px);
  border-color: var(--lobby-accent);
  box-shadow:
    0 24px 46px rgba(62, 53, 45, 0.25),
    0 0 0 4px rgba(var(--lobby-accent-rgb), 0.13);
  outline: none;
}

.game-library-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 235, 177, 0.5);
  border-radius: 999px;
  background: rgba(27, 37, 50, 0.78);
  color: #ffe3a0;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.game-library-theme-preview {
  position: absolute;
  top: 13px;
  right: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  background: rgba(24, 30, 41, 0.6);
  backdrop-filter: blur(8px);
}

.library-checker {
  width: 22px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  box-shadow: inset 0 3px 5px rgba(255, 255, 255, 0.26), inset 0 -5px 8px rgba(0, 0, 0, 0.3);
}

.library-checker-dark {
  background:
    radial-gradient(circle at 34% 24%, var(--checker-dark-shine) 0 9%, transparent 18%),
    radial-gradient(circle at 50% 48%, var(--checker-dark-center) 0 16%, var(--checker-dark-mid) 55%, var(--checker-dark-edge) 100%);
}

.library-checker-light {
  background:
    radial-gradient(circle at 34% 24%, var(--checker-light-shine) 0 10%, transparent 19%),
    radial-gradient(circle at 50% 48%, var(--checker-light-center) 0 14%, var(--checker-light-mid) 56%, var(--checker-light-edge) 100%);
}

.game-library-copy {
  display: grid;
  gap: 3px;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.72);
}

.game-library-copy strong {
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  line-height: 1;
}

.game-library-copy small {
  color: #ead9c6;
  font-size: 0.78rem;
  font-weight: 700;
}

.game-library-open {
  position: absolute;
  right: 16px;
  bottom: 13px;
  font-size: 2rem;
  line-height: 1;
}

.game-library-slot {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border-style: dashed;
  background:
    linear-gradient(145deg, rgba(10, 21, 34, 0.78), rgba(var(--lobby-accent-2-rgb), 0.12)),
    repeating-linear-gradient(135deg, transparent 0 16px, rgba(255, 255, 255, 0.025) 16px 32px);
  color: rgba(246, 241, 233, 0.66);
  backdrop-filter: blur(14px);
}

.game-library-slot span {
  display: grid;
  width: 46px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(var(--lobby-accent-rgb), 0.26);
  background: rgba(255, 255, 255, 0.07);
  color: #ffd38a;
  border-radius: 50%;
  font-size: 1.7rem;
}

.game-library-slot small {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.backgammon-mode-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  padding: clamp(18px, 4vw, 58px);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(54, 29, 20, 0.2), rgba(255, 232, 174, 0.04) 48%, rgba(54, 29, 20, 0.22)),
    linear-gradient(180deg, rgba(35, 19, 14, 0.08), rgba(35, 19, 14, 0.28)),
    var(--screen-background);
}

.backgammon-mode-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 42%, transparent 18%, rgba(45, 23, 16, 0.32) 100%);
}

.backgammon-mode-overlay.is-open {
  display: grid;
}

.backgammon-mode-dialog {
  position: relative;
  z-index: 1;
  width: min(1180px, 96vw);
  padding: clamp(18px, 2.4vw, 30px);
  border: 1px solid rgba(255, 226, 157, 0.44);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(72, 35, 29, 0.76), rgba(28, 22, 30, 0.84));
  backdrop-filter: blur(10px) saturate(1.08);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.backgammon-mode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.backgammon-mode-header h2 {
  color: #fff0cb;
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.backgammon-mode-header .modal-close {
  position: static;
  flex: 0 0 auto;
}

.backgammon-mode-grid {
  width: 100%;
}

.backgammon-mode-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 226, 157, 0.2);
}

.backgammon-mode-tools .player-card {
  width: 100%;
  max-width: 520px;
}

.backgammon-mode-tools .dock {
  justify-content: flex-end;
}

.mode-grid {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1120px, 92vw);
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 16px;
}

.mode-card {
  min-height: 188px;
  padding: 18px;
  border: 1px solid rgba(255, 239, 204, 0.45);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(54, 30, 22, 0.58), rgba(93, 43, 31, 0.78));
  box-shadow: 0 16px 34px rgba(36, 15, 8, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.mode-card:hover,
.mode-card:focus-visible {
  transform: translateY(-6px);
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(117, 55, 41, 0.82), rgba(67, 30, 22, 0.9));
  outline: none;
}

.online-card {
  background: linear-gradient(180deg, rgba(25, 81, 89, 0.76), rgba(88, 45, 35, 0.88));
}

.mode-icon {
  position: relative;
  display: block;
  height: 74px;
  margin-bottom: 16px;
}

.mode-icon::before,
.mode-icon::after {
  content: "";
  position: absolute;
  background: rgba(35, 23, 18, 0.62);
}

.solo-icon::before,
.friend-icon::before {
  left: calc(50% - 20px);
  bottom: 6px;
  width: 42px;
  height: 42px;
  border-radius: 50% 50% 42% 42%;
}

.solo-icon::after,
.friend-icon::after {
  left: calc(50% - 32px);
  bottom: 0;
  width: 64px;
  height: 30px;
  border-radius: 50% 50% 4px 4px;
}

.duo-icon::before {
  left: calc(50% - 43px);
  bottom: 0;
  width: 46px;
  height: 58px;
  border-radius: 30px 30px 8px 8px;
}

.duo-icon::after {
  left: calc(50% - 3px);
  bottom: 0;
  width: 50px;
  height: 70px;
  border-radius: 32px 32px 8px 8px;
}

.globe-icon::before {
  left: calc(50% - 34px);
  bottom: 0;
  width: 68px;
  height: 68px;
  border: 7px solid rgba(35, 23, 18, 0.65);
  border-radius: 50%;
  background: transparent;
}

.globe-icon::after {
  left: calc(50% - 3px);
  bottom: 6px;
  width: 6px;
  height: 56px;
  border-radius: 99px;
}

.friend-icon {
  transform: translateX(-12px);
}

.friend-icon::after {
  box-shadow: 74px -23px 0 -9px rgba(35, 23, 18, 0.62), 74px -23px 0 2px transparent;
}

.mode-title {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #a85c3f, #743629);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #fff2d5;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-weight: 800;
}

.mode-meta {
  display: block;
  min-height: 34px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.player-card,
.player-chip,
.opponent-chip,
.match-panel {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 238, 203, 0.35);
  background: rgba(58, 30, 21, 0.68);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
}

.player-card {
  display: grid;
  width: min(430px, 92vw);
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 8px;
}

.avatar {
  display: grid;
  width: 48px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #a7e7ff, #48aee0);
  color: white;
  font-weight: 900;
}

.avatar.small {
  width: 38px;
}

.player-card strong,
.player-chip strong,
.opponent-chip strong {
  display: block;
  font-size: 1.02rem;
}

.player-card span,
.player-chip span,
.opponent-chip span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.player-chip .cup-line,
.opponent-chip .cup-line {
  margin-top: 2px;
  color: rgba(255, 226, 183, 0.78);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
}

.player-chip .cup-line b,
.opponent-chip .cup-line b {
  color: #fff2d4;
}

dl {
  display: flex;
  gap: 18px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
}

dd {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 900;
}

.dock {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 16px;
}

.dock button,
.round-button,
.back-button {
  display: grid;
  width: 54px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 230, 183, 0.38);
  border-radius: 50%;
  background: linear-gradient(180deg, #9c5540, #673026);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

.audio-control-wrap {
  display: grid;
  place-items: center;
}

#openAudioControls {
  position: relative;
  font-size: 1.25rem;
  transition: border-color 160ms ease, filter 160ms ease, transform 160ms ease;
}

#openAudioControls:hover,
#openAudioControls:focus-visible,
#openAudioControls[aria-expanded="true"] {
  border-color: rgba(255, 220, 135, 0.9);
  filter: brightness(1.12);
  transform: translateY(-2px);
}

#openAudioControls.has-music::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 9px;
  aspect-ratio: 1;
  border: 2px solid #f9e4a3;
  border-radius: 50%;
  background: #50bd69;
  box-shadow: 0 0 8px rgba(80, 189, 105, 0.8);
}

#openAudioControls.is-muted {
  color: #d5a6a0;
  filter: saturate(0.45);
}

.audio-popover {
  position: fixed;
  z-index: 55;
  bottom: 92px;
  left: 50%;
  display: grid;
  width: min(450px, calc(100vw - 28px));
  max-height: min(680px, calc(100dvh - 116px));
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 228, 172, 0.48);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(83, 47, 33, 0.98), rgba(39, 26, 21, 0.99)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 28px);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.13);
  scrollbar-color: rgba(220, 157, 83, 0.74) rgba(255, 255, 255, 0.06);
  transform: translateX(-50%);
}

.audio-popover[hidden] {
  display: none;
}

.audio-popover::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-right: 1px solid rgba(255, 228, 172, 0.42);
  border-bottom: 1px solid rgba(255, 228, 172, 0.42);
  background: #2d1d18;
  transform: translateX(-50%) rotate(45deg);
}

.audio-popover-head {
  display: grid;
  gap: 3px;
  padding: 0 2px 2px;
  text-align: left;
}

.audio-popover-head strong {
  color: #fff2d9;
  font-size: 1.06rem;
}

.audio-popover-head small {
  color: #bda995;
  font-size: 0.72rem;
}

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

.dock .audio-choice {
  display: grid;
  width: 100%;
  min-height: 92px;
  aspect-ratio: auto;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  place-items: center start;
  padding: 11px;
  border: 1px solid rgba(255, 236, 194, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  color: #e7d9c5;
  box-shadow: none;
  text-align: left;
}

.dock .audio-choice:hover,
.dock .audio-choice:focus-visible {
  border-color: rgba(245, 204, 105, 0.65);
  background: rgba(255, 255, 255, 0.1);
}

.dock .audio-choice[aria-pressed="true"] {
  border-color: rgba(119, 208, 130, 0.72);
  background: linear-gradient(180deg, rgba(66, 145, 75, 0.42), rgba(38, 83, 49, 0.35));
  box-shadow: inset 0 0 0 2px rgba(119, 208, 130, 0.08);
}

.audio-choice-icon {
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #b96844, #76392b);
  font-size: 1.25rem;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.24);
}

.audio-choice[aria-pressed="true"] .audio-choice-icon {
  background: linear-gradient(180deg, #62bd6c, #367b45);
}

.audio-choice > span:last-child,
.audio-choice strong,
.audio-choice small {
  display: block;
}

.audio-choice strong {
  font-size: 0.74rem;
  line-height: 1.2;
}

.audio-choice small {
  margin-top: 4px;
  color: #c4ae99;
  font-size: 0.67rem;
}

.audio-choice[aria-pressed="true"] small {
  color: #9ee3a7;
}

.featured-music-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(247, 209, 121, 0.34);
  border-radius: 17px;
  background:
    radial-gradient(circle at 92% 16%, rgba(232, 153, 62, 0.3), transparent 37%),
    linear-gradient(135deg, rgba(119, 51, 34, 0.88), rgba(71, 37, 31, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: left;
}

.featured-music-art {
  display: grid;
  width: 56px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 232, 178, 0.4);
  border-radius: 16px;
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 228, 153, 0.42), transparent 30%),
    linear-gradient(145deg, #cb724a, #6d3027);
  color: #fff0c9;
  font-size: 1.7rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.26);
}

.featured-music-copy {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.featured-music-copy small {
  color: #f2c878;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.featured-music-copy strong {
  overflow: hidden;
  color: #fff4df;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.featured-music-copy span {
  overflow: hidden;
  color: #cdb7a5;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock .featured-music-action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 12px;
  border: 1px solid rgba(255, 229, 166, 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, #bd6847, #82402f);
  color: #fff4df;
  font-size: 0.69rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.dock .featured-music-action:hover,
.dock .featured-music-action:focus-visible {
  border-color: #f3d58c;
  filter: brightness(1.12);
}

.music-app-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 236, 194, 0.16);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.music-app-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.music-app-heading > div {
  display: grid;
  gap: 2px;
}

.music-app-heading strong,
.music-app-heading small {
  display: block;
}

.music-app-heading strong {
  color: #f8ead3;
  font-size: 0.82rem;
}

.music-app-heading small {
  max-width: 285px;
  color: #bca793;
  font-size: 0.65rem;
  line-height: 1.35;
}

#preferredMusicService {
  flex: none;
  padding: 5px 8px;
  border: 1px solid rgba(112, 199, 125, 0.32);
  border-radius: 999px;
  background: rgba(74, 148, 84, 0.16);
  color: #9cdfa6;
  font-size: 0.58rem;
  font-weight: 800;
}

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

.dock .music-service-grid a {
  display: grid;
  min-width: 0;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 236, 194, 0.13);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.04);
  color: #eadac4;
  text-decoration: none;
}

.dock .music-service-grid a:hover,
.dock .music-service-grid a:focus-visible,
.dock .music-service-grid a.is-preferred {
  border-color: rgba(240, 204, 117, 0.57);
  background: rgba(255, 255, 255, 0.09);
}

.dock .music-service-grid a.is-preferred {
  box-shadow: inset 0 0 0 1px rgba(240, 204, 117, 0.12);
}

.music-service-grid a > span:last-child,
.music-service-grid strong,
.music-service-grid small {
  display: block;
  min-width: 0;
}

.music-service-grid strong {
  overflow: hidden;
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.music-service-grid small {
  margin-top: 2px;
  color: #ad9988;
  font-size: 0.59rem;
}

.music-service-mark {
  display: grid;
  width: 34px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 10px;
  color: white;
  font-size: 1rem;
  font-weight: 900;
}

.apple-mark {
  background: linear-gradient(145deg, #f7618f, #a93567);
}

.spotify-mark {
  background: linear-gradient(145deg, #39d36d, #178c45);
}

.youtube-mark {
  background: linear-gradient(145deg, #ff5454, #b72020);
}

.deezer-mark {
  background: linear-gradient(145deg, #8d6df0, #5142ab);
}

.external-music-status {
  margin: -2px 2px 0;
  color: #a9917f;
  font-size: 0.62rem;
  line-height: 1.35;
  text-align: left;
}

.matchmaking-screen,
.game-screen {
  align-items: center;
  justify-content: center;
}

.back-button {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 2;
  font-size: 2.1rem;
}

.mini-board {
  position: absolute;
  inset: 8vh 6vw;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  opacity: 0.45;
}

.mini-half {
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(62deg, transparent 0 44%, rgba(255, 241, 204, 0.62) 45% 60%, transparent 61%) 0 0 / 16.66% 50%,
    linear-gradient(118deg, transparent 0 44%, rgba(65, 31, 23, 0.62) 45% 60%, transparent 61%) 0 100% / 16.66% 50%;
}

.match-panel {
  display: grid;
  width: min(470px, 88vw);
  justify-items: center;
  gap: 18px;
  padding: 34px;
  border-radius: 8px;
  text-align: center;
}

.radar {
  position: relative;
  width: 96px;
  aspect-ratio: 1;
}

.radar span {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(139, 214, 255, 0.85);
  border-radius: 50%;
  animation: ping 1.7s ease-out infinite;
}

.radar span:nth-child(2) {
  animation-delay: 0.45s;
}

.radar span:nth-child(3) {
  animation-delay: 0.9s;
}

@keyframes ping {
  from {
    opacity: 1;
    transform: scale(0.25);
  }
  to {
    opacity: 0;
    transform: scale(1.1);
  }
}

.match-panel h2 {
  font-size: clamp(1.45rem, 4vw, 2.3rem);
}

.match-panel p {
  margin: 0;
  color: var(--muted);
}

.queue-list {
  display: grid;
  width: 100%;
  gap: 10px;
}

.queue-list div {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff6e6;
  font-weight: 700;
}

.queue-list span {
  width: 10px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #62df91;
  box-shadow: 0 0 0 6px rgba(98, 223, 145, 0.14);
}

.game-screen {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 8px clamp(8px, 1.4vw, 18px);
  overflow: hidden;
}

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

.game-header,
.game-footer {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(1320px, 98vw);
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 12px;
}

.opponent-chip,
.player-chip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  justify-self: center;
  width: min(430px, 100%);
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
}

.opponent-chip em,
.player-chip em {
  color: #fff1cc;
  font-size: 1.45rem;
  font-style: normal;
  font-weight: 900;
}

.hint-button {
  position: relative;
}

.hint-button small {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  background: #e9eef4;
  color: #7d372f;
  font-size: 0.74rem;
  font-weight: 900;
}

.board-wrap {
  --play-left: 48px;
  --play-right: 108px;
  --center-shift: calc((var(--play-left) - var(--play-right)) / 2);

  position: relative;
  z-index: 1;
  width: min(1320px, 98vw);
  flex: 1 1 auto;
  min-height: clamp(320px, calc(100dvh - 250px), 760px);
  overflow: hidden;
  border: 8px solid var(--board-frame);
  border-radius: 8px;
  background: var(--board-background);
  box-shadow:
    var(--shadow),
    inset 0 0 0 2px rgba(255, 235, 189, 0.18),
    inset 0 0 54px rgba(24, 10, 6, 0.54);
}

.board-wrap::before {
  content: "";
  position: absolute;
  inset: 18px calc(var(--play-right) - 16px) 18px calc(var(--play-left) - 18px);
  pointer-events: none;
  border: 1px solid rgba(255, 240, 202, 0.22);
  border-radius: 6px;
  background: var(--board-inset-background);
}

.board {
  position: absolute;
  inset: 44px var(--play-right) 44px var(--play-left);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(64px, 6vw) repeat(6, minmax(0, 1fr));
  grid-template-rows: 1fr 1fr;
  column-gap: clamp(8px, 0.8vw, 14px);
  row-gap: 0;
}

.point {
  position: relative;
  display: flex;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding-inline: clamp(7px, 0.7vw, 12px);
}

.point.top {
  align-items: flex-start;
}

.point.bottom {
  align-items: flex-end;
}

.point::before {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  height: 82%;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  opacity: 0.88;
  transition: filter 160ms ease, opacity 160ms ease;
}

.point.bottom::before {
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.point:nth-child(odd)::before {
  background: var(--point-light);
}

.point:nth-child(even)::before {
  background: var(--point-dark);
}

.point.is-selected::before {
  filter: drop-shadow(0 0 16px rgba(139, 214, 255, 0.95));
  opacity: 1;
}

.point.is-movable::before {
  filter: drop-shadow(0 0 12px rgba(139, 214, 255, 0.75));
  opacity: 1;
}

.point.is-legal::after {
  content: "";
  position: absolute;
  top: 42%;
  z-index: 3;
  width: 24px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(98, 223, 145, 0.82);
  box-shadow: 0 0 0 8px rgba(98, 223, 145, 0.16), 0 0 24px rgba(98, 223, 145, 0.75);
}

.point.bottom.is-legal::after {
  top: auto;
  bottom: 42%;
}

.point.is-invalid-target::after {
  content: "";
  position: absolute;
  top: 42%;
  z-index: 5;
  width: 32px;
  aspect-ratio: 1;
  border: 3px solid #ff4b38;
  border-radius: 50%;
  background:
    radial-gradient(circle, #ff4b38 0 19%, #fff8ef 21% 42%, #ff4b38 44% 63%, #fff8ef 65% 100%);
  box-shadow:
    0 0 0 5px rgba(255, 75, 56, 0.18),
    0 0 22px rgba(255, 75, 56, 0.82);
  animation: invalid-target-pop 1.05s ease-out both;
  pointer-events: none;
}

.point.bottom.is-invalid-target::after {
  top: auto;
  bottom: 42%;
}

.point.is-invalid-target .checker {
  filter: drop-shadow(0 0 7px rgba(255, 75, 56, 0.95));
}

@keyframes invalid-target-pop {
  0% {
    opacity: 0;
    transform: scale(0.45);
  }
  22% {
    opacity: 1;
    transform: scale(1.18);
  }
  38% {
    transform: scale(0.94);
  }
  100% {
    opacity: 0.92;
    transform: scale(1);
  }
}

.stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(62%, 52px);
  max-height: calc(100% - 30px);
  padding-top: 14px;
}

.bottom .stack {
  flex-direction: column-reverse;
  padding-top: 0;
  padding-bottom: 14px;
}

.checker {
  width: min(100%, 44px);
  margin-top: -7px;
  border: 2px solid rgba(255, 255, 255, 0.26);
  filter: drop-shadow(0 5px 5px rgba(24, 10, 6, 0.34));
  transition: transform 150ms ease, filter 150ms ease;
}

.stack .checker:first-child {
  margin-top: 0;
}

.stack-count {
  position: relative;
  z-index: 2;
  display: grid;
  width: 30px;
  aspect-ratio: 1;
  place-items: center;
  margin-top: -10px;
  border: 2px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  color: #fff8e8;
  font-size: 0.8rem;
  font-weight: 900;
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.26), inset 0 1px 4px rgba(255, 255, 255, 0.22);
}

.bottom .stack-count {
  margin-top: 0;
  margin-bottom: -10px;
}

.stack-count.light {
  background: linear-gradient(145deg, var(--checker-light-center), var(--checker-light-edge));
  color: #41556a;
}

.stack-count.dark {
  background: linear-gradient(145deg, var(--checker-dark-center), var(--checker-dark-edge));
}

.stack .checker:nth-child(2n) {
  transform: translateX(2px);
}

.stack .checker:nth-child(3n) {
  transform: translateX(-2px);
}

.checker:hover {
  filter: drop-shadow(0 9px 9px rgba(24, 10, 6, 0.46));
}

.bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(50% + var(--center-shift) - 15px);
  z-index: 2;
  width: 30px;
  border-inline: 1px solid rgba(255, 232, 160, 0.38);
  border-radius: 999px;
  background:
    var(--bar-background),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0 2px, transparent 2px 20px);
  box-shadow:
    0 0 28px rgba(0, 0, 0, 0.56),
    0 0 24px rgba(243, 198, 93, 0.34),
    inset 0 0 11px rgba(70, 34, 16, 0.7);
}

.bar::before,
.bar::after {
  content: "";
  position: absolute;
  left: -13px;
  width: 50px;
  height: 58px;
  border-radius: 10px;
  background: var(--bar-cap-background);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.34),
    inset 0 0 0 2px rgba(65, 35, 15, 0.28);
}

.bar::before {
  top: 30%;
}

.bar::after {
  bottom: 30%;
}

.bearing-tray {
  position: absolute;
  top: 30px;
  right: 18px;
  bottom: 30px;
  z-index: 2;
  width: 42px;
  border: 1px solid rgba(255, 242, 210, 0.6);
  border-radius: 999px;
  background: var(--tray-background);
  cursor: pointer;
  overflow: hidden;
}

.bearing-tray.is-legal {
  border-color: #62df91;
  box-shadow: 0 0 0 8px rgba(98, 223, 145, 0.16), 0 0 28px rgba(98, 223, 145, 0.7);
}

.bearing-tray.is-ready {
  border-color: rgba(139, 214, 255, 0.9);
  box-shadow: 0 0 0 8px rgba(139, 214, 255, 0.14), 0 0 26px rgba(139, 214, 255, 0.62);
}

.bearing-tray.is-invalid-target {
  border-color: #ff4b38;
  box-shadow:
    0 0 0 7px rgba(255, 75, 56, 0.18),
    0 0 24px rgba(255, 75, 56, 0.78);
  animation: invalid-tray-pulse 1.05s ease-out both;
}

@keyframes invalid-tray-pulse {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

.off-stack {
  position: absolute;
  left: 50%;
  display: flex;
  width: 34px;
  transform: translateX(-50%);
  align-items: center;
  pointer-events: none;
}

.off-stack.dark {
  top: 14px;
  flex-direction: column;
}

.off-stack.light {
  bottom: 14px;
  flex-direction: column-reverse;
}

.off-stack .checker {
  width: 30px;
  margin-top: -12px;
  border-width: 1px;
}

.off-stack .checker:first-child {
  margin-top: 0;
}

.bar-count {
  position: absolute;
  left: calc(50% + var(--center-shift) - 23px);
  z-index: 5;
  display: grid;
  width: 46px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  border: 1px solid rgba(255, 242, 210, 0.44);
  background: rgba(41, 22, 16, 0.72);
  color: #fff4d8;
  font-weight: 900;
}

.bar-count.is-selectable {
  border-color: #62df91;
  cursor: pointer;
  box-shadow: 0 0 0 8px rgba(98, 223, 145, 0.14), 0 0 24px rgba(98, 223, 145, 0.65);
}

.bar-count.dark {
  top: 18px;
}

.bar-count.light {
  bottom: 18px;
}

.jail-stack {
  position: absolute;
  left: calc(50% + var(--center-shift) - 22px);
  z-index: 6;
  display: flex;
  width: 44px;
  min-height: 120px;
  align-items: center;
  pointer-events: none;
}

.jail-stack.dark {
  top: 58px;
  flex-direction: column;
}

.jail-stack.light {
  bottom: 58px;
  flex-direction: column-reverse;
}

.jail-stack .checker {
  width: 38px;
  margin-top: -11px;
}

.jail-stack.is-selectable {
  cursor: pointer;
  pointer-events: auto;
  filter: drop-shadow(0 0 16px rgba(98, 223, 145, 0.8));
}

.score-pill {
  position: absolute;
  right: 18px;
  z-index: 3;
  display: grid;
  width: 44px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: #e6e4dc;
  color: #4e3125;
  font-weight: 900;
}

.score-pill.top {
  top: 26px;
}

.score-pill.bottom {
  right: 15px;
  bottom: 20px;
  background: linear-gradient(180deg, #9c5540, #673026);
  color: white;
}

.dice {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  perspective: 720px;
}

.dice-stage {
  position: relative;
  display: flex;
  width: min(380px, 52vw);
  min-height: 150px;
  align-items: center;
  justify-content: center;
  gap: clamp(78px, 10vw, 112px);
  pointer-events: none;
  transform: translateX(var(--center-shift));
  transform-style: preserve-3d;
}

.dice-impact {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 210px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(35, 16, 9, 0.34) 0 28%, rgba(35, 16, 9, 0.13) 45%, transparent 70%);
  opacity: 0.55;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.dice.is-rolling .dice-impact {
  animation: impact-pulse 900ms ease-out both;
}

@keyframes impact-pulse {
  0%, 34% {
    opacity: 0.12;
    transform: translate(-50%, -50%) scale(0.72);
  }
  48% {
    opacity: 0.68;
    transform: translate(-50%, -50%) scale(1.16);
  }
  100% {
    opacity: 0.36;
    transform: translate(-50%, -50%) scale(1);
  }
}

.dice-hand {
  position: absolute;
  right: -42px;
  top: -8px;
  z-index: 5;
  width: 92px;
  height: 106px;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(120px, -72px, 0) rotate(34deg) scale(0.86);
  transform-origin: 70% 90%;
}

.dice-hand::before,
.dice-hand::after {
  content: "";
  position: absolute;
  z-index: 7;
  width: 25px;
  aspect-ratio: 1;
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 50%, #241b18 0 2px, transparent 2.5px) 6px 6px / 9px 9px,
    linear-gradient(145deg, #fffdf4, #d7c8b1);
  box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.7), inset -3px -4px 6px rgba(83, 60, 41, 0.24), 0 8px 14px rgba(0, 0, 0, 0.22);
  opacity: 0;
}

.dice-hand::before {
  left: 34px;
  top: 46px;
  transform: rotate(-14deg);
}

.dice-hand::after {
  left: 58px;
  top: 42px;
  transform: rotate(18deg);
}

.dice-hand b {
  position: absolute;
  left: 24px;
  bottom: 0;
  width: 54px;
  height: 58px;
  border-radius: 22px 22px 18px 18px;
  background: linear-gradient(145deg, #ffd6a8, #b86c42);
  box-shadow: inset 8px 8px 14px rgba(255, 255, 255, 0.25), inset -8px -10px 16px rgba(76, 32, 14, 0.28), 0 14px 22px rgba(0, 0, 0, 0.28);
}

.dice-hand i {
  position: absolute;
  bottom: 50px;
  width: 15px;
  height: 54px;
  border-radius: 999px;
  background: linear-gradient(145deg, #ffe0b9, #bd7147);
  box-shadow: inset 4px 3px 7px rgba(255, 255, 255, 0.23);
}

.dice-hand i:nth-child(1) {
  left: 18px;
  height: 48px;
  transform: rotate(-10deg);
}

.dice-hand i:nth-child(2) {
  left: 34px;
  height: 62px;
}

.dice-hand i:nth-child(3) {
  left: 50px;
  height: 58px;
  transform: rotate(7deg);
}

.dice-hand i:nth-child(4) {
  left: 66px;
  height: 42px;
  transform: rotate(19deg);
}

.dice.is-rolling .dice-hand {
  animation: throw-hand 900ms cubic-bezier(0.18, 0.8, 0.18, 1) both;
}

.dice.is-rolling .dice-hand::before,
.dice.is-rolling .dice-hand::after {
  animation: hand-dice-release 900ms ease-out both;
}

@keyframes throw-hand {
  0% {
    opacity: 0;
    transform: translate3d(140px, -78px, 0) rotate(34deg) scale(0.86);
  }
  16% {
    opacity: 1;
  }
  38% {
    opacity: 1;
    transform: translate3d(30px, 10px, 0) rotate(3deg) scale(1.04);
  }
  52% {
    opacity: 1;
    transform: translate3d(-42px, 34px, 0) rotate(-28deg) scale(0.95);
  }
  100% {
    opacity: 0;
    transform: translate3d(-138px, 58px, 0) rotate(-40deg) scale(0.72);
  }
}

@keyframes hand-dice-release {
  0%, 30% {
    opacity: 1;
  }
  45%, 100% {
    opacity: 0;
  }
}

.die {
  position: relative;
  display: grid;
  width: clamp(54px, 6.4vw, 72px);
  aspect-ratio: 1;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 12px;
  background:
    radial-gradient(circle at 26% 22%, rgba(255, 255, 255, 0.98), transparent 22%),
    linear-gradient(145deg, #fffdf4 0 18%, #eadcc6 52%, #bba27f 100%);
  color: #3c2c2a;
  box-shadow:
    inset 4px 4px 8px rgba(255, 255, 255, 0.75),
    inset -8px -9px 14px rgba(92, 65, 38, 0.34),
    0 16px 26px rgba(0, 0, 0, 0.34);
  pointer-events: auto;
  transform-style: preserve-3d;
}

.die::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.58);
  border-left: 1px solid rgba(255, 255, 255, 0.42);
  pointer-events: none;
}

.die.is-preferred {
  border-color: #ffd873;
  box-shadow:
    inset 4px 4px 8px rgba(255, 255, 255, 0.75),
    inset -8px -9px 14px rgba(92, 65, 38, 0.34),
    0 0 0 4px rgba(255, 196, 69, 0.2),
    0 0 22px rgba(255, 196, 69, 0.72),
    0 16px 26px rgba(0, 0, 0, 0.34);
  transform: translateY(-3px);
}

.die.is-used {
  opacity: 0.42;
  filter: grayscale(0.72);
}

.die.is-invalid-target {
  border-color: #ff4b38;
  box-shadow:
    0 0 0 5px rgba(255, 75, 56, 0.2),
    0 0 22px rgba(255, 75, 56, 0.82);
  animation: invalid-die-shake 1.05s ease-out both;
}

@keyframes invalid-die-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-5px);
  }
  40%,
  80% {
    transform: translateX(5px);
  }
}

.die span {
  display: block;
  width: 10px;
  aspect-ratio: 1;
  place-self: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #5d4a43, #1d1715 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 1px 1px rgba(255, 255, 255, 0.35);
}

.dice.is-rolling #dieOne {
  animation: dice-one-roll 900ms cubic-bezier(0.15, 0.8, 0.22, 1) both;
}

.dice.is-rolling #dieTwo {
  animation: dice-two-roll 940ms cubic-bezier(0.15, 0.8, 0.22, 1) both;
}

@keyframes dice-one-roll {
  0% {
    transform: translate3d(92px, -72px, 0) rotateX(20deg) rotateY(-26deg) rotateZ(18deg) scale(0.62);
  }
  30% {
    transform: translate3d(34px, -24px, 58px) rotateX(220deg) rotateY(150deg) rotateZ(-46deg) scale(1.06);
  }
  52% {
    transform: translate3d(-30px, 28px, 0) rotateX(440deg) rotateY(310deg) rotateZ(-128deg) scale(0.96);
  }
  72% {
    transform: translate3d(-8px, 8px, 16px) rotateX(570deg) rotateY(420deg) rotateZ(-168deg) scale(1.02);
  }
  100% {
    transform: translate3d(-18px, 18px, 0) rotateX(720deg) rotateY(540deg) rotateZ(-180deg) scale(1);
  }
}

@keyframes dice-two-roll {
  0% {
    transform: translate3d(122px, -62px, 0) rotateX(-20deg) rotateY(28deg) rotateZ(-18deg) scale(0.62);
  }
  28% {
    transform: translate3d(62px, -18px, 54px) rotateX(-230deg) rotateY(-160deg) rotateZ(54deg) scale(1.06);
  }
  50% {
    transform: translate3d(32px, 36px, 0) rotateX(-450deg) rotateY(-300deg) rotateZ(122deg) scale(0.97);
  }
  74% {
    transform: translate3d(10px, 10px, 14px) rotateX(-590deg) rotateY(-420deg) rotateZ(164deg) scale(1.02);
  }
  100% {
    transform: translate3d(20px, -10px, 0) rotateX(-720deg) rotateY(-540deg) rotateZ(180deg) scale(1);
  }
}

.die[data-value="1"] span:nth-child(1) {
  grid-column: 2;
  grid-row: 2;
}

.die[data-value="2"] span:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.die[data-value="2"] span:nth-child(2) {
  grid-column: 3;
  grid-row: 3;
}

.die[data-value="3"] span:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.die[data-value="3"] span:nth-child(2) {
  grid-column: 2;
  grid-row: 2;
}

.die[data-value="3"] span:nth-child(3) {
  grid-column: 3;
  grid-row: 3;
}

.die[data-value="4"] span:nth-child(1),
.die[data-value="5"] span:nth-child(1),
.die[data-value="6"] span:nth-child(1) {
  grid-column: 1;
  grid-row: 1;
}

.die[data-value="4"] span:nth-child(2),
.die[data-value="5"] span:nth-child(2),
.die[data-value="6"] span:nth-child(2) {
  grid-column: 3;
  grid-row: 1;
}

.die[data-value="4"] span:nth-child(3),
.die[data-value="5"] span:nth-child(3),
.die[data-value="6"] span:nth-child(3) {
  grid-column: 1;
  grid-row: 3;
}

.die[data-value="4"] span:nth-child(4),
.die[data-value="5"] span:nth-child(4),
.die[data-value="6"] span:nth-child(4) {
  grid-column: 3;
  grid-row: 3;
}

.die[data-value="5"] span:nth-child(5) {
  grid-column: 2;
  grid-row: 2;
}

.die[data-value="6"] span:nth-child(5) {
  grid-column: 1;
  grid-row: 2;
}

.die[data-value="6"] span:nth-child(6) {
  grid-column: 3;
  grid-row: 2;
}

.die.is-empty {
  opacity: 0.78;
  background:
    radial-gradient(circle at 26% 22%, rgba(255, 255, 255, 0.88), transparent 22%),
    linear-gradient(145deg, rgba(255, 253, 244, 0.84), rgba(187, 162, 127, 0.6));
}

.die.is-empty span {
  opacity: 0;
}

.dice-moves {
  position: absolute;
  left: 50%;
  bottom: 8px;
  z-index: 7;
  display: flex;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transform: translateX(-50%);
  pointer-events: none;
}

.dice-moves span {
  display: grid;
  width: 24px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 244, 218, 0.8);
  border-radius: 6px;
  background: rgba(45, 24, 18, 0.74);
  color: #fff1cb;
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 7px 12px rgba(0, 0, 0, 0.25);
}

.roll-button {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 8;
  display: grid;
  width: 58px;
  aspect-ratio: 1;
  min-height: 0;
  place-items: center;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 2px solid rgba(255, 234, 192, 0.68);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.34), transparent 24%),
    linear-gradient(180deg, #d84f3d, #77261f);
  box-shadow:
    0 13px 24px rgba(0, 0, 0, 0.34),
    0 0 0 7px rgba(126, 42, 32, 0.18),
    inset 0 2px 0 rgba(255, 255, 255, 0.24);
  font-size: 1.65rem;
  font-weight: 900;
  pointer-events: auto;
  cursor: pointer;
}

.roll-button:hover:not(:disabled),
.roll-button:focus-visible {
  background:
    radial-gradient(circle at 35% 22%, rgba(255, 255, 255, 0.42), transparent 25%),
    linear-gradient(180deg, #f05b45, #86281f);
  outline: none;
  transform: translate(-50%, -50%) scale(1.05);
}

.dice.is-rolling .roll-button {
  opacity: 0.55;
  transform: translate(-50%, -50%) scale(0.94);
}

.table-side-panel {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(1320px, 98vw);
  grid-template-columns: minmax(320px, 1fr) minmax(260px, 340px) minmax(120px, 150px) minmax(160px, 210px);
  gap: 8px;
}

.game-instructions,
.voice-room,
.cube-control,
.home-guide {
  min-height: 58px;
  border: 1px solid rgba(255, 238, 203, 0.32);
  border-radius: 8px;
  background: rgba(39, 25, 20, 0.72);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
}

.game-instructions {
  display: grid;
  gap: 2px;
  padding: 8px 12px;
}

.game-instructions span,
.voice-room span,
.cube-control span,
.home-guide span {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.game-instructions strong,
.voice-room strong {
  color: #fff8e8;
  font-size: 0.9rem;
}

.game-instructions p {
  margin: 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.25;
}

.online-turn-clock {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 214, 115, 0.28);
  border-radius: 7px;
  background: linear-gradient(135deg, rgba(22, 14, 16, 0.9), rgba(92, 42, 34, 0.76));
}

.online-turn-clock[hidden],
.online-warning[hidden] {
  display: none;
}

.online-clock-main,
.online-warning {
  display: flex;
  align-items: center;
  gap: 7px;
}

.online-clock-main strong {
  min-width: 48px;
  color: #fff5d9;
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.online-warning {
  padding: 4px 7px;
  border: 1px solid rgba(255, 108, 80, 0.55);
  border-radius: 999px;
  background: rgba(174, 42, 27, 0.35);
  animation: online-warning-pulse 0.8s ease-in-out infinite alternate;
}

.online-warning b {
  display: grid;
  width: 26px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: #ef5a3f;
  color: white;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.online-strikes {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.online-strikes span {
  color: #dbcaba;
  font-size: 0.64rem;
  text-transform: none;
}

.online-strikes b {
  color: #ffcf6b;
}

.online-turn-clock small {
  grid-column: 1 / -1;
  color: #bfa99a;
  font-size: 0.62rem;
  line-height: 1.3;
}

.online-turn-clock.is-warning {
  border-color: rgba(255, 91, 64, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 91, 64, 0.14), 0 0 22px rgba(255, 76, 50, 0.18);
}

@keyframes online-warning-pulse {
  from { transform: scale(0.98); }
  to { transform: scale(1.02); }
}

.voice-room {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
}

.cube-control {
  display: grid;
  place-items: center;
  gap: 5px;
  padding: 8px;
}

.home-guide {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.72rem;
}

.home-guide div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 3px;
  border-top: 1px solid rgba(255, 238, 203, 0.12);
}

.home-guide b {
  color: #fff8e8;
}

.voice-actions button {
  min-width: 74px;
}

.voice-actions button:last-child {
  background: linear-gradient(180deg, #9c5540, #673026);
}

.cube-button {
  position: relative;
  z-index: 1;
  display: grid;
  width: 54px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: linear-gradient(145deg, #eef9ff, #beddf0);
  color: #5e6670;
  font-size: 1.2rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.cube-button::after {
  content: "";
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #52c56b;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.72);
}

.game-footer {
  grid-template-columns: 1fr auto;
}

.game-footer .player-chip {
  justify-self: start;
}

.primary-action {
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid rgba(255, 239, 204, 0.45);
  border-radius: 8px;
  background: linear-gradient(180deg, #1b7b83, #61412a);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.32);
  font-weight: 900;
  cursor: pointer;
}

.result-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(36, 19, 13, 0.18);
  backdrop-filter: blur(2px);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(18, 10, 7, 0.58);
  backdrop-filter: blur(7px);
}

.modal-overlay.is-visible {
  display: flex;
}

.account-modal {
  position: relative;
  display: grid;
  width: min(420px, 92vw);
  gap: 14px;
  padding: 26px;
  border: 1px solid rgba(255, 239, 204, 0.48);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(65, 37, 28, 0.96), rgba(33, 22, 18, 0.96)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 38px);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.admin-modal {
  width: min(760px, 94vw);
  max-height: min(860px, 94vh);
  overflow: auto;
}

.auth-modal {
  width: min(590px, 94vw);
  max-height: min(860px, 94vh);
  overflow: auto;
  gap: 18px;
  padding: clamp(24px, 4vw, 34px);
}

.player-account-modal {
  width: min(570px, 94vw);
  max-height: min(860px, 94vh);
  overflow: auto;
  gap: 18px;
}

.admin-access-modal {
  width: min(430px, 92vw);
  justify-items: stretch;
  text-align: center;
}

.help-modal {
  width: min(920px, 94vw);
  max-height: min(900px, 94vh);
  overflow: auto;
  gap: 22px;
  padding: clamp(28px, 5vw, 46px);
  border-color: rgba(255, 232, 180, 0.5);
  background:
    linear-gradient(180deg, rgba(245, 204, 129, 0.94), rgba(186, 119, 55, 0.96)),
    repeating-linear-gradient(90deg, rgba(85, 42, 20, 0.12) 0 2px, rgba(255, 244, 205, 0.12) 2px 38px);
  box-shadow:
    0 34px 110px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 0 48px rgba(88, 42, 18, 0.18);
}

.help-modal h2 {
  color: #624231;
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  text-shadow: 0 1px 0 rgba(255, 244, 212, 0.42);
}

.help-list {
  display: grid;
  gap: 14px;
}

.help-row {
  display: grid;
  min-height: 86px;
  grid-template-columns: 68px 1fr 24px;
  gap: 16px;
  align-items: center;
  padding: 14px 20px 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 18px;
  background: rgba(255, 248, 231, 0.72);
  color: #594033;
  text-align: left;
  box-shadow:
    0 12px 22px rgba(93, 48, 20, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.help-row:hover,
.help-row:focus-visible {
  background: rgba(255, 252, 240, 0.9);
  box-shadow:
    0 16px 28px rgba(93, 48, 20, 0.22),
    0 0 0 4px rgba(255, 239, 197, 0.24);
  outline: none;
  transform: translateY(-2px);
}

.help-icon {
  display: grid;
  width: 58px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.58);
  color: #6f5546;
  font-size: 1.8rem;
  font-weight: 900;
}

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

.help-row strong {
  font-size: 1.18rem;
}

.help-row small {
  margin-top: 4px;
  color: rgba(73, 51, 40, 0.72);
  font-size: 0.96rem;
}

.help-row em {
  color: rgba(80, 56, 45, 0.58);
  font-size: 2.3rem;
  font-style: normal;
  line-height: 1;
}

.help-modal .modal-close {
  border-color: rgba(90, 61, 45, 0.44);
  background: rgba(255, 248, 231, 0.62);
  color: #594033;
}

.help-menu-view[hidden],
.tutorial-view[hidden] {
  display: none;
}

.help-menu-view,
.tutorial-view {
  display: grid;
  gap: 18px;
}

.tutorial-view {
  position: relative;
  min-height: 620px;
}

.tutorial-back {
  justify-self: start;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(92, 64, 47, 0.38);
  border-radius: 8px;
  background: rgba(255, 248, 232, 0.78);
  color: #5a4034;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.tutorial-card {
  display: grid;
  min-height: 470px;
  align-content: start;
  gap: 18px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(95, 61, 35, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 245, 220, 0.9), rgba(241, 214, 165, 0.86)),
    repeating-linear-gradient(90deg, rgba(139, 87, 44, 0.07) 0 1px, transparent 1px 28px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 18px 38px rgba(78, 44, 22, 0.18);
}

.tutorial-card h2 {
  margin: 0;
  color: #5b4338;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.08;
}

.tutorial-body {
  margin: 0 auto;
  max-width: 760px;
  color: #4d3a32;
  font-size: clamp(1.05rem, 2.3vw, 1.42rem);
  font-weight: 800;
  line-height: 1.35;
  text-align: left;
}

.tutorial-body p {
  margin: 0;
  text-align: center;
}

.tutorial-body ul {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding-left: 1.25em;
}

.tutorial-body li {
  padding-left: 0.1em;
}

.tutorial-diagram {
  align-self: end;
}

.tutorial-board-visual {
  position: relative;
  width: min(690px, 100%);
  margin: 0 auto;
  aspect-ratio: 1.78;
  overflow: hidden;
  border: 8px solid var(--board-frame);
  border-radius: 8px;
  background: var(--board-background);
  box-shadow:
    inset 0 0 0 2px rgba(255, 234, 187, 0.24),
    inset 0 18px 35px rgba(255, 255, 255, 0.09),
    inset 0 -24px 45px rgba(49, 24, 15, 0.28);
}

.tutorial-points {
  position: absolute;
  inset: 7% 7% 9%;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: 1fr 1fr;
  gap: 0 1.2%;
}

.tutorial-point {
  position: relative;
  display: grid;
  justify-items: center;
}

.tutorial-point.top {
  align-items: start;
}

.tutorial-point.bottom {
  align-items: end;
}

.tutorial-point::before {
  content: "";
  width: 100%;
  height: 80%;
  opacity: 0.84;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  background: var(--point-light);
}

.tutorial-point:nth-child(even)::before {
  background: var(--point-dark);
}

.tutorial-point.bottom::before {
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.tutorial-checker {
  position: absolute;
  top: calc(6px + var(--checker-offset));
  width: clamp(15px, 4vw, 24px);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow:
    inset -4px -5px 8px rgba(0, 0, 0, 0.28),
    inset 3px 3px 7px rgba(255, 255, 255, 0.45),
    0 2px 4px rgba(30, 16, 10, 0.34);
  z-index: 2;
}

.tutorial-point.bottom .tutorial-checker {
  top: auto;
  bottom: calc(6px + var(--checker-offset));
}

.tutorial-checker.light {
  background: radial-gradient(circle at 32% 28%, var(--checker-light-center), var(--checker-light-mid) 58%, var(--checker-light-edge) 100%);
}

.tutorial-checker.dark {
  background: radial-gradient(circle at 32% 28%, var(--checker-dark-center), var(--checker-dark-mid) 65%, var(--checker-dark-edge) 100%);
}

.tutorial-bar {
  position: absolute;
  top: 5%;
  bottom: 6%;
  left: 49.1%;
  width: 1.8%;
  border-radius: 999px;
  background: var(--bar-background);
  box-shadow:
    0 0 0 2px rgba(73, 40, 21, 0.55),
    inset 0 0 12px rgba(255, 245, 158, 0.55);
}

.tutorial-bar span {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(35, 24, 20, 0.7);
  color: #fff3cf;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.tutorial-off {
  position: absolute;
  top: 13%;
  bottom: 14%;
  display: grid;
  width: 4.8%;
  place-items: center;
  border-radius: 999px;
  background: rgba(71, 40, 25, 0.2);
  color: rgba(255, 246, 217, 0.82);
  font-size: 0.66rem;
  font-weight: 900;
  writing-mode: vertical-rl;
  box-shadow: inset 0 0 0 2px rgba(255, 240, 192, 0.22);
}

.tutorial-off.left {
  left: 1.2%;
}

.tutorial-off.right {
  right: 1.2%;
}

.tutorial-dice {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  pointer-events: none;
}

.tutorial-die {
  display: grid;
  width: clamp(34px, 8vw, 58px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(145deg, #fbffff, #b5e8f1);
  color: #31525a;
  font-size: clamp(1.05rem, 3vw, 1.7rem);
  font-weight: 950;
  box-shadow:
    inset 3px 3px 4px rgba(255, 255, 255, 0.88),
    inset -4px -5px 7px rgba(55, 92, 104, 0.28),
    0 12px 18px rgba(34, 19, 13, 0.25);
}

.tutorial-cube-display {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 18px);
  padding-inline: 12%;
  pointer-events: none;
}

.tutorial-cube-tile {
  display: grid;
  width: clamp(54px, 11vw, 92px);
  aspect-ratio: 1;
  place-items: center;
  align-content: center;
  gap: 3px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.95), transparent 24%),
    linear-gradient(145deg, #f7fbff, #bdd2df 62%, #8298a6);
  color: #30404b;
  box-shadow:
    inset 4px 4px 7px rgba(255, 255, 255, 0.85),
    inset -5px -7px 9px rgba(55, 74, 88, 0.27),
    0 14px 24px rgba(35, 19, 12, 0.34);
  transform: rotate(-3deg);
}

.tutorial-cube-tile:nth-child(even) {
  transform: rotate(3deg);
}

.tutorial-cube-tile b {
  font-size: clamp(1rem, 3.5vw, 1.85rem);
  line-height: 1;
}

.tutorial-cube-tile.is-wide-value b {
  font-size: clamp(0.7rem, 2.25vw, 1.2rem);
}

.tutorial-cube-tile small {
  max-width: 82%;
  color: #536974;
  font-size: clamp(0.48rem, 1.2vw, 0.7rem);
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
}

.tutorial-callouts {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 7%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.tutorial-callout {
  min-height: 28px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(208, 255, 117, 0.88);
  color: #42522a;
  font-size: clamp(0.7rem, 2vw, 0.9rem);
  font-weight: 950;
  box-shadow: 0 5px 12px rgba(37, 22, 12, 0.18);
}

.tutorial-note {
  position: absolute;
  top: 7%;
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(42, 29, 25, 0.74);
  color: #fff4cf;
  font-size: clamp(0.78rem, 2.1vw, 1rem);
  text-align: center;
  box-shadow: 0 8px 18px rgba(29, 14, 8, 0.25);
}

.tutorial-controls {
  display: grid;
  grid-template-columns: 56px auto auto 56px;
  gap: 12px;
  align-items: center;
  justify-content: center;
}

.tutorial-nav,
.tutorial-restart {
  min-height: 46px;
  border: 1px solid rgba(80, 52, 38, 0.42);
  border-radius: 999px;
  background: rgba(255, 248, 231, 0.78);
  color: #5a4034;
  font-weight: 950;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 8px 18px rgba(75, 39, 21, 0.16);
}

.tutorial-nav {
  width: 56px;
  font-size: 2rem;
  line-height: 1;
}

.tutorial-restart {
  padding: 0 18px;
}

.tutorial-nav:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.tutorial-counter {
  min-width: 74px;
  color: #5b4338;
  font-size: 1.05rem;
  font-weight: 950;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  width: 36px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 239, 204, 0.36);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff8e8;
  font-size: 1.25rem;
  cursor: pointer;
}

.modal-kicker {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.account-modal h2 {
  font-size: 1.55rem;
}

.account-modal label {
  display: grid;
  gap: 6px;
  color: #fff4d8;
  font-size: 0.86rem;
  font-weight: 900;
}

.account-modal input,
.account-modal select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(255, 239, 204, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff8e8;
  padding: 0 12px;
  font: inherit;
}

.account-modal select {
  color-scheme: dark;
}

.account-modal select option {
  background: #251b1d;
  color: #fff8e8;
}

.account-modal input:focus,
.account-modal select:focus {
  border-color: rgba(103, 199, 210, 0.9);
  outline: 3px solid rgba(64, 164, 178, 0.16);
}

.auth-forms,
.auth-form,
.auth-success {
  display: grid;
  gap: 16px;
}

.auth-forms[hidden],
.auth-form[hidden],
.auth-success[hidden],
#setPasswordForm[hidden] {
  display: none;
}

.auth-intro {
  max-width: 48ch;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(255, 239, 204, 0.18);
  border-radius: 12px;
  background: rgba(8, 7, 6, 0.28);
}

.auth-tabs button {
  min-height: 42px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #bba994;
  font-weight: 900;
  cursor: pointer;
}

.auth-tabs button[aria-selected="true"] {
  background: linear-gradient(180deg, #b86645, #773629);
  color: #fff8e8;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.auth-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
}

.password-input {
  position: relative;
  display: block;
}

.password-input input {
  padding-right: 68px;
}

.password-input button {
  position: absolute;
  top: 50%;
  right: 8px;
  min-height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.09);
  color: #e8d9c3;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: pointer;
  transform: translateY(-50%);
}

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

.password-rules span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 239, 204, 0.13);
  border-radius: 8px;
  color: #a99583;
  font-size: 0.69rem;
  font-weight: 800;
}

.password-rules span::before {
  content: "○";
  color: #a66e58;
  font-size: 0.78rem;
}

.password-rules span.is-valid {
  border-color: rgba(96, 197, 116, 0.34);
  background: rgba(64, 132, 77, 0.16);
  color: #a9deb1;
}

.password-rules span.is-valid::before {
  content: "✓";
  color: #77d589;
}

.terms-row {
  display: grid !important;
  grid-template-columns: 20px 1fr;
  align-items: start;
  gap: 9px !important;
  color: #c8b7a2 !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  line-height: 1.35;
}

.terms-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 1px;
  accent-color: #3197a4;
}

.form-notice {
  min-height: 20px;
  padding: 9px 11px;
  border-left: 3px solid rgba(88, 180, 193, 0.7);
  border-radius: 5px;
  background: rgba(34, 99, 108, 0.12);
}

.form-notice:empty {
  display: none;
}

.form-notice.is-error {
  border-color: #d56b5d;
  background: rgba(139, 48, 39, 0.14);
  color: #f2b0a7;
}

.form-notice.is-success {
  border-color: #69c47a;
  background: rgba(55, 126, 69, 0.15);
  color: #aae2b3;
}

.auth-submit {
  min-height: 48px;
  font-size: 0.95rem;
}

.auth-success {
  justify-items: center;
  text-align: center;
}

.success-check {
  display: grid;
  width: 72px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(127, 221, 145, 0.56);
  border-radius: 50%;
  background: linear-gradient(145deg, #62c779, #2c7240);
  color: #fff;
  font-size: 2rem;
  font-weight: 950;
  box-shadow: 0 15px 32px rgba(34, 104, 52, 0.32);
}

.account-timeline {
  display: grid;
  width: 100%;
  gap: 8px;
  text-align: left;
}

.account-timeline > div {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 11px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(255, 239, 204, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  opacity: 0.55;
}

.account-timeline i {
  display: grid;
  width: 32px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-style: normal;
  font-weight: 900;
}

.account-timeline strong,
.account-timeline small {
  display: block;
}

.account-timeline small {
  margin-top: 2px;
  color: var(--muted);
}

.account-timeline .is-complete,
.account-timeline .is-current {
  opacity: 1;
}

.account-timeline .is-complete i {
  background: #3c9752;
}

.account-timeline .is-current {
  border-color: rgba(243, 198, 93, 0.46);
  background: rgba(137, 91, 34, 0.16);
}

.account-timeline .is-current i {
  background: #b76a3f;
}

.account-profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
}

.account-avatar {
  display: grid;
  width: 58px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid rgba(198, 235, 255, 0.7);
  border-radius: 50%;
  background: linear-gradient(145deg, #72d0ed, #397dbb);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 950;
  box-shadow: 0 10px 24px rgba(34, 93, 133, 0.34);
}

.account-profile-hero p {
  overflow: hidden;
  margin-top: 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-state-pill {
  min-height: 27px;
  padding: 6px 10px;
  border: 1px solid rgba(243, 198, 93, 0.38);
  border-radius: 999px;
  background: rgba(161, 101, 43, 0.18);
  color: #ffda83;
  font-size: 0.7rem;
  font-weight: 900;
}

.account-state-pill.is-confirmed {
  border-color: rgba(105, 204, 124, 0.46);
  background: rgba(53, 129, 69, 0.2);
  color: #9ee0aa;
}

.account-progress-grid,
.admin-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.admin-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.account-progress-grid > div,
.admin-summary > div {
  display: grid;
  gap: 3px;
  min-height: 74px;
  align-content: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 239, 204, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.account-progress-grid small,
.admin-summary small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.account-progress-grid strong,
.admin-summary strong {
  color: #fff1d2;
  font-size: 1.12rem;
}

.account-security-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 239, 204, 0.16);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
}

.security-heading {
  display: flex;
  gap: 10px;
  align-items: center;
}

.security-heading > span {
  display: grid;
  width: 38px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 10px;
  background: rgba(47, 132, 144, 0.24);
  color: #82d0db;
}

.security-heading strong,
.security-heading small,
.account-session-note strong,
.account-session-note small {
  display: block;
}

.security-heading small,
.account-session-note small {
  margin-top: 2px;
  color: var(--muted);
}

#setPasswordForm {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 239, 204, 0.12);
}

.account-inline-action {
  min-height: 40px;
  border: 1px solid rgba(117, 209, 133, 0.45);
  border-radius: 8px;
  background: linear-gradient(180deg, #4aab61, #2f7140);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.account-session-note {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 11px 13px;
  border-radius: 10px;
  background: rgba(41, 121, 61, 0.13);
}

.account-session-note > span {
  display: grid;
  width: 30px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: rgba(72, 172, 91, 0.28);
  color: #9ce2a8;
  font-weight: 950;
}

.account-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.account-secondary-action,
.account-danger-action,
.admin-exit-button {
  min-height: 43px;
  border: 1px solid rgba(255, 239, 204, 0.26);
  border-radius: 8px;
  color: #fff5df;
  font-weight: 900;
  cursor: pointer;
}

.account-secondary-action {
  background: rgba(255, 255, 255, 0.07);
}

.account-danger-action,
.admin-exit-button {
  border-color: rgba(221, 103, 88, 0.4);
  background: linear-gradient(180deg, #a04b3f, #682b27);
}

.admin-access-icon {
  display: grid;
  width: 66px;
  margin: 2px auto;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(145deg, #b76b47, #703225);
  color: #ffe6af;
  font-size: 2rem;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.28);
}

.admin-demo-code {
  padding: 9px;
  border-radius: 8px;
  background: rgba(243, 198, 93, 0.1);
  color: #d8c5aa !important;
}

.admin-demo-code strong {
  color: #ffe19a;
  letter-spacing: 0.14em;
}

.admin-console-heading {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding-right: 42px;
}

.admin-exit-button {
  min-height: 38px;
  padding: 0 13px;
}

.admin-modal h3 {
  margin: 4px 0 0;
  color: #fff0d1;
  font-size: 0.9rem;
}

.account-modal p,
.email-box {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.admin-list,
#emailQueue,
.admin-report-list {
  display: grid;
  gap: 10px;
}

.admin-section-heading {
  display: flex;
  gap: 14px;
  align-items: end;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 239, 204, 0.16);
}

.admin-section-heading > div:first-child {
  display: grid;
  gap: 3px;
}

.admin-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-filters input,
.admin-filters select,
.report-modal select,
.report-modal textarea {
  min-height: 40px;
  border: 1px solid rgba(255, 239, 204, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff4dc;
  font: inherit;
}

.admin-filters input {
  width: min(240px, 100%);
  padding: 0 12px;
}

.admin-filters select {
  padding: 0 34px 0 10px;
}

.admin-filters option,
.report-modal option {
  background: #2d2224;
  color: #fff4dc;
}

.country-analytics {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(255, 239, 204, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.country-analytics > div:first-child {
  display: grid;
  gap: 3px;
}

.country-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.country-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 239, 204, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #eadbc5;
  font-size: 0.75rem;
  font-weight: 800;
}

.country-chip strong {
  color: var(--gold);
}

.admin-row,
.email-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 239, 204, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.admin-row {
  grid-template-columns: minmax(190px, 1fr) auto minmax(220px, auto);
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.admin-row strong,
.email-row strong {
  display: block;
}

.admin-row span,
.email-row span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-row button,
.email-row button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 239, 204, 0.36);
  border-radius: 8px;
  background: linear-gradient(180deg, #1f8b92, #315146);
  color: #fff8e8;
  font-weight: 900;
  cursor: pointer;
}

.admin-row button.is-danger-soft,
.admin-report-row button.is-danger-soft {
  border-color: rgba(242, 155, 91, 0.48);
  background: linear-gradient(180deg, #9b6336, #624021);
}

.admin-row button.is-danger,
.admin-report-row button.is-danger {
  border-color: rgba(231, 103, 90, 0.52);
  background: linear-gradient(180deg, #a94e45, #682725);
}

.status-pill {
  display: inline-grid;
  min-height: 24px;
  place-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(243, 198, 93, 0.18);
  color: #ffe6a9;
  font-size: 0.72rem;
  font-weight: 900;
}

.status-pill.is-alert {
  background: rgba(212, 76, 63, 0.2);
  color: #ffb2a8;
}

.admin-safety-note {
  padding: 10px 12px;
  border-left: 3px solid #d89b4b;
  border-radius: 7px;
  background: rgba(216, 155, 75, 0.1);
  color: #d9c4ab;
  font-size: 0.78rem;
  line-height: 1.45;
}

.admin-report-row {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(255, 239, 204, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.admin-report-row > header,
.report-evidence {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.admin-report-row header > div {
  display: grid;
  gap: 3px;
}

.admin-report-row p {
  margin: 0;
  color: #efe2ce;
  line-height: 1.45;
}

.admin-report-row small,
.report-evidence {
  color: var(--muted);
  font-size: 0.75rem;
}

.report-severity {
  color: #ffce72 !important;
  font-weight: 900;
  text-transform: uppercase;
}

.report-evidence {
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.14);
}

.report-evidence b {
  color: #d7eaf0;
}

.admin-report-row.is-empty {
  color: var(--muted);
}

.report-modal {
  width: min(680px, 94vw);
}

.report-modal label {
  display: grid;
  gap: 7px;
  color: #fff0d1;
  font-weight: 850;
}

.report-modal select {
  padding: 0 12px;
}

.report-modal textarea {
  min-height: 112px;
  padding: 10px 12px;
  resize: vertical;
}

.report-intro {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.report-check {
  grid-template-columns: auto 1fr;
  align-items: start;
  padding: 11px;
  border: 1px solid rgba(255, 239, 204, 0.16);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
}

.report-check input {
  margin-top: 3px;
}

.report-check span {
  display: grid;
  gap: 3px;
}

.report-check small {
  color: var(--muted);
  font-weight: 600;
}

.report-check.is-disabled {
  opacity: 0.58;
}

.email-box {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 239, 204, 0.2);
}

.help-modal > .help-menu-view > h2,
.help-modal .tutorial-card h2 {
  color: #624231;
  text-align: center;
  font-size: clamp(1.8rem, 4vw, 2.45rem);
  text-shadow: 0 1px 0 rgba(255, 244, 212, 0.42);
}

.help-modal .tutorial-body {
  margin: 0 auto;
  max-width: 760px;
  color: #4d3a32;
  font-size: clamp(1.05rem, 2.3vw, 1.42rem);
  font-weight: 800;
  line-height: 1.35;
}

.help-modal .tutorial-body p {
  color: #4d3a32;
  text-align: center;
}

.design-modal {
  width: min(960px, 96vw);
  max-height: 94vh;
  overflow: auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  padding: clamp(24px, 4vw, 38px);
  border-color: rgba(255, 232, 180, 0.5);
  background:
    linear-gradient(180deg, rgba(57, 37, 29, 0.98), rgba(27, 20, 18, 0.98)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 38px);
}

.design-modal h2,
.design-modal h3,
.design-copy,
.design-selection-summary {
  margin: 0;
}

.design-modal h2 {
  font-size: clamp(1.8rem, 4vw, 2.55rem);
}

.design-copy {
  max-width: 700px;
  color: #d8c8b6;
  line-height: 1.5;
}

.design-preview {
  min-width: 0;
  padding: clamp(12px, 2vw, 20px);
  border: 1px solid rgba(255, 239, 204, 0.24);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.16);
}

.design-preview-board {
  position: relative;
  width: min(640px, 100%);
  margin: 0 auto;
  aspect-ratio: 2.05;
  overflow: hidden;
  border: clamp(5px, 1vw, 9px) solid var(--board-frame);
  border-radius: 9px;
  background: var(--board-background);
  box-shadow:
    inset 0 0 0 2px rgba(255, 244, 210, 0.2),
    inset 0 0 38px rgba(0, 0, 0, 0.24),
    0 18px 36px rgba(0, 0, 0, 0.34);
}

.preview-points {
  position: absolute;
  left: 5%;
  right: 5%;
  display: grid;
  height: 43%;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1.1%;
}

.preview-points.top {
  top: 5%;
}

.preview-points.bottom {
  bottom: 5%;
}

.preview-point {
  height: 100%;
  background: var(--point-light);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  opacity: 0.92;
}

.preview-points.bottom .preview-point {
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.preview-point.even {
  background: var(--point-dark);
}

.preview-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 48.8%;
  width: 2.4%;
  background: var(--bar-background);
  box-shadow: 0 0 16px rgba(0, 0, 0, 0.38);
}

.design-checker {
  display: block;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  box-shadow:
    inset 2px 3px 5px rgba(255, 255, 255, 0.36),
    inset -3px -5px 7px rgba(0, 0, 0, 0.34),
    0 4px 8px rgba(0, 0, 0, 0.26);
}

.design-checker.light {
  background:
    radial-gradient(circle at 34% 24%, var(--checker-light-shine) 0 10%, transparent 19%),
    radial-gradient(circle at 50% 48%, var(--checker-light-center) 0 14%, var(--checker-light-mid) 56%, var(--checker-light-edge) 100%);
}

.design-checker.dark {
  background:
    radial-gradient(circle at 34% 24%, var(--checker-dark-shine) 0 9%, transparent 18%),
    radial-gradient(circle at 50% 48%, var(--checker-dark-center) 0 16%, var(--checker-dark-mid) 55%, var(--checker-dark-edge) 100%);
}

.preview-checker {
  position: absolute;
  z-index: 2;
  width: clamp(24px, 7%, 44px);
}

.preview-checker.one {
  top: 9%;
  left: 12%;
}

.preview-checker.two {
  top: 20%;
  left: 12%;
}

.preview-checker.three {
  right: 18%;
  bottom: 9%;
}

.preview-checker.four {
  right: 18%;
  bottom: 20%;
}

.design-selection-summary {
  color: #f3c65d;
  font-size: 0.9rem;
  font-weight: 900;
  text-align: center;
}

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

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

.design-section h3 {
  color: #f5e5c6;
  font-size: 0.96rem;
}

.design-grid {
  display: grid;
  gap: 9px;
}

.design-option {
  display: grid;
  min-width: 0;
  min-height: 82px;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(255, 239, 204, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.055);
  color: #fff6e4;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.design-option:hover,
.design-option:focus-visible {
  border-color: rgba(243, 198, 93, 0.72);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.design-option.is-selected {
  border-color: #f3c65d;
  background: rgba(243, 198, 93, 0.14);
  box-shadow: 0 0 0 2px rgba(243, 198, 93, 0.12);
}

.design-option > span:last-child,
.design-option strong,
.design-option small {
  display: block;
  min-width: 0;
}

.design-option strong {
  font-size: 0.88rem;
}

.design-option small {
  margin-top: 3px;
  color: #cbbba9;
  font-size: 0.74rem;
  line-height: 1.25;
}

.theme-swatch {
  position: relative;
  display: grid;
  height: 58px;
  grid-template-columns: repeat(6, 1fr);
  overflow: hidden;
  border: 4px solid var(--board-frame);
  border-radius: 7px;
  background: var(--board-background);
}

.theme-swatch i {
  align-self: start;
  height: 82%;
  background: var(--point-light);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

.theme-swatch i:nth-child(even) {
  align-self: end;
  background: var(--point-dark);
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.checker-swatch {
  display: flex;
  height: 58px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 239, 204, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.checker-swatch .design-checker {
  width: 34px;
}

.design-apply {
  justify-self: end;
  min-width: 170px;
  min-height: 46px;
}

.friend-modal,
.private-room-modal {
  width: min(650px, 94vw);
  gap: 18px;
  padding: clamp(26px, 4vw, 38px);
  border-color: rgba(255, 226, 165, 0.5);
  background:
    linear-gradient(180deg, rgba(83, 47, 33, 0.98), rgba(36, 24, 20, 0.99)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 34px);
}

.private-room-modal {
  width: min(520px, 94vw);
}

.friend-modal h2,
.private-room-modal h2,
.friend-copy {
  margin: 0;
}

.friend-modal h2,
.private-room-modal h2 {
  color: #fff4df;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
}

.friend-copy {
  color: #cdbba9;
  line-height: 1.45;
}

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

.friend-choice {
  display: grid;
  min-height: 150px;
  grid-template-columns: 1fr;
  place-items: center;
  gap: 10px;
  padding: 18px 14px;
  border: 1px solid rgba(255, 234, 191, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
  color: #f6ead5;
  text-align: center;
  cursor: pointer;
}

.friend-choice:not(:disabled):hover,
.friend-choice:not(:disabled):focus-visible {
  border-color: rgba(243, 198, 93, 0.72);
  background: rgba(243, 198, 93, 0.11);
  transform: translateY(-2px);
}

.friend-choice:disabled {
  color: #9e8d80;
  cursor: not-allowed;
  opacity: 0.6;
}

.friend-choice-icon {
  display: grid;
  width: 58px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 235, 195, 0.32);
  border-radius: 50%;
  background: linear-gradient(180deg, #ad6344, #6e362a);
  color: #fff0cf;
  font-size: 1.55rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.26);
}

.friend-choice > span:last-child,
.friend-choice strong,
.friend-choice small {
  display: block;
}

.friend-choice strong {
  font-size: 1rem;
}

.friend-choice small {
  margin-top: 5px;
  color: #c7b5a3;
  font-size: 0.74rem;
  line-height: 1.3;
}

.private-room-form {
  display: grid;
  gap: 12px;
}

.private-room-form label {
  color: #ead9c2;
  font-size: 0.8rem;
  font-weight: 900;
}

.private-room-form input {
  width: 100%;
  min-height: 52px;
  border: 1px solid rgba(255, 232, 184, 0.3);
  border-radius: 11px;
  background: rgba(255, 250, 237, 0.94);
  color: #513326;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  outline: none;
  padding: 0 15px;
}

.private-room-form input:focus {
  border-color: #f3c65d;
  box-shadow: 0 0 0 3px rgba(243, 198, 93, 0.17);
}

.private-room-form input.is-invalid {
  border-color: #eb756c;
  box-shadow: 0 0 0 3px rgba(235, 117, 108, 0.12);
}

.private-room-form .modal-primary {
  min-height: 48px;
}

.private-room-form .modal-primary:disabled {
  cursor: not-allowed;
  filter: saturate(0.35);
  opacity: 0.58;
}

.private-room-error {
  min-height: 18px;
  margin: -3px 0 0;
  color: #ff9b92;
  font-size: 0.75rem;
}

.private-room-rules {
  display: grid;
  gap: 7px;
  margin: 2px 0 0;
  padding: 14px 14px 14px 32px;
  border: 1px solid rgba(255, 233, 190, 0.13);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.14);
  color: #c9b8a7;
  font-size: 0.78rem;
  line-height: 1.35;
}

.private-room-waiting {
  display: grid;
  min-height: 320px;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  border: 1px solid rgba(255, 233, 190, 0.16);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.15);
  text-align: center;
}

.private-room-waiting[hidden] {
  display: none;
}

.private-room-signal {
  position: relative;
  display: grid;
  width: 70px;
  aspect-ratio: 1;
  place-items: center;
}

.private-room-signal::after {
  content: "⌁";
  position: relative;
  z-index: 2;
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 235, 195, 0.5);
  border-radius: 50%;
  background: linear-gradient(180deg, #b96d47, #71392b);
  color: #fff0d2;
  font-size: 1.4rem;
}

.private-room-signal i {
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(243, 198, 93, 0.62);
  border-radius: 50%;
  animation: private-room-pulse 1.8s ease-out infinite;
}

.private-room-signal i:nth-child(2) {
  animation-delay: 0.6s;
}

.private-room-signal i:nth-child(3) {
  animation-delay: 1.2s;
}

@keyframes private-room-pulse {
  from {
    opacity: 0.8;
    transform: scale(0.58);
  }
  to {
    opacity: 0;
    transform: scale(1.28);
  }
}

.private-room-waiting > small {
  color: #bca995;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.private-room-waiting > strong {
  max-width: 100%;
  color: #f5d06d;
  font-size: clamp(1.45rem, 6vw, 2rem);
  overflow-wrap: anywhere;
}

.private-room-waiting p,
.private-room-hint {
  margin: 0;
}

.private-room-waiting p {
  color: #f6ead7;
  font-weight: 900;
}

.private-room-hint {
  max-width: 310px;
  color: #bfae9d;
  font-size: 0.76rem;
  line-height: 1.4;
}

.private-room-cancel {
  min-height: 40px;
  margin-top: 8px;
  padding: 0 18px;
  border: 1px solid rgba(235, 117, 108, 0.35);
  border-radius: 10px;
  background: rgba(151, 55, 49, 0.16);
  color: #f3a29a;
  font-weight: 900;
  cursor: pointer;
}

.game-center-modal {
  width: min(940px, 96vw);
  min-height: min(650px, 92vh);
  max-height: 94vh;
  overflow: auto;
  align-content: center;
  padding: clamp(28px, 5vw, 48px);
  border-color: rgba(255, 226, 165, 0.5);
  background:
    radial-gradient(circle at 78% 24%, rgba(210, 126, 59, 0.26), transparent 42%),
    linear-gradient(135deg, rgba(78, 44, 32, 0.99), rgba(35, 23, 20, 0.99));
}

.game-center-back {
  position: absolute;
  top: 18px;
  left: 18px;
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 234, 191, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: #f7e7cd;
  font-size: 1.75rem;
  cursor: pointer;
}

.game-center-back[hidden] {
  display: none;
}

.game-center-view {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.game-center-view[hidden] {
  display: none;
}

.game-center-view h2,
.game-center-view p {
  margin: 0;
}

.game-center-view h2 {
  color: #fff4df;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.game-center-copy,
.shareplay-view > p {
  max-width: 720px;
  color: #cdbba9;
  line-height: 1.5;
}

.game-center-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.game-center-method {
  display: grid;
  min-height: 250px;
  align-content: center;
  justify-items: center;
  gap: 13px;
  padding: 24px 18px;
  border: 1px solid rgba(255, 235, 194, 0.2);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    rgba(0, 0, 0, 0.12);
  color: #f7ebd8;
  text-align: center;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.game-center-method:hover,
.game-center-method:focus-visible {
  border-color: rgba(243, 198, 93, 0.75);
  background: rgba(243, 198, 93, 0.11);
  transform: translateY(-3px);
}

.game-center-method-icon,
.game-center-hero-icon {
  display: grid;
  width: 66px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 238, 203, 0.42);
  border-radius: 22px;
  background: linear-gradient(145deg, #b96a45, #6f372a);
  color: #fff1d4;
  font-size: 1.75rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

.shareplay-icon {
  color: #99e7be;
  font-family: Arial, sans-serif;
}

.game-center-method strong {
  font-size: 1.08rem;
}

.game-center-method small {
  max-width: 210px;
  color: #c5b3a1;
  font-size: 0.8rem;
  line-height: 1.45;
}

.game-center-native-note {
  color: #a99582;
  font-size: 0.72rem;
  line-height: 1.4;
  text-align: center;
}

.shareplay-view {
  max-width: 640px;
  justify-self: center;
  justify-items: center;
  text-align: center;
}

.game-center-hero-icon {
  width: 86px;
  border-radius: 28px;
  font-size: 2.15rem;
}

.shareplay-benefits {
  display: grid;
  width: min(520px, 100%);
  gap: 9px;
}

.shareplay-benefits span {
  display: grid;
  min-height: 52px;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 236, 194, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: #e9dcc8;
  padding: 8px 14px;
  text-align: left;
}

.shareplay-benefits b {
  display: grid;
  width: 30px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: #488f63;
  color: white;
}

.shareplay-view .modal-primary {
  min-width: 220px;
  min-height: 48px;
}

.game-center-lobby {
  justify-items: center;
  text-align: center;
}

.game-center-lobby .game-center-copy {
  text-align: center;
}

.game-center-players {
  display: grid;
  width: min(520px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 12px auto;
}

.game-center-player-card {
  display: grid;
  min-height: 230px;
  align-content: center;
  justify-items: center;
  gap: 9px;
  border: 1px solid rgba(255, 236, 194, 0.18);
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.19);
  padding: 22px 16px;
}

.game-center-player-card.is-ready {
  border-color: rgba(112, 207, 128, 0.5);
  box-shadow: inset 0 -4px 0 rgba(80, 166, 95, 0.4);
}

.game-center-player-card.is-invited {
  border-color: rgba(243, 198, 93, 0.52);
}

.game-center-player-card.is-searching .game-center-avatar {
  animation: game-center-search 1.1s ease-in-out infinite;
}

@keyframes game-center-search {
  50% {
    box-shadow: 0 0 0 12px rgba(243, 198, 93, 0.08), 0 12px 24px rgba(0, 0, 0, 0.28);
    transform: scale(0.94);
  }
}

.game-center-avatar {
  display: grid;
  width: 78px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: linear-gradient(145deg, #64c6e8, #4d83c7);
  color: white;
  font-size: 1.8rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

.game-center-player-card strong {
  max-width: 100%;
  overflow: hidden;
  color: #fff3de;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-center-player-card small {
  color: #baa895;
}

.game-center-player-card.is-ready small {
  color: #9ee2a9;
}

.game-center-lobby-status {
  min-height: 22px;
  color: #d3c0ad;
  font-size: 0.8rem;
  font-weight: 800;
}

.game-center-lobby-actions {
  display: grid;
  width: min(660px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.game-center-lobby-actions button,
.game-center-message-invite {
  min-height: 48px;
  border: 1px solid rgba(255, 235, 195, 0.28);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
  color: #f3e5d0;
  font-weight: 900;
  cursor: pointer;
}

.game-center-lobby-actions button:disabled {
  cursor: not-allowed;
  filter: saturate(0.25);
  opacity: 0.5;
}

.game-center-picker {
  align-content: start;
}

.game-center-search {
  display: grid;
  gap: 7px;
}

.game-center-search > span,
.message-invite-view label > span {
  color: #dbcab6;
  font-size: 0.78rem;
  font-weight: 900;
}

.game-center-search input,
.message-invite-view input,
.message-invite-view textarea {
  width: 100%;
  border: 1px solid rgba(255, 234, 190, 0.26);
  border-radius: 11px;
  background: rgba(255, 249, 235, 0.94);
  color: #523528;
  font: inherit;
  outline: none;
}

.game-center-search input,
.message-invite-view input {
  min-height: 48px;
  padding: 0 14px;
}

.message-invite-view textarea {
  min-height: 110px;
  padding: 13px 14px;
  resize: vertical;
}

.game-center-search input:focus,
.message-invite-view input:focus,
.message-invite-view textarea:focus {
  border-color: #f3c65d;
  box-shadow: 0 0 0 3px rgba(243, 198, 93, 0.14);
}

.game-center-friend-list {
  display: grid;
  max-height: 310px;
  gap: 8px;
  overflow-y: auto;
}

.game-center-friend-row {
  display: grid;
  min-height: 68px;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid rgba(255, 236, 194, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: #f2e5d0;
  text-align: left;
  cursor: pointer;
}

.game-center-friend-row:hover,
.game-center-friend-row:focus-visible {
  border-color: rgba(243, 198, 93, 0.68);
  background: rgba(243, 198, 93, 0.1);
}

.game-center-friend-row .game-center-avatar {
  width: 44px;
  font-size: 1rem;
}

.game-center-friend-row > span:nth-child(2),
.game-center-friend-row strong,
.game-center-friend-row small {
  display: block;
  min-width: 0;
}

.game-center-friend-row small {
  margin-top: 3px;
  color: #aa9887;
  font-size: 0.7rem;
}

.game-center-friend-row > b {
  color: #83d591;
  font-size: 0.72rem;
}

.game-center-empty-list {
  padding: 34px 18px;
  border: 1px dashed rgba(255, 235, 195, 0.2);
  border-radius: 12px;
  color: #bba895;
  text-align: center;
}

.game-center-message-invite {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  text-align: left;
}

.game-center-message-invite > span:first-child {
  font-size: 1.45rem;
  text-align: center;
}

.game-center-message-invite strong,
.game-center-message-invite small {
  display: block;
}

.game-center-message-invite small {
  margin-top: 3px;
  color: #b6a491;
}

.message-invite-view {
  width: min(650px, 100%);
  justify-self: center;
}

.message-invite-view label {
  display: grid;
  gap: 7px;
}

.game-center-invite-preview {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(255, 236, 194, 0.18);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.05);
}

.game-center-invite-preview .game-center-avatar {
  width: 56px;
  font-size: 1.15rem;
}

.game-center-invite-preview small,
.game-center-invite-preview strong {
  display: block;
}

.game-center-invite-preview small {
  color: #b5a18f;
}

.game-center-invite-preview strong {
  margin-top: 2px;
  color: #f7ead5;
}

.message-invite-view .modal-primary {
  min-height: 48px;
}

.stats-modal,
.leaderboard-modal {
  width: min(820px, 96vw);
  max-height: 94vh;
  overflow: auto;
  gap: 18px;
  padding: clamp(24px, 4vw, 38px);
  border-color: rgba(255, 226, 165, 0.5);
  background:
    linear-gradient(180deg, rgba(77, 44, 31, 0.98), rgba(35, 23, 19, 0.99)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 34px);
}

.stats-modal h2,
.leaderboard-modal h2 {
  margin: 0;
  color: #fff4df;
  font-size: clamp(1.8rem, 4vw, 2.55rem);
}

.stats-mode-tabs,
.leaderboard-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(255, 238, 202, 0.17);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
}

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

.stats-mode-tabs button,
.leaderboard-tabs button {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #cfbca8;
  font-weight: 900;
  cursor: pointer;
}

.stats-mode-tabs button:hover,
.stats-mode-tabs button:focus-visible,
.leaderboard-tabs button:hover,
.leaderboard-tabs button:focus-visible {
  color: #fff6e5;
  background: rgba(255, 255, 255, 0.07);
}

.stats-mode-tabs button[aria-pressed="true"],
.leaderboard-tabs button[aria-pressed="true"] {
  border-color: rgba(255, 229, 166, 0.46);
  background: linear-gradient(180deg, #b96b42, #7c392a);
  color: #fff9ed;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.solo-level-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 236, 190, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

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

.solo-level-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.solo-level-heading strong {
  color: #f5d681;
  font-size: 1rem;
}

.solo-level-heading span {
  color: #c9b7a5;
  font-size: 0.78rem;
}

.solo-level-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(38px, 1fr));
  gap: 8px;
}

.solo-level-grid button {
  position: relative;
  display: grid;
  min-width: 0;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 238, 202, 0.28);
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(0, 0, 0, 0.18));
  color: #f5e7ce;
  font-weight: 900;
  cursor: pointer;
}

.solo-level-grid button:hover:not(:disabled),
.solo-level-grid button:focus-visible:not(:disabled) {
  border-color: #f2c75f;
  transform: translateY(-1px);
}

.solo-level-grid button[aria-pressed="true"] {
  border-color: #ffd36a;
  background: linear-gradient(145deg, #78bf56, #2d783d);
  box-shadow: 0 0 0 3px rgba(242, 199, 95, 0.2);
}

.solo-level-grid button:disabled {
  color: #88786b;
  cursor: not-allowed;
  opacity: 0.58;
}

.solo-level-grid button small {
  position: absolute;
  right: -2px;
  bottom: -2px;
  overflow: hidden;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #2d2420;
  color: transparent;
}

.solo-level-grid button small::before {
  content: "×";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #a99380;
  font-size: 0.7rem;
}

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

.stats-overview > div {
  display: grid;
  min-height: 78px;
  place-content: center;
  gap: 5px;
  border: 1px solid rgba(255, 237, 198, 0.16);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
  text-align: center;
}

.stats-overview span {
  color: #bda995;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-overview strong {
  color: #7bd488;
  font-size: 1.35rem;
}

.stats-overview strong.is-negative {
  color: #f08b80;
}

.stats-metrics {
  display: grid;
  gap: 9px;
}

.stats-metric {
  display: grid;
  grid-template-columns: minmax(120px, 0.65fr) minmax(280px, 1.35fr);
  gap: 16px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(255, 238, 202, 0.13);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.stats-metric-title {
  display: grid;
  gap: 3px;
}

.stats-metric-title strong {
  color: #f5e7ce;
  font-size: 0.9rem;
}

.stats-metric-title span {
  color: #ad9b8c;
  font-size: 0.72rem;
}

.stats-metric-values {
  display: grid;
  grid-template-columns: 54px minmax(120px, 1fr) 54px;
  gap: 10px;
  align-items: center;
}

.stats-metric-values > span {
  display: grid;
  text-align: center;
}

.stats-metric-values b {
  color: #f2e6d1;
  font-size: 0.88rem;
}

.stats-metric-values small {
  color: #a89584;
  font-size: 0.62rem;
}

.stats-bar {
  display: flex;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: #392a24;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.38);
}

.stats-bar i:first-child {
  width: var(--win-share);
  background: linear-gradient(90deg, #2a934d, #63cf6d);
}

.stats-bar i:last-child {
  flex: 1;
  background: linear-gradient(90deg, #c9685f, #9e3e3b);
}

.stats-metric.is-empty .stats-bar i {
  background: #5b4a40;
}

.stats-reset {
  justify-self: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(239, 127, 116, 0.38);
  border-radius: 10px;
  background: rgba(142, 48, 43, 0.15);
  color: #ef9289;
  font-weight: 900;
  cursor: pointer;
}

.stats-reset:hover,
.stats-reset:focus-visible {
  background: rgba(166, 55, 49, 0.28);
  color: #ffd4cf;
}

.leaderboard-modal {
  width: min(720px, 96vw);
}

.leaderboard-head,
.leaderboard-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 120px;
  align-items: center;
  gap: 10px;
}

.leaderboard-head {
  padding: 0 14px;
  color: #aa9785;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.leaderboard-head span:last-child {
  text-align: right;
}

.leaderboard-list {
  display: grid;
  max-height: min(560px, 58vh);
  gap: 5px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: #9d5b3d rgba(0, 0, 0, 0.18);
  scrollbar-width: thin;
}

.leaderboard-row {
  min-height: 42px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 235, 194, 0.11);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.leaderboard-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.075);
}

.leaderboard-row strong {
  min-width: 0;
  overflow: hidden;
  color: #d9f5b4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-row strong small {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 210, 98, 0.18);
  color: #ffd875;
  font-size: 0.62rem;
  vertical-align: middle;
}

.leaderboard-row > b {
  color: #f7ecda;
  text-align: right;
}

.leaderboard-rank {
  display: grid;
  width: 30px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  color: #c9b5a3;
  font-weight: 900;
}

.leaderboard-row.gold .leaderboard-rank {
  background: #d9a72e;
  color: #3f2a13;
}

.leaderboard-row.silver .leaderboard-rank {
  background: #b8c2c8;
  color: #29343a;
}

.leaderboard-row.bronze .leaderboard-rank {
  background: #a96e43;
  color: #fff2df;
}

.leaderboard-row.is-current {
  border-color: rgba(255, 210, 98, 0.65);
  background: linear-gradient(90deg, rgba(172, 94, 52, 0.62), rgba(96, 52, 34, 0.65));
  box-shadow: inset 3px 0 0 #f3c65d;
}

.leaderboard-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #c9b6a2;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.leaderboard-divider::before,
.leaderboard-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: rgba(255, 230, 182, 0.2);
}

.leaderboard-note {
  margin: 0;
  color: #a99582;
  font-size: 0.72rem;
  line-height: 1.4;
  text-align: center;
}

.result-overlay.is-visible {
  display: flex;
}

.result-card {
  position: relative;
  width: min(360px, 86vw);
  padding: 28px 28px 22px;
  border: 1px solid rgba(255, 245, 215, 0.6);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 246, 209, 0.9), rgba(229, 196, 127, 0.82)),
    repeating-linear-gradient(90deg, rgba(174, 115, 61, 0.2) 0 18px, rgba(255, 230, 169, 0.18) 19px 38px);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  color: #5a3728;
  text-align: center;
}

.cube-badge {
  position: absolute;
  top: -18px;
  left: 18px;
  display: grid;
  width: 52px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: linear-gradient(145deg, #eef9ff, #beddf0);
  color: #5e6670;
  font-size: 1.15rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.cube-badge::after {
  content: "";
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #52c56b;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.72);
}

.result-kicker {
  margin: 0 0 18px;
  color: #704d8f;
  font-weight: 900;
}

.result-card h2 {
  margin-bottom: 12px;
  font-size: 1.45rem;
}

.result-card h2.is-win {
  color: #277c42;
}

.result-card h2.is-loss {
  color: #a9473e;
}

.result-stats {
  display: grid;
  gap: 8px;
  margin: 0 auto 14px;
  width: min(250px, 100%);
}

.result-stats div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: baseline;
  gap: 12px;
}

.result-stats dt {
  color: #7a5c48;
  font-size: 0.92rem;
  text-align: right;
  text-transform: none;
}

.result-stats dd {
  color: #4b3025;
  font-size: 1rem;
  text-align: left;
}

.result-stats small {
  color: #8d554e;
  font-size: 0.92rem;
}

.result-reason {
  min-height: 42px;
  margin: 0 0 18px;
  border-top: 1px solid rgba(101, 67, 43, 0.22);
  padding-top: 14px;
  color: #6a4a38;
  font-size: 0.86rem;
  line-height: 1.4;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 18px;
}

.replay-button,
.home-button {
  display: grid;
  width: 54px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 50%;
  color: white;
  font-size: 1.65rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(76, 47, 36, 0.24);
}

.replay-button {
  background: linear-gradient(180deg, #7d6fe8, #5d4bc2);
}

.home-button {
  background: linear-gradient(180deg, #d7c59a, #b99658);
}

.settings-modal {
  width: min(780px, 96vw);
  max-height: min(900px, 94vh);
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  background:
    radial-gradient(circle at 90% 0%, rgba(197, 112, 65, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(59, 38, 31, 0.99), rgba(26, 20, 18, 0.99));
}

.settings-header {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 235, 193, 0.14);
  background: rgba(37, 25, 21, 0.92);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
}

.settings-header > div {
  display: grid;
  gap: 2px;
}

.settings-header h2 {
  margin: 0;
  color: #fff3dd;
  font-size: clamp(1.55rem, 3vw, 2.05rem);
}

.settings-done {
  display: grid;
  width: 48px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(248, 216, 145, 0.45);
  border-radius: 50%;
  background: linear-gradient(180deg, #a45a40, #6d3428);
  color: #fff2d4;
  font-size: 1.45rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.settings-done:hover,
.settings-done:focus-visible {
  border-color: #f5d785;
  filter: brightness(1.12);
  outline: none;
}

.settings-scroll {
  display: grid;
  max-height: calc(min(900px, 94vh) - 88px);
  gap: 14px;
  padding: 18px 20px 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(211, 137, 72, 0.82) rgba(255, 255, 255, 0.05);
}

.settings-section {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(255, 235, 193, 0.15);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.settings-section-title {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.settings-section-icon,
.setting-row-icon {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 232, 181, 0.22);
  background: linear-gradient(145deg, rgba(174, 92, 56, 0.74), rgba(91, 47, 35, 0.8));
  color: #fce7bb;
  font-weight: 900;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.settings-section-icon {
  width: 44px;
  aspect-ratio: 1;
  border-radius: 13px;
  font-size: 1.15rem;
}

.settings-section-title > div,
.settings-section-title strong,
.settings-section-title small {
  display: block;
}

.settings-section-title strong {
  color: #f9ead1;
  font-size: 0.96rem;
}

.settings-section-title small {
  margin-top: 3px;
  color: #ad9987;
  font-size: 0.72rem;
}

.settings-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(255, 235, 193, 0.12);
  border-radius: 13px;
  background: rgba(12, 9, 8, 0.26);
}

.settings-segmented button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #bda998;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.settings-segmented button:hover,
.settings-segmented button:focus-visible {
  color: #f7e7ce;
  outline: none;
}

.settings-segmented button[aria-pressed="true"] {
  border-color: rgba(239, 203, 120, 0.5);
  background: linear-gradient(180deg, rgba(177, 92, 57, 0.82), rgba(101, 49, 36, 0.86));
  color: #fff2d8;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.settings-view-note,
.settings-fair-play {
  margin: 0 2px;
  color: #9d8877;
  font-size: 0.67rem;
  line-height: 1.4;
}

.settings-fair-play {
  display: flex;
  align-items: center;
  gap: 7px;
}

.settings-fair-play::before {
  content: "✓";
  display: grid;
  flex: none;
  width: 20px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: rgba(66, 151, 82, 0.22);
  color: #91df9f;
  font-size: 0.68rem;
  font-weight: 900;
}

.settings-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 3px;
}

.settings-section-heading span {
  color: #f3d891;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.settings-section-heading small {
  color: #8f7c6c;
  font-size: 0.65rem;
}

.settings-list,
.settings-action-list {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(255, 235, 193, 0.11);
  border-radius: 13px;
  background: rgba(9, 7, 6, 0.14);
}

.setting-row {
  display: grid;
  width: 100%;
  min-height: 72px;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 235, 193, 0.1);
  background: transparent;
  color: #eadbc5;
  text-align: left;
  cursor: pointer;
}

.setting-row:last-child,
.settings-action-row:last-child {
  border-bottom: 0;
}

.setting-row:hover,
.setting-row:focus-visible,
.settings-action-row:hover,
.settings-action-row:focus-visible {
  background: rgba(255, 255, 255, 0.055);
  outline: none;
}

.setting-row-icon {
  width: 40px;
  aspect-ratio: 1;
  border-radius: 12px;
  font-size: 0.66rem;
}

.setting-row-copy,
.setting-row-copy strong,
.setting-row-copy small {
  display: block;
  min-width: 0;
}

.setting-row-copy strong {
  color: #f5e6ce;
  font-size: 0.82rem;
}

.setting-row-copy small {
  margin-top: 3px;
  color: #a89584;
  font-size: 0.67rem;
  line-height: 1.3;
}

.setting-switch {
  position: relative;
  display: grid;
  width: 51px;
  height: 28px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(120, 106, 95, 0.48);
  transition: background 150ms ease, border-color 150ms ease;
}

.setting-switch i {
  position: absolute;
  left: 3px;
  width: 22px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #e9ded0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
  transition: transform 150ms ease;
}

.setting-switch b {
  position: absolute;
  right: calc(100% + 7px);
  color: #8f7d6f;
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.setting-row[aria-checked="true"] .setting-switch {
  border-color: rgba(93, 204, 111, 0.56);
  background: linear-gradient(180deg, #52b967, #348747);
}

.setting-row[aria-checked="true"] .setting-switch i {
  transform: translateX(22px);
}

.setting-row[aria-checked="true"] .setting-switch b {
  color: #83d990;
}

.settings-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.settings-plan {
  position: relative;
  display: grid;
  min-height: 142px;
  align-content: end;
  justify-items: start;
  gap: 3px;
  padding: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 232, 181, 0.26);
  border-radius: 15px;
  color: #fff1d4;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.settings-plan::after {
  content: "";
  position: absolute;
  top: -45px;
  right: -35px;
  width: 130px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.premium-plan {
  background: linear-gradient(145deg, #9e5b36, #5b3026);
}

.social-plan {
  background: linear-gradient(145deg, #3f6d82, #294052);
}

.settings-plan:hover,
.settings-plan:focus-visible {
  border-color: rgba(255, 226, 152, 0.72);
  filter: brightness(1.08);
  outline: none;
}

.settings-plan-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.16);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-plan strong {
  font-size: 1rem;
}

.settings-plan small {
  max-width: 210px;
  color: rgba(255, 241, 218, 0.72);
  font-size: 0.66rem;
}

.settings-plan b {
  margin-top: 4px;
  color: #ffe09a;
  font-size: 0.78rem;
}

.settings-action-row {
  display: grid;
  width: 100%;
  min-height: 54px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 235, 193, 0.1);
  background: transparent;
  color: #e7d7c1;
  text-align: left;
  cursor: pointer;
}

.settings-action-row > span {
  display: grid;
  width: 32px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 10px;
  background: rgba(172, 92, 56, 0.23);
  color: #f4d896;
  font-weight: 900;
}

.settings-action-row strong {
  font-size: 0.79rem;
}

.settings-action-row em {
  color: #8f7b6c;
  font-size: 1.35rem;
  font-style: normal;
}

.settings-notice,
.settings-info-notice {
  min-height: 0;
  margin: 0;
  color: #91dba0;
  font-size: 0.7rem;
  line-height: 1.4;
  text-align: center;
}

.settings-notice:empty,
.settings-info-notice:empty {
  display: none;
}

.settings-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 4px 4px 0;
  color: #8f7d6d;
}

.settings-footer span {
  color: #c9b59d;
  font-size: 0.7rem;
  font-weight: 800;
}

.settings-footer small {
  font-size: 0.62rem;
}

.settings-info-modal {
  width: min(560px, 94vw);
  max-height: min(820px, 92vh);
  overflow-y: auto;
  gap: 16px;
  padding: 28px;
  border-radius: 18px;
}

.settings-info-modal h2 {
  margin: 0;
}

.settings-info-body {
  display: grid;
  gap: 12px;
  color: #d8c7b4;
  font-size: 0.83rem;
  line-height: 1.5;
}

.settings-info-body p,
.settings-info-body ul {
  margin: 0;
}

.settings-info-body ul {
  display: grid;
  gap: 7px;
  padding-left: 20px;
}

.settings-info-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid rgba(255, 231, 178, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.settings-info-price strong {
  color: #ffe09a;
  font-size: 1.15rem;
}

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

.settings-info-actions:empty {
  display: none;
}

.settings-info-actions button {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(255, 232, 181, 0.24);
  border-radius: 10px;
  background: linear-gradient(180deg, #a65b40, #71372a);
  color: #fff0d4;
  font-weight: 800;
  cursor: pointer;
}

.settings-info-actions button.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #cfbca8;
}

.settings-consent-list {
  display: grid;
  overflow: hidden;
  border: 1px solid rgba(255, 231, 178, 0.16);
  border-radius: 12px;
}

.settings-consent-row {
  display: grid;
  min-height: 58px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 231, 178, 0.12);
  background: rgba(255, 255, 255, 0.025);
  color: #e6d7c4;
  text-align: left;
  cursor: pointer;
}

.settings-consent-row:last-child {
  border-bottom: 0;
}

.settings-consent-row strong,
.settings-consent-row small {
  display: block;
}

.settings-consent-row small {
  margin-top: 3px;
  color: #9f8c7c;
  font-size: 0.66rem;
}

.settings-consent-row b {
  color: #83d990;
  font-size: 0.68rem;
}

.settings-contact-form {
  display: grid;
  gap: 11px;
}

.settings-contact-form label {
  display: grid;
  gap: 6px;
  color: #cdb9a4;
  font-size: 0.72rem;
  font-weight: 800;
}

.settings-contact-form select,
.settings-contact-form textarea {
  width: 100%;
  border: 1px solid rgba(255, 232, 181, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff1d8;
  font: inherit;
}

.settings-contact-form select {
  min-height: 42px;
  padding: 0 11px;
}

.settings-contact-form textarea {
  min-height: 120px;
  padding: 10px 11px;
  resize: vertical;
}

.settings-contact-form option {
  background: #35231d;
}

.pip-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 3px;
}

.game-instructions .pip-summary span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid rgba(255, 232, 181, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: #bca998;
  font-size: 0.59rem;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}

.pip-summary b {
  color: #f8df9d;
  font-size: 0.66rem;
}

.pip-summary i {
  font-style: normal;
}

html[data-show-rating="false"] .rating-stat,
html[data-show-rating="false"] .rating-value,
html[data-show-rating="false"] .rating-result {
  display: none;
}

html[data-show-pips="false"] .pip-summary {
  display: none;
}

html[data-doubling-cube="false"] .cube-control,
html[data-doubling-cube="false"] .cube-badge {
  display: none;
}

html[data-two-dice-pairs="true"] .dice[data-turn="dark"] .die {
  border-color: rgba(255, 230, 183, 0.5);
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.25), transparent 16%),
    linear-gradient(145deg, #4d4542, #1d1918);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 8px 16px rgba(0, 0, 0, 0.34);
}

html[data-two-dice-pairs="true"] .dice[data-turn="dark"] .die span {
  background: #f6e7cd;
}

html[data-board-view="portrait"] .game-header,
html[data-board-view="portrait"] .game-footer,
html[data-board-view="portrait"] .board-wrap,
html[data-board-view="portrait"] .table-side-panel {
  width: min(760px, 96vw);
}

html[data-board-view="portrait"] .table-side-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html[data-board-view="portrait"] .game-screen {
  align-items: center;
}

@media (min-width: 821px) and (max-height: 760px) {
  .game-screen {
    gap: 5px;
    height: 100dvh;
    min-height: 0;
    padding-block: 5px;
  }

  .game-header,
  .game-footer {
    min-height: 42px;
  }

  .opponent-chip,
  .player-chip {
    gap: 8px;
    padding: 4px 10px;
  }

  .opponent-chip .avatar,
  .player-chip .avatar {
    width: 34px;
  }

  .opponent-chip em,
  .player-chip em {
    font-size: 1.12rem;
  }

  .player-chip .cup-line,
  .opponent-chip .cup-line {
    display: none;
  }

  .board-wrap {
    min-height: clamp(300px, calc(100dvh - 246px), 500px);
    border-width: 6px;
  }

  .board-wrap::before {
    inset-block: 10px;
  }

  .board {
    inset-block: 22px;
  }

  .bearing-tray {
    top: 18px;
    bottom: 18px;
  }

  .checker {
    width: min(100%, 38px);
  }

  .stack {
    max-height: calc(100% - 18px);
    padding-top: 8px;
  }

  .bottom .stack {
    padding-bottom: 8px;
  }

  .table-side-panel {
    gap: 5px;
  }

  .game-instructions,
  .voice-room,
  .cube-control,
  .home-guide {
    min-height: 52px;
  }

  .game-instructions,
  .voice-room {
    padding-block: 6px;
  }

  .online-turn-clock {
    gap: 5px;
    margin-top: 3px;
    padding: 5px 7px;
  }

  .game-screen.is-online-game {
    gap: 3px;
    padding-block: 3px;
  }

  .game-screen.is-online-game .game-header,
  .game-screen.is-online-game .game-footer {
    min-height: 34px;
  }

  .game-screen.is-online-game .board-wrap {
    min-height: clamp(280px, calc(100dvh - 200px), 480px);
  }

  .game-screen.is-online-game .game-instructions,
  .game-screen.is-online-game .voice-room,
  .game-screen.is-online-game .cube-control,
  .game-screen.is-online-game .home-guide {
    min-height: 46px;
  }

  .game-screen.is-online-game .game-instructions {
    padding: 4px 8px;
  }

  .game-screen.is-online-game .game-instructions > p,
  .game-screen.is-online-game .online-turn-clock > small {
    display: none;
  }

  .game-screen.is-online-game .online-turn-clock {
    grid-template-columns: auto auto 1fr;
    margin-top: 2px;
    padding: 3px 6px;
  }

  .game-screen.is-online-game .voice-room {
    gap: 6px;
    padding: 4px 7px;
  }

  .game-screen.is-online-game .voice-actions {
    gap: 5px;
  }

  .game-screen.is-online-game .voice-actions button {
    min-width: 56px;
    min-height: 34px;
    padding-inline: 8px;
  }

  .primary-action {
    min-height: 40px;
  }
}

@media (max-width: 820px) {
  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    width: 100%;
    min-height: 100vh;
    height: auto;
    overflow-x: hidden;
  }

  .screen {
    min-height: 100vh;
  }

  .menu-screen {
    justify-content: flex-start;
    padding-top: 84px;
  }

  .top-rail,
  .backgammon-mode-rail {
    left: 16px;
    right: 16px;
  }

  .top-rail span:nth-child(n + 8),
  .backgammon-mode-rail span:nth-child(n + 8) {
    display: none;
  }

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

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

  .backgammon-mode-dialog {
    max-height: calc(100dvh - 36px);
    overflow-y: auto;
  }

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

  .auth-actions {
    flex-wrap: wrap;
  }

  .auth-actions button {
    flex: 1 1 120px;
  }

  .mode-card {
    min-height: 156px;
  }

  .player-card {
    grid-template-columns: auto 1fr;
  }

  .player-card dl {
    grid-column: 1 / -1;
    justify-content: space-around;
  }

  .backgammon-mode-tools {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .backgammon-mode-tools .player-card {
    max-width: 620px;
  }

  .backgammon-mode-tools .dock {
    justify-content: center;
  }

  .dock {
    flex-wrap: wrap;
    justify-content: center;
  }

  .game-screen {
    min-height: 100vh;
  }

  .game-header {
    grid-template-columns: 46px 1fr 46px;
  }

  .round-button,
  .back-button,
  .dock button {
    width: 46px;
  }

  .opponent-chip,
  .player-chip {
    width: 100%;
  }

  .board-wrap {
    --play-left: 34px;
    --play-right: 78px;

    min-height: max(500px, 66vh);
  }

  .board {
    inset: 28px var(--play-right) 28px var(--play-left);
    grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(50px, 7vw) repeat(6, minmax(0, 1fr));
    column-gap: 6px;
  }

  .checker {
    width: min(100%, 36px);
  }

  .stack {
    width: min(70%, 44px);
    max-height: calc(100% - 22px);
    padding-top: 10px;
  }

  .bottom .stack {
    padding-bottom: 10px;
  }

  .dice-stage {
    width: min(320px, 62vw);
    gap: 74px;
  }

  .roll-button {
    width: 52px;
    font-size: 1.45rem;
  }

  .game-footer {
    grid-template-columns: 1fr;
  }

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

  .online-turn-clock {
    grid-template-columns: 1fr auto;
  }

  .online-strikes {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .voice-room {
    grid-template-columns: 1fr;
  }

  .help-row {
    min-height: 76px;
    grid-template-columns: 54px 1fr 18px;
    gap: 12px;
    padding: 12px 14px 12px 10px;
  }

  .help-icon {
    width: 48px;
    border-radius: 13px;
    font-size: 1.45rem;
  }

  .help-row strong {
    font-size: 1rem;
  }

  .help-row small {
    font-size: 0.82rem;
  }

  .help-modal {
    width: min(96vw, 760px);
    padding: 22px;
  }

  .design-modal {
    width: min(96vw, 760px);
    padding: 22px;
  }

  .settings-modal {
    width: min(96vw, 760px);
  }

  .stats-modal,
  .leaderboard-modal {
    width: min(96vw, 760px);
    padding: 22px;
  }

  .game-center-modal {
    width: min(96vw, 820px);
    min-height: 0;
    padding: 30px 22px 22px;
  }

  .game-center-method {
    min-height: 220px;
  }

  .solo-level-grid {
    grid-template-columns: repeat(5, minmax(42px, 1fr));
  }

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

  .tutorial-view {
    min-height: 0;
  }

  .tutorial-card {
    min-height: 0;
    gap: 14px;
  }

  .tutorial-body {
    font-size: 1rem;
  }

  .tutorial-board-visual {
    border-width: 5px;
  }

  .tutorial-checker {
    width: 16px;
    top: calc(4px + var(--checker-offset-small));
  }

  .tutorial-point.bottom .tutorial-checker {
    bottom: calc(4px + var(--checker-offset-small));
  }

  .tutorial-dice {
    gap: 10px;
  }

  .tutorial-controls {
    grid-template-columns: 44px auto auto 44px;
    gap: 8px;
  }

  .tutorial-nav {
    width: 44px;
    min-height: 42px;
    font-size: 1.6rem;
  }

  .tutorial-restart {
    min-height: 42px;
    padding: 0 12px;
  }

  .primary-action {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .game-library-grid {
    grid-template-columns: 1fr;
  }

  .game-library-card,
  .game-library-slot {
    min-height: 140px;
  }

  .backgammon-mode-overlay {
    padding: 8px;
  }

  .backgammon-mode-dialog {
    width: calc(100vw - 16px);
    padding: 16px;
    border-radius: 16px;
  }

  .settings-modal {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 16px;
  }

  .settings-header {
    min-height: 74px;
    padding: 14px 16px;
  }

  .settings-done {
    width: 43px;
  }

  .settings-scroll {
    max-height: calc(100dvh - 86px);
    gap: 11px;
    padding: 12px 10px 16px;
  }

  .settings-section {
    padding: 11px;
    border-radius: 14px;
  }

  .settings-section-heading {
    display: grid;
    gap: 2px;
  }

  .setting-row {
    min-height: 68px;
    grid-template-columns: 36px minmax(0, 1fr) 48px;
    gap: 9px;
    padding-inline: 9px;
  }

  .setting-row-icon {
    width: 36px;
  }

  .setting-switch {
    width: 48px;
    height: 27px;
  }

  .setting-row[aria-checked="true"] .setting-switch i {
    transform: translateX(19px);
  }

  .setting-switch b {
    display: none;
  }

  .settings-plan-grid,
  .settings-info-actions {
    grid-template-columns: 1fr;
  }

  .settings-plan {
    min-height: 126px;
  }

  .settings-footer {
    display: grid;
    gap: 3px;
  }

  .settings-info-modal {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    padding: 24px 16px 18px;
  }

  .audio-popover {
    bottom: 76px;
    width: calc(100vw - 18px);
    max-height: calc(100dvh - 92px);
    padding: 13px;
    border-radius: 18px;
  }

  .audio-toggle-grid {
    grid-template-columns: 1fr;
  }

  .dock .audio-choice {
    min-height: 68px;
  }

  .featured-music-card {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 10px;
  }

  .featured-music-art {
    width: 50px;
  }

  .dock .featured-music-action {
    grid-column: 1 / -1;
    width: 100%;
  }

  .music-app-heading {
    display: grid;
  }

  #preferredMusicService {
    justify-self: start;
  }

  .music-service-grid {
    grid-template-columns: 1fr;
  }

  .auth-modal,
  .player-account-modal,
  .admin-access-modal,
  .admin-modal {
    padding: 24px 16px 18px;
  }

  .auth-form-grid,
  .password-rules {
    grid-template-columns: 1fr;
  }

  .password-rules {
    gap: 5px;
  }

  .password-rules span {
    min-height: 30px;
  }

  .account-profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .account-state-pill {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .account-progress-grid,
  .admin-summary {
    gap: 6px;
  }

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

  .account-progress-grid > div,
  .admin-summary > div {
    min-height: 66px;
    padding-inline: 8px;
  }

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

  .admin-console-heading {
    display: grid;
    padding-right: 32px;
  }

  .admin-section-heading,
  .admin-report-row > header,
  .report-evidence {
    display: grid;
  }

  .admin-filters {
    justify-content: stretch;
  }

  .admin-filters input,
  .admin-filters select {
    width: 100%;
  }

  .admin-row {
    grid-template-columns: 1fr auto;
  }

  .admin-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .admin-exit-button {
    justify-self: start;
  }

  .board-wrap {
    --play-left: 22px;
    --play-right: 66px;
  }

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

  .help-modal {
    padding: 18px;
  }

  .design-modal {
    padding: 18px;
  }

  .stats-modal,
  .leaderboard-modal {
    padding: 18px 14px;
  }

  .friend-modal,
  .private-room-modal {
    padding: 22px 18px;
  }

  .friend-choice-grid {
    grid-template-columns: 1fr;
  }

  .friend-choice {
    min-height: 112px;
    grid-template-columns: 54px minmax(0, 1fr);
    text-align: left;
  }

  .friend-choice-icon {
    width: 48px;
  }

  .game-center-modal {
    padding: 58px 16px 20px;
  }

  .game-center-methods {
    grid-template-columns: 1fr;
  }

  .game-center-method {
    min-height: 112px;
    grid-template-columns: 56px minmax(0, 1fr);
    justify-items: start;
    gap: 5px 12px;
    padding: 14px;
    text-align: left;
  }

  .game-center-method-icon {
    width: 52px;
    grid-row: 1 / span 2;
    border-radius: 16px;
    font-size: 1.35rem;
  }

  .game-center-method small {
    max-width: none;
  }

  .game-center-hero-icon {
    width: 70px;
  }

  .game-center-players {
    gap: 8px;
  }

  .game-center-player-card {
    min-height: 180px;
    padding: 15px 8px;
  }

  .game-center-avatar {
    width: 62px;
    font-size: 1.4rem;
  }

  .game-center-lobby-actions {
    grid-template-columns: 1fr;
  }

  .game-center-friend-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    padding-inline: 9px;
  }

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

  .leaderboard-tabs button {
    padding-inline: 5px;
    font-size: 0.76rem;
  }

  .solo-level-heading {
    display: grid;
    gap: 4px;
  }

  .solo-level-grid {
    grid-template-columns: repeat(5, minmax(38px, 1fr));
  }

  .stats-overview {
    gap: 6px;
  }

  .stats-overview > div {
    min-height: 68px;
  }

  .stats-overview span {
    font-size: 0.61rem;
  }

  .stats-overview strong {
    font-size: 1.08rem;
  }

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

  .stats-metric-title {
    grid-template-columns: 1fr auto;
    align-items: baseline;
  }

  .stats-metric-values {
    grid-template-columns: 46px minmax(90px, 1fr) 46px;
    gap: 6px;
  }

  .leaderboard-head,
  .leaderboard-row {
    grid-template-columns: 44px minmax(0, 1fr) 82px;
    gap: 7px;
  }

  .leaderboard-head {
    padding-inline: 8px;
  }

  .leaderboard-row {
    padding-inline: 8px;
  }

  .leaderboard-row strong,
  .leaderboard-row > b {
    font-size: 0.82rem;
  }

  .design-option {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .design-apply {
    width: 100%;
  }

  .tutorial-card h2 {
    padding-inline: 18px;
  }

  .tutorial-board-visual {
    aspect-ratio: 1.45;
  }

  .tutorial-points {
    inset: 8% 8% 10%;
    gap: 0 0.8%;
  }

  .tutorial-callouts {
    left: 6%;
    right: 6%;
    bottom: 5%;
  }

  .tutorial-note {
    top: 5%;
  }

  .tutorial-counter {
    min-width: 58px;
    font-size: 0.9rem;
  }

  .brand-title-row {
    flex-direction: column;
    gap: 8px;
  }

  .brand-logo-heading {
    width: min(92vw, 620px);
    border-radius: 18px;
  }

  .brand-domain {
    padding: 7px 12px;
  }

  .brand-tagline {
    max-width: 320px;
    margin-top: 10px;
    line-height: 1.45;
    letter-spacing: 0.09em;
  }

  .mode-card {
    display: grid;
    min-height: 112px;
    grid-template-columns: 76px 1fr;
    align-items: center;
    text-align: left;
  }

  .mode-icon {
    margin: 0;
  }

  .mode-title,
  .mode-meta {
    grid-column: 2;
  }

  .mode-meta {
    min-height: auto;
  }

  .board {
    grid-template-columns: repeat(6, minmax(0, 1fr)) minmax(40px, 9vw) repeat(6, minmax(0, 1fr));
    grid-template-rows: 1fr 1fr;
  }

  .point::before {
    left: 12%;
    right: 12%;
  }
}
