:root {
  --ink: #16201d;
  --muted: #63736d;
  --line: #dce5df;
  --panel: #ffffff;
  --soft: #eef6f1;
  --mint: #13a06f;
  --mint-dark: #08744f;
  --gold: #e0a229;
  --rose: #c54053;
  --navy: #263447;
  --shadow: 0 18px 44px rgba(27, 42, 36, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(135deg, #f7fbf8 0%, #f2f6fb 52%, #fff8ea 100%);
}

body[data-app="player"] {
  background: #eef4f1;
}

body[data-app="admin"] {
  background: #eef3f1;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

body.auth-active {
  background: #061512;
}

.auth-landing {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 82% 18%, rgba(19, 160, 111, 0.34), transparent 30%),
    radial-gradient(circle at 16% 88%, rgba(224, 162, 41, 0.24), transparent 26%),
    linear-gradient(135deg, #061512 0%, #10231d 48%, #111f1a 100%);
}

.auth-hero-scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.auth-hero-scene::before {
  content: "";
  position: absolute;
  inset: -15% -8%;
  background:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(120deg, transparent 0%, #000 28%, #000 74%, transparent 100%);
  transform: rotate(-8deg);
}

.auth-hero-scene::after {
  content: "";
  position: absolute;
  inset: auto -12% -22% -12%;
  height: 42%;
  background: radial-gradient(ellipse at center, rgba(2, 9, 7, 0.82), transparent 68%);
}

.auth-board-preview {
  position: absolute;
  top: clamp(48px, 9vw, 104px);
  right: clamp(-64px, 5vw, 88px);
  width: min(44vw, 450px);
  min-width: 300px;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 14px;
  border: 14px solid #5d2a12;
  border-radius: 8px;
  background: #20130f;
  box-shadow: 0 42px 90px rgba(0, 0, 0, 0.42);
  transform: perspective(820px) rotateX(58deg) rotateZ(-24deg);
  transform-origin: center;
}

.auth-board-preview span,
.auth-board-preview b {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
}

.auth-board-preview span:nth-child(odd),
.auth-board-preview b:nth-child(even) {
  background: #f5ead5;
}

.auth-board-preview span:nth-child(even),
.auth-board-preview b:nth-child(odd) {
  background: #101312;
}

.auth-board-preview b {
  color: #f7efe2;
  font-size: clamp(36px, 6vw, 70px);
  font-weight: 900;
  text-shadow: 0 14px 20px rgba(0, 0, 0, 0.52);
  transform: translateY(-16px) rotateZ(24deg) rotateX(-58deg);
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  margin: 0 auto;
  padding: clamp(22px, 5vw, 56px);
}

.auth-copy {
  max-width: 650px;
}

.auth-brand {
  margin-bottom: clamp(36px, 8vh, 80px);
}

.auth-copy .brand-mark {
  background: #f5ca5f;
  color: #14211c;
}

.auth-copy .brand small,
.auth-copy > p {
  color: #d8e4de;
}

.auth-copy h1 {
  max-width: 760px;
  margin: 10px 0 18px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.98;
}

.auth-copy > p:not(.eyebrow) {
  max-width: 560px;
  margin: 0;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.7;
}

.auth-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.auth-highlights span {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 13px;
  border-radius: 999px;
  color: #f7fbf9;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 900;
}

.auth-panel {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border-radius: 8px;
  background: #e8eee9;
}

.auth-tab {
  min-height: 42px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.auth-tab.active {
  color: #fff;
  background: #12211c;
  box-shadow: 0 8px 18px rgba(18, 33, 28, 0.16);
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form h2 {
  margin: 4px 0 0;
  font-size: 27px;
  line-height: 1.1;
}

.auth-form label {
  display: grid;
  gap: 8px;
  color: #31423b;
  font-weight: 900;
}

.auth-form input {
  width: 100%;
  min-height: 50px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

.auth-form input:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 4px rgba(19, 160, 111, 0.14);
}

.auth-form p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-form .primary,
.auth-form .secondary {
  width: 100%;
}

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(12, 28, 23, 0.96), rgba(26, 57, 48, 0.9)),
    repeating-linear-gradient(45deg, #12211c 0 16px, #1e3a31 16px 32px);
}

.login-card {
  width: min(100%, 500px);
  display: grid;
  gap: 24px;
  padding: 30px;
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
}

.login-brand-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.portal-badge,
.system-pill {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 1000;
}

.portal-badge {
  color: #17362d;
  background: #f5ca5f;
}

.login-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.login-feature-grid span {
  min-height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #d8e3de;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 900;
}

.login-card h1 {
  margin-bottom: 10px;
  font-size: 36px;
  line-height: 1.05;
}

.login-copy,
.login-hint {
  margin-bottom: 0;
  color: #d8e3de;
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  color: #d8e3de;
}

.app-shell {
  display: grid;
  grid-template-columns: 244px 1fr;
  min-height: 100vh;
}

.player-shell {
  display: block;
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 88px;
  background: #f8fbf9;
  box-shadow: 0 0 0 1px rgba(18, 33, 28, 0.06), 0 24px 80px rgba(18, 33, 28, 0.16);
}

.admin-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
  background: #eef3f1;
}

.rail {
  padding: 24px 18px;
  background: #12211c;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 26px 20px;
  color: #fff;
  background: linear-gradient(180deg, #111f1a, #1f3442);
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 14px 0 34px rgba(18, 33, 28, 0.16);
}

.admin-nav {
  display: grid;
  gap: 7px;
}

.admin-nav-item {
  min-height: 48px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 0 12px;
  border-radius: 8px;
  color: #cddbd5;
  background: transparent;
  text-align: left;
  font-weight: 900;
}

.admin-nav-item span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #d8e6df;
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 1000;
}

.admin-nav-item b {
  font-size: 14px;
}

.admin-nav-item.active {
  color: #10201a;
  background: #f2c860;
  box-shadow: 0 10px 20px rgba(224, 162, 41, 0.2);
}

.admin-nav-item.active span {
  color: #10201a;
  background: rgba(255, 255, 255, 0.44);
}

.admin-main {
  min-width: 0;
  padding: 24px;
}

.mobile-appbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 74px;
  padding: 12px 14px;
  color: #fff;
  background: #12211c;
  box-shadow: 0 10px 24px rgba(18, 33, 28, 0.18);
}

.admin-summary {
  margin-top: auto;
  padding: 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.admin-summary span {
  display: block;
  margin-bottom: 8px;
  color: #bdc9d6;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.admin-summary strong {
  word-break: break-word;
}

.admin-summary button {
  width: 100%;
  margin-top: 14px;
}

.brand,
.player-chip,
.section-head,
.match-bar,
.inline-form {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #092015;
  background: var(--gold);
  font-weight: 900;
  font-size: 24px;
}

.brand small,
.player-chip small,
.stats-grid span,
.balance-panel span,
.match-bar span,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.brand small {
  color: #a8b8b1;
  display: block;
}

.nav {
  display: grid;
  gap: 8px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 6;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: min(100%, 520px);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line);
  box-shadow: 0 -16px 40px rgba(18, 33, 28, 0.12);
  transform: translateX(-50%);
}

.nav-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  height: 46px;
  padding: 0 12px;
  border-radius: 8px;
  color: #dce9e3;
  background: transparent;
  text-align: left;
}

.nav-item span {
  font-size: 22px;
}

.nav-item.active {
  background: #234036;
  color: #fff;
}

.bottom-nav .nav-item {
  grid-template-columns: 1fr;
  place-items: center;
  height: 58px;
  padding: 5px 4px;
  color: var(--muted);
  background: transparent;
  text-align: center;
}

.bottom-nav .nav-item span {
  font-size: 24px;
  line-height: 1;
}

.bottom-nav .nav-item b {
  font-size: 11px;
}

.bottom-nav .nav-item.active {
  color: #fff;
  background: var(--mint);
}

.main-panel {
  padding: 28px;
  overflow: hidden;
}

.player-shell .main-panel {
  padding: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.player-shell .topbar {
  display: block;
  margin-bottom: 14px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 44px);
}

.player-shell h1 {
  font-size: 28px;
}

.player-chip {
  gap: 10px;
  min-width: 214px;
  justify-content: flex-end;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mobile-appbar .player-chip {
  min-width: 0;
  max-width: 190px;
  padding: 7px 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
}

.mobile-appbar .player-chip small {
  color: #b9c8c1;
}

.mobile-appbar .player-chip strong {
  display: block;
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 5px rgba(19, 160, 111, 0.12);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: block;
}

.hero {
  min-height: 300px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: stretch;
  padding: 32px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(105deg, rgba(12, 34, 26, 0.96), rgba(16, 84, 61, 0.84)),
    radial-gradient(circle at 80% 25%, rgba(224, 162, 41, 0.45), transparent 32%),
    repeating-linear-gradient(45deg, #17362d 0 14px, #1f473c 14px 28px);
  box-shadow: var(--shadow);
}

.player-shell .hero {
  min-height: 0;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 20px;
}

.player-shell .game-hero {
  position: relative;
  overflow: hidden;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(8, 36, 28, 0.98), rgba(20, 103, 73, 0.9)),
    radial-gradient(circle at 88% 8%, rgba(255, 216, 103, 0.9), transparent 24%),
    radial-gradient(circle at 12% 88%, rgba(216, 78, 94, 0.65), transparent 30%),
    repeating-linear-gradient(45deg, #10251f 0 12px, #183b31 12px 24px);
}

.game-hero::after {
  content: "XO";
  position: absolute;
  right: -14px;
  top: 8px;
  color: rgba(255, 255, 255, 0.08);
  font-size: 112px;
  font-weight: 1000;
  line-height: 1;
}

.hero h2 {
  max-width: 680px;
  margin-bottom: 12px;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 0.98;
}

.player-shell .hero h2 {
  font-size: 36px;
  line-height: 1.02;
}

.hero p {
  max-width: 580px;
  color: #d8e9df;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.live-ticket {
  align-self: center;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
}

.player-shell .live-ticket {
  position: relative;
  z-index: 1;
  padding: 16px;
  background: rgba(255, 255, 255, 0.14);
}

.live-ticket strong {
  display: block;
  margin: 10px 0 18px;
  font-size: 30px;
}

dl,
dd {
  margin: 0;
}

.live-ticket div {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

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

.home-stats article {
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  color: #fff;
  background: #263447;
  box-shadow: 0 10px 20px rgba(18, 33, 28, 0.1);
}

.home-stats span,
.game-copy span {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.home-stats strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: #fff;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary,
.secondary,
.danger {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 800;
}

.primary:disabled,
.secondary:disabled,
.danger:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  filter: grayscale(0.2);
}

.primary {
  color: #fff;
  background: var(--mint);
}

.primary:hover {
  background: var(--mint-dark);
}

.secondary {
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.danger {
  color: #fff;
  background: var(--rose);
}

.stats-grid,
.game-cards,
.wallet-grid,
.admin-layout {
  display: grid;
  gap: 16px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 22px 0;
}

.stats-grid article,
.game-card,
.balance-panel,
.ledger-panel,
.admin-panel,
.match-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 20px rgba(27, 42, 36, 0.06);
}

.stats-grid article {
  padding: 18px;
}

.stats-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.section-head {
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 12px;
}

.section-head.compact {
  margin: 0 0 16px;
}

.segmented {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.segmented button {
  min-height: 38px;
  padding: 0 14px;
  background: transparent;
  font-weight: 800;
}

.segmented .selected {
  color: #fff;
  background: var(--navy);
}

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

.player-shell .game-cards {
  grid-template-columns: 1fr;
}

.game-card {
  display: grid;
  grid-template-columns: 76px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.player-shell .game-card {
  grid-template-columns: 64px 1fr;
  padding: 14px;
}

.player-shell .featured-game {
  position: relative;
  overflow: hidden;
  grid-template-columns: 96px 1fr;
  min-height: 176px;
  color: #fff;
  border: 0;
}

.xo-card {
  background:
    linear-gradient(135deg, rgba(18, 33, 28, 0.96), rgba(19, 160, 111, 0.86)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 34px);
}

.dama-card {
  background:
    linear-gradient(135deg, rgba(38, 52, 71, 0.97), rgba(224, 162, 41, 0.82)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 12px, transparent 12px 24px);
}

.tankegna-card {
  background:
    linear-gradient(135deg, rgba(18, 33, 28, 0.96), rgba(150, 78, 26, 0.9)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 12px, transparent 12px 24px);
}

.chess-card {
  background:
    linear-gradient(135deg, rgba(5, 7, 8, 0.98), rgba(36, 39, 42, 0.96)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.14) 0 14px, transparent 14px 28px);
}

.game-art {
  width: 96px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.xo-art {
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 10px;
}

.xo-art span {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  color: #12211c;
  background: #fff;
  font-size: 24px;
  font-weight: 1000;
}

.dama-art {
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 16px;
}

.dama-art span {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #26322e 0 42%, transparent 43%),
    repeating-conic-gradient(from 6deg, #0f1715 0deg 9deg, #34413d 9deg 18deg);
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.22), inset 0 6px 0 rgba(255, 255, 255, 0.14), 0 8px 14px rgba(0, 0, 0, 0.22);
}

.dama-art span:nth-child(2),
.dama-art span:nth-child(3) {
  background:
    radial-gradient(circle at 50% 50%, #d84e5e 0 42%, transparent 43%),
    repeating-conic-gradient(from 6deg, #992c3a 0deg 9deg, #f07a86 9deg 18deg);
}

.tankegna-art span::after {
  content: "♛";
  position: absolute;
  inset: 24%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffd66a;
  background: rgba(255, 255, 255, 0.16);
  font-size: 17px;
  line-height: 1;
}

.chess-art {
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 12px;
  background:
    linear-gradient(145deg, #160904, #6f2b0e 12%, #080909 13% 87%, #5b220d 88%, #120704);
  border: 5px solid #180903;
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.12),
    inset 0 0 0 5px rgba(0, 0, 0, 0.5),
    0 12px 18px rgba(0, 0, 0, 0.26);
}

.chess-art span {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  color: #f4ead4;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.72), transparent 28%),
    #f3debd;
  padding-bottom: 8%;
  font-size: 29px;
  line-height: 1;
  border-radius: 0;
  filter: drop-shadow(0 5px 3px rgba(0, 0, 0, 0.34));
  text-shadow:
    0 1px 0 #7c7568,
    0 3px 5px rgba(0, 0, 0, 0.4);
}

.chess-art span::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 13%;
  width: 58%;
  height: 18%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 18%, #fff 0 17%, transparent 18%),
    linear-gradient(180deg, #fff7df, #d1b98e 58%, #7f6a4e);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.32),
    inset 0 -4px 4px rgba(0, 0, 0, 0.28),
    0 4px 3px rgba(0, 0, 0, 0.28);
  transform: translateX(-50%);
}

.chess-art span:nth-child(2),
.chess-art span:nth-child(4) {
  color: #111a2a;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.08), transparent 28%),
    #07090a;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.28),
    0 4px 5px rgba(0, 0, 0, 0.42);
}

.chess-art span:nth-child(2)::before,
.chess-art span:nth-child(4)::before {
  background:
    radial-gradient(circle at 32% 18%, rgba(230, 240, 255, 0.58) 0 14%, transparent 15%),
    linear-gradient(180deg, #46546b, #142033 55%, #04060a);
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.16),
    inset 0 -4px 4px rgba(0, 0, 0, 0.5),
    0 4px 3px rgba(0, 0, 0, 0.34);
}

.game-copy h3 small {
  color: #ffe18a;
  font-size: 14px;
  font-weight: 900;
}

.active-game-count {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  min-height: 26px;
  margin-top: 10px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 12px;
  font-weight: 1000;
  line-height: 1;
  white-space: nowrap;
}

.active-game-count::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: #42ff9e;
  box-shadow: 0 0 8px rgba(66, 255, 158, 0.82);
}

body[data-cork-brand="coca-cola"] .dama-art span,
body[data-cork-brand="coca-cola"] .piece.black {
  background:
    radial-gradient(circle at 50% 50%, #f7f2e8 0 40%, transparent 41%),
    radial-gradient(circle at 50% 56%, rgba(110, 5, 4, 0.28) 0 44%, transparent 45%),
    repeating-conic-gradient(from 3deg, #7a0807 0deg 5deg, #e41d16 5deg 10deg, #fff4ea 10deg 15deg);
}

body[data-cork-brand="coca-cola"] .dama-art span:nth-child(2),
body[data-cork-brand="coca-cola"] .dama-art span:nth-child(3),
body[data-cork-brand="coca-cola"] .piece.red {
  background:
    radial-gradient(circle at 50% 50%, #e21c16 0 40%, transparent 41%),
    radial-gradient(circle at 50% 56%, rgba(255, 255, 255, 0.32) 0 44%, transparent 45%),
    repeating-conic-gradient(from 3deg, #ffffff 0deg 5deg, #d71913 5deg 10deg, #860706 10deg 15deg);
}

body[data-cork-brand="pepsi"] .dama-art span,
body[data-cork-brand="pepsi"] .piece.black {
  background:
    radial-gradient(circle at 50% 50%, #f8fbff 0 40%, transparent 41%),
    radial-gradient(circle at 50% 56%, rgba(0, 57, 166, 0.25) 0 44%, transparent 45%),
    repeating-conic-gradient(from 3deg, #004b9b 0deg 5deg, #ffffff 5deg 10deg, #d71920 10deg 15deg);
}

body[data-cork-brand="pepsi"] .dama-art span:nth-child(2),
body[data-cork-brand="pepsi"] .dama-art span:nth-child(3),
body[data-cork-brand="pepsi"] .piece.red {
  background:
    radial-gradient(circle at 50% 50%, #063d8f 0 40%, transparent 41%),
    radial-gradient(circle at 50% 56%, rgba(255, 255, 255, 0.3) 0 44%, transparent 45%),
    repeating-conic-gradient(from 3deg, #e4252b 0deg 5deg, #ffffff 5deg 10deg, #004b9b 10deg 15deg);
}

body[data-red-cork-brand="coca-cola"] .piece.red,
body[data-black-cork-brand="coca-cola"] .piece.black {
  overflow: visible;
  background: url("./assets/coca-cork-generated.png") center / contain no-repeat;
  box-shadow:
    0 9px 12px rgba(0, 0, 0, 0.32);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.18));
}

body[data-red-cork-brand="coca-cola"] .piece.red::before,
body[data-black-cork-brand="coca-cola"] .piece.black::before {
  display: none;
}

body[data-red-cork-brand="pepsi"] .piece.red,
body[data-black-cork-brand="pepsi"] .piece.black {
  overflow: visible;
  background: url("./assets/pepsi-cork-generated.png") center / contain no-repeat;
  box-shadow:
    0 9px 12px rgba(0, 0, 0, 0.32);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.18));
}

body[data-red-cork-brand="pepsi"] .piece.red::before,
body[data-black-cork-brand="pepsi"] .piece.black::before {
  display: none;
}

body[data-red-cork-brand="classic"] .piece.red {
  background:
    radial-gradient(circle at 50% 50%, #f8f6f0 0 40%, transparent 41%),
    radial-gradient(circle at 50% 57%, rgba(128, 42, 34, 0.32) 0 44%, transparent 45%),
    repeating-conic-gradient(from 3deg, #d0cac1 0deg 5deg, #ffffff 5deg 10deg, #ede9e1 10deg 15deg);
}

body[data-black-cork-brand="classic"] .piece.black {
  background:
    radial-gradient(circle at 50% 50%, #171918 0 40%, transparent 41%),
    radial-gradient(circle at 50% 57%, rgba(135, 35, 32, 0.24) 0 44%, transparent 45%),
    repeating-conic-gradient(from 3deg, #050707 0deg 5deg, #2a2f2c 5deg 10deg, #101312 10deg 15deg);
}

.game-copy {
  position: relative;
  z-index: 1;
}

.game-copy h3 {
  margin: 4px 0 6px;
  font-size: 30px;
}

.game-copy p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.82);
}

.player-shell .game-card button {
  grid-column: 1 / -1;
  position: relative;
  z-index: 1;
  background: #fff;
  color: #12211c;
}

.game-icon {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 900;
  font-size: 26px;
}

.xo-icon {
  background: var(--mint);
}

.dama-icon {
  background: var(--gold);
  color: #2b210b;
}

.match-bar {
  position: relative;
  overflow: hidden;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  margin-bottom: 16px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(15, 41, 39, 0.96), rgba(23, 118, 105, 0.94)),
    radial-gradient(circle at 92% 12%, rgba(255, 214, 102, 0.55), transparent 28%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 28px rgba(11, 55, 52, 0.2);
}

.match-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0 46%, rgba(255, 255, 255, 0.08) 46% 48%, transparent 48% 100%),
    linear-gradient(0deg, transparent 0 46%, rgba(255, 255, 255, 0.08) 46% 48%, transparent 48% 100%);
  opacity: 0.42;
}

.match-bar > * {
  position: relative;
  z-index: 1;
}

.match-bar span {
  color: rgba(255, 255, 255, 0.72);
}

.match-bar strong {
  display: block;
  color: #fff;
  font-size: 21px;
  line-height: 1.1;
}

.match-start-notice {
  display: block;
  min-height: 18px;
  margin-top: 6px;
  color: #ffe98a;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.match-bar .secondary {
  min-width: 118px;
  color: #12372f;
  background: linear-gradient(180deg, #ffffff, #dff8ef);
  border: 0;
  box-shadow: inset 0 -3px 0 rgba(17, 93, 78, 0.16), 0 8px 16px rgba(0, 0, 0, 0.18);
}

.board-wrap {
  display: grid;
  grid-template-columns: minmax(280px, 560px) minmax(220px, 320px);
  gap: 20px;
  align-items: start;
}

.player-shell .board-wrap {
  grid-template-columns: 1fr;
  gap: 12px;
}

.xo-board,
.dama-board,
.chess-board {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 1;
  display: grid;
  border: 3px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.xo-board.my-turn-board,
.dama-board.my-turn-board,
.chess-board.my-turn-board {
  border-color: #f5ca5f;
  box-shadow:
    0 0 0 4px rgba(245, 202, 95, 0.34),
    0 0 28px rgba(245, 202, 95, 0.72),
    0 12px 34px rgba(19, 160, 111, 0.28);
  filter: saturate(1.08);
  animation: boardTurnGlow 1.45s ease-in-out infinite;
}

.my-turn-board-wrap .match-card {
  border-color: rgba(245, 202, 95, 0.42);
}

@keyframes boardTurnGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 4px rgba(245, 202, 95, 0.25),
      0 0 22px rgba(245, 202, 95, 0.56),
      0 12px 34px rgba(19, 160, 111, 0.22);
  }
  50% {
    box-shadow:
      0 0 0 7px rgba(245, 202, 95, 0.34),
      0 0 38px rgba(245, 202, 95, 0.82),
      0 16px 42px rgba(19, 160, 111, 0.32);
  }
}

.player-shell .xo-board,
.player-shell .dama-board,
.player-shell .chess-board {
  width: 100%;
}

.captured-panel {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, #f8fbf9, #eef6f1);
  border: 1px solid var(--line);
}

.captured-head,
.captured-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.captured-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.captured-head b {
  min-width: 34px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: var(--navy);
  text-align: center;
}

.captured-row {
  min-height: 46px;
  padding: 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(220, 229, 223, 0.8);
}

.captured-row > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 74px;
}

.captured-dot,
.captured-piece {
  display: inline-block;
  border-radius: 50%;
  box-shadow: inset 0 -3px 8px rgba(0, 0, 0, 0.22), 0 2px 5px rgba(18, 33, 28, 0.16);
}

.captured-dot {
  width: 18px;
  height: 18px;
}

.captured-stack {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.captured-piece {
  width: 16px;
  height: 16px;
}

.captured-dot.red,
.captured-piece.red {
  background: linear-gradient(145deg, #f7c5b8, #b8293d 62%, #7b1425);
}

.captured-dot.black,
.captured-piece.black {
  background: linear-gradient(145deg, #5b6672, #101820 62%, #05080a);
}

body[data-red-cork-brand="coca-cola"] .captured-dot.red,
body[data-red-cork-brand="coca-cola"] .captured-piece.red,
body[data-black-cork-brand="coca-cola"] .captured-dot.black,
body[data-black-cork-brand="coca-cola"] .captured-piece.black {
  background: url("./assets/coca-cork-generated.png") center / contain no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28), 0 2px 5px rgba(18, 33, 28, 0.16);
}

body[data-red-cork-brand="pepsi"] .captured-dot.red,
body[data-red-cork-brand="pepsi"] .captured-piece.red,
body[data-black-cork-brand="pepsi"] .captured-dot.black,
body[data-black-cork-brand="pepsi"] .captured-piece.black {
  background: url("./assets/pepsi-cork-generated.png") center / contain no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32), 0 2px 5px rgba(18, 33, 28, 0.16);
}

.captured-row > b {
  min-width: 24px;
  color: var(--mint-dark);
  text-align: right;
}

.xo-board {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: clamp(6px, 1.8vw, 12px);
  padding: 0;
  background: #ffffff;
  border-radius: 0;
  box-shadow: 0 18px 34px rgba(15, 86, 79, 0.22);
}

.xo-cell {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  color: transparent;
  background: #20a79b;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(74px, 22vw, 150px);
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: none;
  transition: background 0.16s ease, transform 0.16s ease;
}

.xo-cell:hover {
  background: #24b6a9;
}

.xo-cell.mark-x {
  color: #164f4b;
}

.xo-cell.mark-o {
  color: #ffffff;
}

.xo-cell.win {
  background: #18beb0;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.42);
}

.dama-board {
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 2px;
  padding: 6px;
  background:
    linear-gradient(90deg, rgba(55, 28, 17, 0.9) 0 2px, transparent 2px),
    linear-gradient(0deg, rgba(55, 28, 17, 0.9) 0 2px, transparent 2px),
    #2f1b12;
  border: 10px solid #5b351f;
  box-shadow:
    inset 0 0 0 4px #d8a75e,
    inset 0 0 0 8px #2b160e,
    var(--shadow);
}

.chess-board {
  position: relative;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  gap: 0;
  padding: clamp(12px, 3.2vw, 20px);
  overflow: visible;
  border: clamp(10px, 2.8vw, 18px) solid #070808;
  border-radius: 4px;
  transform-style: preserve-3d;
  background:
    linear-gradient(145deg, #050607, #25282a 48%, #090a0b);
  box-shadow:
    inset 0 0 0 2px #4b4f51,
    inset 0 0 0 7px #111315,
    inset 0 0 0 10px rgba(255, 255, 255, 0.08),
    0 18px 28px rgba(0, 0, 0, 0.22);
}

.chess-square {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1;
  font-family: Georgia, "Times New Roman", serif;
  transform-style: preserve-3d;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.08),
    inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

.chess-square::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), transparent 40%, rgba(0, 0, 0, 0.14));
  transform: translateZ(2px);
}

.chess-square.light {
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.72), transparent 28%),
    linear-gradient(135deg, rgba(222, 176, 113, 0.18), transparent 45%),
    #f3debd;
}

.chess-square.dark {
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.08), transparent 28%),
    linear-gradient(135deg, rgba(60, 71, 79, 0.28), transparent 42%),
    #07090a;
}

.chess-square.selected {
  box-shadow:
    inset 0 0 0 4px #e0a229,
    inset 0 0 18px rgba(224, 162, 41, 0.36);
}

.chess-square.target::after {
  content: "";
  position: absolute;
  width: 34%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(224, 162, 41, 0.52);
  box-shadow: 0 0 0 5px rgba(224, 162, 41, 0.18);
  pointer-events: none;
}

.chess-square.target:has(.chess-piece)::after {
  width: 82%;
  border: 4px solid rgba(224, 162, 41, 0.82);
  background: transparent;
}

.chess-square.in-check {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.26), transparent 42%),
    #c54053;
}

.chess-piece {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding-bottom: 13%;
  font-size: clamp(30px, 11.2vw, 64px);
  line-height: 1;
  isolation: isolate;
  transform: translateZ(22px) perspective(140px) rotateX(11deg) translateY(-8%);
  filter: drop-shadow(0 15px 7px rgba(0, 0, 0, 0.5));
  transition: transform 0.16s ease, filter 0.16s ease;
}

.chess-glyph {
  position: relative;
  z-index: 4;
  display: grid;
  place-items: center;
  transform: translateZ(14px);
  opacity: 0.08;
  mix-blend-mode: normal;
}

.chess-shape {
  position: absolute;
  left: 50%;
  pointer-events: none;
  transform: translateX(-50%);
}

.chess-shadow {
  z-index: -2;
  bottom: 1%;
  width: 90%;
  height: 20%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.46);
  filter: blur(4px);
}

.chess-base {
  z-index: 1;
  bottom: 5%;
  width: 82%;
  height: 30%;
  border-radius: 50%;
  box-shadow:
    inset 0 6px 6px rgba(255, 255, 255, 0.36),
    inset 0 -10px 9px rgba(0, 0, 0, 0.5),
    0 9px 8px rgba(0, 0, 0, 0.34);
}

.chess-body {
  z-index: 2;
  bottom: 25%;
  width: 56%;
  height: 38%;
  border-radius: 50% 50% 40% 40%;
  box-shadow:
    inset 10px 0 9px rgba(255, 255, 255, 0.24),
    inset -10px 0 12px rgba(0, 0, 0, 0.48),
    0 7px 6px rgba(0, 0, 0, 0.3);
}

.chess-head {
  z-index: 3;
  bottom: 57%;
  width: 40%;
  height: 32%;
  border-radius: 50%;
  box-shadow:
    inset 8px 6px 8px rgba(255, 255, 255, 0.42),
    inset -9px -10px 10px rgba(0, 0, 0, 0.48),
    0 7px 5px rgba(0, 0, 0, 0.3);
}

.chess-piece.white .chess-base,
.chess-piece.white .chess-body,
.chess-piece.white .chess-head {
  background:
    linear-gradient(105deg, transparent 0 28%, rgba(255, 255, 255, 0.48) 29% 36%, transparent 37% 100%),
    radial-gradient(circle at 30% 18%, #fff 0 16%, transparent 17%),
    radial-gradient(circle at 64% 20%, rgba(255, 255, 255, 0.58), transparent 18%),
    linear-gradient(135deg, #fff9e7, #dcc497 50%, #8a7352 78%, #5f4d36);
}

.chess-piece.black .chess-base,
.chess-piece.black .chess-body,
.chess-piece.black .chess-head {
  background:
    linear-gradient(105deg, transparent 0 28%, rgba(230, 242, 255, 0.24) 29% 36%, transparent 37% 100%),
    radial-gradient(circle at 30% 18%, rgba(235, 244, 255, 0.62) 0 14%, transparent 15%),
    radial-gradient(circle at 64% 20%, rgba(128, 154, 196, 0.34), transparent 18%),
    linear-gradient(135deg, #51647f, #18263e 48%, #060a12 78%, #010203);
}

.chess-square:hover .chess-piece,
.chess-square.selected .chess-piece {
  transform: translateZ(30px) perspective(140px) rotateX(8deg) translateY(-12%);
  filter: drop-shadow(0 19px 9px rgba(0, 0, 0, 0.58));
}

.chess-piece::before,
.chess-piece::after {
  content: "";
  position: absolute;
  left: 50%;
  z-index: -1;
  pointer-events: none;
  transform: translateX(-50%);
}

.chess-piece::before {
  bottom: 10%;
  width: 56%;
  height: 22%;
  border-radius: 50%;
  box-shadow:
    inset 0 3px 3px rgba(255, 255, 255, 0.28),
    inset 0 -5px 6px rgba(0, 0, 0, 0.34),
    0 5px 4px rgba(0, 0, 0, 0.24);
}

.chess-piece::after {
  bottom: 5%;
  width: 76%;
  height: 17%;
  border-radius: 50%;
  box-shadow:
    inset 0 2px 3px rgba(255, 255, 255, 0.2),
    inset 0 -5px 5px rgba(0, 0, 0, 0.4),
    0 8px 7px rgba(0, 0, 0, 0.3);
}

.chess-piece.white {
  color: #f4ead4;
  text-shadow:
    -2px -2px 0 rgba(255, 255, 255, 0.72),
    1px -1px 0 #fff9e9,
    0 1px 0 #c2b7a2,
    1px 3px 0 #8f806a,
    2px 5px 0 rgba(108, 93, 70, 0.52),
    0 9px 10px rgba(0, 0, 0, 0.52);
}

.chess-piece.white::before {
  background:
    radial-gradient(circle at 32% 18%, #fff 0 17%, transparent 18%),
    radial-gradient(circle at 58% 20%, rgba(255, 255, 255, 0.62), transparent 18%),
    linear-gradient(180deg, #fff7df, #d1b98e 58%, #7f6a4e);
}

.chess-piece.white::after {
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.78), transparent 20%),
    linear-gradient(180deg, #fff1cf, #c7aa76 56%, #766249);
}

.chess-piece.black {
  color: #111a2a;
  text-shadow:
    -2px -2px 0 rgba(210, 225, 255, 0.2),
    1px -1px 0 rgba(125, 147, 180, 0.26),
    0 1px 0 #020304,
    1px 3px 0 #304059,
    2px 5px 0 #05070b,
    0 9px 11px rgba(0, 0, 0, 0.66);
}

.chess-piece.black::before {
  background:
    radial-gradient(circle at 32% 18%, rgba(230, 240, 255, 0.58) 0 14%, transparent 15%),
    radial-gradient(circle at 58% 20%, rgba(125, 147, 180, 0.28), transparent 18%),
    linear-gradient(180deg, #46546b, #142033 55%, #04060a);
}

.chess-piece.black::after {
  background:
    radial-gradient(circle at 34% 22%, rgba(220, 235, 255, 0.32), transparent 18%),
    linear-gradient(180deg, #3b495e, #111b2d 58%, #020306);
}

.chess-square.light .chess-piece.black,
.chess-square.dark .chess-piece.white {
  filter: drop-shadow(0 10px 5px rgba(0, 0, 0, 0.48));
}

.chess-square .chess-piece + *,
.chess-piece {
  will-change: transform;
}

.chess-piece.type-pawn {
  font-size: clamp(26px, 9.2vw, 52px);
  padding-bottom: 16%;
}

.chess-piece.type-pawn .chess-body {
  bottom: 27%;
  width: 44%;
  height: 28%;
  border-radius: 48% 48% 38% 38%;
}

.chess-piece.type-pawn .chess-head {
  bottom: 54%;
  width: 40%;
  height: 34%;
}

.chess-piece.type-pawn::before {
  bottom: 12%;
  width: 50%;
  height: 21%;
}

.chess-piece.type-pawn::after {
  width: 66%;
  height: 15%;
}

.chess-piece.type-rook {
  font-size: clamp(30px, 10.2vw, 58px);
}

.chess-piece.type-rook .chess-head {
  bottom: 56%;
  width: 54%;
  height: 27%;
  border-radius: 18% 18% 42% 42%;
  clip-path: polygon(0 22%, 14% 22%, 14% 0, 31% 0, 31% 22%, 45% 22%, 45% 0, 62% 0, 62% 22%, 78% 22%, 78% 0, 95% 0, 95% 22%, 100% 22%, 100% 100%, 0 100%);
}

.chess-piece.type-knight {
  font-size: clamp(32px, 11vw, 64px);
  transform: translateZ(24px) perspective(140px) rotateX(11deg) rotateZ(-3deg) translateY(-8%);
}

.chess-piece.type-knight .chess-head {
  bottom: 50%;
  width: 52%;
  height: 40%;
  border-radius: 56% 42% 42% 34%;
  clip-path: polygon(18% 100%, 8% 58%, 30% 18%, 38% 0, 54% 17%, 82% 20%, 68% 42%, 90% 68%, 58% 78%, 48% 100%);
}

.chess-square:hover .chess-piece.type-knight,
.chess-square.selected .chess-piece.type-knight {
  transform: translateZ(32px) perspective(140px) rotateX(8deg) rotateZ(-3deg) translateY(-12%);
}

.chess-piece.type-bishop {
  font-size: clamp(31px, 10.8vw, 62px);
}

.chess-piece.type-bishop .chess-head {
  bottom: 55%;
  width: 42%;
  height: 37%;
  border-radius: 48% 48% 44% 44%;
  clip-path: polygon(50% 0, 78% 18%, 88% 56%, 66% 100%, 34% 100%, 12% 56%, 22% 18%);
}

.chess-piece.type-queen,
.chess-piece.type-king {
  font-size: clamp(34px, 11.8vw, 70px);
  padding-bottom: 10%;
}

.chess-piece.type-queen::before,
.chess-piece.type-king::before {
  width: 60%;
  height: 23%;
}

.chess-piece.type-queen::after,
.chess-piece.type-king::after {
  width: 80%;
  height: 18%;
}

.chess-piece.type-queen .chess-head {
  bottom: 55%;
  width: 58%;
  height: 37%;
  border-radius: 44% 44% 42% 42%;
  clip-path: polygon(0 58%, 12% 18%, 28% 45%, 42% 8%, 50% 42%, 60% 8%, 74% 45%, 90% 18%, 100% 58%, 84% 100%, 16% 100%);
}

.chess-piece.type-king .chess-head {
  bottom: 54%;
  width: 50%;
  height: 41%;
  border-radius: 42% 42% 44% 44%;
  clip-path: polygon(42% 0, 58% 0, 58% 18%, 75% 18%, 75% 32%, 58% 32%, 58% 48%, 88% 66%, 75% 100%, 25% 100%, 12% 66%, 42% 48%, 42% 32%, 25% 32%, 25% 18%, 42% 18%);
}

.player-shell .chess-board {
  margin: 8px 0 12px;
}

.chess-board .chess-piece {
  position: absolute;
  left: 50%;
  bottom: 2%;
  z-index: 2;
  width: 88%;
  height: 128%;
  padding: 0;
  font-size: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: contain;
  transform: translateX(-50%) translateZ(30px);
  filter: drop-shadow(0 13px 6px rgba(0, 0, 0, 0.56));
}

.chess-board .chess-piece::before,
.chess-board .chess-piece::after,
.chess-board .chess-shape,
.chess-board .chess-glyph {
  display: none;
}

.chess-board .chess-square:hover .chess-piece,
.chess-board .chess-square.selected .chess-piece {
  transform: translateX(-50%) translateZ(38px) translateY(-5%);
  filter: drop-shadow(0 18px 8px rgba(0, 0, 0, 0.64));
}

.chess-board .chess-piece.black.type-rook {
  background-image: url("./assets/chess3d/black-rook.png");
}

.chess-board .chess-piece.black.type-knight {
  background-image: url("./assets/chess3d/black-knight.png");
}

.chess-board .chess-piece.black.type-bishop {
  background-image: url("./assets/chess3d/black-bishop.png");
}

.chess-board .chess-piece.black.type-queen {
  background-image: url("./assets/chess3d/black-queen.png");
}

.chess-board .chess-piece.black.type-king {
  background-image: url("./assets/chess3d/black-king.png");
}

.chess-board .chess-piece.black.type-pawn {
  background-image: url("./assets/chess3d/black-pawn.png");
}

.chess-board .chess-piece.white.type-rook {
  background-image: url("./assets/chess3d/white-rook.png");
}

.chess-board .chess-piece.white.type-knight {
  background-image: url("./assets/chess3d/white-knight.png");
}

.chess-board .chess-piece.white.type-bishop {
  background-image: url("./assets/chess3d/white-bishop.png");
}

.chess-board .chess-piece.white.type-queen {
  background-image: url("./assets/chess3d/white-queen.png");
}

.chess-board .chess-piece.white.type-king {
  background-image: url("./assets/chess3d/white-king.png");
}

.chess-board .chess-piece.white.type-pawn {
  background-image: url("./assets/chess3d/white-pawn.png");
}

.chess-board .chess-piece.type-pawn {
  bottom: 4%;
  width: 72%;
  height: 108%;
  transform: translateX(-50%) translateZ(28px);
}

.chess-board .chess-square:hover .chess-piece.type-pawn,
.chess-board .chess-square.selected .chess-piece.type-pawn {
  transform: translateX(-50%) translateZ(36px) translateY(-4%);
}

.chess-match-bar {
  background:
    linear-gradient(135deg, rgba(18, 33, 28, 0.98), rgba(38, 52, 71, 0.94)),
    radial-gradient(circle at 88% 12%, rgba(245, 217, 144, 0.62), transparent 28%);
}

.chess-captured {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 12px;
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
}

.chess-captured span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 1000;
  text-transform: uppercase;
}

.chess-captured div {
  min-height: 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.2;
  word-break: break-word;
}

.square {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

.square.light {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 36%),
    radial-gradient(circle at 30% 20%, rgba(255, 246, 195, 0.42), transparent 36%),
    linear-gradient(45deg, #c89147, #f0c875 42%, #b97937);
}

.square.dark {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 34%),
    radial-gradient(circle at 70% 80%, rgba(47, 12, 8, 0.34), transparent 42%),
    #7a3328;
}

.square.selected {
  outline: 4px solid var(--gold);
  outline-offset: -4px;
}

.square.chain-source {
  box-shadow: inset 0 0 0 4px var(--gold), inset 0 0 24px rgba(224, 162, 41, 0.4);
}

.square.capture-required {
  box-shadow: inset 0 0 0 4px var(--mint), inset 0 0 22px rgba(19, 160, 111, 0.36);
}

.square.capture-required.selected,
.square.chain-source {
  box-shadow: inset 0 0 0 4px var(--gold), inset 0 0 24px rgba(224, 162, 41, 0.4);
}

.square.jump-target::after {
  content: "";
  width: 42%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid #fff2b8;
  background: rgba(224, 162, 41, 0.42);
  box-shadow: 0 0 0 5px rgba(224, 162, 41, 0.18);
}

.piece {
  position: relative;
  width: 76%;
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow:
    inset 0 -9px 0 rgba(0, 0, 0, 0.26),
    inset 0 5px 0 rgba(255, 255, 255, 0.2),
    0 9px 12px rgba(0, 0, 0, 0.32);
}

.piece::before {
  content: "";
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow:
    inset 0 3px 4px rgba(255, 255, 255, 0.55),
    inset 0 -4px 6px rgba(0, 0, 0, 0.12),
    0 0 0 2px rgba(255, 255, 255, 0.16);
}

.piece::after {
  content: "";
  position: absolute;
  inset: 22% 12%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: clamp(8px, 2.9vw, 17px);
  font-weight: 1000;
  line-height: 0.86;
  text-align: center;
  letter-spacing: 0;
  white-space: pre;
  font-family: Georgia, "Times New Roman", serif;
  transform: rotate(-3deg) scaleX(1.08);
}

.piece.red {
  background:
    radial-gradient(circle at 50% 46%, #fffdf7 0 47%, transparent 48%),
    radial-gradient(circle at 50% 57%, rgba(128, 42, 34, 0.2) 0 50%, transparent 51%),
    repeating-conic-gradient(from 3deg, #d8d2c9 0deg 5deg, #ffffff 5deg 10deg, #ebe6dd 10deg 15deg);
}

.piece.red::before {
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.95), transparent 25%),
    linear-gradient(145deg, #ffffff, #f1ece5);
  border-color: rgba(170, 160, 150, 0.36);
}

.piece.red::after {
  color: #bd2a24;
  text-shadow:
    0 1px 0 #fff,
    1px 1px 0 rgba(27, 86, 62, 0.28),
    0 0 1px rgba(157, 52, 45, 0.25);
}

.piece.black {
  background:
    radial-gradient(circle at 50% 46%, #141715 0 47%, transparent 48%),
    radial-gradient(circle at 50% 57%, rgba(255, 255, 255, 0.08) 0 50%, transparent 51%),
    repeating-conic-gradient(from 3deg, #030404 0deg 5deg, #2a2e2b 5deg 10deg, #0e1110 10deg 15deg);
}

.piece.black::before {
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.12), transparent 25%),
    linear-gradient(145deg, #20231f, #080a09);
  border-color: rgba(255, 255, 255, 0.14);
}

.piece.black::after {
  color: #f5f2ec;
  text-shadow:
    0 1px 0 #000,
    1px 1px 0 rgba(176, 47, 42, 0.78);
}

.piece.king::after {
  content: "♛";
  display: grid;
  place-items: center;
  inset: 0;
  border: 0;
  border-radius: 0;
  color: #ffd866;
  background: transparent;
  box-shadow: none;
  font-weight: 1000;
  font-size: clamp(15px, 4.1vw, 27px);
  line-height: 1;
  transform: perspective(80px) rotateX(10deg);
  text-shadow:
    0 -1px 0 #fff7bd,
    1px 1px 0 #c9850d,
    2px 2px 0 #8f5200,
    3px 3px 0 #4d2a00,
    -1px 0 0 #6a3a00,
    0 0 6px rgba(255, 216, 102, 0.74),
    0 4px 6px rgba(0, 0, 0, 0.36);
}

body[data-cork-brand="coca-cola"] .piece::after {
  content: "Coca\A Cola";
  display: grid;
  place-items: center;
  inset: 22%;
  color: #ffffff;
  background: rgba(215, 25, 19, 0.72);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 1000;
  font-size: clamp(8px, 2.8vw, 16px);
  line-height: 0.86;
  text-shadow: 0 1px 0 rgba(90, 0, 0, 0.6);
  white-space: pre;
}

body[data-cork-brand="coca-cola"] .piece.black::after {
  color: #d71913;
  background: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 0 #fff;
}

body[data-cork-brand="pepsi"] .piece::after {
  content: "Pepsi";
  display: grid;
  place-items: center;
  inset: 22%;
  color: #ffffff;
  background:
    linear-gradient(180deg, #d71920 0 34%, #ffffff 34% 52%, #004b9b 52% 100%);
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 1000;
  font-size: clamp(8px, 2.8vw, 16px);
  line-height: 1;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55);
}

body[data-cork-brand="pepsi"] .piece.black::after {
  color: #004b9b;
  background:
    linear-gradient(180deg, #d71920 0 28%, #ffffff 28% 64%, #004b9b 64% 100%);
  text-shadow: 0 1px 0 #fff;
}

body[data-red-cork-brand="coca-cola"] .piece.red::after,
body[data-black-cork-brand="coca-cola"] .piece.black::after {
  content: "";
  display: none;
  transform: none;
}

body[data-red-cork-brand="pepsi"] .piece.red::after,
body[data-black-cork-brand="pepsi"] .piece.black::after {
  content: "";
  display: none;
  transform: none;
}

body[data-red-cork-brand="classic"] .piece.red::after,
body[data-black-cork-brand="classic"] .piece.black::after {
  content: "";
}

body[data-cork-brand="coca-cola"] .piece.king::after,
body[data-cork-brand="pepsi"] .piece.king::after,
body[data-red-cork-brand] .piece.king::after,
body[data-black-cork-brand] .piece.king::after {
  content: "♛";
  color: #ffd866;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: inherit;
  font-style: normal;
  font-weight: 1000;
  font-size: clamp(15px, 4.1vw, 27px);
  line-height: 1;
  transform: perspective(80px) rotateX(10deg);
  text-shadow:
    0 -1px 0 #fff7bd,
    1px 1px 0 #c9850d,
    2px 2px 0 #8f5200,
    3px 3px 0 #4d2a00,
    -1px 0 0 #6a3a00,
    0 0 6px rgba(255, 216, 102, 0.74),
    0 4px 6px rgba(0, 0, 0, 0.36);
}

.match-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  color: #fff;
  background:
    linear-gradient(145deg, #172b28, #0f5b53 66%, #178f7f),
    radial-gradient(circle at 84% 12%, rgba(255, 214, 102, 0.68), transparent 24%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow: 0 16px 28px rgba(13, 61, 55, 0.24);
}

.match-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 34px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 34px);
  opacity: 0.38;
}

.match-card > * {
  position: relative;
  z-index: 1;
}

.match-card h3 {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0;
  text-transform: uppercase;
}

.match-card p {
  margin: 0 0 14px;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
}

.match-card .danger,
.match-card .secondary {
  width: 100%;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18), 0 10px 18px rgba(0, 0, 0, 0.2);
}

.player-shell .match-card {
  padding: 14px;
}

.turn-timer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  padding: 12px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #172b28, #265249);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 -4px 0 rgba(255, 255, 255, 0.06), 0 10px 18px rgba(13, 61, 55, 0.18);
}

.turn-timer span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.turn-timer strong {
  font-size: 28px;
  font-weight: 1000;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.top-timer {
  min-width: 126px;
  margin: 0;
  padding: 10px 14px;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  background: linear-gradient(180deg, #101d1a, #102d28);
  border-color: rgba(255, 214, 102, 0.22);
  box-shadow:
    inset 0 -5px 0 rgba(255, 255, 255, 0.08),
    0 0 0 3px rgba(255, 214, 102, 0.08),
    0 8px 18px rgba(18, 33, 28, 0.24);
}

.top-timer span {
  font-size: 10px;
}

.top-timer strong {
  color: #ffe98a;
  font-size: 34px;
  font-weight: 1000;
  text-shadow: 0 0 18px rgba(255, 214, 102, 0.36);
}

.top-timer.paused {
  background: linear-gradient(180deg, #5d6965, #404b48);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.top-timer.active-turn {
  background: linear-gradient(180deg, #162a25, #0f4f45);
  box-shadow:
    inset 0 -5px 0 rgba(255, 255, 255, 0.08),
    0 0 0 3px rgba(255, 214, 102, 0.16),
    0 10px 22px rgba(13, 61, 55, 0.28);
}

.opponent-timer {
  background: linear-gradient(180deg, #263447, #18222f);
  border-color: rgba(255, 255, 255, 0.1);
}

.opponent-timer strong {
  color: #dce8ff;
  text-shadow: none;
}

.opponent-timer.active-turn {
  background: linear-gradient(180deg, #3d3047, #263447);
  box-shadow:
    inset 0 -5px 0 rgba(255, 255, 255, 0.07),
    0 0 0 3px rgba(78, 111, 181, 0.18),
    0 10px 22px rgba(38, 52, 71, 0.22);
}

.wallet-grid {
  grid-template-columns: 320px 1fr;
}

.player-shell .wallet-grid {
  grid-template-columns: 1fr;
}

.wallet-page {
  display: grid;
  gap: 14px;
}

.wallet-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, #12211c, #146749),
    radial-gradient(circle at 85% 15%, rgba(224, 162, 41, 0.8), transparent 26%);
  box-shadow: var(--shadow);
}

.wallet-hero span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.wallet-hero strong {
  display: block;
  margin: 8px 0;
  font-size: 40px;
  line-height: 1;
}

.wallet-hero p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.78);
}

.wallet-mark {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: #10201a;
  background: var(--gold);
  font-size: 28px;
  font-weight: 1000;
  box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.12);
}

.wallet-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.wallet-legend {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.wallet-legend span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 1000;
}

.legend-credit {
  color: var(--mint-dark);
  background: #e4f8ee;
  border: 1px solid rgba(19, 160, 111, 0.22);
}

.legend-debit {
  color: #a42135;
  background: #ffe9ed;
  border: 1px solid rgba(197, 64, 83, 0.2);
}

.wallet-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.wallet-tab {
  min-height: 42px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.wallet-tab.active {
  color: #fff;
  background: var(--navy);
}

.wallet-tab-panel {
  display: none;
}

.wallet-tab-panel.active {
  display: block;
}

.wallet-page .ledger-panel {
  background: #fff;
}

.balance-panel,
.ledger-panel,
.admin-panel {
  padding: 20px;
}

.balance-panel strong {
  display: block;
  margin: 8px 0 12px;
  font-size: 42px;
}

.ledger-list,
.people-list,
.room-list,
.history-list {
  display: grid;
  gap: 12px;
}

.person-row,
.room-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--soft);
}

.ledger-row {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(27, 42, 36, 0.06);
}

.ledger-row.selected {
  border-color: rgba(33, 150, 107, 0.45);
  background: #f4fff9;
  box-shadow: 0 12px 28px rgba(33, 150, 107, 0.12);
}

.ledger-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--line);
}

.ledger-credit::before {
  background: var(--mint);
}

.ledger-debit::before {
  background: var(--rose);
}

.ledger-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 1000;
}

.ledger-credit .ledger-icon {
  color: var(--mint-dark);
  background: #dff8ec;
}

.ledger-debit .ledger-icon {
  color: #9d2537;
  background: #ffe6eb;
}

.ledger-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.ledger-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-copy span {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ledger-amount {
  padding: 7px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 1000;
  white-space: nowrap;
}

.ledger-credit .ledger-amount {
  color: var(--mint-dark);
  background: #e6f8ef;
}

.ledger-debit .ledger-amount {
  color: #a42135;
  background: #ffe9ed;
}

.ledger-empty {
  grid-template-columns: minmax(0, 1fr) auto;
  color: var(--muted);
  background: var(--soft);
  box-shadow: none;
}

.history-empty,
.history-card {
  display: grid;
  gap: 14px;
  position: relative;
  overflow: hidden;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(27, 42, 36, 0.08);
}

.history-empty {
  min-height: 160px;
  place-items: center;
  text-align: center;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(19, 160, 111, 0.1), rgba(224, 162, 41, 0.1)),
    #fff;
}

.history-empty strong {
  display: block;
  color: var(--ink);
  font-size: 22px;
}

.history-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--line);
}

.history-playing::before,
.history-waiting::before {
  background: var(--mint);
}

.history-card.result-won::before {
  background: var(--gold);
}

.history-card.result-lost::before {
  background: var(--rose);
}

.history-card.result-draw::before {
  background: var(--navy);
}

.history-card-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.history-game-badge {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #17362d;
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.18);
}

.history-game-badge.xo {
  background: linear-gradient(135deg, #17362d, var(--mint-dark));
}

.history-game-badge.dama {
  background: linear-gradient(135deg, #6f2f2f, var(--gold));
}

.history-game-badge.dama-egregna {
  background: linear-gradient(135deg, #263447, var(--gold));
}

.history-game-badge.dama-tankegna {
  background: linear-gradient(135deg, #12211c, #a05a1d);
}

.history-game-badge span {
  font-size: 16px;
  font-weight: 1000;
}

.history-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.history-title span {
  font-size: 17px;
  font-weight: 1000;
}

.history-title small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-result {
  align-self: start;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--mint-dark);
  background: #e9f8f1;
  font-size: 12px;
  text-transform: uppercase;
}

.result-won .history-result {
  color: #7a5200;
  background: #fff2c8;
}

.result-lost .history-result {
  color: #9d2537;
  background: #ffe8ec;
}

.result-draw .history-result {
  color: var(--navy);
  background: #edf1f7;
}

.history-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.history-meta span {
  padding: 7px 9px;
  border-radius: 999px;
  color: #17362d;
  background: var(--soft);
  font-size: 11px;
  font-weight: 900;
}

.history-detail {
  display: grid;
  gap: 8px;
  margin: 0;
}

.history-detail div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.history-detail dt {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.history-detail dd {
  max-width: 58%;
  margin: 0;
  text-align: right;
  word-break: break-word;
  font-weight: 800;
}

.history-card-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.history-continue {
  min-width: 112px;
  height: 42px;
}

.history-complete {
  display: inline-grid;
  place-items: center;
  min-width: 112px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
  font-weight: 900;
  text-align: center;
}

@media (max-width: 420px) {
  .history-card-head {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .history-game-badge {
    width: 44px;
    height: 44px;
  }

  .history-result {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .history-card-foot {
    grid-template-columns: 1fr;
  }

  .history-continue,
  .history-complete {
    width: 100%;
  }
}

.profile-page {
  display: grid;
  gap: 14px;
}

.profile-hero {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 156px;
  padding: 18px;
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(18, 33, 28, 0.97), rgba(19, 160, 111, 0.84)),
    repeating-linear-gradient(45deg, #17362d 0 14px, #234036 14px 28px);
  box-shadow: var(--shadow);
}

.profile-hero::after {
  content: "XO";
  position: absolute;
  right: 18px;
  bottom: -10px;
  color: rgba(255, 255, 255, 0.09);
  font-size: 88px;
  font-weight: 1000;
  line-height: 1;
}

.profile-avatar {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #211703;
  background: linear-gradient(145deg, #ffe19b, var(--gold));
  border: 4px solid rgba(255, 255, 255, 0.24);
  font-size: 34px;
  font-weight: 1000;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.profile-identity {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.profile-identity span,
.profile-grid span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
}

.profile-identity span {
  color: #bfe8d7;
  font-weight: 900;
}

.profile-identity h3 {
  margin-bottom: 6px;
  font-size: 26px;
  line-height: 1.05;
  word-break: break-word;
}

.profile-identity p {
  margin-bottom: 0;
  color: #d6efe4;
  font-weight: 800;
  word-break: break-word;
}

.profile-status {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  padding: 6px 10px;
  border-radius: 999px;
  color: #073b28;
  background: #d9ffef;
  font-size: 12px;
  font-weight: 1000;
}

.profile-edit-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(27, 42, 36, 0.06);
}

.profile-edit-card h3,
.profile-edit-card .eyebrow {
  margin-bottom: 0;
}

.profile-edit-card label {
  margin-bottom: 0;
}

.profile-edit-card small {
  color: var(--muted);
  font-weight: 700;
}

.profile-edit-actions {
  display: grid;
  gap: 10px;
}

.profile-edit-actions .primary {
  width: 100%;
}

.profile-logout {
  width: 100%;
}

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

.profile-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(27, 42, 36, 0.06);
}

.profile-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

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

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  align-items: center;
  margin: -24px -24px 22px;
  padding: 20px 24px;
  background: rgba(238, 243, 241, 0.92);
  border-bottom: 1px solid rgba(220, 229, 223, 0.9);
  backdrop-filter: blur(14px);
}

.admin-topbar h1 {
  font-size: 30px;
}

.admin-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

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

.system-pill {
  color: var(--mint-dark);
  background: #dcf7eb;
  border: 1px solid rgba(19, 160, 111, 0.22);
}

.admin-page-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(27, 42, 36, 0.06);
}

.admin-page-intro h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.admin-stats {
  gap: 14px;
  margin-bottom: 16px;
}

.stat-card,
.stats-grid article {
  position: relative;
  overflow: hidden;
  min-height: 142px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(27, 42, 36, 0.08);
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--mint);
}

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

.stat-card.revenue::before {
  background: var(--navy);
}

.stat-card.games::before {
  background: #4e6fb5;
}

.stat-card strong,
.stats-grid article strong {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.stat-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-weight: 800;
}

.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.admin-panel.wide {
  grid-column: 1 / -1;
}

.game-catalog-panel {
  margin-bottom: 16px;
}

.admin-game-catalog {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-game-box {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 14px;
  align-content: space-between;
  min-height: 220px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(220, 229, 223, 0.9);
  border-radius: 8px;
  background: #f8fbf9;
  box-shadow: 0 8px 20px rgba(27, 42, 36, 0.06);
}

.admin-game-box::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--mint);
}

.admin-game-box.dama-tankegna::before {
  background: var(--gold);
}

.admin-game-box.dama-egregna::before {
  background: #4e6fb5;
}

.admin-game-box.chess::before {
  background: #263447;
}

.admin-game-box.selected {
  border-color: rgba(19, 160, 111, 0.5);
  background: #edf8f2;
  box-shadow: inset 4px 0 0 var(--mint), 0 12px 28px rgba(19, 160, 111, 0.12);
}

.admin-game-top {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.admin-game-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: #12211c;
  font-size: 14px;
  font-weight: 1000;
}

.admin-game-title {
  min-width: 0;
}

.admin-game-title h3 {
  margin: 0 0 6px;
  overflow: hidden;
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-game-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.admin-game-stats span {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 9px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(220, 229, 223, 0.85);
}

.admin-game-stats small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-game-stats b {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.admin-game-actions button {
  min-width: 0;
  padding: 0 10px;
}

.catalog-settings-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.catalog-settings-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 900;
}

.catalog-settings-form input {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.mini-list [data-room-id] {
  cursor: pointer;
}

.mini-list [data-room-id]:hover {
  border-color: rgba(19, 160, 111, 0.44);
  background: #edf8f2;
}

.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(27, 42, 36, 0.07);
}

.detail-list,
.audit-list,
.customer-list {
  display: grid;
  gap: 10px;
}

.detail-list div,
.audit-row,
.room-row,
.person-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f7faf8;
  border: 1px solid rgba(220, 229, 223, 0.76);
}

.detail-list span,
.audit-row span {
  color: var(--muted);
}

.detail-list b,
.audit-row b {
  text-align: right;
}

.room-row b,
.person-row b {
  align-self: flex-start;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--mint-dark);
  background: #e3f8ee;
  font-size: 12px;
  text-transform: uppercase;
}

.room-row {
  position: relative;
  overflow: hidden;
}

.customer-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(96px, 0.8fr));
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 8px;
  background: #f7faf8;
  border: 1px solid rgba(220, 229, 223, 0.76);
}

.customer-row[data-customer-phone],
.room-row[data-room-id] {
  cursor: pointer;
}

.customer-row[data-customer-phone]:hover,
.customer-row.selected,
.room-row[data-room-id]:hover,
.room-row.selected {
  border-color: rgba(19, 160, 111, 0.44);
  background: #edf8f2;
  box-shadow: inset 4px 0 0 var(--mint);
}

.customer-row > div {
  min-width: 0;
}

.customer-row span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-row b,
.customer-main strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-main strong {
  font-size: 16px;
}

.customer-status {
  width: max-content;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--mint-dark);
  background: #e3f8ee;
  font-size: 12px;
  text-transform: uppercase;
}

.customer-status.offline {
  color: #56635f;
  background: #e9efec;
}

.customer-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px 120px;
  gap: 12px;
  margin-bottom: 14px;
}

