:root {
  --felt: #0c1a14;
  --deep: #071410;
  --gold: #c9a227;
  --gold-2: #ead7a2;
  --line: #c9a227;
  --ruby: #8b1e2d;
  --ink: #0a0b10;
  --text: #fff6d8;
  --muted: #c4b48a;
  --safe: env(safe-area-inset-bottom, 14px);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  min-height: 100%; background: var(--deep); color: var(--text);
  font-family: Nunito, system-ui, sans-serif;
  overflow-x: hidden;
  text-shadow: 0 0 6px rgba(255,61,138,.35), 0 0 10px rgba(255,210,74,.22);
}
#app { min-height: 100%; }
.hidden { display: none !important; }

#tableLobby { min-height: 100dvh; justify-content: center; padding: calc(10px + env(safe-area-inset-top)) 10px 16px; position: relative; z-index: 3; }
#tableLobby:not(.hidden) { display: flex; }
#game.screen { position: fixed; inset: 0; z-index: 4; background: #12081a; min-height: 0; overflow: hidden; }
.modal { z-index: 80 !important; pointer-events: auto; }
#lobby {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: calc(10px + env(safe-area-inset-top)) 10px calc(12px + var(--safe));
}
.felt-bg {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, #3a1450 0%, transparent 40%),
    radial-gradient(ellipse at 80% 80%, #0a3a4a 0%, transparent 35%),
    linear-gradient(180deg, #14081c, #07060c);
}
.frame {
  position: relative; z-index: 2;
  width: min(680px, 100%);
  border: 3px solid #f2c14e;
  border-radius: 18px;
  box-shadow: 0 0 24px rgba(255,80,180,.25), inset 0 0 30px rgba(0,0,0,.35);
  padding: 18px 14px 18px;
  background: linear-gradient(180deg, #22102e, #12081a);
}
.marquee {
  height: 10px; margin: -6px -4px 10px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(90deg, #ff3d8a 0 10px, #ffd24a 10px 20px, #3dffc5 20px 30px, #6aa8ff 30px 40px);
  background-size: 80px 10px;
  animation: marquee 1.1s linear infinite;
  box-shadow: 0 0 12px rgba(255,80,180,.45);
}
@keyframes marquee { to { background-position: 80px 0; } }
.brand-name {
  font-family: Bungee, sans-serif;
  font-weight: 400;
  font-size: clamp(26px, 8vw, 38px);
  letter-spacing: .08em;
  color: #ffd24a;
  margin-bottom: 10px;
  text-align: center;
  text-shadow: 0 0 8px #ff3d8a, 0 0 14px rgba(255,210,74,.4), 0 3px 0 #7a1f4a;
}
.brand-name span { color: var(--gold); }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 8px; min-width: 0;
}
.ctrl-cluster, .top-actions { display: flex; gap: 8px; align-items: center; min-width: 0; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  background: rgba(0,0,0,.28); border: 1px solid var(--line); color: var(--gold-2);
}
.icon-btn.muted { opacity: .4; }
.lang-wrap { position: relative; }
.lang-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 8;
  min-width: 132px; padding: 6px; border-radius: 12px;
  background: #0c1814; border: 1px solid var(--line);
}
.lang-menu button {
  display: block; width: 100%; text-align: left;
  background: none; border: 0; color: var(--text);
  padding: 8px 10px; font: 500 13px Outfit, sans-serif;
}
.lang-menu button:hover, .lang-menu button.on { color: var(--gold-2); background: rgba(196,163,90,.1); }
.ghost-btn {
  border: 1px solid var(--line); background: rgba(0,0,0,.25); color: var(--gold-2);
  padding: 8px 12px; font: 800 13px Nunito, sans-serif; white-space: nowrap;
  border-radius: 999px;
}
.ghost-btn.full { width: 100%; margin-top: 8px; }
.wallet-chip {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--gold); color: var(--gold-2);
  background: #1a160c; padding: 7px 11px; font-weight: 700; font-size: 14px;
  border-radius: 999px;
}
.wallet-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.wallet-chip.hidden-cash { display: none; }

.logo-wrap { display: flex; flex-direction: column; align-items: center; padding: 18px 0 8px; }
.logo-stage {
  position: relative;
  width: min(248px, 78vw);
  height: min(138px, 36vw);
  display: grid;
  place-items: center;
  margin: 0 auto;
}
.logo-star {
  position: absolute;
  top: 50%;
  font-style: normal;
  font-size: clamp(22px, 7vw, 34px);
  line-height: 1;
  color: #ffd24a;
  pointer-events: none;
  text-shadow: 0 0 10px #ff3d8a, 0 0 18px #ffd24a, 0 0 26px #ff3d8a;
  animation: starblink 1.2s ease-in-out infinite;
}
.logo-star.left { left: 0; margin-top: -0.52em; }
.logo-star.right { right: 0; margin-top: -0.52em; animation-delay: .6s; }
@keyframes starblink {
  0%, 100% { opacity: .4; filter: brightness(.85); }
  50% { opacity: 1; filter: brightness(1.45); }
}
.reg-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 12px; }
.reg-choice.hidden { display: none !important; }
.reg-way {
  height: 86px; border-radius: 14px; border: 2px solid #f2c14e;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font: 800 13px Russo One, sans-serif; color: #ffe9a0;
}
.reg-way span { font-size: 22px; }
.reg-way.email { background: linear-gradient(180deg, #3a2410, #1a1208); }
.reg-way.tg { background: linear-gradient(180deg, #1a3a58, #0c2238); border-color: #54a9eb; color: #d6f0ff; }
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.star {
  position: absolute; color: #ffd24a; font-style: normal;
  animation: twinkle 1.2s ease-in-out infinite;
  text-shadow: 0 0 8px #ff3d8a;
}
.s1 { left: 8%; top: 12%; font-size: 14px; }
.s2 { left: 18%; top: 62%; font-size: 18px; animation-delay: .2s; }
.s3 { right: 10%; top: 18%; font-size: 12px; animation-delay: .4s; }
.s4 { right: 16%; top: 70%; font-size: 20px; animation-delay: .1s; }
.s5 { left: 48%; top: 8%; font-size: 11px; animation-delay: .6s; }
.s6 { left: 72%; top: 44%; font-size: 16px; animation-delay: .3s; }
@keyframes twinkle {
  0%, 100% { opacity: .25; transform: scale(.8) rotate(0); }
  50% { opacity: 1; transform: scale(1.25) rotate(18deg); }
}
.float-chip {
  position: absolute; width: 26px; height: 26px; border-radius: 50%;
  border: 3px dashed rgba(255,255,255,.4);
  animation: drift 9s ease-in-out infinite;
}
.c1 { left: 6%; top: 30%; background: radial-gradient(circle at 30% 30%, #ffd24a, #b8860b); }
.c2 { right: 8%; top: 36%; background: radial-gradient(circle at 30% 30%, #ff7ab0, #8b1e4a); animation-delay: -3s; }
.c3 { left: 12%; bottom: 14%; background: radial-gradient(circle at 30% 30%, #7ad7ff, #1a4a7a); animation-delay: -6s; }
.float-fruit {
  position: absolute; font-style: normal; font-size: 22px;
  animation: drift 11s ease-in-out infinite;
}
.f1 { right: 12%; bottom: 22%; animation-delay: -2s; }
.f2 { left: 22%; top: 22%; animation-delay: -5s; }
.f3 { right: 22%; top: 58%; animation-delay: -7s; }
@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-18px) rotate(10deg); }
}
.logo-clip {
  width: min(138px, 36vw); height: min(138px, 36vw);
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #ffd24a;
  background: transparent;
  box-shadow: 0 0 0 4px #ff3d8a, 0 0 22px rgba(255,61,138,.5);
  animation: logoglow 2.4s ease-in-out infinite;
}
@keyframes logoglow {
  0%, 100% { box-shadow: 0 0 0 4px #ff3d8a, 0 0 16px rgba(255,61,138,.4); }
  50% { box-shadow: 0 0 0 4px #ffd24a, 0 0 28px rgba(255,210,74,.55); }
}
.logo-img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  filter: saturate(1.06) contrast(1.04);
}
.tag {
  margin-top: 14px;
  font-family: Russo One, sans-serif;
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #ff9ad4;
}

.hero-card {
  margin: 10px 0 16px;
  padding: 18px 16px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.slot-frame {
  display: flex; justify-content: center; gap: 6px;
  margin: 0 auto 14px;
  width: min(260px, 86%);
  padding: 8px;
  border-radius: 12px;
  background: linear-gradient(180deg, #3a2a12, #1a1208);
  border: 3px solid #ffd24a;
  box-shadow: inset 0 0 0 2px #8a1e4a, 0 0 16px rgba(255,61,138,.35);
}
.reel {
  flex: 1; height: 52px; overflow: hidden;
  background: #0c0810;
  border-radius: 6px;
  border: 1px solid #5a3a18;
}
.strip {
  display: flex; flex-direction: column; align-items: center;
  animation: spinreel 4.2s linear infinite;
}
.strip span, .strip img { height: 52px; width: 100%; object-fit: contain; display: block; }
.reel:nth-child(2) .strip { animation-duration: 5s; animation-delay: -.6s; }
.reel:nth-child(3) .strip { animation-duration: 3.8s; animation-delay: -1.1s; }
.reel:nth-child(4) .strip { animation-duration: 5.6s; animation-delay: -.3s; }
@keyframes spinreel {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}
.chip-row, .fruit-row { display: flex; justify-content: center; gap: 12px; margin-bottom: 12px; }
.hero-card h2 {
  font-family: Russo One, sans-serif;
  font-weight: 400;
  font-size: clamp(20px, 5.4vw, 28px);
  line-height: 1.2;
  text-align: center;
  color: var(--gold-2);
}
.hero-card p {
  margin-top: 8px;
  text-align: center;
  color: #cfc3aa;
  font-size: 14px;
  line-height: 1.5;
}

.tables h3 {
  font-family: Russo One, sans-serif;
  font-size: 13px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
  margin-bottom: 12px;
}
.table-list { display: flex; flex-direction: column; gap: 10px; }
.table-card {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 10px;
  padding: 14px;
  border: 1px solid rgba(212,175,55,.28);
  border-radius: 16px;
  background: rgba(8,24,18,.55);
}
.table-card h4 {
  font-family: Russo One, sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--gold-2);
}
.table-card .meta { font-size: 12px; color: var(--muted); grid-column: 1 / -1; }
.table-card .buy { font-weight: 700; color: var(--gold-2); font-size: 18px; }
.table-card button, .cta {
  grid-column: 1 / -1; height: 44px; border: 1px solid #c9a227;
  border-radius: 12px;
  background: linear-gradient(180deg, #f0d78c, #c4a227);
  color: #1a1408; font: 800 14px Nunito, sans-serif;
}
.table-card button:disabled { opacity: .35; }
.join-btn { font-size: 20px !important; letter-spacing: 0; }
.legal { margin-top: 16px; text-align: center; font-size: 11px; color: #6f6758; }

.modal {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(2,8,6,.7);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  position: relative;
  width: min(480px, 100%);
  background: linear-gradient(180deg, #1a1822, #0c0d12);
  border: 2px solid #e0b54a;
  border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(20px + var(--safe));
  max-height: 88vh; overflow: auto;
}
.close { position: absolute; right: 12px; top: 10px; background: none; border: 0; color: var(--gold-2); font-size: 20px; }
.sheet h3 { font-family: Russo One, sans-serif; font-size: 24px; color: var(--gold-2); }
.auth-tabs { display: flex; gap: 8px; margin: 8px 0 14px; }
.auth-tabs button {
  flex: 1; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: #bbb;
}
.auth-tabs button.on { border-color: var(--gold); color: #1a1408; background: var(--gold-2); }
#authForm label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
#authForm input {
  width: 100%; margin-top: 4px; height: 42px; border: 1px solid var(--line);
  border-radius: 10px; background: #07110d; color: #fff; padding: 0 10px;
}
.err { color: #d27a82; min-height: 16px; font-size: 13px; }
.muted { color: var(--muted); font-size: 13px; margin: 8px 0; }
.tiny { font-size: 11px; }
.bal-big { font-size: 28px; font-weight: 700; color: var(--gold-2); margin-bottom: 10px; }
.pack-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pack {
  border: 1px solid var(--line); border-radius: 12px; background: #0a1410; padding: 12px;
  text-align: left; color: inherit;
}
.pack strong { display: block; color: var(--gold-2); }
.pack span { font-size: 12px; color: var(--muted); }
.net-tabs { display: flex; gap: 6px; margin: 12px 0 8px; flex-wrap: wrap; }
.net-tabs button { flex: 1; min-width: 88px; padding: 8px; border: 1px solid var(--line); background: #0a1410; color: #ddd; font-size: 12px; }
.net-tabs button.on { border-color: var(--gold); color: var(--gold-2); }
.addr-box { display: flex; gap: 8px; align-items: center; background: #07110d; padding: 10px; border: 1px solid var(--line); }
.addr-box code { font-size: 11px; word-break: break-all; flex: 1; }
.cta { width: 100%; margin-top: 12px; }

.tl-title { font-family: Russo One, sans-serif; font-size: 16px; color: #ffd24a; }
.tl-room { text-align: center; margin: 8px 0; }
.tl-hint { text-align: center; font-size: 13px; padding: 0 8px 10px; }
.seat-list { list-style: none; max-height: 42vh; overflow: auto; margin: 0 0 12px; }
.seat-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; margin-bottom: 6px;
  border: 1px solid rgba(242,193,78,.3); border-radius: 10px;
}
.seat-list .rdy { color: #3dffc5; font-size: 12px; }
.seat-list .wait { color: #ff9ad4; font-size: 12px; }
.tl-status { text-align: center; min-height: 22px; margin-bottom: 8px; color: #ffd24a; }
body.playing { overflow: hidden; height: 100%; }
#c { width: 100%; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; inset: 0; pointer-events: none; }
.hud-top {
  pointer-events: auto; display: flex; justify-content: space-between; align-items: center;
  padding: calc(8px + env(safe-area-inset-top)) 10px 0; gap: 6px;
}
.pill {
  background: rgba(18,8,26,.78); border: 1px solid #f2c14e;
  border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 700;
  color: #ffe9a0; font-family: Russo One, sans-serif;
}
.pill.gold { color: #ffd24a; }
#leaveBtn {
  pointer-events: auto; background: rgba(18,8,26,.78); color: #ffe9a0;
  border: 1px solid #f2c14e; border-radius: 999px; padding: 6px 12px; font-size: 12px;
  font-family: Russo One, sans-serif;
}
.minimap-wrap {
  position: absolute; left: 10px; top: calc(52px + env(safe-area-inset-top));
  width: 104px; height: 104px; border-radius: 50%; overflow: hidden;
  border: 2px solid #ffd24a; background: rgba(18,8,26,.85);
  box-shadow: 0 0 0 3px #ff3d8a;
}
#minimap { width: 100%; height: 100%; display: block; }
.lb {
  position: absolute; top: calc(58px + env(safe-area-inset-top)); right: 10px;
  width: 148px; background: transparent; border: 0;
  padding: 0; font-size: 11px; line-height: 1.55; text-align: right;
  font-family: Russo One, sans-serif; color: #ffe9a0;
}
.lb b { color: #ffd24a; }
.toast {
  position: absolute; left: 50%; top: 28%; transform: translateX(-50%);
  font-family: Russo One, sans-serif; font-size: clamp(16px, 5vw, 24px);
  color: var(--gold-2); max-width: 88vw; text-align: center;
  text-shadow: 0 2px 12px #000; opacity: 0; transition: opacity .25s;
}
.toast.show { opacity: 1; }
#game.hidden .boost-btn, #game.hidden .boost-hint, #game.hidden .stamina-wrap, #game.hidden .joystick { display: none !important; }
.boost-btn {
  position: absolute; right: 18px; bottom: calc(36px + var(--safe));
  width: 74px; height: 74px; border-radius: 50%;
  border: 2px solid #ffd24a; color: #1a1408; font: 800 11px Russo One, sans-serif;
  background: radial-gradient(circle at 30% 25%, #fff1c4, #e0b54a);
  box-shadow: 0 0 0 3px #ff3d8a, 0 8px 18px rgba(0,0,0,.35);
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
  pointer-events: auto; z-index: 5;
}
.boost-btn.on { transform: scale(.94); filter: brightness(1.15); }
.stamina-wrap {
  position: absolute; left: 50%; bottom: calc(52px + var(--safe));
  transform: translateX(-50%);
  width: min(220px, 56vw); height: 8px;
  background: rgba(0,0,0,.4); border: 1px solid var(--line);
  border-radius: 999px; overflow: hidden;
  pointer-events: none;
}
.stamina-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #8a6a28, #ead7a2);
  transition: width .08s linear;
}
.stamina-bar.full { box-shadow: 0 0 10px rgba(234,215,162,.45); }
.boost-hint {
  position: absolute; bottom: calc(24px + var(--safe)); left: 0; right: 0;
  text-align: center; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(234,215,162,.35); pointer-events: none;
}
.joystick {
  display: none; position: absolute; left: 20px; bottom: calc(32px + var(--safe));
  width: 90px; height: 90px; border-radius: 50%;
  border: 1px solid var(--line); pointer-events: none;
}
.joystick .stick {
  width: 36px; height: 36px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ead7a2, #8a6a28);
  position: absolute; left: 27px; top: 27px;
}
@media (pointer: coarse) { .joystick { display: block; } }
.result-sheet ul { list-style: none; margin: 12px 0; }
.result-sheet li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #243028; }
.panel-screen { min-height: 100dvh; justify-content: center; padding: calc(10px + env(safe-area-inset-top)) 10px 16px; position: relative; z-index: 3; }
.panel-screen:not(.hidden) { display: flex; }
.frame.wide { width: min(920px, 100%); }
.acc-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 10px 0 14px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.stat-grid div { border: 1px solid rgba(242,193,78,.3); border-radius: 12px; padding: 10px; }
.stat-grid b { display: block; color: #ffd24a; font-size: 18px; }
.stat-grid span { font-size: 11px; color: var(--muted); }
.subh { font-family: Russo One, sans-serif; color: var(--gold); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; margin: 8px 0; }
.hist-list { list-style: none; max-height: 40vh; overflow: auto; }
.hist-list li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid #243028; font-size: 13px; }
.crm-tabs { display: flex; gap: 6px; margin: 10px 0; }
.crm-tabs button { flex: 1; height: 36px; border: 1px solid var(--line); background: transparent; color: #bbb; border-radius: 10px; font: 700 12px Nunito, sans-serif; }
.crm-tabs button.on { background: var(--gold-2); color: #1a1408; }
.crm-row { display: grid; grid-template-columns: 1.2fr .6fr .8fr auto; gap: 6px; align-items: center; padding: 8px 0; border-bottom: 1px solid #243028; font-size: 13px; }
.crm-row button { height: 28px; padding: 0 8px; font-size: 11px; border-radius: 8px; border: 1px solid var(--line); background: #1a160c; color: var(--gold-2); }
.field { display: block; font-size: 12px; color: var(--muted); margin: 8px 0; }
.field input { width: 100%; margin-top: 4px; height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #07110d; color: #fff; padding: 0 10px; }
.st-ok { color: #3dffc5; }
.st-wait { color: #ffd24a; }
.st-no { color: #ff7ab0; }
@media (min-width: 800px) {
  .table-list { display: grid; grid-template-columns: 1fr 1fr; }
  .modal { align-items: center; }
}
