/* ============================================================
   Sozdatel Mini App — «casino noir»
   Mobile-first, dark. The rules that matter:
     - the page scrolls normally (no scroll-jacking, no fixed body)
     - the tab bar is fixed; content reserves room for it + the home bar
     - every tap target is >= 44px
     - icons are stroked SVG on a shared 24px grid (never emoji: those
       render differently per platform and break the visual language)
   Light model: near-black base, warm gold key light from the top,
   each game owns one hue (wheel = gold, classic = amber, poker = felt
   green) so screens are recognisable before a single word is read.
   ============================================================ */

:root{
  /* surfaces, dark to light — warm blacks, the family yellow light sits on */
  --bg:#0a0806;
  --bg-2:#0f0c07;
  --surface:#151109;
  --surface-2:#191409;
  --surface-3:#221a0c;

  /* hairlines: yellow-tinted, so even the borders carry the brand */
  --line:rgba(255,214,130,.07);
  --line-2:rgba(255,214,130,.13);

  /* text */
  --txt:#f5f2ea;
  --txt-2:#a8a08c;
  --txt-3:#6e6753;

  /* brand — yellow is THE accent, amber only shades it */
  --gold:#ffd23e;
  --gold-2:#ffb800;
  --gold-grad:linear-gradient(135deg,#ffe985,#ffd23e 45%,#ffb800);
  --gold-line:rgba(255,210,62,.4);

  /* functional hues (data viz / danger only — never chrome) */
  --green:#3fe39b;
  --green-2:#1fa872;
  --blue:#57a5ff;
  --pink:#ff4d7d;

  --r-lg:22px;
  --r-md:14px;
  --r-sm:10px;

  --tab-h:64px;
  --safe-b:env(safe-area-inset-bottom,0px);
  --safe-t:env(safe-area-inset-top,0px);
  --pad:16px;

  --shadow-1:0 2px 10px rgba(0,0,0,.4);
  --shadow-2:0 14px 40px rgba(0,0,0,.55);
  --glow-gold:0 10px 32px rgba(255,204,50,.3);
  --ease:cubic-bezier(.4,0,.2,1);
  --spring:cubic-bezier(.24,1.12,.32,1);
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}

html{
  height:100%;
  background:var(--bg);
  /* stops iOS bouncing the document while inner content scrolls */
  overscroll-behavior-y:contain;
}

body{
  margin:0;
  min-height:100%;
  background:
    radial-gradient(900px 440px at 50% -200px,rgba(255,210,62,.1),transparent 70%),
    radial-gradient(720px 360px at 104% -4%,rgba(255,184,0,.07),transparent 64%),
    radial-gradient(760px 420px at -8% 108%,rgba(255,210,62,.035),transparent 62%),
    var(--bg);
  color:var(--txt);
  /* System UI stack: SF Pro on iOS, Roboto on Android, Segoe on desktop.
     Native faces beat a downloaded font here — they render at the weight the
     OS is hinted for, and cost zero bytes on a mobile connection. */
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text",
              "Segoe UI Variable Display","Segoe UI",Roboto,"Helvetica Neue",
              system-ui,sans-serif;
  font-size:15px;line-height:1.5;font-weight:400;
  font-variant-numeric:tabular-nums;   /* digits keep their column when values tick */
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  text-rendering:optimizeLegibility;
  /* scroll lives on the document — no fixed/overflow-hidden body, which is
     what previously made the app impossible to scroll inside Telegram */
  overflow-x:hidden;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}

/* Film grain: pure CSS texture so big flat surfaces stop reading like a UI
   kit screenshot. Sits above content, below chrome (z >= 30). */
body::before{
  content:"";position:fixed;inset:-40px;z-index:2;pointer-events:none;
  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='160' height='160' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  opacity:.035;
}

button{font:inherit;color:inherit;border:0;background:none;cursor:pointer;padding:0}
input{font:inherit;color:inherit}
b,strong{font-weight:700}

:focus-visible{outline:2px solid rgba(255,200,94,.55);outline-offset:2px}

/* shared icon defaults — one stroke weight across the whole app */
.ico{
  width:22px;height:22px;flex:none;display:block;
  fill:none;stroke:currentColor;stroke-width:1.75;
  stroke-linecap:round;stroke-linejoin:round;
}

/* ---------------- boot ---------------- */
.app-loading{
  position:fixed;inset:0;z-index:99;
  display:grid;place-content:center;justify-items:center;gap:18px;
  background:
    radial-gradient(420px 300px at 50% 30%,rgba(255,194,71,.08),transparent 70%),
    var(--bg);
}
.boot-logo{
  position:relative;width:104px;height:104px;border-radius:50%;overflow:hidden;
  box-shadow:0 0 0 1px var(--gold-line),0 0 0 6px rgba(255,194,71,.06),
             0 18px 50px rgba(255,143,61,.32);
  animation:bootPulse 2s var(--ease) infinite;
}
.boot-logo img{width:100%;height:100%;object-fit:cover;display:block}
.boot-logo::after{
  /* soft inner vignette so the photo blends into the dark background
     instead of sitting on it as a hard-edged circle */
  content:"";position:absolute;inset:0;border-radius:50%;
  box-shadow:inset 0 0 24px rgba(6,7,12,.6);
}
@keyframes bootPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.045)}}
.boot-name{
  font-size:15px;font-weight:750;letter-spacing:.28em;text-indent:.28em;
  background:var(--gold-grad);-webkit-background-clip:text;background-clip:text;
  color:transparent;
}
.boot-bar{width:132px;height:3px;border-radius:99px;background:var(--surface-2);overflow:hidden}
.boot-bar span{
  display:block;height:100%;width:38%;border-radius:99px;
  background:var(--gold-grad);
  animation:bootSlide 1.15s var(--ease) infinite;
}
@keyframes bootSlide{0%{transform:translateX(-110%)}100%{transform:translateX(320%)}}

/* shown in place of the boot screen when the app can't authenticate */
.fail-screen{max-width:300px;padding:8px 20px;text-align:center;line-height:1.5}
.fail-screen__ico{width:44px;height:44px;margin:0 auto 14px;color:var(--txt-3);display:block}
.fail-screen__title{font-size:16px;font-weight:700;letter-spacing:-.02em;margin-bottom:8px}
.fail-screen__text{font-size:13px;color:var(--txt-2)}
.fail-screen__meta{margin-top:18px;font-size:11px;color:var(--txt-3);opacity:.7}

/* ---------------- shell ---------------- */
main{
  position:relative;
  padding:calc(var(--safe-t) + 12px) var(--pad) calc(var(--tab-h) + var(--safe-b) + 30px);
  max-width:560px;margin:0 auto;
}
.screen{animation:screenIn .26s var(--ease)}
@keyframes screenIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* ---------------- top bar ---------------- */
.topbar{display:flex;align-items:center;gap:12px;margin-bottom:20px;min-height:44px}
.topbar--sub{
  justify-content:space-between;
  /* three real columns so the title stays optically centred even when the
     flanking controls differ in width */
  display:grid;grid-template-columns:40px 1fr auto;
}
.topbar__title{
  text-align:center;font-size:16px;font-weight:700;letter-spacing:-.015em;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}

.icon-btn{
  width:40px;height:40px;flex:none;border-radius:13px;
  display:grid;place-items:center;color:var(--txt-2);
  background:linear-gradient(180deg,var(--surface-2),var(--surface));
  border:1px solid var(--line);
  box-shadow:var(--shadow-1);
  transition:background .15s var(--ease),transform .1s var(--ease),color .15s var(--ease);
}
.icon-btn:active{background:var(--surface-3);color:var(--txt);transform:scale(.94)}

.profile-chip{display:flex;align-items:center;gap:11px;min-width:0;flex:1}
.avatar{
  width:42px;height:42px;flex:none;border-radius:50%;
  background:var(--gold-grad);
  background-size:cover;background-position:center;
  display:grid;place-items:center;font-weight:700;font-size:17px;color:#0a0a10;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.28),0 4px 14px rgba(0,0,0,.45);
}
.avatar--lg{
  width:92px;height:92px;font-size:34px;margin:0 auto 14px;
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.3),0 16px 40px rgba(255,194,71,.3);
}
.profile-chip__meta{display:flex;flex-direction:column;gap:1px;min-width:0}
.profile-chip__name{
  font-size:14.5px;font-weight:650;letter-spacing:-.015em;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:38vw;
}
.profile-chip__id{font-size:11.5px;color:var(--txt-3)}

