:root {
  --bg: #07060c;
  --felt: #0b3a2a;
  --paper: rgba(16, 14, 22, .78);
  --ink: #f7f1e4;
  --muted: #b7ab96;
  --line: rgba(231, 197, 106, .22);
  --gold: #e7c56a;
  --gold-deep: #a9782d;
  --ruby: #d23b55;
  --green: #1f9d5a;
  --green-deep: #0e6b3a;
  --danger: #ff8d8d;
  --shadow: 0 24px 60px rgba(0, 0, 0, .45);
  --radius: 22px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Heebo, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 480px at 100% -10%, rgba(210, 59, 85, .22), transparent 55%),
    radial-gradient(820px 520px at -10% 110%, rgba(14, 90, 58, .55), transparent 60%),
    radial-gradient(600px 320px at 50% -20%, rgba(231, 197, 106, .16), transparent 50%),
    var(--bg);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
.hidden { display: none !important; }

.scene { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; display: none; }
body.is-login .scene, body.app-player .scene { display: block; }
body.app-player .scene-panda, body.app-player .wheel { display: none; }
.glow { position: absolute; border-radius: 50%; filter: blur(30px); opacity: .85; }
.glow.g1 { width: 420px; height: 420px; background: rgba(210, 59, 85, .28); top: -80px; left: -60px; }
.glow.g2 { width: 520px; height: 520px; background: rgba(18, 110, 70, .35); bottom: -160px; right: -80px; }
.glow.g3 { width: 280px; height: 280px; background: rgba(231, 197, 106, .16); top: 18%; right: 22%; }
.wheel {
  position: absolute; width: 540px; height: 540px; border-radius: 50%;
  left: -180px; bottom: -180px; opacity: .35;
  background:
    repeating-conic-gradient(from 0deg, #1a120c 0 12deg, #e7c56a 12deg 16deg, #7a1d2c 16deg 28deg, #e7c56a 28deg 32deg);
  box-shadow: inset 0 0 0 28px rgba(7, 6, 12, .65), 0 0 0 10px rgba(231, 197, 106, .35);
  animation: spin 48s linear infinite;
}
.scene-panda { position: absolute; width: 150px; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .45)); }
.scene-panda.a { top: 8%; left: 7%; animation: float 7s ease-in-out infinite; }
.scene-panda.b { bottom: 8%; right: 6%; width: 120px; transform: scaleX(-1); animation: float 8s ease-in-out infinite reverse; }
@keyframes float { 50% { transform: translateY(-12px); } }
@keyframes spin { to { transform: rotate(360deg); } }

.boot {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; align-content: center; gap: 14px;
  background: radial-gradient(500px 240px at 50% 40%, rgba(231, 197, 106, .16), transparent 70%), #07060c;
}
.boot img { width: 120px; }
.boot-word { font-family: Cinzel, Heebo, serif; font-size: 28px; letter-spacing: .18em; }
.boot-word span { color: var(--gold); }
.boot-bar { width: 160px; height: 3px; border-radius: 99px; background: rgba(231, 197, 106, .18); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); animation: load 1s ease-in-out infinite; }
@keyframes load { 50% { transform: translateX(160%); } }