.customer-filters label,
.admin-list-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.admin-list-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 120px;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-list-controls label:last-child:nth-child(2) {
  grid-column: auto;
}

.admin-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-pager button {
  min-height: 34px;
  padding: 7px 12px;
}

.admin-pager button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ledger-action {
  min-height: 34px;
  padding: 7px 12px;
  white-space: nowrap;
}

.finance-shell {
  display: grid;
  gap: 16px;
}

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

.finance-metric-card {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 8px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(220, 229, 223, 0.84);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f4faf7);
  box-shadow: 0 12px 28px rgba(27, 42, 36, 0.07);
}

.finance-metric-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--mint), #ffc857);
}

.finance-metric-card.primary {
  color: #fff;
  border-color: rgba(22, 68, 53, 0.2);
  background: linear-gradient(135deg, #13261f, #1d5f49);
}

.finance-metric-card.primary::before {
  background: linear-gradient(90deg, #ffc857, #80ed99);
}

.finance-metric-card span,
.finance-metric-card small {
  color: inherit;
  opacity: 0.72;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.finance-metric-card strong {
  overflow: hidden;
  color: inherit;
  font-size: 30px;
  font-weight: 1000;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-workspace {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 16px;
  align-items: start;
}

.finance-queue-panel,
.payment-detail-panel,
.finance-report-card,
.finance-rule-card,
.finance-ledger-panel {
  padding: 16px;
}

.finance-queue-panel .section-head,
.payment-detail-panel .section-head,
.finance-report-card .section-head,
.finance-ledger-panel .section-head {
  align-items: flex-start;
}

.section-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.badge.urgent {
  color: #9d2537;
  background: #ffe6eb;
}

.badge.credit {
  color: var(--mint-dark);
  background: #dff8ec;
}

.badge.debit {
  color: #9d2537;
  background: #ffe6eb;
}

.finance-report-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.compact-ledger {
  max-height: 420px;
  overflow: auto;
}

.compact-ledger .ledger-row {
  grid-template-columns: 38px minmax(0, 1fr) auto auto auto;
  align-items: center;
}

.payment-detail {
  display: grid;
  gap: 14px;
}

.finance-rule-list {
  display: grid;
  gap: 10px;
}

.finance-rule-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(220, 229, 223, 0.76);
  border-radius: 8px;
  background: #f7faf8;
}

.finance-rule-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.finance-rule-list b {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-note {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(220, 229, 223, 0.76);
  border-radius: 8px;
  background: #f7faf8;
}

.payment-note span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.payment-note strong {
  color: var(--ink);
  line-height: 1.4;
}

.payment-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.customer-detail-panel {
  margin-top: 0;
}

.customer-detail {
  display: grid;
  gap: 16px;
}

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

.customer-detail-grid article,
.mini-list div {
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  background: #f7faf8;
  border: 1px solid rgba(220, 229, 223, 0.76);
}

.customer-detail-grid span,
.mini-list span,
.mini-list small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-detail-grid strong,
.mini-list b {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-detail-columns section {
  min-width: 0;
}

.customer-detail-columns h4 {
  margin: 0 0 8px;
}

.mini-list {
  display: grid;
  gap: 8px;
}

.mini-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.customer-detail-empty {
  display: grid;
  gap: 6px;
  padding: 18px;
  border-radius: 8px;
  background: #f7faf8;
  border: 1px solid rgba(220, 229, 223, 0.76);
}

.customer-detail-empty strong {
  color: var(--ink);
  font-size: 18px;
}

.customer-detail-empty span {
  color: var(--muted);
}

.room-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--line);
}

.room-playing::before {
  background: var(--mint);
}

.room-waiting::before {
  background: var(--gold);
}

.room-finished::before {
  background: var(--navy);
}

.room-row span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.room-row span strong {
  color: var(--ink);
}

.room-row small,
.audit-row small {
  color: var(--muted);
}

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

.settings-form-grid label {
  margin-bottom: 0;
}

.settings-form-grid .wide-field {
  grid-column: 1 / -1;
}

.bar-chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 34px;
  gap: 10px;
  align-items: center;
}

.bar-row span,
.bar-row b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 1000;
}

.bar-row b {
  color: var(--ink);
  text-align: right;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3ef;
}

.bar-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--gold));
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.report-filters label {
  margin-bottom: 0;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.report-summary article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faf8;
}