.balance-pill{
  flex:none;padding:8px 14px;border-radius:14px;
  display:flex;flex-direction:column;align-items:flex-end;gap:1px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.04),transparent 55%),
    linear-gradient(180deg,var(--surface-2),var(--surface));
  border:1px solid var(--line-2);box-shadow:var(--shadow-1);
}
.balance-pill--sm{padding:9px 13px}
.balance-pill__label{
  font-size:9px;font-weight:650;letter-spacing:.1em;text-transform:uppercase;color:var(--txt-3);
}
.balance-pill b{
  font-size:15px;white-space:nowrap;letter-spacing:-.02em;
  background:var(--gold-grad);-webkit-background-clip:text;background-clip:text;
  color:transparent;
  filter:drop-shadow(0 2px 8px rgba(255,176,84,.25));
}
/* balance moved — a one-shot pulse so the change is felt, not hunted for */
.balance-pill b.is-flash{animation:balFlash .7s var(--ease)}
@keyframes balFlash{
  0%{transform:scale(1)}
  35%{transform:scale(1.12);filter:drop-shadow(0 0 14px rgba(255,200,94,.65))}
  100%{transform:scale(1)}
}

/* ---------------- section head ---------------- */
.section-head{display:flex;align-items:center;gap:12px;margin:24px 2px 13px}
.section-head span{
  display:flex;align-items:center;gap:8px;
  font-size:10.5px;font-weight:700;letter-spacing:.13em;text-transform:uppercase;
  color:var(--txt-3);white-space:nowrap;
}
.section-head span::before{
  content:"";width:12px;height:2px;border-radius:99px;background:var(--gold-line);
}
.section-head::after{content:"";flex:1;height:1px;background:var(--line)}

/* ---------------- game cards ---------------- */
.game-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}
.game-card{
  position:relative;overflow:hidden;display:block;text-align:left;
  padding:18px 15px 17px;border-radius:var(--r-lg);
  background:var(--surface-2);
  border:1px solid var(--line-2);box-shadow:var(--shadow-1);
  transition:transform .13s var(--ease),border-color .2s var(--ease);
}
.game-card:active{transform:scale(.965)}
/* top gloss shared by every card */
.game-card::before{
  content:"";position:absolute;inset:0 0 55%;pointer-events:none;
  background:linear-gradient(180deg,rgba(255,255,255,.045),transparent);
}
/* per-game key light — on ::after WITH content, unlike the old broken
   ::before which never rendered (poker's glow was silently missing) */
.game-card::after{content:"";position:absolute;inset:0;opacity:.17;pointer-events:none}
.game-card--wheel::after{background:radial-gradient(circle at 84% 2%,var(--gold),transparent 58%)}
.game-card--classic::after{background:radial-gradient(circle at 84% 2%,var(--gold-2),transparent 58%)}
.game-card--poker::after{background:radial-gradient(circle at 84% 0%,var(--gold),transparent 60%)}
.game-card__badge{
  position:absolute;top:11px;right:11px;z-index:1;
  display:inline-flex;align-items:center;gap:5px;
  font-size:9px;font-weight:800;letter-spacing:.06em;padding:4px 8px;border-radius:8px;
  background:rgba(255,194,71,.14);color:var(--gold);
  border:1px solid rgba(255,194,71,.22);
}
.game-card__badge--live{
  background:rgba(255,148,61,.13);color:#ffb877;border-color:rgba(255,148,61,.24);
}
/* "this room breathes" — a live pulse dot only on live badges */
.game-card__badge--live::before{
  content:"";width:5px;height:5px;border-radius:50%;background:#ffb877;
  box-shadow:0 0 8px rgba(255,184,119,.9);
  animation:livePulse 1.6s ease-in-out infinite;
}
@keyframes livePulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(.55);opacity:.5}}
.game-card__icon{
  display:grid;place-items:center;width:46px;height:46px;margin-bottom:13px;border-radius:14px;
  background:var(--surface-3);border:1px solid var(--line);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}
.game-card--wheel .game-card__icon{color:var(--gold);background:rgba(255,210,62,.1)}
.game-card--classic .game-card__icon{color:var(--gold-2);background:rgba(255,184,0,.1)}
.game-card--poker .game-card__icon{color:var(--gold);background:rgba(255,210,62,.09)}
.game-card__icon .ico{width:24px;height:24px}
.game-card__name{display:block;font-size:17.5px;font-weight:750;letter-spacing:-.025em;
  /* keep the text out of the arrow's corner — the card is a button, the whole
     bottom-right quadrant belongs to the chevron chip */
  max-width:calc(100% - 52px)}
.game-card__desc{display:block;font-size:11.5px;color:var(--txt-3);margin-top:3px;
  max-width:calc(100% - 52px)}
.game-card__arrow{
  position:absolute;right:14px;bottom:14px;
  display:grid;place-items:center;width:30px;height:30px;border-radius:50%;
  background:var(--surface-3);border:1px solid var(--line-2);color:var(--txt-3);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
  transition:transform .18s var(--ease),color .18s var(--ease),border-color .18s var(--ease);
}
.game-card__arrow .ico{width:14px;height:14px;stroke-width:2}
.game-card:active .game-card__arrow{transform:translateX(3px);color:var(--gold);border-color:var(--gold-line)}
.game-card--poker .game-card__arrow{color:rgba(255,210,62,.5)}

/* ---------------- stat boxes ---------------- */
.stat-row{display:grid;grid-template-columns:1fr 1fr;gap:13px}
.stat-box{
  position:relative;padding:15px 14px;overflow:hidden;
  background:var(--surface-2);
  border:1px solid var(--line);border-radius:var(--r-md);
  box-shadow:var(--shadow-1);
}
/* lit top edge — the one-hairline trick that makes flat cards read as
   machined metal instead of painted rectangles */
.stat-box::before{
  content:"";position:absolute;top:0;left:12%;right:12%;height:1px;
  background:linear-gradient(90deg,transparent,rgba(255,214,130,.4),transparent);
}
.stat-box__ico{position:absolute;top:13px;right:13px;color:var(--gold);opacity:.4}
.stat-box__ico .ico{width:19px;height:19px}
.stat-box__val{display:block;font-size:23px;font-weight:750;line-height:1.1;letter-spacing:-.025em}
.stat-box__key{display:block;font-size:11px;color:var(--txt-3);margin-top:2px}

/* ---------------- wheel: arc ---------------- */
/* Cells sit on a circle of radius ARC_R (set from JS via --arc-r) and are
   rotated into place, so the row reads as the rim of a big wheel. Rotating
   the whole track spins it; the pointer is fixed at bottom centre. */
.wheel-stage{position:relative;margin-bottom:6px}

