/* =========================================================
   DOMINA — style
   ========================================================= */
:root {
  --bg: #06070b;
  --panel: rgba(24, 27, 39, .72);
  --panel2: rgba(38, 42, 60, .78);
  --line: rgba(255, 255, 255, .09);
  --line2: rgba(255, 255, 255, .16);
  --text: #f4f6fb;
  --muted: #8e97ae;
  --red: #ff3b3f;
  --red2: #c8161c;
  --gold: #ffc94a;
  --gold2: #e0960f;
  --green: #34d67b;
  --felt1: #17985a;
  --felt2: #063d20;
  --wood1: #8a5a2e;
  --wood2: #2e1a0a;
  --rim: linear-gradient(150deg, #9a6634 0%, #4a2a10 30%, #7a4c24 55%, #2e1a0a 80%, #5e3a1a 100%);
  --felt-pattern: none;
  --felt-size: auto;
  --pip: #15161a;
  --tile-fill: url(#tg-classic);
  --tstroke: rgba(120, 104, 70, .55);
  --tline: rgba(0, 0, 0, .22);
  --thl: rgba(255, 255, 255, .55);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input { font: inherit; }
.hidden { display: none !important; }
svg.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
i[data-icon], i.snd-icon { display: inline-flex; font-style: normal; }

/* ---------- background ---------- */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; transition: opacity .6s; }
.bg-glow {
  position: fixed; inset: -25%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(38% 32% at 22% 22%, rgba(255, 59, 63, .24), transparent 70%),
    radial-gradient(34% 30% at 80% 70%, rgba(255, 201, 74, .15), transparent 70%),
    radial-gradient(50% 40% at 50% 115%, rgba(60, 100, 255, .14), transparent 70%);
  animation: glow 16s ease-in-out infinite alternate;
  transition: opacity .6s;
}
@keyframes glow { to { transform: translate(5%, -4%) rotate(10deg) scale(1.12); } }
body.in-game #bg, body.in-game .bg-glow { opacity: 0; }
body.in-lobby #bg { opacity: .35; }
#app { position: relative; z-index: 1; }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 200; pointer-events: none; }
#fly-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; }

/* ---------- screens ---------- */
.screen { display: none; min-height: 100vh; min-height: 100dvh; }
.screen.active { display: flex; flex-direction: column; animation: screenIn .55s var(--ease); }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px) scale(.99); } }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px; min-height: 64px;
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, rgba(6, 7, 11, .85), rgba(6, 7, 11, .55));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar.clear { background: none; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; position: relative; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.brand { font-weight: 900; letter-spacing: 4px; display: flex; align-items: center; gap: 10px; font-size: 17px; }
.brand-tile {
  width: 13px; height: 24px; border-radius: 3px; background: linear-gradient(160deg, #fffef8, #e6dbbf);
  position: relative; box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.brand-tile::before { content: ''; position: absolute; left: 2px; right: 2px; top: 11.5px; height: 1px; background: rgba(0, 0, 0, .3); }
.brand-tile::after { content: ''; position: absolute; left: 4.5px; top: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--red); box-shadow: 0 11px 0 var(--pip); }

.icon-btn {
  height: 42px; min-width: 42px; padding: 0 11px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--line); position: relative; font-weight: 700; font-size: 13px;
  transition: background .2s, transform .2s var(--spring), border-color .2s;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.icon-btn:hover { background: var(--panel2); border-color: var(--line2); transform: translateY(-2px); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.sm { height: 34px; min-width: 34px; border-radius: 11px; }
.lang-code { letter-spacing: 1px; }
.badge {
  position: absolute; top: -5px; right: -5px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800;
  min-width: 19px; height: 19px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px;
  box-shadow: 0 0 0 2px var(--bg); animation: pop .4s var(--spring);
}
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); font-weight: 700;
  transition: transform .2s var(--spring), border-color .2s; animation: pop .5s var(--spring);
}
.user-chip:hover { transform: translateY(-2px); border-color: rgba(255, 201, 74, .5); }
.user-chip .avatar { width: 32px; height: 32px; font-size: 14px; }
.user-chip .uc-bal { color: var(--gold); }

/* ---------- buttons ---------- */
.btn {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 14px; font-weight: 800; letter-spacing: .3px; font-size: 15px;
  transition: transform .2s var(--spring), filter .2s, box-shadow .2s, opacity .2s;
}
.btn::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform .7s var(--ease);
}
.btn:hover:not(:disabled)::after { transform: translateX(120%); }
.btn:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.08); }
.btn:active:not(:disabled) { transform: scale(.96); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, #ff5a5e, var(--red2)); color: #fff;
  box-shadow: 0 10px 24px -10px var(--red), inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -2px 0 rgba(0, 0, 0, .2);
}
.btn-gold {
  background: linear-gradient(180deg, #ffe08a, var(--gold2)); color: #2b1b00;
  box-shadow: 0 10px 24px -10px var(--gold), inset 0 1px 0 rgba(255, 255, 255, .6), inset 0 -2px 0 rgba(0, 0, 0, .15);
}
.btn-ghost { background: var(--panel2); border: 1px solid var(--line2); }
.btn-big { width: 100%; padding: 16px; font-size: 17px; margin-top: 22px; border-radius: 16px; }
.btn-row { display: flex; gap: 10px; margin-top: 18px; }
.btn-row .btn { flex: 1; }
.ripple {
  position: absolute; border-radius: 50%; pointer-events: none; background: rgba(255, 255, 255, .35);
  transform: scale(0); animation: ripple .65s var(--ease) forwards; z-index: 3;
}
@keyframes ripple { to { transform: scale(1); opacity: 0; } }

/* ---------- forms ---------- */
.field-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1.6px; color: var(--muted); margin: 18px 0 8px; font-weight: 700; }
.seg { display: flex; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button {
  flex: 1; padding: 10px 6px; border-radius: 10px; font-weight: 700; font-size: 14px; color: var(--muted);
  transition: background .25s, color .25s, box-shadow .25s, transform .2s var(--spring);
}
.seg button:hover { color: var(--text); }
.seg button.on {
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .06)); color: var(--text);
  box-shadow: 0 0 0 1px var(--line2), 0 6px 14px -6px rgba(0, 0, 0, .6);
}
.seg.small button { padding: 6px 12px; font-size: 13px; }
input {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line2);
  background: rgba(0, 0, 0, .35); color: var(--text); outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus { border-color: var(--red); box-shadow: 0 0 0 4px rgba(255, 59, 63, .18); }
.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.error { color: #ff7b7e; min-height: 1.2em; margin: 8px 0 0; font-size: 14px; font-weight: 600; }

.glass {
  background: linear-gradient(160deg, rgba(34, 38, 54, .78), rgba(16, 18, 27, .78));
  border: 1px solid var(--line); border-radius: 24px;
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.panel { padding: 22px; }
.panel h3 { margin: 0 0 4px; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.panel h3 .ico { color: var(--gold); }

/* ---------- avatar ---------- */
.avatar {
  --c: #e41e20; --p: 1;
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; position: relative;
  background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--c) 55%, white), var(--c) 60%, color-mix(in srgb, var(--c) 70%, black));
  font-weight: 900; font-size: 18px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .4), 0 8px 18px -6px rgba(0, 0, 0, .8);
}
.avatar.xl { width: 64px; height: 64px; font-size: 28px; }
.avatar.sm { width: 36px; height: 36px; font-size: 15px; }

/* =========================================================
   HOME
   ========================================================= */