#app { position: relative; z-index: 1; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 72px 16px 28px; }
.marquee {
  position: fixed; top: 0; inset-inline: 0; height: 42px; overflow: hidden; direction: ltr;
  background: linear-gradient(90deg, #140c08, #3a2412 40%, #140c08);
  border-bottom: 1px solid rgba(231, 197, 106, .35); z-index: 5;
}
.marquee-track { display: flex; width: max-content; animation: ticker 28s linear infinite; }
.marquee span {
  flex: none; display: flex; align-items: center; height: 42px; padding-inline: 8px;
  font-weight: 700; letter-spacing: .12em; color: var(--gold); white-space: nowrap;
}
@keyframes ticker { to { transform: translateX(-50%); } }
.login-card {
  width: min(480px, 100%);
  background:
    linear-gradient(180deg, rgba(28, 22, 16, .92), rgba(10, 9, 14, .92));
  border: 1px solid rgba(231, 197, 106, .45);
  border-radius: 28px;
  box-shadow: 0 0 0 8px rgba(231, 197, 106, .06), var(--shadow);
  padding: 28px 28px 26px;
  text-align: center;
  backdrop-filter: blur(16px);
}
.crest {
  width: 108px; height: 108px; margin: 0 auto 8px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 40% 30%, #fff, #f3d48a 42%, #8a5a22);
  box-shadow: 0 0 0 6px rgba(231, 197, 106, .2), 0 16px 30px rgba(0, 0, 0, .35);
}
.crest img { width: 86px; }
.eyebrow { color: var(--gold); letter-spacing: .28em; font-size: 12px; font-weight: 700; }
.word { font-family: Cinzel, Heebo, serif; font-weight: 700; letter-spacing: .14em; margin: 6px 0 0; font-size: 34px; }
.word span { color: var(--gold); }
.sub { color: var(--muted); margin: 8px 0 22px; }
.stack { display: grid; gap: 12px; text-align: right; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
input, select, textarea {
  height: 54px; border-radius: 14px; border: 1px solid rgba(231, 197, 106, .28);
  background: rgba(8, 7, 12, .72); padding: 0 14px; outline: none; color: var(--ink);
}
textarea { height: auto; padding: 12px 14px; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(231, 197, 106, .15); }
.ltr { direction: ltr; text-align: right; }

.btn {
  height: 52px; border: 0; border-radius: 14px; padding: 0 18px;
  background: linear-gradient(180deg, #2bb56a, #147844); color: white; font-weight: 800;
  box-shadow: 0 10px 24px rgba(16, 90, 48, .35);
}
.btn.gold {
  background: linear-gradient(180deg, #f3d98a, #c9963a 55%, #8d5e1d);
  color: #1a1208; text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
  box-shadow: 0 10px 24px rgba(160, 110, 30, .35);
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: none; border: 1px solid rgba(231, 197, 106, .28); }
.btn.danger { color: var(--danger); }
.btn.small { height: 42px; border-radius: 12px; font-size: 14px; }
.btn:disabled { opacity: .6; cursor: wait; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row .btn { flex: 1; }

.kiosk { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.kbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(12, 10, 16, .94), rgba(12, 10, 16, .78));
  border-bottom: 1px solid rgba(231, 197, 106, .28);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; color: inherit; }
.brand img { width: 46px; }
.brand strong { font-family: Cinzel, Heebo, serif; letter-spacing: .12em; font-size: 18px; }
.brand strong span { color: var(--gold); }
.station-badge, .clock {
  display: grid; justify-items: center; line-height: 1;
  min-width: 72px; padding: 6px 10px; border-radius: 14px;
  border: 1px solid rgba(231, 197, 106, .28);
  background: rgba(231, 197, 106, .06);
}
.station-badge span, .clock { font-size: 11px; color: var(--gold); letter-spacing: .08em; }
.station-badge b { font-family: Cinzel, Heebo, serif; font-size: 26px; }
.clock { font-family: Cinzel, Heebo, serif; font-size: 22px; align-content: center; min-height: 52px; }
.spacer { flex: 1; }
.pill {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, #f6e2a8, #c9963a);
  color: #1a1208; border-radius: 999px; padding: 8px 16px;
  box-shadow: 0 8px 20px rgba(160, 110, 30, .28); font-weight: 800;
}
.pill span { font-size: 12px; opacity: .75; }
.pill b { font-size: 22px; }
.pill.mini { padding: 6px 12px; }
.pill.mini b, .pill.mini { font-size: 16px; }
.pill.ping, [data-live-balance].ping, .money.ping, [data-field="balance"].ping, #stat-room.ping { animation: ping .45s ease; }
@keyframes ping { 40% { transform: scale(1.05); } }
.who-line { display: grid; line-height: 1.15; text-align: right; }
.who-line small { color: var(--muted); font-weight: 500; }

.kiosk-body { display: grid; grid-template-columns: 168px 1fr; min-height: 0; }
.rail {
  position: sticky; top: 74px; align-self: start;
  display: grid; gap: 8px; padding: 14px 10px 24px 12px;
  max-height: calc(100vh - 74px); overflow: auto;
}
.rail-btn {
  text-align: right; border-radius: 16px; padding: 12px 12px 10px;
  border: 1px solid rgba(231, 197, 106, .16);
  background: rgba(16, 14, 22, .55); color: var(--ink);
  display: grid; gap: 2px;
}
.rail-btn b { font-size: 16px; }
.rail-btn small { color: var(--muted); font-size: 12px; }
.rail-btn.on {
  background: linear-gradient(180deg, rgba(243, 217, 138, .95), rgba(176, 122, 42, .95));
  color: #1a1208; border-color: transparent;
  box-shadow: 0 10px 22px rgba(160, 110, 30, .28);
}
.rail-btn.on small { color: rgba(26, 18, 8, .7); }
.floor { padding: 8px 18px 28px 8px; min-width: 0; }
.filters { display: flex; gap: 10px; align-items: center; margin: 8px 0 14px; }
body.app-player:not(.compact) .filters { display: none; }
.search { flex: 1; }
.providers { width: min(220px, 40%); }

.welcome {
  display: flex; justify-content: space-between; gap: 16px; align-items: end;
  margin: 8px 0 16px; padding: 8px 4px 0;
}
.welcome h1 { margin: 4px 0; font-size: 40px; font-weight: 800; }
.welcome p { margin: 0; color: var(--muted); }
.welcome-balance {
  min-width: 220px; padding: 16px 18px; border-radius: 20px;
  background: linear-gradient(160deg, #2a2114, #12100f);
  border: 1px solid rgba(231, 197, 106, .45);
}
.welcome-balance span { color: var(--gold); font-size: 13px; }
.welcome-balance b { display: block; font-size: 32px; margin-top: 4px; }

.floor-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(148px, 18vh);
  gap: 14px;
}
.tile {
  position: relative; overflow: hidden; text-align: right; border: 0; border-radius: 26px;
  padding: 18px; color: white; display: grid; align-content: end; gap: 4px;
  box-shadow: var(--shadow); min-height: 148px;
}
.tile::after {
  content: ""; position: absolute; inset: auto -20% -40% 20%; height: 80%;
  background: radial-gradient(circle, rgba(255,255,255,.22), transparent 68%);
  pointer-events: none;
}
.tile strong { font-size: 30px; position: relative; }
.tile em { font-style: normal; opacity: .86; position: relative; }
.tile-kicker {
  position: absolute; top: 14px; left: 14px; z-index: 1;
  background: rgba(0,0,0,.28); border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; padding: 4px 10px; font-weight: 800;
}
.tile.slots { grid-column: span 2; grid-row: span 2; background: linear-gradient(145deg, #5b2a86, #1b1030 60%, #c9963a); }
.tile.live { grid-column: span 2; background: linear-gradient(145deg, #8d1d34, #2a0c14 55%, #e7c56a); }
.tile.roulette { background: linear-gradient(160deg, #0f6b45, #071910 70%); }
.tile.blackjack { background: linear-gradient(160deg, #1d4e89, #0b1220); }
.tile.baccarat { background: linear-gradient(160deg, #8a6230, #24170c); }
.tile.poker { background: linear-gradient(160deg, #7a2344, #1a0c12); }
.tile.shows { background: linear-gradient(160deg, #6a3a12, #1a100c); }
.tile.sicbo { background: linear-gradient(160deg, #1e6a62, #071614); }
.tile.mini { background: linear-gradient(160deg, #3d3a8a, #121022); }
.tile:hover { transform: translateY(-3px); filter: saturate(1.08); }

.shelf { margin: 0 0 22px; }
.shelf-head { display: flex; align-items: baseline; justify-content: flex-start; gap: 14px; margin: 0 2px 10px; }
.shelf-head h2 { margin: 0; font-size: 22px; }
.shelf-head span { color: var(--muted); }
.recent-shelf h2 { font-family: Cinzel, Heebo, serif; letter-spacing: .22em; color: var(--gold); }
.recent-empty {
  color: #f6e7c1; border: 1px solid rgba(231, 197, 106, .45); border-radius: 18px;
  padding: 16px 18px; background: rgba(42, 33, 20, .9);
}
.shelf-row { display: flex; gap: 12px; overflow-x: auto; padding: 2px 2px 12px; scroll-snap-type: x mandatory; }
.shelf-row .game { flex: 0 0 188px; scroll-snap-align: start; }
.recent-shelf .game { flex-basis: 210px; border-color: rgba(231, 197, 106, .45); }
.type-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 18px; }
.type-door {
  min-height: 88px; border-radius: 18px; border: 1px solid rgba(231, 197, 106, .28);
  text-align: right; padding: 12px 14px; color: white; display: grid; align-content: end;
  background: linear-gradient(160deg, #3a2a12, #120e0c);
}
.type-door b { font-size: 18px; }
.type-door small { color: rgba(255,255,255,.8); }
.type-door.classic { background: linear-gradient(160deg, #8d1d34, #2a0c14); }
.type-door.gold { background: linear-gradient(160deg, #8a6230, #24170c); }
.type-door.animals { background: linear-gradient(160deg, #0f6b45, #071910); }
.type-door.egypt { background: linear-gradient(160deg, #a06a22, #2a1608); }
.type-door.books { background: linear-gradient(160deg, #6a3a12, #1a100c); }
.type-door.megaways { background: linear-gradient(160deg, #5b2a86, #1b1030); }
.type-door.sweet { background: linear-gradient(160deg, #a33b78, #2a1020); }
.type-door.asian { background: linear-gradient(160deg, #9a2a2a, #240c0c); }
.type-door.olympus { background: linear-gradient(160deg, #1d4e89, #0b1220); }
.type-door.bonus { background: linear-gradient(160deg, #1e6a62, #071614); }
.type-door.more { background: linear-gradient(160deg, #3d3a8a, #121022); }
.studio-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.studio {
  border-radius: 999px; padding: 8px 12px; border: 1px solid rgba(231, 197, 106, .28);
  background: rgba(16, 14, 22, .72); color: inherit; display: inline-flex; gap: 8px; align-items: baseline;
}
.studio small { color: var(--gold); }
.hall-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 2px 12px; }
.hall-title h1 { margin: 0; font-size: 32px; }
.hall-title span { color: var(--gold); font-weight: 700; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; padding-bottom: 28px; }
.game {
  display: grid; gap: 8px; padding: 8px; text-align: right; color: inherit;
  background: rgba(16, 14, 22, .72); border: 1px solid rgba(231, 197, 106, .16); border-radius: 20px;
}
.game:hover { transform: translateY(-4px); border-color: rgba(231, 197, 106, .7); box-shadow: 0 16px 34px rgba(0,0,0,.35); }
.thumb { aspect-ratio: 16/11; border-radius: 14px; overflow: hidden; background: #1a1520; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-family: Cinzel, serif; letter-spacing: .2em; color: var(--gold); }
.ribbon, .play-tag {
  position: absolute; border-radius: 999px; font-size: 12px; padding: 4px 8px; font-weight: 800;
}
.ribbon { top: 8px; right: 8px; background: var(--ruby); color: white; }
.play-tag {
  left: 8px; bottom: 8px; background: linear-gradient(180deg, #f3d98a, #c9963a); color: #1a1208;
  opacity: 0; transform: translateY(6px); transition: .18s ease;
}
.game:hover .play-tag { opacity: 1; transform: none; }
.game b { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; unicode-bidi: plaintext; }
.game small { color: var(--muted); unicode-bidi: plaintext; }
.more { display: grid; place-items: center; padding: 6px 0 36px; }
.more .btn { min-width: 220px; }
.empty { text-align: center; color: var(--muted); padding: 40px 0 60px; }
.empty img { width: 96px; }

.account { display: grid; gap: 14px; padding-bottom: 40px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat, .card {
  background: rgba(16, 14, 22, .78); border: 1px solid rgba(231, 197, 106, .16); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
}
.stat span, .muted { color: var(--muted); font-size: 13px; }
.stat b { display: block; font-size: 22px; margin-top: 4px; }
.pos { color: #7dffa8; }
.neg { color: var(--danger); }

.admin { min-height: 100vh; display: grid; grid-template-columns: 240px 1fr; }
.side {
  padding: 22px 16px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  border-left: 1px solid rgba(231, 197, 106, .16);
  background: rgba(8, 7, 12, .72);
}
.side nav { display: grid; gap: 6px; margin-top: 18px; }
.side .nav button {
  appearance: none;
  text-align: right;
  background: #2a241c;
  color: #fff6df;
  border: 1px solid #e7c56a;
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 16px;
}
.side .nav button.on {
  background: linear-gradient(180deg, #f6e2a8, #c9963a);
  color: #1a1208;
  border-color: #f6e2a8;
}
.admin-main { padding: 18px 22px 40px; }
.admin-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 16px; }
.admin-top h1 { margin: 0; font-size: 28px; }
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.station {
  background: rgba(16, 14, 22, .78); border-radius: 26px; padding: 16px; border: 1px solid rgba(231, 197, 106, .16);
  display: grid; gap: 4px;
}
.station.on { box-shadow: 0 0 0 2px var(--gold), 0 16px 36px rgba(231, 197, 106, .12); }
.seat-no { font-family: Cinzel, Heebo, serif; font-size: 40px; line-height: 1; color: var(--gold); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #5c564c; display: inline-block; }
.station.on .dot { background: #3dff8a; box-shadow: 0 0 0 4px rgba(61, 255, 138, .15); }
.station-top { display: flex; justify-content: space-between; align-items: center; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th { text-align: right; color: var(--muted); font-size: 13px; font-weight: 600; }
td, th { padding: 12px 10px; border-bottom: 1px solid rgba(231, 197, 106, .12); vertical-align: middle; }
.split { display: grid; grid-template-columns: 340px 1fr; gap: 14px; align-items: start; }
.form { display: grid; gap: 12px; }
.online { display: grid; gap: 8px; }
.person {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  background: rgba(16, 14, 22, .78); border-radius: 16px; padding: 10px 12px; border: 1px solid rgba(231, 197, 106, .16);
}

.stage {
  position: fixed; inset: 0; z-index: 40; background: #05040a;
  display: flex; flex-direction: column; padding: 10px;
}
.stage[hidden] { display: none; }
.stage header { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; }
.stage header b { flex: 1; unicode-bidi: plaintext; font-size: 18px; }
.stage header .btn.gold { min-width: 160px; }
.stage iframe { flex: 1; width: 100%; border: 0; border-radius: 16px; background: #111; }

.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .62);
  display: grid; place-items: center; padding: 18px;
}
.sheet {
  width: min(720px, 100%); max-height: min(86vh, 860px); overflow: auto;
  background: #14121a; border: 1px solid rgba(231, 197, 106, .28);
  border-radius: 28px; padding: 20px; box-shadow: var(--shadow); color: var(--ink);
}
.sheet.narrow { width: min(420px, 100%); }
.sheet h2 { margin: 0 0 8px; }
.toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: #1a1208; color: var(--gold); border: 1px solid rgba(231, 197, 106, .4);
  border-radius: 999px; padding: 12px 18px; z-index: 60;
}
.toast.bad { background: #4a1520; color: white; border-color: transparent; }
.guide { display: grid; gap: 8px; }
.guide div { background: rgba(16, 14, 22, .78); border-radius: 16px; padding: 12px 14px; border: 1px solid rgba(231, 197, 106, .16); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; unicode-bidi: isolate; }

@media (max-width: 980px) {
  .kiosk-body, .stats, .split { grid-template-columns: 1fr; }
  .floor-grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 140px; }
  .type-row { grid-template-columns: 1fr 1fr; }
  .tile.slots, .tile.live { grid-column: span 2; grid-row: auto; }
  .rail { position: sticky; top: 74px; max-height: none; display: flex; overflow: auto; z-index: 15; padding-bottom: 8px; }
  .rail-btn { min-width: 108px; }
  .welcome { flex-direction: column; align-items: stretch; }
  .welcome h1 { font-size: 30px; }
  .admin { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; height: auto; z-index: 15; }
  .side nav { display: flex; overflow: auto; margin-top: 8px; }
  .scene-panda { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .scene-panda, .boot-bar i, .pill.ping, .wheel, .marquee span { animation: none; }
}