.arc{
  position:relative;height:196px;overflow:hidden;
  border-radius:22px;
  background:
    radial-gradient(150% 130% at 50% 128%,rgba(255,194,71,.17) 0%,transparent 52%),
    radial-gradient(120% 150% at 50% 118%,#1e1910 0%,var(--bg-2) 62%);
  box-shadow:
    inset 0 -24px 48px rgba(0,0,0,.62),
    inset 0 1px 0 rgba(255,214,130,.16),
    var(--shadow-2),
    0 0 0 1px rgba(255,194,71,.1);
  /* fade the rim into the frame instead of slicing cells off with a hard
     edge — that hard cut is what made stray corners poke out at the sides */
  -webkit-mask-image:linear-gradient(90deg,transparent,#000 13%,#000 87%,transparent);
  mask-image:linear-gradient(90deg,transparent,#000 13%,#000 87%,transparent);
}
.arc__track{
  /* rim sits mid-frame: 100% + R - 98px puts the visible arc centre at y=98,
     leaving the shadowed wheel body below and room for the needle above */
  position:absolute;left:50%;top:calc(100% + var(--arc-r,300px) - 98px);
  width:0;height:0;
  transform:rotate(0deg);will-change:transform;
}
.arc__cell{
  position:absolute;left:0;top:0;
  width:58px;height:58px;margin:-29px 0 0 -29px;
  display:grid;place-items:center;border-radius:17px;
  font-size:16px;font-weight:800;letter-spacing:-.03em;color:#06070c;
  /* gem cut: colour comes as inline background- COLOR (not shorthand, which
     would wipe this bevel), gloss + dark base give the 3D read */
  background-image:
    radial-gradient(130% 90% at 32% 10%, rgba(255,255,255,.55), transparent 46%),
    linear-gradient(180deg, rgba(255,255,255,.28), transparent 38%, rgba(0,0,0,.22) 88%);
  box-shadow:0 6px 16px rgba(0,0,0,.6),
             inset 0 2px 2px rgba(255,255,255,.5),
             inset 0 -4px 8px rgba(0,0,0,.28);
  transform-origin:center;
  text-shadow:0 1px 1px rgba(0,0,0,.18);
}
.arc__cell.is-hit{animation:cellHit .5s var(--ease)}
.arc__cell.is-hit::after{
  content:"";position:absolute;inset:0;border-radius:15px;
  box-shadow:inset 0 0 0 3px rgba(255,255,255,.92),0 0 26px rgba(255,255,255,.55);
}
@keyframes cellHit{0%{filter:brightness(2.2)}45%{filter:brightness(1.35)}100%{filter:brightness(1)}}

/* The needle presses down on the rim from above: a short gold pin whose tip
   lands exactly on the winning cell, so nothing overlaps the cell's label. */
.arc__pointer{
  position:absolute;left:50%;top:0;width:2px;margin-left:-1px;z-index:4;
  height:66px;
  background:linear-gradient(180deg,rgba(255,200,94,.95),rgba(255,200,94,.35));
  pointer-events:none;
}
.arc__pointer i{
  position:absolute;left:50%;bottom:-8px;margin-left:-9px;
  width:0;height:0;border:9px solid transparent;border-top-color:var(--gold);
  filter:drop-shadow(0 4px 10px rgba(255,194,71,.85));
}
.arc__pointer::after{
  content:"";position:absolute;left:50%;bottom:-52px;width:84px;height:84px;
  margin-left:-42px;border-radius:50%;
  background:radial-gradient(circle,rgba(255,194,71,.2),transparent 68%);
}

/* Curved glass over the rim: a highlight along the top plus a vignette at the
   corners, which is what makes the flat cells read as a physical wheel. */
.arc__glass{
  position:absolute;inset:0;z-index:2;pointer-events:none;border-radius:22px;
  background:
    linear-gradient(180deg,rgba(255,255,255,.08),transparent 34%),
    radial-gradient(120% 80% at 50% 118%,transparent 52%,rgba(6,7,12,.78) 100%);
}
/* sparkles at the rim's ends — the twinkle that sells "jackpot machine".
   They live on the glass (not the arc) so the side mask never clips them. */
.arc__glass::before,.arc__glass::after{
  content:"";position:absolute;top:46px;width:18px;height:18px;
  background:var(--gold);
  clip-path:polygon(50% 0,62% 38%,100% 50%,62% 62%,50% 100%,38% 62%,0 50%,38% 38%);
  filter:drop-shadow(0 0 8px rgba(255,210,62,.85));
  animation:starTwinkle 2.6s ease-in-out infinite;
}
.arc__glass::before{left:15%;transform:rotate(-14deg) scale(.82);animation-delay:.9s}
.arc__glass::after{right:15%;transform:rotate(12deg)}
@keyframes starTwinkle{0%,100%{opacity:.95}50%{opacity:.4}}

/* Recent results as a scrolling tape of chips. Ticks were unreadable — you
   could see that something happened, never what. */
.tape{
  display:flex;gap:6px;overflow-x:auto;padding:2px var(--pad) 2px;
  margin:0 calc(var(--pad) * -1);
  scrollbar-width:none;-webkit-overflow-scrolling:touch;
}
.tape::-webkit-scrollbar{display:none}
.tape__chip{
  flex:none;min-width:42px;padding:5px 10px;border-radius:99px;
  font-size:11.5px;font-weight:800;letter-spacing:-.02em;text-align:center;
  color:#06070c;
  background-image:linear-gradient(180deg,rgba(255,255,255,.3),transparent 45%);
  box-shadow:0 2px 8px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.35);
  animation:tapeIn .28s var(--ease);
}
.tape__chip--rare{
  box-shadow:0 0 0 1.5px rgba(255,255,255,.6),0 3px 14px rgba(0,0,0,.55),
             inset 0 1px 0 rgba(255,255,255,.35);
}
@keyframes tapeIn{from{opacity:0;transform:translateX(-10px) scale(.85)}to{opacity:1;transform:none}}

.wheel-result{
  display:flex;justify-content:center;min-height:0;margin-top:10px;
  opacity:0;transform:translateY(6px) scale(.96);
  transition:opacity .25s var(--ease),transform .25s var(--ease);
}
.wheel-result.is-show{opacity:1;transform:none}
.wheel-result span{
  padding:7px 15px;border-radius:99px;
  font-size:13.5px;font-weight:800;letter-spacing:-.015em;
  background:var(--surface-2);border:1px solid var(--line-2);color:var(--txt-2);
}
.wheel-result.is-win span{
  color:#06070c;border-color:transparent;
  background:var(--gold-grad);
  box-shadow:var(--glow-gold);
  animation:resPop .45s var(--spring);
}
.wheel-result.is-lose span{color:var(--txt-3)}
@keyframes resPop{0%{transform:scale(.8)}60%{transform:scale(1.06)}100%{transform:scale(1)}}

/* sector buttons: solid colour fills like a real betting board, with the
   players who backed each one listed underneath */
.sector-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;align-items:start}
.sector{display:flex;flex-direction:column;gap:7px;min-width:0}

.sector__btn{
  position:relative;width:100%;padding:14px 4px 12px;border-radius:16px;
  text-align:center;color:#06070c;overflow:hidden;
  border:2px solid transparent;
  /* gem cut, same as the wheel cells: inline background- COLOR survives this */
  background-image:
    radial-gradient(120% 90% at 32% 10%, rgba(255,255,255,.5), transparent 46%),
    linear-gradient(180deg, rgba(255,255,255,.25), transparent 40%, rgba(0,0,0,.2) 85%);
  box-shadow:0 5px 16px rgba(0,0,0,.5),
             inset 0 2px 2px rgba(255,255,255,.45),
             inset 0 -3px 6px rgba(0,0,0,.25);
  transition:transform .1s var(--ease),box-shadow .18s var(--ease),
             filter .18s var(--ease);
  filter:saturate(.94) brightness(.94);
}
.sector__btn::after{
  /* subtle top gloss so the flat fill reads as a physical chip */
  content:"";position:absolute;inset:0 0 55% 0;
  background:linear-gradient(180deg,rgba(255,255,255,.2),transparent);
  pointer-events:none;
}
.sector__btn:active{transform:scale(.95)}
.sector__btn.is-on{
  /* the picked sector comes forward with a yellow halo — findable at a
     glance without hunting for a white border */
  border-color:#fff;filter:none;transform:translateY(-2px);
  box-shadow:0 0 0 3px rgba(255,210,62,.4),0 10px 24px rgba(0,0,0,.55),
             inset 0 2px 2px rgba(255,255,255,.55);
}
.sector__m{
  display:block;font-size:19px;font-weight:800;letter-spacing:-.03em;
  text-shadow:0 1px 2px rgba(0,0,0,.22);
}
.sector__c{display:block;margin-top:2px;font-size:10px;font-weight:700;opacity:.62}

.sector__stakes{display:flex;flex-direction:column;gap:5px;min-height:4px}
.stake-row{
  display:flex;align-items:center;gap:5px;padding:3px 6px 3px 3px;
  background:var(--surface);border:1px solid var(--line);border-radius:99px;
  animation:stakeIn .22s var(--ease);
}
@keyframes stakeIn{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.stake-row.is-you{border-color:var(--gold-line);background:rgba(255,194,71,.07)}
.stake-row i{
  width:18px;height:18px;flex:none;border-radius:50%;
  display:grid;place-items:center;
  font-size:9px;font-weight:800;font-style:normal;color:#06070c;
  background-size:cover;background-position:center;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.25);
}
.stake-row b{
  font-size:10.5px;font-weight:700;color:var(--txt-2);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.stake-row.is-you b{color:var(--gold)}
.stake-more{
  text-align:center;font-size:10px;font-weight:700;color:var(--txt-3);
  padding:2px 0;
}

/* Countdown as a labelled capsule with a live bar underneath: the number
   alone floated in the layout with nothing to anchor it. */
.wheel-timer{
  margin-top:14px;padding:11px 14px 12px;
  background:var(--surface-2);
  border:1px solid var(--line);border-radius:var(--r-md);
}
.wheel-timer__row{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.wheel-timer__sub{
  font-size:10.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;
  color:var(--txt-3);
}
.wheel-timer__val{
  font-size:27px;font-weight:800;letter-spacing:-.04em;line-height:1;
  color:var(--txt);font-variant-numeric:tabular-nums;
}
/* decorative track + JS-driven fill: startWheelTimer sets scaleX(left/total)
   every 100ms, so the bar drains in step with the number above it */
.wheel-timer__bar{
  margin-top:9px;height:4px;border-radius:99px;background:var(--surface-3);overflow:hidden;
}
.wheel-timer__bar i{
  display:block;height:100%;width:100%;border-radius:99px;
  transform-origin:left;
  background:linear-gradient(90deg,var(--gold),var(--gold-2));
  transition:transform .1s linear,background .3s var(--ease);
}
.wheel-timer.is-hot .wheel-timer__val{color:var(--gold)}
.wheel-timer.is-hot .wheel-timer__bar i{
  background:linear-gradient(90deg,var(--pink),#ff2d62);
}
/* the round is resolving server-side — the number breathes while we wait */
.wheel-timer.is-spin .wheel-timer__val{color:var(--gold);animation:timerPulse .8s ease-in-out infinite}
@keyframes timerPulse{0%,100%{opacity:1}50%{opacity:.45}}

.wheel-round-meta{
  display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px;
}
.wheel-round-meta > div{
  padding:11px 12px;text-align:center;
  background:var(--surface-2);
  border:1px solid var(--line);border-radius:var(--r-md);
}
.wheel-round-meta b{
  display:block;font-size:18px;font-weight:800;color:var(--txt);letter-spacing:-.025em;
}
.wheel-round-meta span{
  display:block;margin-top:2px;font-size:9.5px;letter-spacing:.13em;
  text-transform:uppercase;color:var(--txt-3);
}

/* ---------------- bet panel ---------------- */
.bet-panel{
  padding:15px;
  background:var(--surface-2);
  border:1px solid var(--line-2);border-radius:var(--r-lg);box-shadow:var(--shadow-1);
}
.bet-input-wrap{position:relative;margin-bottom:11px}
/* stepper: the reference app's − [ amount ] + — thumb-friendly, the amount
   is the biggest number on screen after the pot */
.bet-step{display:grid;grid-template-columns:48px 1fr 48px;gap:9px;align-items:start;margin-bottom:11px}
.bet-step__btn{
  height:56px;border-radius:var(--r-md);
  display:grid;place-items:center;color:var(--gold);
  background:var(--surface-3);border:1px solid var(--line-2);
  transition:transform .1s var(--ease),border-color .15s var(--ease);
}
.bet-step__btn:active{transform:scale(.92);border-color:var(--gold-line)}
.bet-step__mid{min-width:0}
.bet-step .bet-input{text-align:center;padding:15px 8px;font-size:25px}
.bet-cur{
  display:block;text-align:center;margin-top:3px;
  font-size:10px;font-weight:650;letter-spacing:.14em;text-transform:uppercase;
  color:var(--txt-3);
}
.bet-input{
  width:100%;padding:15px 72px 15px 15px;
  background:var(--bg-2);border:1.5px solid var(--line);border-radius:var(--r-md);
  font-size:21px;font-weight:750;letter-spacing:-.025em;outline:none;
  transition:border-color .18s var(--ease),box-shadow .18s var(--ease);
}
.bet-input:focus{
  border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(255,194,71,.12);
}
.bet-input__cur{
  position:absolute;right:15px;top:50%;transform:translateY(-50%);
  font-size:12px;font-weight:600;color:var(--txt-3);pointer-events:none;
}
.chip-row{display:flex;gap:7px}
.chip{
  flex:1;min-height:40px;padding:10px 0;border-radius:99px;
  background:var(--bg-2);border:1px solid var(--line);
  font-size:13px;font-weight:650;color:var(--txt-2);
  transition:background .14s var(--ease),color .14s var(--ease),transform .1s var(--ease);
}
.chip:active{background:var(--surface-3);color:var(--gold);transform:scale(.96)}
.chip--max{color:var(--gold);border-color:rgba(255,210,62,.3)}

/* ---------------- CTA ---------------- */
.cta{
  width:100%;margin-top:18px;min-height:54px;padding:17px;
  display:flex;align-items:center;justify-content:center;gap:9px;
  border-radius:var(--r-lg);font-size:16px;font-weight:750;letter-spacing:-.015em;
  color:#06070c;background:var(--gold-grad);
  box-shadow:var(--glow-gold),inset 0 1.5px 0 rgba(255,255,255,.5);
  transition:transform .11s var(--ease),opacity .2s var(--ease),box-shadow .2s var(--ease);
}
.cta:active{transform:scale(.98) translateY(1px);box-shadow:0 4px 14px rgba(255,194,71,.2)}
.cta:disabled{opacity:.45;box-shadow:none;transform:none}
/* waiting on the server: sheen sweeps across so the tap clearly registered */
.cta.is-busy{position:relative;overflow:hidden;opacity:.75}
.cta.is-busy::after{
  content:"";position:absolute;inset:0;
  background:linear-gradient(100deg,transparent 25%,rgba(255,255,255,.45),transparent 75%);
  animation:ctaSheen 1s linear infinite;
}
@keyframes ctaSheen{from{transform:translateX(-100%)}to{transform:translateX(100%)}}
.cta--green{
  /* the class name says green, history says yellow — one primary money colour */
  background:var(--gold-grad);
  box-shadow:var(--glow-gold),inset 0 1.5px 0 rgba(255,255,255,.4);
}
.cta--green:active{box-shadow:0 4px 14px rgba(255,204,50,.2)}
.cta--ghost{
  margin-top:13px;color:var(--txt);
  background:var(--surface-3);border:1px solid var(--line-2);box-shadow:none;
}
.cta--ghost:active{box-shadow:none}
.cta--ghost .ico{width:19px;height:19px}

/* ---------------- classic: avatar roulette ---------------- */
.pot-stage{
  position:relative;padding:16px 14px 15px;overflow:hidden;
  border:1px solid transparent;
  background:
    linear-gradient(165deg,var(--surface-2),var(--surface) 72%) padding-box,
    linear-gradient(150deg,rgba(255,194,71,.34),rgba(255,255,255,.05) 45%,rgba(255,148,61,.16)) border-box;
  border-radius:var(--r-lg);box-shadow:var(--shadow-2);
}
/* pot glow keyed to the top number — the bank is the hero of this screen */
.pot-stage::before{
  content:"";position:absolute;top:-90px;left:50%;transform:translateX(-50%);
  width:300px;height:190px;border-radius:50%;
  background:radial-gradient(closest-side,rgba(255,194,71,.13),transparent);
  pointer-events:none;
}

.roul{position:relative;margin-bottom:14px}
.roul__viewport{
  position:relative;height:88px;border-radius:var(--r-md);overflow:hidden;
  background:var(--bg-2);border:1px solid var(--line);
  box-shadow:inset 0 3px 18px rgba(0,0,0,.55);
}
.roul__viewport::before,.roul__viewport::after{
  content:"";position:absolute;top:0;bottom:0;width:52px;z-index:2;pointer-events:none;
}
.roul__viewport::before{left:0;background:linear-gradient(90deg,var(--bg-2) 8%,transparent)}
.roul__viewport::after{right:0;background:linear-gradient(270deg,var(--bg-2) 8%,transparent)}
.roul__strip{
  position:absolute;top:0;left:0;height:100%;display:flex;align-items:center;
  will-change:transform;
}
/* one tile per player-slice; width is proportional to their share of the pot */
.roul__seat{
  position:relative;height:100%;flex:none;
  display:flex;align-items:center;justify-content:center;
  border-right:1px solid rgba(0,0,0,.45);
}
.roul__seat i{
  width:44px;height:44px;border-radius:50%;display:grid;place-items:center;
  font-size:16px;font-weight:800;font-style:normal;color:#06070c;
  background-size:cover;background-position:center;
  box-shadow:0 3px 10px rgba(0,0,0,.5),inset 0 0 0 1px rgba(255,255,255,.2);
}
.roul__seat.is-you i{box-shadow:0 0 0 2.5px var(--gold),0 3px 12px rgba(0,0,0,.55)}
.roul__seat.is-narrow i{width:26px;height:26px;font-size:12px}
/* stake too small to fit an avatar — shown as a plain coloured sliver so its
   width still equals its true win chance */
.roul__seat.is-sliver{min-width:2px}
.roul__seat.is-win i{box-shadow:0 0 0 3px #fff,0 0 22px rgba(255,194,71,.9)}
.roul__seat.is-win{animation:cellHit .5s var(--ease)}
.roul__pointer{
  position:absolute;left:50%;top:-6px;bottom:-6px;width:2px;margin-left:-1px;z-index:3;
  background:linear-gradient(180deg,var(--gold),rgba(255,194,71,.15));
  box-shadow:0 0 14px rgba(255,194,71,.8);
}
.roul__pointer::before{
  content:"";position:absolute;top:0;left:-7px;
  border:7px solid transparent;border-top-color:var(--gold);
  filter:drop-shadow(0 3px 8px rgba(255,194,71,.7));
}
.roul__empty{
  position:absolute;inset:0;display:grid;place-items:center;
  font-size:13px;color:var(--txt-3);
}

.pot-head{text-align:center;margin-bottom:14px;position:relative}
.pot-head__label{
  display:block;font-size:9.5px;font-weight:700;
  letter-spacing:.17em;text-transform:uppercase;color:var(--txt-3);
}
.pot-head__val{
  display:block;margin:2px 0 1px;font-size:31px;font-weight:800;
  line-height:1.05;letter-spacing:-.035em;
  background:var(--gold-grad);-webkit-background-clip:text;background-clip:text;
  color:transparent;
  filter:drop-shadow(0 6px 18px rgba(255,176,84,.28));
}
.pot-head__timer{display:block;font-size:12px;font-weight:550;color:var(--txt-2)}

.pot-meta{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;text-align:center}
.pot-meta div{
  padding:11px 4px;background:var(--bg-2);border:1px solid var(--line);border-radius:var(--r-md);
}
.pot-meta b{display:block;font-size:16.5px;font-weight:750;letter-spacing:-.025em}
.pot-meta span{font-size:10.5px;color:var(--txt-3)}

.players-list{display:flex;flex-direction:column;gap:8px}
.player-row{
  display:flex;align-items:center;gap:11px;padding:11px 13px;
  background:var(--surface-2);
  border:1px solid var(--line);border-radius:var(--r-md);
  animation:rowIn .22s var(--ease);
}
@keyframes rowIn{from{opacity:0;transform:translateX(-6px)}to{opacity:1;transform:none}}
.player-row.is-you{border-color:var(--gold-line);background:rgba(255,194,71,.06)}
.player-row__av{
  width:34px;height:34px;flex:none;border-radius:50%;
  display:grid;place-items:center;
  font-size:13px;font-weight:800;font-style:normal;color:#06070c;
  background-size:cover;background-position:center;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.22),0 2px 8px rgba(0,0,0,.4);
}
.player-row.is-you .player-row__av{box-shadow:0 0 0 2px var(--gold),inset 0 0 0 1px rgba(255,255,255,.22)}
.player-row__name{
  flex:1;font-size:13.5px;font-weight:600;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.player-row__stake{
  font-size:13px;font-weight:700;letter-spacing:-.02em;color:var(--txt-2);
}
.player-row.is-you .player-row__stake{color:var(--gold)}
.player-row__chance{
  min-width:52px;text-align:center;font-size:11.5px;font-weight:700;color:var(--txt-2);
  padding:3px 7px;border-radius:8px;
  background:var(--bg-2);border:1px solid var(--line);
}
.player-row.is-you .player-row__chance{color:var(--gold);border-color:rgba(255,194,71,.3)}
.empty-note{
  display:flex;flex-direction:column;align-items:center;gap:9px;
  padding:24px 12px;text-align:center;font-size:13px;color:var(--txt-3);
  background:var(--surface);border:1px dashed var(--line-2);border-radius:var(--r-md);
}
.empty-note .ico{width:26px;height:26px;opacity:.45}

.history-list{display:flex;flex-direction:column;gap:7px}
.history-row{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:11px 14px;font-size:13px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-md);
}
.history-row__who{color:var(--txt-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.history-row__amt{
  font-weight:700;color:var(--gold);white-space:nowrap;letter-spacing:-.02em;
  text-shadow:0 0 16px rgba(255,210,62,.35);
}

/* ---------------- profile ---------------- */
.profile-hero{
  position:relative;text-align:center;padding:14px 0 20px;
}
/* halo behind the avatar so the profile reads as a place, not a form */
.profile-hero::before{
  content:"";position:absolute;top:-30px;left:50%;transform:translateX(-50%);
  width:320px;height:220px;border-radius:50%;
  background:radial-gradient(closest-side,rgba(255,194,71,.12),transparent);
  pointer-events:none;
}
.profile-hero__name{font-size:20px;font-weight:750;letter-spacing:-.025em}
.profile-hero__tag{font-size:13px;color:var(--txt-3);margin-top:3px}
.profile-hero__balance{
  position:relative;margin:18px auto 0;max-width:240px;padding:16px;
  display:flex;flex-direction:column;gap:4px;overflow:hidden;
  border:1px solid transparent;
  background:
    linear-gradient(160deg,#221a0c,#15161e 70%) padding-box,
    linear-gradient(150deg,rgba(255,206,102,.5),rgba(255,148,61,.14) 45%,rgba(255,255,255,.06)) border-box;
  border-radius:var(--r-lg);box-shadow:var(--shadow-2);
}
.profile-hero__balance span{
  font-size:10px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--txt-3);
}
.profile-hero__balance b{
  font-size:27px;font-weight:800;letter-spacing:-.035em;
  background:var(--gold-grad);-webkit-background-clip:text;background-clip:text;
  color:transparent;
  filter:drop-shadow(0 4px 14px rgba(255,176,84,.3));
}

.lock-card{
  display:flex;gap:13px;align-items:center;margin-top:15px;padding:15px;
  background:
    linear-gradient(170deg,rgba(255,77,125,.1),rgba(255,77,125,.04)),
    var(--surface);
  border:1px solid rgba(255,77,125,.28);border-radius:var(--r-lg);
}
.lock-card__icon{flex:none;color:var(--pink);display:grid;place-items:center}
.lock-card__icon .ico{width:24px;height:24px}
.lock-card__title{font-size:14px;font-weight:700}
.lock-card__text{font-size:12.5px;line-height:1.4;color:var(--txt-2);margin-top:3px}

.ref-card{
  padding:17px;
  background:var(--surface-2);
  border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--shadow-1);
}
.ref-card__rows{display:flex;flex-direction:column}
.ref-card__rows div{
  display:flex;justify-content:space-between;align-items:center;gap:12px;
  padding:9px 0;font-size:13.5px;
}
.ref-card__rows div + div{border-top:1px solid var(--line)}
.ref-card__rows span{color:var(--txt-2)}
.ref-card__rows b{font-weight:700;letter-spacing:-.015em}

/* ---------------- tab bar ---------------- */
.tabbar{
  position:fixed;left:0;right:0;bottom:0;z-index:30;
  height:calc(var(--tab-h) + var(--safe-b));padding-bottom:var(--safe-b);
  /* auto-fit keeps every tab equal width whatever the count — adding a game
     must never wrap the bar onto a second row again */
  display:grid;grid-auto-flow:column;grid-auto-columns:1fr;
  background:rgba(8,10,16,.86);
  backdrop-filter:blur(26px) saturate(1.55);
  -webkit-backdrop-filter:blur(26px) saturate(1.55);
  border-top:1px solid var(--line-2);
  box-shadow:0 -12px 34px rgba(0,0,0,.5);
}
.tab{
  position:relative;display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:3px;min-width:0;padding:0 2px;
  color:var(--txt-3);transition:color .18s var(--ease);
}
/* active tab: a lit pill behind the icon rather than a bare colour change */
.tab::before{
  content:"";position:absolute;top:8px;left:50%;width:42px;height:30px;
  margin-left:-21px;border-radius:11px;
  background:rgba(255,210,62,.15);
  border:1px solid rgba(255,210,62,.3);
  box-shadow:0 0 20px rgba(255,210,62,.2),inset 0 1px 0 rgba(255,255,255,.07);
  opacity:0;transform:scale(.8);
  transition:opacity .18s var(--ease),transform .18s var(--ease);
}
.tab.is-active{color:var(--gold)}
.tab.is-active::before{opacity:1;transform:none}
.tab__ico{width:21px;height:21px;transition:transform .18s var(--ease)}
.tab.is-active .tab__ico{transform:translateY(-1px)}
.tab__txt{
  font-size:9.5px;font-weight:700;letter-spacing:.01em;line-height:1;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;
}
.tab:active .tab__ico{transform:scale(.9)}

/* ---------------- toast ---------------- */
.toast{
  position:fixed;left:var(--pad);right:var(--pad);z-index:50;
  bottom:calc(var(--tab-h) + var(--safe-b) + 14px);
  display:flex;align-items:center;gap:10px;
  padding:14px 16px;border-radius:var(--r-md);
  font-size:13.5px;font-weight:600;line-height:1.4;
  background:var(--surface-3);border:1px solid var(--line-2);box-shadow:var(--shadow-2);
  opacity:0;transform:translateY(16px);pointer-events:none;
  transition:opacity .26s var(--ease),transform .26s var(--ease);
}
/* accent tick: the kind is legible from the corner of the eye, no icon needed */
.toast::before{
  content:"";flex:none;width:3px;align-self:stretch;border-radius:99px;
  background:var(--txt-3);
}
.toast.is-show{opacity:1;transform:none}
.toast.is-err{border-color:rgba(255,77,125,.5);color:#ffa8bf}
.toast.is-err::before{background:var(--pink)}
.toast.is-ok{border-color:rgba(255,210,62,.45);color:#ffe38f}
.toast.is-ok::before{background:var(--gold)}

/* ---------------- wallet buttons + sheet ---------------- */
.wallet-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:14px auto 0;max-width:300px}
.wallet-btn{
  min-height:48px;display:flex;align-items:center;justify-content:center;gap:8px;
  border-radius:var(--r-md);font-size:14px;font-weight:700;letter-spacing:-.015em;
  background:linear-gradient(180deg,var(--surface-3),var(--surface-2));
  border:1px solid var(--line-2);color:var(--txt);
  transition:transform .11s var(--ease),background .15s var(--ease);
}
.wallet-btn .ico{width:18px;height:18px}
.wallet-btn:active{transform:scale(.97);background:var(--surface-2)}
.wallet-btn--in{
  color:#06070c;border-color:transparent;
  background:var(--gold-grad);
  box-shadow:var(--glow-gold),inset 0 1.5px 0 rgba(255,255,255,.5);
}

.sheet{position:fixed;inset:0;z-index:70;display:flex;align-items:flex-end;justify-content:center}
.sheet[hidden]{display:none}
.sheet__backdrop{
  position:absolute;inset:0;
  background:rgba(3,4,8,.66);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  animation:fadeIn .2s var(--ease);
}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.sheet__panel{
  position:relative;width:100%;max-width:560px;
  padding:10px var(--pad) calc(18px + var(--safe-b));
  background:linear-gradient(175deg,var(--surface-2),var(--surface) 30%);
  border:1px solid var(--line-2);border-bottom:0;
  border-radius:24px 24px 0 0;
  box-shadow:0 -14px 44px rgba(0,0,0,.6),inset 0 1px 0 rgba(255,255,255,.06);
  animation:sheetUp .32s var(--spring);
}
@keyframes sheetUp{from{transform:translateY(100%)}to{transform:none}}
/* grabber: the affordance that says "swipe me down", standard sheet grammar */
.sheet__grab{
  display:block;width:38px;height:4px;border-radius:99px;
  margin:0 auto 12px;
  background:rgba(255,255,255,.16);
}
.sheet__head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.sheet__title{font-size:17px;font-weight:750;letter-spacing:-.02em}
.sheet__x{
  width:34px;height:34px;flex:none;border-radius:11px;display:grid;place-items:center;
  color:var(--txt-3);background:var(--surface-3);
}
.sheet__x .ico{width:17px;height:17px}
.sheet__sub{margin-top:4px;font-size:12.5px;color:var(--txt-3)}
.sheet__body{margin-top:16px}
.sheet__row{
  display:flex;align-items:center;gap:12px;width:100%;padding:14px;margin-bottom:9px;
  background:var(--bg-2);border:1px solid var(--line);border-radius:var(--r-md);
  text-align:left;transition:background .15s var(--ease),transform .1s var(--ease);
}
.sheet__row:active{background:var(--surface-3);transform:scale(.99)}
.sheet__row b{display:block;font-size:14.5px;font-weight:700}
.sheet__row span{display:block;font-size:11.5px;color:var(--txt-3);margin-top:1px}
.sheet__amounts{display:grid;grid-template-columns:repeat(5,1fr);gap:7px;margin-top:10px}
.sheet__amounts button{
  padding:11px 0;border-radius:var(--r-sm);font-size:13px;font-weight:700;
  background:var(--bg-2);border:1px solid var(--line);color:var(--txt-2);
}
.sheet__amounts button:active{background:var(--surface-3);color:var(--txt)}
.sheet__note{margin-top:12px;font-size:12px;line-height:1.45;color:var(--txt-3);text-align:center}

/* ---------------- confetti ---------------- */
.confetti{
  position:fixed;left:50%;top:38%;z-index:60;
  width:0;height:0;pointer-events:none;
}
.confetti i{
  position:absolute;left:0;top:0;width:8px;height:12px;border-radius:2px;
  will-change:transform,opacity;
}

/* keep it phone-shaped on wide screens instead of stretching */
@media (min-width:600px){
  /* floating dock: the same bar, but it stops pretending to be a phone */
  .tabbar{
    max-width:548px;left:50%;transform:translateX(-50%);
    bottom:calc(12px + var(--safe-b));height:var(--tab-h);
    border:1px solid var(--line-2);border-radius:18px;
    box-shadow:0 18px 44px rgba(0,0,0,.55);
  }
  /* sheets become centred dialogs on wide screens */
  .sheet__panel{
    max-width:540px;margin:0 16px calc(16px + var(--safe-b));
    border-radius:24px;border-bottom:1px solid var(--line-2);
  }
}

@media (prefers-reduced-motion:reduce){
  *{animation-duration:.01ms !important;transition-duration:.01ms !important}
}

/* ================= poker ================= */

.game-card--wide{grid-column:1 / -1}

/* The felt is an oval with seats pinned around it. Seat positions come from
   --sx/--sy set per seat in JS, so adding a seat never reflows the others. */
.felt{
  position:relative;margin:14px var(--pad) 0;height:330px;
  border-radius:150px/120px;
  background:
    radial-gradient(120% 90% at 50% 15%,rgba(255,210,62,.06),transparent 62%),
    repeating-linear-gradient(45deg,rgba(255,255,255,.01) 0 2px,transparent 2px 7px),
    radial-gradient(130% 110% at 50% 0%,#1a150c,#0b0906 72%);
  /* rail: dark bronze ring around midnight cloth, gold hairline on top */
  border:2px solid #3a2f12;
  box-shadow:
    inset 0 0 70px rgba(0,0,0,.7),
    0 0 0 1px rgba(255,210,62,.18),
    0 18px 44px rgba(0,0,0,.55);
}
/* watermark: the room's maker's mark, felt-embossed not printed */
.felt::after{
  content:"SOZDATEL";position:absolute;left:50%;top:24%;transform:translateX(-50%);
  font-size:15px;font-weight:800;letter-spacing:.34em;text-indent:.34em;
  color:rgba(255,255,255,.05);pointer-events:none;
}
.felt__ring{
  position:absolute;inset:14px;border-radius:140px/110px;
  border:1px solid rgba(255,255,255,.05);
  box-shadow:inset 0 0 26px rgba(0,0,0,.3);
  pointer-events:none;
}
.felt__seats{position:absolute;inset:0}

.felt__centre{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  display:flex;flex-direction:column;align-items:center;gap:9px;width:100%;
}
.felt__street{
  font-size:10.5px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;
  color:var(--txt-3);
}
/* pot as a chip stack pill, not bare text */
.felt__pot{
  display:flex;align-items:center;gap:7px;padding:5px 13px;border-radius:99px;
  background:rgba(0,0,0,.34);
  border:1px solid rgba(255,255,255,.07);
}
.felt__pot span{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--txt-3)}
.felt__pot b{
  font-size:19px;font-weight:800;letter-spacing:-.02em;
  background:var(--gold-grad);-webkit-background-clip:text;background-clip:text;
  color:transparent;
}

/* board */
.board{display:flex;gap:5px;min-height:52px;align-items:center}
.card{
  width:37px;height:52px;border-radius:6px;flex:none;
  background:linear-gradient(175deg,#fffdf6,#e8e9ef);
  color:#16181f;display:flex;flex-direction:column;align-items:center;justify-content:center;
  font-weight:800;line-height:1;
  box-shadow:0 4px 12px rgba(0,0,0,.5),inset 0 0 0 1px rgba(255,255,255,.5),
             inset 0 -2px 0 rgba(0,0,0,.05);
  animation:cardIn .3s var(--ease) backwards;
}
@keyframes cardIn{
  from{opacity:0;transform:translateY(-12px) rotateY(80deg) scale(.94)}
  to{opacity:1;transform:none}
}
.card__r{font-size:16px}
.card__s{font-size:12px;margin-top:1px}
.card.is-red{color:#dd2a4c}
.card--back{
  background:
    repeating-linear-gradient(45deg,rgba(255,194,71,.16) 0 3px,transparent 3px 9px),
    linear-gradient(175deg,#241d33,#171226);
  box-shadow:0 4px 12px rgba(0,0,0,.5),inset 0 0 0 1.5px rgba(255,194,71,.28);
}
.card--sm{width:26px;height:36px;border-radius:5px}
.card--sm .card__r{font-size:11px}
.card--sm .card__s{font-size:9px}

/* seats */
.pseat{
  position:absolute;left:var(--sx);top:var(--sy);transform:translate(-50%,-50%);
  width:78px;display:flex;flex-direction:column;align-items:center;gap:3px;
  transition:opacity .2s var(--ease);
}
.pseat.is-folded{opacity:.34}
.pseat__cards{display:flex;gap:2px;height:36px}
.pseat__av{
  width:38px;height:38px;border-radius:50%;
  background-size:cover;background-position:center;
  display:grid;place-items:center;
  font-size:14px;font-weight:800;color:#06070c;
  border:2px solid rgba(255,255,255,.14);box-shadow:0 3px 10px rgba(0,0,0,.5);
}
.pseat.is-turn .pseat__av{
  border-color:var(--gold);
  animation:seatPulse 1.1s ease-in-out infinite;
}
@keyframes seatPulse{
  0%,100%{box-shadow:0 0 0 0 rgba(255,194,71,.55)}
  50%{box-shadow:0 0 0 8px rgba(255,194,71,0)}
}
.pseat.is-you .pseat__av{border-color:#fff}
.pseat__name{
  max-width:78px;font-size:10px;font-weight:650;color:var(--txt-2);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  text-shadow:0 1px 3px rgba(0,0,0,.8);
}
.pseat__stack{
  font-size:10.5px;font-weight:800;color:var(--txt);
  background:rgba(0,0,0,.5);border:1px solid rgba(255,255,255,.07);
  border-radius:99px;padding:1px 7px;
}
.pseat__bet{
  position:absolute;top:100%;margin-top:2px;
  font-size:10px;font-weight:800;color:#06070c;
  background:var(--gold-grad);border-radius:99px;padding:1px 7px;white-space:nowrap;
  box-shadow:0 2px 8px rgba(0,0,0,.5),inset 0 1px 0 rgba(255,255,255,.4);
}
.pseat__tag{
  position:absolute;top:-4px;right:2px;
  font-size:8.5px;font-weight:800;letter-spacing:.05em;
  padding:1px 5px;border-radius:99px;background:var(--surface-3);color:var(--txt-2);
}
.pseat__tag--btn{background:#fff;color:#06070c}
.pseat__tag--allin{background:var(--pink);color:#fff}
.pseat__tag--wait{background:var(--surface);color:var(--txt-3)}
.pseat__won{
  position:absolute;top:-16px;font-size:11px;font-weight:800;color:var(--gold);
  text-shadow:0 0 12px rgba(255,210,62,.55);
  animation:wonFloat .5s var(--ease);
}
@keyframes wonFloat{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}

/* action clock */
.felt__clock{
  position:absolute;right:12px;top:12px;width:42px;height:42px;
  display:grid;place-items:center;
  filter:drop-shadow(0 3px 8px rgba(0,0,0,.5));
}
.clock-ring{position:absolute;inset:0;transform:rotate(-90deg)}
.clock-ring circle{fill:none;stroke-width:3}
.clock-ring__bg{stroke:rgba(255,255,255,.09)}
.clock-ring__fg{
  stroke:var(--gold);stroke-linecap:round;
  /* 2*pi*16 = 100.53, written out so JS only ever sets the offset */
  stroke-dasharray:100.53;
  transition:stroke-dashoffset .9s linear;
}
.felt__clock b{font-size:14px;font-weight:800;color:var(--txt)}
.felt__clock.is-urgent .clock-ring__fg{stroke:var(--pink)}
.felt__clock.is-urgent b{color:var(--pink)}

/* action bar */
.poker-actions{margin:14px var(--pad) 0;display:flex;flex-direction:column;gap:10px}
.act-row{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.act-btn{
  min-height:52px;padding:14px 6px;border-radius:var(--r-md);font-size:13px;font-weight:800;
  background:linear-gradient(180deg,var(--surface-2),var(--surface));
  border:1px solid var(--line-2);color:var(--txt);
  transition:transform .1s var(--ease),filter .15s var(--ease);
}
.act-btn:active{transform:scale(.96)}
.act-btn small{display:block;margin-top:2px;font-size:10px;font-weight:650;opacity:.75}
.act-btn--fold{background:var(--surface);color:var(--txt-2);border-color:rgba(255,77,125,.22)}
.act-btn--fold:active{color:#ffa8bf}
.act-btn--call{
  background:var(--surface-3);color:var(--gold);border-color:rgba(255,210,62,.35);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
}
.act-btn--check{background:var(--surface-3)}
.act-btn--raise{
  background:var(--gold-grad);color:#0a0806;border-color:transparent;
  box-shadow:0 6px 18px rgba(255,204,50,.22),inset 0 1.5px 0 rgba(255,255,255,.45);
}
.act-btn--allin{
  background:linear-gradient(135deg,var(--pink),#c62450);color:#fff;border-color:transparent;
  box-shadow:0 6px 18px rgba(255,77,125,.22),inset 0 1.5px 0 rgba(255,255,255,.25);
}
.act-btn[disabled]{opacity:.4;pointer-events:none}

.raise-row{
  background:var(--surface-2);
  border:1px solid var(--line);border-radius:var(--r-md);
  padding:12px;display:flex;flex-direction:column;gap:9px;
}
.raise-row__meta{display:flex;justify-content:space-between;align-items:baseline}
.raise-row__meta span{font-size:10px;letter-spacing:.12em;text-transform:uppercase;color:var(--txt-3)}
.raise-row__meta b{font-size:16px;font-weight:800;color:var(--gold)}
.raise-slider{
  -webkit-appearance:none;appearance:none;width:100%;height:5px;border-radius:99px;
  background:var(--surface-3);outline:none;
}
.raise-slider::-webkit-slider-thumb{
  -webkit-appearance:none;width:22px;height:22px;border-radius:50%;
  background:var(--gold-grad);cursor:pointer;
  box-shadow:0 2px 8px rgba(0,0,0,.5),inset 0 1px 0 rgba(255,255,255,.55);
}
.raise-slider::-moz-range-thumb{
  width:22px;height:22px;border:0;border-radius:50%;
  background:var(--gold-grad);
  box-shadow:0 2px 8px rgba(0,0,0,.5),inset 0 1px 0 rgba(255,255,255,.55);
}
.chip-row--tight .chip{padding:7px 9px;font-size:11px}

/* sit-down / seated panels */
.poker-seated{
  margin:14px var(--pad) 0;padding:14px;
  background:var(--surface-2);
  border:1px solid var(--line);border-radius:var(--r-lg);
  display:flex;flex-direction:column;gap:10px;
}
.poker-join__head{display:flex;justify-content:space-between;align-items:baseline}
.poker-join__head span{font-size:12px;font-weight:700;color:var(--txt-2)}
.poker-join__head b{font-size:13px;font-weight:800;color:var(--gold)}
.poker-join__note{font-size:11px;color:var(--txt-3);line-height:1.5}
.poker-seated__row{display:flex;justify-content:space-between;align-items:baseline}
.poker-seated__row span{font-size:12px;color:var(--txt-2)}
.poker-seated__row b{font-size:18px;font-weight:800;color:var(--gold)}
.poker-seated__btns{display:grid;grid-template-columns:1fr 1fr;gap:8px}

/* hand log */
.poker-log{
  margin:0 var(--pad);padding:12px 14px;
  background:var(--bg-2);border:1px solid var(--line);border-radius:var(--r-md);
  display:flex;flex-direction:column;gap:5px;
}
.poker-log__line{
  font-size:11.5px;color:var(--txt-2);line-height:1.45;
  padding-left:10px;position:relative;
  animation:logIn .2s var(--ease);
}
/* rail tick: log lines read as a tape, not a paragraph */
.poker-log__line::before{
  content:"";position:absolute;left:0;top:.62em;
  width:4px;height:4px;border-radius:1px;background:var(--txt-3);opacity:.5;
}
@keyframes logIn{from{opacity:0;transform:translateX(-6px)}to{opacity:1;transform:none}}
.poker-log__line--win{color:var(--gold);font-weight:700}
.poker-log__line--win::before{background:var(--gold);opacity:.9}
.poker-log__line--rake{color:var(--txt-3)}

/* ================= poker lobby ================= */

.lobby-head{padding:18px var(--pad) 6px}
.lobby-head__title{font-size:23px;font-weight:800;letter-spacing:-.03em}
.lobby-head__sub{
  display:flex;align-items:center;gap:7px;margin-top:4px;
  font-size:12px;color:var(--txt-3);
}
.lobby-head__sub::before{
  content:"";width:6px;height:6px;border-radius:50%;background:var(--gold);
  box-shadow:0 0 8px rgba(255,210,62,.7);
}

.room-list{display:flex;flex-direction:column;gap:10px;padding:8px var(--pad) 0}
.room{
  display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:13px;
  padding:13px 15px;text-align:left;
  background:var(--surface-2);
  border:1px solid var(--line);border-radius:var(--r-lg);
  box-shadow:var(--shadow-1);
  transition:transform .1s var(--ease),border-color .18s var(--ease);
}
.room:active{transform:scale(.985)}
.room.is-seated{border-color:var(--gold-line);background:rgba(255,194,71,.05)}
.room__chip{
  width:54px;height:38px;border-radius:99px;display:grid;place-items:center;
  background:radial-gradient(90% 90% at 50% 20%,#3a2f0f,#1c1608);
  border:1px solid rgba(255,210,62,.28);
  box-shadow:inset 0 0 14px rgba(0,0,0,.55);
  color:var(--gold);
  text-shadow:0 0 10px rgba(255,210,62,.5);
}
.room__chip .ico{width:19px;height:19px}
.room__body{min-width:0}
.room__name{display:block;font-size:15px;line-height:1.2;font-weight:800;letter-spacing:-.02em}
.room__line{display:block;margin-top:3px;line-height:1.35;font-size:11.5px;color:var(--txt-3)}
.room__line b{color:var(--txt-2);font-weight:700}
.room__count{
  font-size:13px;font-weight:800;color:var(--txt-2);white-space:nowrap;
}
.room__count.is-full{color:var(--pink)}
.room__live{
  display:flex;align-items:center;justify-content:flex-end;gap:4px;
  margin-top:3px;font-size:9.5px;font-weight:800;letter-spacing:.08em;
  color:var(--gold);text-transform:uppercase;
}
.room__live::before{
  content:"";width:5px;height:5px;border-radius:50%;background:var(--gold);
  box-shadow:0 0 8px rgba(255,210,62,.9);
  animation:livePulse 1.6s ease-in-out infinite;
}

/* empty chair on the felt */
.pseat--free{cursor:pointer}
.pseat__add{
  width:38px;height:38px;border-radius:50%;
  display:grid;place-items:center;color:var(--txt-2);
  border:1.5px dashed rgba(255,255,255,.3);
  background:rgba(0,0,0,.28);
  transition:transform .1s var(--ease),border-color .18s var(--ease),color .18s var(--ease);
}
.pseat--free:active .pseat__add{transform:scale(.9)}
.pseat--free .pseat__name{color:var(--txt-3)}
.pseat__add .ico{width:17px;height:17px}
.pseat--taken-free .pseat__add{opacity:.35}

/* ================= sit-down sheet ================= */

.seat-sheet__meta{
  display:grid;grid-template-columns:1fr 1fr;gap:8px;
}
.seat-sheet__meta > div{
  padding:11px 13px;border-radius:var(--r-md);
  background:var(--bg-2);border:1px solid var(--line);
}
.seat-sheet__meta span{font-size:11px;color:var(--txt-3);display:block}
.seat-sheet__meta b{font-size:13px;font-weight:800;color:var(--txt)}
.seat-sheet__meta div:last-child{text-align:right}
.seat-sheet__hint{font-size:11px;line-height:1.5;color:var(--txt-3)}

.stepper{display:grid;grid-template-columns:48px 1fr 48px;gap:10px;align-items:center}
.stepper__btn{
  height:48px;border-radius:var(--r-md);display:grid;place-items:center;
  background:var(--bg-2);border:1px solid var(--line-2);color:var(--txt);
}
.stepper__btn:active{transform:scale(.94);border-color:var(--gold-line)}
.stepper__val{
  height:48px;text-align:center;font-size:24px;font-weight:800;letter-spacing:-.03em;
  background:transparent;border:0;color:var(--txt);width:100%;
}
.stepper__val:focus{outline:none}

.seg{
  display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;
  background:var(--bg-2);border:1px solid var(--line);border-radius:var(--r-md);
}
.seg__btn{
  padding:11px 6px;border-radius:10px;font-size:12.5px;font-weight:700;
  color:var(--txt-2);transition:background .16s var(--ease),color .16s var(--ease);
}
.seg__btn.is-on{
  background:var(--surface-3);color:var(--gold);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
}

.switch-row{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:11px 13px;border-radius:var(--r-md);
  background:var(--bg-2);border:1px solid var(--line);
}
.switch-row__title{font-size:13px;font-weight:700}
.switch-row__sub{margin-top:1px;font-size:11px;color:var(--txt-3)}
.switch{
  -webkit-appearance:none;appearance:none;flex:none;
  width:46px;height:27px;border-radius:99px;position:relative;
  background:var(--surface-3);border:1px solid var(--line-2);
  transition:background .18s var(--ease);cursor:pointer;
}
.switch::after{
  content:"";position:absolute;top:2px;left:2px;width:21px;height:21px;border-radius:50%;
  background:var(--txt-3);transition:transform .18s var(--ease),background .18s var(--ease);
}
.switch:checked{background:rgba(255,210,62,.25);border-color:rgba(255,210,62,.5)}
.switch:checked::after{transform:translateX(19px);background:var(--gold)}

.cta[disabled]{opacity:.45;pointer-events:none}

/* a tighter section head for stacked blocks inside one card group */
.section-head--tight{padding-top:14px;padding-bottom:6px}