.report-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.report-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.report-table {
  display: grid;
  gap: 10px;
}

.report-row {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.8fr 1fr 1.35fr;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.report-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--line);
}

.report-playing::before {
  background: var(--mint);
}

.report-waiting::before {
  background: var(--gold);
}

.report-finished::before {
  background: var(--navy);
}

.report-row span {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.report-row strong,
.report-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-row small {
  color: var(--muted);
  font-weight: 800;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

select {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.settings-toggles {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.toggle-row {
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--mint);
}

.toggle-row span {
  display: grid;
  gap: 3px;
}

.toggle-row small {
  color: var(--muted);
  font-weight: 700;
}

.inline-form {
  gap: 8px;
  margin-bottom: 14px;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--mint-dark);
  background: #e4f5ed;
  font-weight: 900;
  font-size: 12px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  background: #17211e;
  box-shadow: var(--shadow);
  transition: 180ms ease;
}

body[data-app="player"] .toast {
  bottom: 92px;
}

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

.wallet-modal {
  position: fixed;
  inset: 0;
  z-index: 18;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 18px;
  pointer-events: none;
  opacity: 0;
  background: rgba(10, 20, 16, 0.48);
  transition: opacity 160ms ease;
}

.wallet-modal.show {
  pointer-events: auto;
  opacity: 1;
}

.wallet-modal-card {
  width: min(100%, 480px);
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  transform: translateY(22px);
  transition: transform 180ms ease;
}

.wallet-modal.show .wallet-modal-card {
  transform: translateY(0);
}

.wallet-modal-card h3 {
  margin-bottom: 0;
}

.wallet-modal-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.modal-close {
  min-height: 36px;
  padding: 0 12px;
}

.win-celebration {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  background: rgba(11, 23, 18, 0);
  transition: opacity 160ms ease;
}

.win-celebration.show {
  opacity: 1;
  background: rgba(11, 23, 18, 0.42);
}

.boom-gif {
  position: relative;
  width: min(82vw, 340px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #fff;
  transform: scale(0.4) rotate(-8deg);
}

.win-celebration.show .boom-gif {
  animation: boomPop 880ms cubic-bezier(0.2, 1.4, 0.28, 1) forwards, boomFloat 900ms ease-in-out 900ms infinite alternate;
}

.burst-ring,
.burst-core,
.confetti,
.boom-gif strong,
.boom-gif small {
  position: absolute;
}

.burst-ring {
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 10px solid var(--gold);
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.18), 0 0 50px rgba(224, 162, 41, 0.8);
}

.ring-one {
  animation: ringPulse 780ms ease-out infinite;
}

.ring-two {
  width: 56%;
  border-color: #fff;
  animation: ringPulse 780ms ease-out 160ms infinite;
}

.burst-core {
  width: 62%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #17211e;
  background: radial-gradient(circle, #fff 0 28%, #ffd867 29% 54%, #e64f52 55% 100%);
  font-size: 42px;
  font-weight: 1000;
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.14), 0 24px 60px rgba(0, 0, 0, 0.28);
}

.win-celebration[data-result="lost"] .burst-core {
  color: #fff;
  background: radial-gradient(circle, #ff9aa5 0 30%, #c54053 31% 62%, #5d1d28 63% 100%);
  font-size: 34px;
}

.win-celebration[data-result="draw"] .burst-core {
  color: #17211e;
  background: radial-gradient(circle, #fff 0 28%, #bdc9d6 29% 58%, #63736d 59% 100%);
  font-size: 38px;
}

.win-celebration[data-result="lost"] .burst-ring {
  border-color: #c54053;
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.18), 0 0 50px rgba(197, 64, 83, 0.78);
}

.win-celebration[data-result="draw"] .burst-ring {
  border-color: #bdc9d6;
  box-shadow: 0 0 0 12px rgba(255, 255, 255, 0.18), 0 0 50px rgba(99, 115, 109, 0.55);
}

.boom-gif strong {
  bottom: 36px;
  padding: 8px 22px;
  border-radius: 999px;
  color: #092015;
  background: #fff;
  font-size: 38px;
  line-height: 1;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.win-celebration[data-result="lost"] .boom-gif strong {
  color: #fff;
  background: #c54053;
}

.win-celebration[data-result="draw"] .boom-gif strong {
  color: #17211e;
  background: #f0f4f2;
}

.boom-gif small {
  bottom: 8px;
  width: 100%;
  color: #fff;
  font-weight: 900;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.confetti {
  width: 16px;
  height: 38px;
  border-radius: 4px;
  background: var(--mint);
  animation: confettiFly 900ms ease-out infinite;
}

.c1 {
  top: 14%;
  left: 12%;
  background: #fff;
}

.c2 {
  top: 9%;
  right: 18%;
  background: var(--gold);
  animation-delay: 120ms;
}

.c3 {
  left: 8%;
  bottom: 26%;
  background: #e64f52;
  animation-delay: 220ms;
}

.c4 {
  right: 10%;
  bottom: 24%;
  background: #2ed39a;
  animation-delay: 320ms;
}

.c5 {
  top: 40%;
  right: 2%;
  background: #ffffff;
  animation-delay: 420ms;
}

@keyframes boomPop {
  0% {
    transform: scale(0.25) rotate(-14deg);
    filter: blur(2px);
  }
  55% {
    transform: scale(1.08) rotate(4deg);
    filter: blur(0);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes boomFloat {
  from {
    transform: translateY(0) rotate(-1deg);
  }
  to {
    transform: translateY(-8px) rotate(1deg);
  }
}

@keyframes ringPulse {
  0% {
    transform: scale(0.75);
    opacity: 1;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@keyframes confettiFly {
  0% {
    transform: translate(0, 0) rotate(0);
    opacity: 1;
  }
  100% {
    transform: translate(18px, -42px) rotate(240deg);
    opacity: 0.15;
  }
}

@media (max-width: 900px) {
  .admin-game-catalog {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-shell {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 28px;
    padding: 24px;
  }

  .auth-copy {
    padding-top: 28px;
  }

  .auth-brand {
    margin-bottom: 34px;
  }

  .auth-copy h1 {
    max-width: 620px;
    font-size: clamp(40px, 10vw, 64px);
  }

  .auth-board-preview {
    top: 76px;
    right: -98px;
    width: 360px;
    min-width: 360px;
    opacity: 0.34;
  }

  .auth-panel {
    width: min(100%, 480px);
  }

  .app-shell:not(.player-shell),
  .admin-shell {
    grid-template-columns: 1fr;
  }

  .rail,
  .admin-sidebar {
    position: sticky;
    top: 0;
    z-index: 3;
    padding: 10px;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .admin-sidebar {
    height: auto;
    background: linear-gradient(90deg, #111f1a, #1f3442);
    box-shadow: 0 10px 24px rgba(18, 33, 28, 0.16);
  }

  .admin-nav {
    display: flex;
    min-width: max-content;
  }

  .admin-nav-item {
    min-width: 116px;
  }

  .admin-summary {
    min-width: 220px;
    margin-top: 0;
  }

  .brand {
    min-width: 150px;
  }

  .nav {
    display: flex;
  }

  .nav-item {
    width: 52px;
    grid-template-columns: 1fr;
    place-items: center;
    padding: 0;
  }

  .nav-item b {
    display: none;
  }

  .main-panel,
  .admin-main {
    padding: 18px;
  }

  .admin-topbar {
    position: static;
    margin: -18px -18px 18px;
    padding: 18px;
  }

  .admin-page-intro,
  .admin-topbar,
  .admin-top-actions {
    align-items: stretch;
    flex-direction: column;
  }

	  .topbar,
	  .hero,
	  .game-cards,
		  .board-wrap,
		  .wallet-grid,
		  .admin-layout,
		  .admin-detail-grid,
		  .settings-form-grid,
		  .finance-metrics,
		  .finance-workspace,
			  .finance-report-grid,
			  .admin-list-controls,
		  .report-filters,
		  .report-summary,
	  .customer-filters,
	  .customer-row,
	  .customer-detail-grid,
	  .customer-detail-columns,
	  .report-row {
	    grid-template-columns: 1fr;
	  }

  .topbar {
    display: grid;
  }

  .player-chip {
    justify-content: flex-start;
  }

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

@media (max-width: 560px) {
  .admin-game-catalog,
  .catalog-settings-form {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    min-height: 100vh;
    padding: 18px;
  }

  .auth-copy {
    padding-top: 12px;
  }

  .auth-copy h1 {
    margin-bottom: 12px;
    font-size: 40px;
  }

  .auth-copy > p:not(.eyebrow) {
    font-size: 15px;
    line-height: 1.55;
  }

  .auth-highlights {
    margin-top: 18px;
  }

  .auth-panel {
    padding: 18px;
  }

  .auth-form h2 {
    font-size: 24px;
  }

  .player-shell {
    width: 100%;
    box-shadow: none;
  }

  .mobile-appbar {
    min-height: 68px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 21px;
  }

  .brand strong {
    font-size: 15px;
  }

  .mobile-appbar .player-chip {
    max-width: 162px;
  }

  .mobile-appbar .player-chip strong {
    max-width: 104px;
    font-size: 13px;
  }

  .hero {
    padding: 18px;
  }

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

  .ledger-row,
  .compact-ledger .ledger-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .ledger-action {
    grid-column: span 1;
  }

  .admin-sidebar {
    gap: 10px;
  }

  .admin-nav-item {
    min-width: 92px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 6px;
  }

  .admin-nav-item b {
    font-size: 12px;
  }

  .admin-summary {
    min-width: 190px;
  }

  .admin-page-intro h2,
  .admin-topbar h1 {
    font-size: 24px;
  }

  .stat-card,
  .stats-grid article {
    min-height: 118px;
  }

  .game-card {
    grid-template-columns: 64px 1fr;
  }

  .game-card button {
    grid-column: 1 / -1;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .segmented button {
    flex: 1;
    padding: 0 8px;
  }

  .match-bar {
    align-items: stretch;
    flex-direction: column;
    padding: 14px;
  }

  .match-bar .secondary {
    width: 100%;
  }

  .top-timer {
    width: 100%;
  }

  .match-card p {
    font-size: 18px;
  }

  .xo-board {
    gap: 6px;
    padding: 0;
  }

  .dama-board {
    border-width: 6px;
  }
}