.hero { text-align: center; padding: 3vh 16px 0; }
.logo { display: flex; gap: clamp(6px, 1.3vw, 14px); justify-content: center; perspective: 1000px; }
.ltile { width: clamp(44px, 10vw, 92px); aspect-ratio: 1 / 1.9; transform-origin: 50% 100%; animation: ltIn 1s var(--spring) backwards; animation-delay: calc(var(--i) * 95ms + .1s); cursor: pointer; }
.logo.ready .ltile { animation: none; }
.logo.ready.wave .ltile { animation: topple 1.1s ease-in-out; animation-delay: calc(var(--i) * 85ms); }
.lt-face {
  position: relative; width: 100%; height: 100%; border-radius: 13% / 7%;
  background: linear-gradient(155deg, #fffef9 0%, #f3ead5 50%, #d8caa6 100%);
  box-shadow: inset 0 2px 0 #fff, inset 0 -5px 0 rgba(0, 0, 0, .13), inset -3px 0 0 rgba(0, 0, 0, .05),
    0 22px 34px -12px rgba(0, 0, 0, .8), 0 0 0 1px rgba(0, 0, 0, .25);
  display: flex; flex-direction: column; align-items: center; overflow: hidden;
  transition: transform .45s var(--spring);
}
.ltile:hover .lt-face { transform: translateY(-12px) rotate(-5deg); }
.ltile.flip .lt-face { animation: flip .8s var(--ease); }
@keyframes flip { to { transform: rotateY(360deg); } }
.lt-letter {
  flex: 1; display: grid; place-items: center; font-weight: 900; font-size: clamp(28px, 6.2vw, 58px); line-height: 1;
  color: #15161b; text-shadow: 0 1px 0 #fff, 0 -1px 0 rgba(0, 0, 0, .15);
}
.lt-line { width: 72%; height: 2px; background: rgba(0, 0, 0, .22); border-radius: 2px; box-shadow: 0 1px 0 rgba(255, 255, 255, .7); }
.lt-pips { flex: 1; width: 100%; padding: 12%; }
.lt-pips circle { fill: var(--red); }
.lt-face::after {
  content: ''; position: absolute; inset: -20%; pointer-events: none;
  background: linear-gradient(110deg, transparent 38%, rgba(255, 255, 255, .85) 50%, transparent 62%);
  transform: translateX(-130%); animation: sweep 6s ease-in-out infinite; animation-delay: calc(var(--i) * .09s + 1.6s);
}
@keyframes sweep { 0%, 75% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
@keyframes ltIn {
  0% { transform: translateY(-180px) rotateX(85deg) rotateZ(-14deg); opacity: 0; }
  55% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes topple { 0% { transform: none; } 30% { transform: rotate(-17deg); } 58% { transform: rotate(5deg); } 78% { transform: rotate(-2deg); } 100% { transform: none; } }
.tagline {
  color: #c3c9d9; margin: 26px auto 0; max-width: 560px; font-size: clamp(15px, 2vw, 18px); line-height: 1.5;
  text-shadow: 0 2px 12px #06070b, 0 0 24px #06070b;
  animation: fadeUp .8s var(--ease) .75s backwards;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(.97); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }

.menu { width: min(760px, 100% - 32px); margin: 34px auto 0; display: grid; gap: 16px; }
.menu-card {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --acc: var(--red);
  position: relative; display: grid; grid-template-columns: 130px 1fr auto; align-items: center; gap: 22px;
  padding: 22px 26px 22px 18px; text-align: left; border-radius: 26px; overflow: hidden;
  background: linear-gradient(135deg, rgba(44, 48, 68, .82), rgba(16, 18, 27, .88));
  border: 1px solid var(--line);
  box-shadow: 0 26px 60px -28px rgba(0, 0, 0, .95), inset 0 1px 0 rgba(255, 255, 255, .07);
  transform: perspective(1000px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .3s var(--ease), box-shadow .3s, border-color .3s;
  animation: rise .8s var(--ease) backwards; animation-delay: calc(.85s + var(--i) * .12s);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.menu-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(255, 255, 255, .13), transparent 45%);
}
.menu-card::after {
  content: ''; position: absolute; left: 0; top: 18%; bottom: 18%; width: 4px; border-radius: 0 4px 4px 0;
  background: var(--acc); box-shadow: 0 0 20px var(--acc);
}
.menu-card:hover { border-color: color-mix(in srgb, var(--acc) 55%, transparent); box-shadow: 0 30px 70px -26px rgba(0, 0, 0, .95), 0 0 0 1px color-mix(in srgb, var(--acc) 30%, transparent), 0 0 60px -20px var(--acc); }
.menu-card:hover::before { opacity: 1; }
.mc-online { --acc: var(--gold); }
.mc-art { height: 96px; display: grid; place-items: center; position: relative; }
.mc-body h2 { margin: 4px 0 6px; font-size: clamp(21px, 3vw, 27px); font-weight: 800; letter-spacing: -.3px; }
.mc-body p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.4; }
.mc-kicker { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; letter-spacing: 1.8px; color: var(--acc); text-transform: uppercase; }
.mc-kicker .ico { width: 15px; height: 15px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(52, 214, 123, .7); animation: live 1.8s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 9px rgba(52, 214, 123, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 214, 123, 0); } }
.mc-go {
  width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line); transition: transform .35s var(--spring), background .3s, color .3s;
}
.menu-card:hover .mc-go { transform: translateX(5px); background: var(--acc); color: #1a1000; border-color: transparent; }

.art-tiles { position: relative; width: 120px; height: 96px; }
.art-tiles svg { position: absolute; width: 34px; height: 68px; filter: drop-shadow(0 10px 10px rgba(0, 0, 0, .55)); animation: float 4s ease-in-out infinite; }
.art-tiles svg:nth-child(1) { left: 6px; top: 16px; rotate: -24deg; animation-delay: 0s; }
.art-tiles svg:nth-child(2) { left: 43px; top: 4px; rotate: 4deg; animation-delay: -1.3s; z-index: 2; }
.art-tiles svg:nth-child(3) { left: 80px; top: 18px; rotate: 26deg; animation-delay: -2.6s; }
.menu-card:hover .art-tiles svg:nth-child(1) { rotate: -34deg; translate: -6px 0; }
.menu-card:hover .art-tiles svg:nth-child(3) { rotate: 36deg; translate: 6px 0; }
.art-tiles svg { transition: rotate .5s var(--spring), translate .5s var(--spring); }
@keyframes float { 50% { transform: translateY(-8px); } }

.coin3d { width: 84px; height: 84px; position: relative; transform-style: preserve-3d; animation: coinspin 5s linear infinite; }
.coin3d.small { width: 64px; height: 64px; }
.coin3d .face {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 44px; color: #7a4a00;
  background: radial-gradient(circle at 34% 28%, #fff6c9, #ffcf55 42%, #e2940e 80%, #b86e05);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .3), inset 0 0 0 9px rgba(170, 100, 0, .35), inset 0 -8px 14px rgba(120, 60, 0, .4);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6), 0 -1px 0 rgba(0, 0, 0, .2);
  backface-visibility: hidden;
}
.coin3d.small .face { font-size: 34px; }
.coin3d .front { transform: translateZ(0); }
.coin3d .back { transform: translateZ(-7px) rotateY(180deg); }
.coin3d > i { position: absolute; inset: 0; border-radius: 50%; background: #b0700a; transform: translateZ(calc(var(--k) * -1px)); }
@keyframes coinspin { to { transform: rotateY(360deg); } }

.menu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.menu-mini {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; border-radius: 20px; font-weight: 700; font-size: 16px;
  background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(12px); position: relative; overflow: hidden;
  transition: transform .25s var(--spring), border-color .25s, background .25s;
  animation: rise .8s var(--ease) backwards; animation-delay: calc(.85s + var(--i) * .12s);
}
.menu-mini:hover { transform: translateY(-3px); border-color: var(--line2); background: var(--panel2); }
.menu-mini .ico { color: var(--gold); }
.foot { text-align: center; padding: 34px 16px 26px; font-size: 12px; color: #5d6479; animation: fadeUp .8s var(--ease) 1.3s backwards; }

/* =========================================================
   MODALS
   ========================================================= */
.modal {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px;
  background: rgba(3, 4, 8, .6); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fade .3s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal-box {
  position: relative; width: 100%; max-width: 420px; max-height: 92vh; overflow-y: auto; padding: 26px;
  background: linear-gradient(165deg, rgba(40, 44, 62, .96), rgba(16, 18, 26, .98));
  border: 1px solid var(--line2); border-radius: 28px;
  box-shadow: 0 40px 100px -30px #000, inset 0 1px 0 rgba(255, 255, 255, .08);
  animation: modalIn .5s var(--spring);
}
.modal-box.sheet { max-width: 520px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(40px) scale(.94); } }
.modal-x {
  position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  color: var(--muted); background: rgba(255, 255, 255, .05); transition: background .2s, color .2s, transform .3s var(--spring);
}
.modal-x:hover { background: rgba(255, 255, 255, .12); color: #fff; transform: rotate(90deg); }
.sheet-kicker { font-size: 11px; letter-spacing: 2px; font-weight: 800; color: var(--red); text-transform: uppercase; }
.sheet-title { margin: 4px 0 4px; font-size: 28px; font-weight: 900; letter-spacing: -.5px; }
.sheet-title.center { text-align: center; margin-bottom: 18px; }
.auth-coin { display: grid; place-items: center; margin: 4px 0 14px; perspective: 600px; }
.confirm-text { font-size: 17px; line-height: 1.5; margin: 6px 0 0; }

.opt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.opt {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 8px 14px; border-radius: 18px; text-align: center;
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line); position: relative; overflow: hidden;
  transition: transform .3s var(--spring), border-color .25s, background .25s, box-shadow .25s;
}
.opt:hover { transform: translateY(-3px); border-color: var(--line2); }
.opt b { font-size: 15px; }
.opt small { color: var(--muted); font-size: 12px; line-height: 1.3; }
.opt.on {
  border-color: var(--gold); background: linear-gradient(180deg, rgba(255, 201, 74, .16), rgba(255, 201, 74, .03));
  box-shadow: 0 0 0 1px var(--gold), 0 14px 30px -14px rgba(255, 201, 74, .6); transform: translateY(-3px);
}
.opt.on::after {
  content: '✓'; position: absolute; top: 8px; right: 9px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold); color: #2b1b00; font-size: 12px; font-weight: 900; animation: pop .35s var(--spring);
}
.mini-table {
  width: 56px; height: 56px; border-radius: 50%; position: relative; margin: 4px 0 10px;
  background: radial-gradient(circle at 50% 38%, var(--felt1), var(--felt2)); box-shadow: 0 0 0 4px var(--wood1), 0 8px 16px rgba(0, 0, 0, .5);
}
.mini-table i { position: absolute; left: 50%; top: 50%; width: 13px; height: 13px; margin: -6.5px; border-radius: 50%; background: #e8ecf5; transform: rotate(var(--a)) translateY(-34px); box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.mini-table i:first-child { background: var(--red); }
.mini-table.n2 i:nth-child(1) { --a: 180deg; } .mini-table.n2 i:nth-child(2) { --a: 0deg; }
.mini-table.n3 i:nth-child(1) { --a: 180deg; } .mini-table.n3 i:nth-child(2) { --a: 60deg; } .mini-table.n3 i:nth-child(3) { --a: 300deg; }
.mini-table.n4 i:nth-child(1) { --a: 180deg; } .mini-table.n4 i:nth-child(2) { --a: 270deg; } .mini-table.n4 i:nth-child(3) { --a: 0deg; } .mini-table.n4 i:nth-child(4) { --a: 90deg; }
.opt.on .mini-table { animation: spinIn .6s var(--spring); }
@keyframes spinIn { from { transform: rotate(-90deg) scale(.8); } }
.pipicon { width: 50px; height: 50px; border-radius: 12px; background: linear-gradient(155deg, #fffef9, #ddd0ad); display: grid; place-items: center; margin: 4px 0 8px; box-shadow: 0 8px 16px rgba(0, 0, 0, .5), inset 0 -3px 0 rgba(0, 0, 0, .12); }
.pipicon svg { width: 80%; height: 80%; }
.pipicon circle { fill: var(--pip); }
.pipicon.hot circle { fill: var(--red); }
.opt.on .pipicon { animation: wobble .6s var(--spring); }
@keyframes wobble { 30% { transform: rotate(-12deg) scale(1.1); } 60% { transform: rotate(8deg); } }

.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.swatches button {
  display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600;
  padding: 10px 4px; border-radius: 16px; border: 1px solid transparent; transition: transform .25s var(--spring), border-color .2s;
}
.swatches button::before {
  content: ''; width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, var(--s1), var(--s2)); box-shadow: 0 0 0 4px #6b4220, 0 8px 16px rgba(0, 0, 0, .5);
  transition: transform .3s var(--spring);
}
.swatches button.on { border-color: var(--gold); color: var(--text); }
.swatches button.on::before { transform: scale(1.12); }
.pips-preview { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.pips-preview svg { width: 32px; height: 64px; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .5)); }
.rules { margin: 14px 0 0; padding: 0; list-style: none; counter-reset: r; display: grid; gap: 12px; }
.rules li {
  counter-increment: r; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; line-height: 1.45; color: #d3d8e4;
  animation: rise .5s var(--ease) backwards; animation-delay: calc(var(--i) * 70ms + .1s);
}
.rules li::before {
  content: counter(r); width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 900;
  background: linear-gradient(155deg, #fffef9, #ddd0ad); color: #15161b; box-shadow: 0 6px 12px rgba(0, 0, 0, .45);
}

/* =========================================================
   LOBBY
   ========================================================= */
.balance {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 900; color: var(--gold); padding: 5px 16px 5px 5px; border-radius: 999px; white-space: nowrap;
  background: linear-gradient(180deg, rgba(255, 201, 74, .16), rgba(255, 201, 74, .05)); border: 1px solid rgba(255, 201, 74, .38);
  box-shadow: 0 0 24px -8px rgba(255, 201, 74, .5);
}
.balance.bump { animation: bump .6s var(--spring); }
@keyframes bump { 40% { transform: scale(1.15); } }
.coin-ico {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; color: #7a4a00; font-weight: 900;
  background: radial-gradient(circle at 34% 28%, #fff6c9, #ffcf55 45%, #d68a0a); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35);
}
.lobby { width: min(1240px, 100%); margin: 0 auto; padding: 22px 18px 40px; display: flex; flex-direction: column; gap: 22px; }
.lobby-hero { display: flex; align-items: center; gap: 18px; padding: 18px 22px; flex-wrap: wrap; animation: rise .6s var(--ease) backwards; }
.lh-info { flex: 1; min-width: 150px; }
.lh-hi { font-size: 24px; font-weight: 900; letter-spacing: -.3px; }
.lh-stats { color: var(--muted); font-size: 14px; margin-top: 2px; }
.lobby-grid { display: grid; grid-template-columns: 1fr 370px; gap: 22px; align-items: start; }
.lobby-main, .lobby-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.lobby-side > * { animation: rise .6s var(--ease) backwards; }
.lobby-side > *:nth-child(2) { animation-delay: .1s; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.section-head h3 { margin: 0; font-size: 22px; font-weight: 900; }
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px; }
.tcard {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 16px 16px; text-align: center; position: relative; overflow: hidden;
  animation: rise .55s var(--ease) backwards; animation-delay: calc(var(--i) * 60ms);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .3s var(--ease), border-color .3s;
}
.tcard::before { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(300px circle at var(--mx) var(--my), rgba(255, 255, 255, .1), transparent 45%); }
.tcard:hover { border-color: var(--line2); }
.tcard:hover::before { opacity: 1; }
.tcard.busy { opacity: .6; }
.tmini { width: 140px; height: 140px; position: relative; }
.tmini .fc {
  position: absolute; inset: 22px; border-radius: 50%; display: grid; place-items: center; text-align: center;
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--felt1) 85%, white), var(--felt1) 40%, var(--felt2));
  box-shadow: 0 0 0 6px var(--wood1), 0 0 0 7px rgba(0, 0, 0, .4), 0 14px 28px rgba(0, 0, 0, .55), inset 0 0 18px rgba(0, 0, 0, .45);
}
.tmini .fc b { display: block; color: var(--gold); font-size: 15px; text-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.tmini .fc small { font-size: 10px; letter-spacing: 1.5px; color: rgba(255, 255, 255, .6); font-weight: 700; text-transform: uppercase; }
.tmini .st {
  position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 900;
  transform: rotate(var(--a)) translateY(-60px) rotate(calc(-1 * var(--a)));
  background: rgba(20, 23, 33, .9); border: 2px dashed rgba(255, 255, 255, .22); color: var(--muted);
}
.tmini .st.on { background: var(--c); border: 2px solid rgba(255, 255, 255, .85); color: #fff; box-shadow: 0 4px 10px rgba(0, 0, 0, .5); animation: pop .4s var(--spring); }
.tinfo { display: flex; flex-direction: column; gap: 2px; }
.tinfo .tbuy { font-weight: 900; font-size: 18px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.tinfo .tsub { color: var(--muted); font-size: 13px; }
.tcard .btn { width: 100%; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 50px 20px; color: var(--muted); border: 2px dashed var(--line); border-radius: 24px; }
.empty-state .es-tiles { display: flex; justify-content: center; gap: 8px; margin-bottom: 14px; }
.empty-state .es-tiles svg { width: 26px; height: 52px; opacity: .6; animation: float 3s ease-in-out infinite; }
.empty-state .es-tiles svg:nth-child(2) { animation-delay: -1s; }
.empty-state .es-tiles svg:nth-child(3) { animation-delay: -2s; }

.chip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 10px; }
.pchip {
  --cc: #777; aspect-ratio: 1; border-radius: 50%; position: relative; display: grid; place-items: center;
  font-weight: 900; font-size: 13px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  background:
    radial-gradient(circle, var(--cc) 0 50%, transparent 51%),
    repeating-conic-gradient(var(--cc) 0 22.5deg, rgba(255, 255, 255, .9) 22.5deg 45deg);
  box-shadow: 0 5px 0 color-mix(in srgb, var(--cc) 55%, black), 0 8px 14px rgba(0, 0, 0, .5), inset 0 0 0 2px rgba(0, 0, 0, .15);
  transition: transform .3s var(--spring), box-shadow .3s, filter .3s;
}
.pchip span { width: 70%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: 2px dashed rgba(255, 255, 255, .55); }
.pchip:hover:not(:disabled) { transform: translateY(-4px) rotate(-10deg); }
.pchip.on { transform: translateY(-7px) scale(1.08); box-shadow: 0 5px 0 color-mix(in srgb, var(--cc) 55%, black), 0 14px 22px -4px var(--cc), 0 0 0 3px var(--gold); }
.pchip:disabled { opacity: .28; filter: grayscale(1); cursor: not-allowed; }
.pot-preview {
  margin-top: 20px; padding: 14px 16px; border-radius: 16px; display: flex; justify-content: space-between; align-items: center;
  background: rgba(0, 0, 0, .3); border: 1px solid var(--line); font-size: 14px; color: var(--muted);
}
.pot-preview b { color: var(--gold); font-size: 20px; font-weight: 900; }

.leaderboard { margin: 12px 0 0; padding: 0; list-style: none; counter-reset: lb; }
.leaderboard li {
  counter-increment: lb; display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 12px; font-size: 14px;
  animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i) * 50ms);
}
.leaderboard li::before {
  content: counter(lb); width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 900; font-size: 12px;
  background: rgba(255, 255, 255, .06); color: var(--muted);
}
.leaderboard li:nth-child(1)::before { background: linear-gradient(180deg, #ffe08a, #d9930c); color: #3a2600; }
.leaderboard li:nth-child(2)::before { background: linear-gradient(180deg, #f2f5fa, #9ea8b8); color: #222; }
.leaderboard li:nth-child(3)::before { background: linear-gradient(180deg, #f3b27a, #a3561d); color: #2a1200; }
.leaderboard .avatar { width: 28px; height: 28px; font-size: 12px; }
.leaderboard .lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.leaderboard .lb-bal { color: var(--gold); font-weight: 800; }
.leaderboard li.me { background: rgba(255, 59, 63, .12); box-shadow: inset 0 0 0 1px rgba(255, 59, 63, .3); }

/* =========================================================
   GAME
   ========================================================= */
#screen-game.active { height: 100vh; height: 100dvh; overflow: hidden; }
.game-bar { background: rgba(6, 7, 11, .6); }
.game-info { flex: 1; text-align: center; font-size: 14px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.game-info b { color: var(--text); }
.game-info .gi-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); margin: 0 3px; }

.felt {
  flex: 1; min-height: 0; position: relative; margin: 10px 14px 0; border-radius: 40px;
  border: 13px solid transparent;
  background:
    radial-gradient(ellipse 70% 60% at 50% 42%, color-mix(in srgb, var(--felt1) 82%, white) 0%, var(--felt1) 38%, var(--felt2) 100%) padding-box,
    var(--rim) border-box;
  transition: box-shadow .4s;
  box-shadow: 0 34px 70px -24px #000, inset 0 0 90px rgba(0, 0, 0, .55), inset 0 0 0 2px rgba(0, 0, 0, .4), 0 0 0 1px rgba(255, 255, 255, .06);
  overflow: hidden;
}
.felt::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .35; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}
.felt-pattern { position: absolute; inset: 0; pointer-events: none; background-image: var(--felt-pattern); background-size: var(--felt-size); background-position: center; }
.felt-light { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 45% 38% at 50% 30%, rgba(255, 245, 210, .16), transparent 70%); animation: lamp 7s ease-in-out infinite alternate; }
@keyframes lamp { to { opacity: .7; transform: scale(1.06); } }
.felt-mark {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none;
  font-weight: 900; font-size: clamp(50px, 11vw, 150px); letter-spacing: .25em; color: rgba(0, 0, 0, .11); white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .04);
}
.felt.shake { animation: shake .55s cubic-bezier(.36, .07, .19, .97); }
@keyframes shake {
  10%, 90% { transform: translate(-1px, 1px); } 20%, 80% { transform: translate(3px, -2px); }
  30%, 50%, 70% { transform: translate(-6px, 3px); } 40%, 60% { transform: translate(6px, -3px); }
}
.board-wrap { position: absolute; top: 104px; bottom: 30px; left: 170px; right: 170px; z-index: 2; }
#board { width: 100%; height: 100%; display: block; overflow: visible; }
#board.bump { animation: boardBump .35s var(--ease); }
@keyframes boardBump { 40% { transform: scale(1.012); } }
.board-msg {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none;
  color: rgba(255, 255, 255, .8); font-size: 17px; font-weight: 500; padding: 20px; text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.board-msg:empty { display: none; }
.board-msg .big { font-size: clamp(24px, 4vw, 34px); font-weight: 900; color: #fff; margin-bottom: 6px; animation: pop .5s var(--spring); }
.board-msg .dots::after { content: ''; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.board-msg .opentile { display: inline-block; width: 30px; height: 60px; vertical-align: middle; margin: 10px auto 0; filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .5)); animation: float 2s ease-in-out infinite; }

/* tiles */
.tile-body { fill: var(--tile-fill); stroke: var(--tstroke); stroke-width: .022; }
.tile-line { stroke: var(--tline); stroke-width: .03; stroke-linecap: round; }
.tile-hl { fill: var(--thl); }
.tile circle { fill: var(--pip); }body.pips-colored .tile circle.p1 { fill: #1e88e5; }
body.pips-colored .tile circle.p2 { fill: #2e9e4f; }
body.pips-colored .tile circle.p3 { fill: #e53935; }
body.pips-colored .tile circle.p4 { fill: #8d5524; }
body.pips-colored .tile circle.p5 { fill: #3949ab; }
body.pips-colored .tile circle.p6 { fill: #e6a100; }
.tile.last .tile-body { stroke: var(--gold); stroke-width: .06; }
.tile.landed { animation: land .45s var(--spring); transform-box: fill-box; transform-origin: center; }
@keyframes land { 0% { transform: scale(1.14); } 100% { transform: scale(1); } }
.ghost { cursor: pointer; }
.ghost .gr { fill: rgba(255, 201, 74, .2); stroke: var(--gold); stroke-width: .06; stroke-dasharray: .18 .1; animation: march 1s linear infinite, gpulse 1s ease-in-out infinite alternate; }
.ghost:hover .gr { fill: rgba(255, 201, 74, .45); }
@keyframes march { to { stroke-dashoffset: -.56; } }
@keyframes gpulse { from { opacity: .6; } to { opacity: 1; } }

.flyer { position: fixed; z-index: 91; pointer-events: none; will-change: transform; filter: drop-shadow(0 22px 20px rgba(0, 0, 0, .55)); }
.flyer svg { display: block; width: 100%; height: 100%; overflow: visible; }
.flyback {
  position: fixed; z-index: 91; width: 22px; height: 44px; border-radius: 5px; pointer-events: none;
  background: linear-gradient(135deg, #e0262b, #7b0d0f); box-shadow: 0 8px 14px rgba(0, 0, 0, .5), inset 0 0 0 2px rgba(255, 255, 255, .2);
}

/* banner */
.banner { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 9; }
.banner span {
  font-weight: 900; font-size: clamp(38px, 8vw, 104px); letter-spacing: .06em; text-align: center; padding: 0 20px;
  color: #fff; text-shadow: 0 6px 0 rgba(0, 0, 0, .25), 0 0 40px rgba(0, 0, 0, .4);
  animation: slam 1.7s var(--ease) forwards;
}
.banner span.gold {
  background: linear-gradient(180deg, #fff6cf 10%, #ffc94a 50%, #d98a06 90%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 rgba(90, 50, 0, .5)) drop-shadow(0 0 30px rgba(255, 201, 74, .55));
  text-shadow: none;
}
.banner span.small { font-size: clamp(26px, 4.6vw, 56px); }
@keyframes slam {
  0% { transform: scale(2.8); opacity: 0; filter: blur(10px); }
  16% { transform: scale(.92); opacity: 1; filter: blur(0); }
  24% { transform: scale(1.05); }
  30%, 76% { transform: scale(1); opacity: 1; }
  100% { transform: translateY(-40px) scale(.96); opacity: 0; }
}

/* seats */
.seat { position: absolute; display: flex; align-items: center; gap: 12px; z-index: 5; }
.pos-top { top: 20px; left: 50%; transform: translateX(-50%); }
.pos-left { left: 24px; top: 50%; transform: translateY(-50%); flex-direction: column; text-align: center; }
.pos-right { right: 24px; top: 50%; transform: translateY(-50%); flex-direction: column; text-align: center; }
.seat:empty { display: none; }
.seat .avatar { width: 52px; height: 52px; font-size: 21px; transition: transform .3s var(--spring); }
.seat.turn .avatar { transform: scale(1.08); box-shadow: 0 0 0 3px rgba(0, 0, 0, .4), 0 0 30px rgba(255, 201, 74, .55); }
.seat.turn .avatar::before {
  content: ''; position: absolute; inset: -7px; border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--p) * 360deg), rgba(255, 255, 255, .1) 0);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 64%); mask: radial-gradient(circle, transparent 62%, #000 64%);
}
.seat.turn.low .avatar::before { background: conic-gradient(var(--red) calc(var(--p) * 360deg), rgba(255, 255, 255, .1) 0); }
.seat.turn.free .avatar::before { background: conic-gradient(var(--gold), transparent 70%); animation: rot 1.1s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.seat-card {
  background: rgba(0, 0, 0, .38); border: 1px solid rgba(255, 255, 255, .1); border-radius: 16px; padding: 8px 14px;
  min-width: 118px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: border-color .3s, box-shadow .3s;
}
.seat.turn .seat-card { border-color: rgba(255, 201, 74, .65); box-shadow: 0 0 24px -6px rgba(255, 201, 74, .5); }
.seat-name { font-weight: 800; font-size: 14px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-score { font-size: 12px; color: var(--gold); font-weight: 700; }
.seat-sub { font-size: 11px; color: rgba(255, 255, 255, .55); }
.seat.out { opacity: .4; filter: grayscale(1); }
.seat.away .avatar::after { content: '⚡'; position: absolute; right: -6px; bottom: -6px; font-size: 15px; }
.backs { display: flex; gap: 3px; justify-content: center; margin-top: 7px; flex-wrap: wrap; max-width: 140px; }
.backs i {
  width: 9px; height: 17px; border-radius: 2px; background: linear-gradient(135deg, #e0262b, #7b0d0f);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .18);
}
.backs.deal i { animation: pop .4s var(--spring) backwards; animation-delay: calc(var(--k) * 60ms + .2s); }
.bubble {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); background: #fff; color: #111; font-size: 12px; font-weight: 800;
  padding: 5px 10px; border-radius: 11px; white-space: nowrap; pointer-events: none; animation: bubble 1.6s var(--spring) forwards; z-index: 3;
}
.bubble::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: #fff; }
@keyframes bubble { 0% { opacity: 0; transform: translate(-50%, 8px) scale(.6); } 15%, 80% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -6px); } }

.boneyard {
  position: absolute; right: 24px; bottom: 20px; display: flex; align-items: center; gap: 10px; z-index: 4;
  font-size: 13px; color: rgba(255, 255, 255, .85); background: rgba(0, 0, 0, .32); padding: 8px 14px 8px 10px; border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, .08);
}
.boneyard:empty { display: none; }
.boneyard b { color: #fff; font-size: 15px; }
.boneyard .stack {
  width: 16px; height: 28px; border-radius: 3px; background: linear-gradient(135deg, #e0262b, #7b0d0f);
  box-shadow: 3px -3px 0 -1px #5d0a0c, 6px -6px 0 -2px #4a0809, 0 4px 8px rgba(0, 0, 0, .5);
}
.status-pill {
  position: absolute; left: 24px; bottom: 20px; font-size: 14px; font-weight: 600; background: rgba(0, 0, 0, .32); color: #fff; z-index: 4;
  padding: 9px 14px; border-radius: 14px; max-width: 46%; border: 1px solid rgba(255, 255, 255, .08); animation: pop .35s var(--spring);
}
.status-pill:empty { display: none; }
.status-pill.mine { background: linear-gradient(180deg, rgba(255, 201, 74, .3), rgba(255, 201, 74, .12)); border-color: rgba(255, 201, 74, .6); }

.my-area { display: flex; align-items: center; gap: 16px; padding: 10px 18px calc(12px + env(safe-area-inset-bottom)); min-height: 142px; position: relative; }
.my-area::before { content: ''; position: absolute; left: 10%; right: 10%; bottom: 0; height: 80px; background: radial-gradient(ellipse at 50% 100%, rgba(255, 201, 74, .18), transparent 70%); opacity: 0; transition: opacity .5s; pointer-events: none; }
.my-area.my-turn::before { opacity: 1; }
.my-area .seat { position: static; transform: none; flex-direction: column; text-align: center; }
.hand { flex: 1; display: flex; gap: 7px; justify-content: center; align-items: flex-end; padding: 22px 6px 14px; min-height: 132px; overflow-x: auto; overflow-y: visible; scrollbar-width: none; }
.hand::-webkit-scrollbar { display: none; }
.htile {
  width: 50px; height: 100px; flex: none; overflow: visible;
  translate: 0 var(--y, 0px); rotate: var(--r, 0deg);
  transition: translate .3s var(--spring), rotate .3s var(--spring), scale .3s var(--spring), filter .25s, opacity .25s;
  filter: drop-shadow(0 7px 6px rgba(0, 0, 0, .5));
}
.htile.deal { animation: deal .65s var(--spring) backwards; animation-delay: calc(var(--k) * 75ms + .15s); }
@keyframes deal { from { transform: translateY(-46vh) rotate(-220deg) scale(.35); opacity: 0; } 40% { opacity: 1; } }
.hand.my-turn .htile.dim { opacity: .42; filter: saturate(.3) brightness(.8) drop-shadow(0 4px 4px rgba(0, 0, 0, .4)); translate: 0 calc(var(--y, 0px) + 6px); }
.hand.my-turn .htile.ok { cursor: pointer; filter: drop-shadow(0 0 9px rgba(255, 201, 74, .8)) drop-shadow(0 7px 6px rgba(0, 0, 0, .5)); animation: bob 1.8s ease-in-out infinite; animation-delay: calc(var(--k) * -.23s); }
.hand.my-turn .htile.ok.deal { animation: deal .65s var(--spring) backwards, bob 1.8s ease-in-out infinite; animation-delay: calc(var(--k) * 75ms + .15s), calc(var(--k) * -.23s); }
@keyframes bob { 50% { transform: translateY(-5px); } }
.hand.my-turn .htile.ok:hover { translate: 0 calc(var(--y, 0px) - 18px); rotate: 0deg; scale: 1.1; }
.htile.sel { translate: 0 -26px !important; rotate: 0deg !important; scale: 1.14; filter: drop-shadow(0 0 14px var(--gold)) drop-shadow(0 12px 10px rgba(0, 0, 0, .5)) !important; animation: none !important; }
.actions { display: flex; flex-direction: column; gap: 8px; min-width: 120px; align-items: flex-end; }
#btn-draw { animation: pop .4s var(--spring), attention 1.6s ease-in-out .4s infinite; }
@keyframes attention { 50% { box-shadow: 0 0 0 8px rgba(255, 201, 74, 0), 0 0 30px rgba(255, 201, 74, .7); } }

/* chat */
.chat-panel {
  position: fixed; right: 14px; top: 74px; bottom: 160px; width: 320px; z-index: 30; display: flex; flex-direction: column;
  background: rgba(18, 21, 30, .95); border: 1px solid var(--line2); border-radius: 22px; box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
  backdrop-filter: blur(16px); animation: slideIn .4s var(--spring);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } }
.chat-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); font-weight: 800; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.chat-log > div { animation: rise .3s var(--ease); line-height: 1.4; }
.chat-log .sys { color: var(--muted); font-style: italic; font-size: 12px; text-align: center; }
.chat-log b { color: var(--gold); }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.chat-form input { padding: 11px 14px; }
.chat-form .btn { padding: 0 14px; }

/* result */
.result-box { max-width: 500px; text-align: center; overflow: visible; }
.result-emblem { width: 84px; height: 84px; margin: -64px auto 10px; border-radius: 26px; display: grid; place-items: center; animation: emblem .8s var(--spring); position: relative; }
.result-emblem.win { background: radial-gradient(circle at 35% 28%, #fff6c9, #ffc94a 45%, #d68a0a); color: #5a3400; box-shadow: 0 0 60px rgba(255, 201, 74, .6), 0 16px 30px rgba(0, 0, 0, .5); }
.result-emblem.lose { background: linear-gradient(160deg, #3a3f52, #1c1f2b); color: #aab2c8; box-shadow: 0 16px 30px rgba(0, 0, 0, .5); border: 1px solid var(--line2); }
.result-emblem .ico { width: 42px; height: 42px; stroke-width: 2.2; }
.result-emblem.win::before { content: ''; position: absolute; inset: -30px; background: conic-gradient(from 0deg, transparent, rgba(255, 220, 120, .35), transparent 30%, rgba(255, 220, 120, .35), transparent 60%, rgba(255, 220, 120, .35), transparent 90%); border-radius: 50%; z-index: -1; animation: rot 6s linear infinite; }
@keyframes emblem { from { transform: scale(0) rotate(-120deg); } }
.result-title { font-size: 30px; font-weight: 900; margin: 4px 0; letter-spacing: -.5px; }
.result-title.win { background: linear-gradient(180deg, #fff6cf, #ffc94a 60%, #e0960f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.result-sub { color: var(--muted); margin-bottom: 18px; line-height: 1.4; }
.result-rows { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.rrow {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: rgba(0, 0, 0, .28); border-radius: 16px; border: 1px solid var(--line);
  animation: rise .5s var(--ease) backwards; animation-delay: calc(var(--i) * 90ms + .25s);
}
.rrow.w { border-color: rgba(255, 201, 74, .7); background: linear-gradient(90deg, rgba(255, 201, 74, .14), rgba(0, 0, 0, .2)); }
.rrow .crown { position: absolute; top: -13px; left: 50%; transform: translateX(-50%) rotate(-8deg); width: 22px; height: 22px; color: var(--gold); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); animation: pop .5s var(--spring) .8s backwards; }
.rrow .crown .ico { width: 22px; height: 22px; fill: var(--gold); stroke: #a86b00; stroke-width: 1.2; }
.rn { flex: 1; min-width: 0; }
.rname { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrow .mini { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 5px; }
.rrow .mini svg { width: 15px; height: 30px; }
.rs { font-weight: 900; font-size: 22px; color: var(--gold); white-space: nowrap; }
.rs small { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.pot-win { font-size: 44px; font-weight: 900; margin: 6px 0 16px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--gold); text-shadow: 0 0 30px rgba(255, 201, 74, .5); animation: pop .6s var(--spring) .3s backwards; }
.pot-win .coin-ico { width: 44px; height: 44px; font-size: 24px; animation: coinspin 2s linear infinite; }
.countdown { margin-top: 18px; color: var(--muted); font-size: 14px; }
.cd-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .1); margin-top: 8px; overflow: hidden; }
.cd-bar i { display: block; height: 100%; background: var(--gold); width: 100%; transition: width .25s linear; }

/* toasts */
.toasts { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 150; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(250, 250, 252, .97); color: #111; padding: 12px 18px; border-radius: 14px; font-weight: 600; max-width: 90vw;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45); animation: toast 3.2s var(--spring) forwards;
}
.toast.err { background: linear-gradient(180deg, #ff5a5e, var(--red2)); color: #fff; }
.toast.gold { background: linear-gradient(180deg, #ffe08a, var(--gold2)); color: #2b1b00; font-weight: 800; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-16px) scale(.9); } 10%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); } }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px) {
  .lobby-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar { padding: 10px 12px; min-height: 58px; }
  .icon-btn { height: 38px; min-width: 38px; border-radius: 12px; }
  .lang-btn .ico { display: none; }
  .user-chip .uc-name { display: none; }
  .hero { padding-top: 1vh; }
  .menu { margin-top: 26px; gap: 12px; }
  .menu-card { grid-template-columns: 78px 1fr auto; gap: 14px; padding: 18px 16px 18px 12px; border-radius: 22px; }
  .mc-art { height: 72px; transform: scale(.6); }
  .mc-body p { font-size: 13px; }
  .mc-go { width: 38px; height: 38px; border-radius: 12px; }
  .menu-mini { padding: 15px; font-size: 14px; }
  .modal-box { padding: 22px 18px; border-radius: 24px; }
  .sheet-title { font-size: 24px; }
  .opt small { display: none; }

  .lobby { padding: 14px 12px 30px; gap: 16px; }
  .lobby-hero { padding: 14px; gap: 12px; }
  .lh-hi { font-size: 19px; }
  .tables-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .tmini { width: 112px; height: 112px; }
  .tmini .fc { inset: 18px; }
  .tmini .st { width: 26px; height: 26px; margin: -13px; font-size: 11px; transform: rotate(var(--a)) translateY(-48px) rotate(calc(-1 * var(--a))); }

  .felt { margin: 6px 6px 0; border-radius: 26px; border-width: 8px; }
  .felt-mark { font-size: 44px; }
  .board-wrap { top: 86px; left: 8px; right: 8px; bottom: 50px; }
  .pos-top { top: 12px; }
  .pos-left { left: 10px; top: 12px; transform: none; flex-direction: row; text-align: left; }
  .pos-right { right: 10px; left: auto; top: 12px; transform: none; flex-direction: row-reverse; text-align: right; }
  .felt.n4 .seat:not(.pos-me) .avatar { display: none; }
  .felt.n4 .seat-card { min-width: 0; padding: 6px 9px; }
  .seat .avatar { width: 38px; height: 38px; font-size: 16px; }
  .seat-card { padding: 6px 10px; min-width: 86px; }
  .seat-name { max-width: 84px; font-size: 13px; }
  .backs { display: none; }
  .status-pill { left: 10px; bottom: 10px; max-width: 62%; font-size: 12px; padding: 7px 11px; }
  .boneyard { right: 10px; bottom: 10px; font-size: 12px; padding: 6px 10px 6px 8px; }
  .my-area { gap: 8px; padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); min-height: 120px; flex-wrap: wrap; }
  .my-area .seat { flex-direction: row; order: 1; }
  .my-area .seat .avatar { width: 34px; height: 34px; font-size: 15px; }
  .my-area .seat .seat-card { min-width: 0; }
  .actions { order: 2; margin-left: auto; min-width: 0; }
  .hand { order: 3; flex-basis: 100%; justify-content: flex-start; min-height: 96px; padding-top: 18px; gap: 5px; }
  .hand > :first-child { margin-left: auto; }
  .hand > :last-child { margin-right: auto; }
  .htile { width: 38px; height: 76px; }
  .chat-panel { left: 8px; right: 8px; width: auto; top: 64px; bottom: 130px; }
  .game-info .gi-pill { padding: 3px 7px; font-size: 12px; }
  .game-info .gi-pill:nth-child(2) { display: none; }
  .topbar .balance { padding-right: 10px; font-size: 14px; }
  .topbar .balance .coin-ico { width: 24px; height: 24px; font-size: 13px; }
  .result-emblem { width: 70px; height: 70px; margin-top: -54px; }
  .pot-win { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* =========================================================
   v3 — deal, teams, wallet, season pass, skins
   ========================================================= */
/* deal */
.deal-pile { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 7; pointer-events: none; }
.deal-pile .db {
  position: absolute; width: 26px; height: 52px; margin: -26px 0 0 -13px; border-radius: 6px;
  background: linear-gradient(135deg, #e0262b, #7b0d0f); box-shadow: 0 6px 12px rgba(0, 0, 0, .45), inset 0 0 0 2px rgba(255, 255, 255, .18);
}
.deal-pile .db::after { content: ''; position: absolute; inset: 7px 6px; border-radius: 3px; border: 1.5px solid rgba(255, 255, 255, .25); }
.flyback.big { width: 26px; height: 52px; border-radius: 6px; }
.htile.pending, .backs i.pending { opacity: 0 !important; animation: none !important; }
.htile.flipin { animation: flipin .45s var(--spring) !important; }
@keyframes flipin { from { transform: rotateY(90deg) scale(.8); } }
.backs i.arrive { animation: pop .3s var(--spring) !important; }

/* teams */
.team-tag {
  display: inline-block; font-size: 9px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase;
  padding: 2px 6px; border-radius: 6px; margin-top: 3px;
}
.team-tag.mate { background: rgba(52, 214, 123, .2); color: #6ff0a8; border: 1px solid rgba(52, 214, 123, .45); }
.team-tag.opp { background: rgba(255, 59, 63, .16); color: #ff8a8d; border: 1px solid rgba(255, 59, 63, .4); }
.seat.mate .avatar { box-shadow: 0 0 0 3px rgba(52, 214, 123, .7), 0 8px 18px -6px rgba(0, 0, 0, .8); }
.mini-table.teams i:nth-child(3) { background: var(--red); }
.team-score {
  position: absolute; top: 16px; left: 18px; z-index: 6; display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 800;
}
.team-score div { padding: 6px 10px; border-radius: 10px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .1); display: flex; gap: 8px; justify-content: space-between; min-width: 120px; }
.team-score .us { border-color: rgba(52, 214, 123, .5); }
.team-score .them { border-color: rgba(255, 59, 63, .45); }
.team-score b { color: var(--gold); }

/* wallet */
.wallet { padding: 8px 16px; border-radius: 16px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 201, 74, .3); }
.wallet-label { font-size: 10px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.wallet-amt { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 900; color: var(--gold); }
.wallet-amt .coin-ico { width: 26px; height: 26px; font-size: 14px; }
.wallet-chip .wl { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-right: 2px; }
.pot-chip { background: linear-gradient(180deg, rgba(52, 214, 123, .16), rgba(52, 214, 123, .04)); border-color: rgba(52, 214, 123, .4); color: #8ff5bd; }
.home-wallet { display: flex; align-items: center; gap: 10px; margin: 10px 0 0; font-weight: 800; color: var(--gold); font-size: 15px; }

/* pass button & emblem */
.btn-pass {
  background: linear-gradient(135deg, #8a3bd1, #3b1a8a); color: #fff;
  box-shadow: 0 10px 24px -10px #8a3bd1, inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn-pass .pass-lv { background: rgba(255, 255, 255, .18); padding: 2px 7px; border-radius: 8px; font-size: 12px; }
.mc-pass { --acc: #b36bff; }
.pass-emblem {
  width: 84px; height: 84px; position: relative; display: grid; place-items: center; animation: float 4s ease-in-out infinite;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: linear-gradient(145deg, #f3d6ff, #b36bff 35%, #5b21b6 70%, #2a0d63);
}
.pass-emblem::before { content: ''; position: absolute; inset: 6px; clip-path: inherit; background: linear-gradient(160deg, #3a1580, #150733); }
.pass-emblem span { position: relative; font-weight: 900; font-size: 28px; background: linear-gradient(180deg, #fff, #e3c6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pass-emblem::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .5) 50%, transparent 65%); transform: translateX(-120%); animation: sweep 4s ease-in-out infinite 1s; }
.mc-xp { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; color: #d9c2ff; font-weight: 700; }
.xpbar { flex: 1; height: 8px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; max-width: 260px; }
.xpbar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #8a3bd1, #e0a8ff); box-shadow: 0 0 12px #b36bff; transition: width 1s var(--ease); }
.xpbar.big { height: 12px; max-width: none; }

/* pass screen */
.pass-wrap { width: min(1240px, 100%); margin: 0 auto; padding: 22px 18px 40px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.pass-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 24px; flex-wrap: wrap; position: relative; overflow: hidden;
  background: linear-gradient(120deg, rgba(91, 33, 182, .55), rgba(20, 16, 40, .85) 55%, rgba(255, 201, 74, .12));
  animation: rise .6s var(--ease) backwards;
}
.pass-hero::before {
  content: ''; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent, rgba(179, 107, 255, .25), transparent 30%, rgba(255, 201, 74, .2), transparent 60%); animation: rot 14s linear infinite;
}
.ph-left { display: flex; align-items: center; gap: 20px; flex: 1; min-width: 260px; position: relative; }
.ph-badge {
  width: 96px; height: 106px; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  background: linear-gradient(160deg, #ffe08a, #b36bff 55%, #3b1a8a); position: relative;
}
.ph-badge::before { content: ''; position: absolute; inset: 5px; clip-path: inherit; background: linear-gradient(160deg, #2c1260, #100526); }
.ph-badge > * { position: relative; }
.ph-badge .lv-label { font-size: 12px; letter-spacing: 3px; color: #d9c2ff; font-weight: 800; }
.ph-badge b { font-size: 40px; font-weight: 900; line-height: 1; color: #fff; }
.ph-badge.up { animation: lvup .9s var(--spring); }
@keyframes lvup { 30% { transform: scale(1.3) rotate(-8deg); } }
.ph-info { flex: 1; min-width: 0; }
.ph-season { font-size: 26px; font-weight: 900; letter-spacing: -.4px; background: linear-gradient(90deg, #fff, #e3c6ff 60%, #ffd772); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph-ends { color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
.ph-xp { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 700; color: #d9c2ff; }
.ph-right { position: relative; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.prem-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 14px; font-weight: 900; letter-spacing: 2px;
  background: linear-gradient(180deg, #ffe08a, var(--gold2)); color: #2b1b00; box-shadow: 0 0 30px rgba(255, 201, 74, .45);
}
.prem-perks { font-size: 12px; color: #d9c2ff; text-align: right; line-height: 1.5; }
.btn-premium { padding: 14px 22px; font-size: 16px; }
.xp-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.xp-chips span {
  padding: 8px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; color: #cfd5e2;
  animation: rise .5s var(--ease) backwards; animation-delay: calc(var(--i) * 60ms + .2s);
}
.xp-chips b { color: #d9a8ff; }
.track-legend { display: flex; gap: 16px; font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.track-legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.tl-free::before { background: #cfd5e2; }
.tl-prem::before { background: linear-gradient(135deg, #ffd772, #b36bff); }
.track-scroll { overflow-x: auto; padding: 8px 4px 18px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #4b2a8a transparent; }
.track { display: flex; gap: 12px; width: max-content; position: relative; padding: 0 8px; }
.lvcol { display: grid; grid-template-rows: 150px 46px 150px; gap: 8px; width: 118px; animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i) * 25ms); }
.lvnode { position: relative; display: grid; place-items: center; }
.lvnode::before { content: ''; position: absolute; left: -12px; right: -12px; top: 50%; height: 6px; margin-top: -3px; background: rgba(255, 255, 255, .08); }
.lvnode.done::before { background: linear-gradient(90deg, #8a3bd1, #e0a8ff); box-shadow: 0 0 10px rgba(179, 107, 255, .6); }
.lvnode span {
  position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 900;
  background: #1c2030; border: 2px solid rgba(255, 255, 255, .15); color: var(--muted); transform: rotate(45deg);
}
.lvnode span b { transform: rotate(-45deg); }
.lvnode.done span { background: linear-gradient(135deg, #b36bff, #5b21b6); border-color: #e0a8ff; color: #fff; }
.lvnode.cur span { box-shadow: 0 0 0 4px rgba(255, 201, 74, .35), 0 0 24px rgba(255, 201, 74, .6); border-color: var(--gold); animation: pulseNode 1.6s ease-in-out infinite; }
@keyframes pulseNode { 50% { box-shadow: 0 0 0 8px rgba(255, 201, 74, 0), 0 0 30px rgba(255, 201, 74, .8); } }
.rwd {
  position: relative; border-radius: 18px; padding: 12px 8px 10px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px; text-align: center;
  background: rgba(24, 27, 39, .8); border: 1px solid var(--line); overflow: hidden; transition: transform .25s var(--spring), border-color .25s;
}
.rwd { background: #181b27; }
.rwd.empty { background: #11131b; border-style: dashed; }
body.in-pass #bg { opacity: .12; }
.rwd.prem { background: linear-gradient(170deg, #3a1a6e, #1a1030); border-color: rgba(179, 107, 255, .35); }
.rwd.prem.empty { background: #16102a; }
.rwd .rname { font-size: 11px; font-weight: 800; color: #dfe3ee; line-height: 1.2; }
.rwd .rart { flex: 1; display: grid; place-items: center; min-height: 60px; }
.rwd.locked .rart, .rwd.locked .rname { opacity: .45; filter: saturate(.6); }
.rwd .lock { position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: rgba(0, 0, 0, .5); color: #d9c2ff; }
.rwd .lock .ico { width: 13px; height: 13px; }
.rwd.claimed::after {
  content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-weight: 900; color: #6ff0a8;
  background: rgba(8, 10, 16, .6); text-shadow: 0 0 20px rgba(52, 214, 123, .7);
}
.rwd.claim { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 0 26px -4px rgba(255, 201, 74, .7); cursor: pointer; animation: claimGlow 1.4s ease-in-out infinite; }
.rwd.claim:hover { transform: translateY(-4px); }
@keyframes claimGlow { 50% { box-shadow: 0 0 0 1px var(--gold), 0 0 40px 0 rgba(255, 201, 74, .85); } }
.rwd .cbtn { font-size: 11px; font-weight: 900; padding: 4px 10px; border-radius: 8px; background: linear-gradient(180deg, #ffe08a, var(--gold2)); color: #2b1b00; letter-spacing: .5px; }
.rw-coin { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 900; color: var(--gold); font-size: 15px; }
.rw-coin .coin-ico { width: 38px; height: 38px; font-size: 20px; }
.skin-table {
  width: 64px; height: 64px; border-radius: 50%; position: relative; overflow: hidden;
  background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--felt1) 80%, white), var(--felt1) 40%, var(--felt2));
  box-shadow: 0 8px 18px rgba(0, 0, 0, .5);
  border: 6px solid transparent;
  background-origin: border-box;
}
.skin-table { background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--felt1) 80%, white), var(--felt1) 40%, var(--felt2)) padding-box, var(--rim) border-box; }
.skin-table::before { content: ''; position: absolute; inset: 0; background-image: var(--felt-pattern); background-size: var(--felt-size); background-position: center; opacity: .9; }
.skin-tile { display: flex; gap: 4px; }
.skin-tile svg { width: 24px; height: 48px; filter: drop-shadow(0 5px 5px rgba(0, 0, 0, .5)); }
.skin-tile svg:nth-child(2) { rotate: 12deg; }

/* settings skin grid */
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.skin-opt {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px 6px 10px; border-radius: 16px; position: relative;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--line); font-size: 12px; font-weight: 700; color: #cfd5e2;
  transition: transform .25s var(--spring), border-color .2s, box-shadow .2s;
}
.skin-opt:hover { transform: translateY(-3px); }
.skin-opt .skin-table { width: 54px; height: 54px; border-width: 5px; }
.skin-opt.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), 0 10px 24px -12px rgba(255, 201, 74, .7); }
.skin-opt.locked { opacity: .55; }
.skin-opt.locked .skin-table, .skin-opt.locked .skin-tile { filter: grayscale(.7) brightness(.7); }
.skin-opt .req { font-size: 10px; color: #d9a8ff; font-weight: 800; display: flex; align-items: center; gap: 3px; }
.skin-opt .req .ico { width: 11px; height: 11px; }

/* reward modal */
.reward-box { text-align: center; overflow: hidden; max-width: 380px; }
.reward-rays {
  position: absolute; left: 50%; top: 120px; width: 520px; height: 520px; margin: -260px 0 0 -260px; pointer-events: none; opacity: .7;
  background: repeating-conic-gradient(from 0deg, rgba(255, 215, 114, .22) 0 10deg, transparent 10deg 25deg);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 65%); mask: radial-gradient(circle, #000 20%, transparent 65%);
  animation: rot 12s linear infinite;
}
.reward-kicker { position: relative; font-size: 12px; letter-spacing: 2px; font-weight: 900; color: #d9a8ff; text-transform: uppercase; }
.reward-art { position: relative; height: 170px; display: grid; place-items: center; animation: rewardIn .9s var(--spring) .1s backwards; }
@keyframes rewardIn { from { transform: scale(0) rotate(-200deg); opacity: 0; } }
.reward-art .skin-table { width: 140px; height: 140px; border-width: 12px; }
.reward-art .skin-tile svg { width: 48px; height: 96px; }
.reward-art .rw-coin { font-size: 30px; }
.reward-art .rw-coin .coin-ico { width: 90px; height: 90px; font-size: 48px; animation: coinspin 2.4s linear infinite; }
.reward-name { position: relative; font-size: 26px; font-weight: 900; margin: 6px 0 2px; }
.reward-sub { position: relative; color: var(--muted); font-size: 14px; }

@media (max-width: 720px) {
  .wallet { order: 5; flex: 1; }
  .wallet-amt { font-size: 20px; }
  .lobby-hero .btn { flex: 1; padding: 11px 12px; font-size: 13px; }
  .pass-hero { padding: 18px; }
  .ph-badge { width: 76px; height: 84px; }
  .ph-badge b { font-size: 30px; }
  .ph-season { font-size: 20px; }
  .ph-right { align-items: stretch; width: 100%; }
  .prem-perks { text-align: left; }
  .lvcol { width: 100px; grid-template-rows: 136px 42px 136px; }
  .team-score { top: auto; bottom: 52px; left: 10px; flex-direction: row; }
  .team-score div { min-width: 0; padding: 4px 8px; }
  .wallet-chip .wl { display: none; }
  #game-pot { display: none !important; }
}

/* =========================================================
   v4 — account, friends, creator
   ========================================================= */
#auth-form.mode-login .reg-only, #auth-form.mode-login .reg-only-inline { display: none; }
#auth-form.mode-register .login-only { display: none; }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 44px; }
.id-status { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-weight: 900; font-size: 16px; }
.id-status.ok { color: var(--green); }
.id-status.no { color: #ff7b7e; }
.hint.ok { color: #6ff0a8; }
.hint.no { color: #ff7b7e; }
input.invalid { border-color: #ff5a5e; box-shadow: 0 0 0 4px rgba(255, 59, 63, .15); }
input[type="date"] { color-scheme: dark; }
#modal-auth .modal-box { max-height: 94vh; }

.cbadge {
  display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; margin-left: 5px; vertical-align: -3px;
  background: radial-gradient(circle at 35% 30%, #fff6c9, #ffc94a 50%, #d68a0a); box-shadow: 0 0 10px rgba(255, 201, 74, .6);
}
.cbadge .ico { width: 10px; height: 10px; fill: #5a3400; stroke: #5a3400; stroke-width: 1; }
.creator-pill {
  display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 900;
  letter-spacing: 1.4px; text-transform: uppercase; vertical-align: 4px; color: #2b1b00;
  background: linear-gradient(180deg, #ffe08a, var(--gold2)); box-shadow: 0 0 18px rgba(255, 201, 74, .5);
}
.creator-pill .ico { width: 12px; height: 12px; fill: currentColor; }

.friends-btn { position: relative; }
.friends-btn .badge, #home-friends .badge { top: -6px; right: -6px; }
.my-id {
  display: flex; align-items: center; gap: 10px; margin: 10px 0 14px; padding: 10px 12px; border-radius: 14px;
  background: rgba(0, 0, 0, .3); border: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.my-id b { color: var(--text); font-size: 15px; flex: 1; }
.add-friend { display: flex; gap: 8px; }
.add-friend input { flex: 1; }
.add-friend .btn { padding: 0 16px; }
.fsec { margin-top: 18px; }
.fsec h4 { margin: 0 0 8px; font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.frow {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 14px; background: rgba(0, 0, 0, .25);
  border: 1px solid var(--line); margin-bottom: 7px; animation: rise .35s var(--ease) backwards; animation-delay: calc(var(--i) * 40ms);
}
.frow .avatar { width: 36px; height: 36px; font-size: 15px; }
.frow .avatar::after { content: ''; position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #5d6479; box-shadow: 0 0 0 2px #1a1d29; }
.frow.on .avatar::after { background: var(--green); }
.frow .fi { flex: 1; min-width: 0; }
.frow .fn { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .fs { font-size: 12px; color: var(--muted); }
.frow.on .fs { color: #6ff0a8; }
.frow .fa { display: flex; gap: 6px; }
.frow .btn { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.frow .icon-btn.sm { height: 32px; min-width: 32px; }
.fempty { color: var(--muted); font-size: 14px; text-align: center; padding: 18px 10px; border: 1px dashed var(--line); border-radius: 14px; }

.toast.action { pointer-events: auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; animation: toastIn .4s var(--spring); }
.toast.action.out { animation: toastOut .3s ease forwards; }
.toast.action .ta { display: flex; gap: 6px; }
.toast.action .btn { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-10px); } }
.board-msg .btn { pointer-events: auto; margin-top: 14px; }

/* =========================================================
   v5 — music, account
   ========================================================= */
.music-btn.off { opacity: .45; }
.music-btn.off .ico { stroke-dasharray: 2 2; }
.music-btn.playing .ico { animation: notebob 1.6s ease-in-out infinite; }
@keyframes notebob { 50% { transform: translateY(-2px) rotate(-6deg); } }
.music-row { display: flex; align-items: center; gap: 14px; }
.music-row .seg { flex: 1; }
.music-row input[type="range"] { flex: 1; padding: 0; accent-color: var(--gold); height: 6px; border: 0; background: none; box-shadow: none; }
.account-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-row span { flex: 1; font-weight: 800; min-width: 120px; }
.btn-danger { background: rgba(255, 59, 63, .12); color: #ff7b7e; border: 1px solid rgba(255, 59, 63, .45); }
.btn-danger:hover:not(:disabled) { background: rgba(255, 59, 63, .22); }
.bot-tag { font-size: 9px; font-weight: 900; letter-spacing: 1px; padding: 1px 5px; border-radius: 5px; background: rgba(255,255,255,.12); color: var(--muted); vertical-align: 2px; margin-left: 4px; }

/* =========================================================
   v6 — shop & ads
   ========================================================= */
button.wallet { text-align: left; cursor: pointer; transition: transform .2s var(--spring), border-color .2s; }
button.wallet:hover { transform: translateY(-2px); border-color: var(--gold); }
.wallet-plus { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 16px; background: var(--gold); color: #2b1b00; margin-left: 4px; }
.btn-shop { background: linear-gradient(180deg, #4be08f, #13a35a); color: #052b16; box-shadow: 0 10px 24px -10px #2ecc71, inset 0 1px 0 rgba(255, 255, 255, .45); }
.foot a, .shop-legal a { color: #9aa3b8; }
.shop-box { max-width: 620px; }
.shop-wallet { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: var(--gold); margin: 4px 0 6px; }
.shop-note { margin: 10px 0; padding: 10px 14px; border-radius: 12px; font-size: 13px; background: rgba(255, 201, 74, .1); border: 1px solid rgba(255, 201, 74, .35); color: #ffe08a; }
.shop-pass {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: 20px; margin: 14px 0 16px;
  background: linear-gradient(120deg, #5b21b6, #2a0d63 60%, #3a1a10); border: 1px solid rgba(224, 168, 255, .5);
  box-shadow: 0 16px 40px -18px #8a3bd1;
}
.shop-pass::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .18) 50%, transparent 65%); transform: translateX(-120%); animation: sweep 4.5s ease-in-out infinite; pointer-events: none; }
.shop-pass .pass-emblem { width: 64px; height: 64px; flex: none; }
.shop-pass .pass-emblem span { font-size: 22px; }
.shop-pass .sp-info { flex: 1; min-width: 0; }
.shop-pass .sp-title { font-weight: 900; font-size: 18px; }
.shop-pass .sp-perks { font-size: 12px; color: #e3c6ff; line-height: 1.5; margin-top: 3px; }
.shop-pass .owned { font-weight: 900; color: #6ff0a8; }
.shop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pack {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 10px 12px; border-radius: 18px; text-align: center;
  background: linear-gradient(170deg, rgba(40, 44, 62, .95), rgba(18, 20, 30, .95)); border: 1px solid var(--line);
  transition: transform .25s var(--spring), border-color .25s, box-shadow .25s; animation: rise .45s var(--ease) backwards; animation-delay: calc(var(--i) * 50ms);
}
.pack:hover { transform: translateY(-4px); border-color: rgba(255, 201, 74, .6); box-shadow: 0 16px 30px -16px rgba(255, 201, 74, .6); }
.pack .tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; padding: 3px 9px; border-radius: 8px; white-space: nowrap; }
.pack .tag.popular { background: var(--red); color: #fff; }
.pack .tag.best { background: var(--gold); color: #2b1b00; }
.pack .coins { position: relative; height: 54px; width: 80px; }
.pack .coins .coin-ico { position: absolute; width: 34px; height: 34px; font-size: 18px; box-shadow: 0 3px 0 #a86b00, 0 6px 10px rgba(0, 0, 0, .4); }
.pack .amt { font-weight: 900; font-size: 20px; color: var(--gold); }
.pack .bonus { font-size: 11px; font-weight: 800; color: #6ff0a8; min-height: 14px; }
.pack .btn { width: 100%; padding: 9px 10px; font-size: 15px; margin-top: 4px; }
.shop-legal { font-size: 11px; color: var(--muted); margin: 16px 0 0; line-height: 1.5; }

.ad-modal { background: rgba(3, 4, 8, .9); z-index: 150; }
.ad-box { max-width: 520px; text-align: center; }
.ad-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ad-label { font-size: 10px; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line2); border-radius: 6px; padding: 2px 8px; }
.ad-timer { --p: 1; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; position: relative; }
.ad-timer::before { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p) * 360deg), rgba(255, 255, 255, .1) 0); -webkit-mask: radial-gradient(circle, transparent 60%, #000 62%); mask: radial-gradient(circle, transparent 60%, #000 62%); }
.ad-content { min-height: 240px; display: grid; place-items: center; }
.house-ad { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.house-ad .pass-emblem { width: 110px; height: 110px; }
.house-ad .pass-emblem span { font-size: 36px; }
.house-ad h3 { margin: 6px 0 0; font-size: 26px; font-weight: 900; background: linear-gradient(90deg, #fff, #e3c6ff 60%, #ffd772); -webkit-background-clip: text; background-clip: text; color: transparent; }
.house-ad ul { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 6px; text-align: left; }
.house-ad li { font-size: 14px; color: #dfe3ee; }
.house-ad li::before { content: '✓'; color: #6ff0a8; font-weight: 900; margin-right: 8px; }
.house-ad .price { font-size: 30px; font-weight: 900; color: var(--gold); }
@media (max-width: 720px) {
  .shop-grid { grid-template-columns: repeat(2, 1fr); }
  .btn-shop span { display: none; }
  .shop-pass { flex-wrap: wrap; }
}
.btn-admin { background: linear-gradient(135deg, #ffe08a, #b36bff); color: #1b0b33; box-shadow: 0 10px 24px -10px #b36bff; }
.admin-check { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-weight: 700; cursor: pointer; }
.admin-check input { width: 20px; height: 20px; accent-color: var(--gold); }
.admin-card { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(0,0,0,.3); border: 1px solid rgba(255,201,74,.35); animation: rise .3s var(--ease); }
.admin-card.none { color: #ff7b7e; border-color: rgba(255,59,63,.4); font-weight: 700; font-size: 14px; }
.admin-card .ac-info { flex: 1; min-width: 0; }
.admin-card .ac-name { font-weight: 900; font-size: 16px; }
.admin-card .ac-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ac-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #5d6479; vertical-align: 1px; }
.ac-dot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }

/* =========================================================
   v7 — spazio, fluidità, compatibilità
   ========================================================= */
body { background: #05030f; }
.bg-glow {
  background:
    radial-gradient(38% 32% at 18% 20%, rgba(124, 58, 237, .20), transparent 70%),
    radial-gradient(34% 30% at 82% 72%, rgba(37, 99, 235, .16), transparent 70%),
    radial-gradient(50% 40% at 50% 115%, rgba(219, 39, 119, .12), transparent 70%);
  mix-blend-mode: screen;
}
.logo .lt-face { box-shadow: inset 0 2px 0 #fff, inset 0 -5px 0 rgba(0,0,0,.13), 0 22px 34px -12px rgba(0,0,0,.8), 0 0 0 1px rgba(0,0,0,.25), 0 0 40px -6px rgba(139, 92, 246, .55); }
.tagline { text-shadow: 0 2px 12px #05030f, 0 0 24px #05030f; }

/* Fluidità: solo animazioni su transform/opacity, livelli GPU dove serve */
.menu-card, .tcard, .htile, .flyer, .flyback, .deal-pile .db, .modal-box { will-change: transform; }
#bg, #fx { contain: strict; }

/* Dispositivi poco potenti: niente sfocature costose né ombre enormi */
.lowfx .glass, .lowfx .menu-card, .lowfx .menu-mini, .lowfx .topbar, .lowfx .modal, .lowfx .icon-btn, .lowfx .user-chip,
.lowfx .seat-card, .lowfx .chat-panel { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
.lowfx .modal { background: rgba(3, 4, 8, .85); }
.lowfx .bg-glow { animation: none; }
.lowfx .felt::before { display: none; }
.lowfx .lt-face::after, .lowfx .shop-pass::after, .lowfx .pass-emblem::after { animation: none; }
.lowfx .menu-card, .lowfx .glass { box-shadow: 0 10px 24px -14px rgba(0,0,0,.9); }

/* Browser più vecchi senza color-mix(): colori di riserva */
@supports not (color: color-mix(in srgb, red, blue)) {
  .avatar { background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.35), transparent 45%), var(--c); }
  .felt { background: radial-gradient(ellipse 70% 60% at 50% 42%, var(--felt1) 0%, var(--felt1) 38%, var(--felt2) 100%) padding-box, var(--rim) border-box; }
  .tmini .fc, .skin-table, .mini-table { background: radial-gradient(circle at 50% 38%, var(--felt1), var(--felt2)); }
  .menu-card:hover { border-color: var(--line2); }
  .pchip { box-shadow: 0 5px 0 rgba(0,0,0,.45), 0 8px 14px rgba(0,0,0,.5); }
}

/* ===== v8: griglia lingue ===== */
.seg.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; }
.seg.lang-grid button { white-space: nowrap; }
