/* The poker Salon (Hold'em and Stud): the roller ladder + buy-in adjuster opened from the lobby (static/js/poker_salon.js).
   Obsidian & Gold, 2.5D = layered gradients, shadows and a lift on hover; no backdrop blur (it opens over the
   lobby's animated ticker and gold-dust canvas). */
#ps-root { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; padding: 16px;
    background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(20,16,8,.72), rgba(0,0,0,.9)); }
#ps-root.open { display: flex; animation: ps-fade .18s ease-out; }
@keyframes ps-fade { from { opacity: 0; } }

.ps-modal { position: relative; width: 100%; max-width: 56rem; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: hidden; display: flex; flex-direction: column;
    border-radius: 24px; background: #0b0c10; border: 1px solid rgba(245,158,11,.3); color: #f4f4f5;
    box-shadow: 0 40px 90px rgba(0,0,0,.75), 0 0 0 1px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,236,179,.08);
    animation: ps-rise .28s cubic-bezier(.2,.9,.3,1.1); }
@keyframes ps-rise { from { transform: translateY(14px) scale(.98); opacity: 0; } }
.ps-modal::before { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    background: radial-gradient(ellipse 50% 32% at 50% -6%, rgba(251,191,36,.14), transparent 72%),
                repeating-linear-gradient(100deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px); }

.ps-head { position: relative; padding: 24px 24px 16px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
@media (min-width: 768px) { .ps-head { padding: 32px 32px 18px; } }
.ps-kicker { font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: rgba(245,158,11,.8); font-weight: 700; }
.ps-title { font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: clamp(20px, 3.4vw, 28px); letter-spacing: .08em; margin-top: 4px;
    background: linear-gradient(180deg, #fff4c2, #e6b84c 55%, #a8741c); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ps-sub { margin-top: 6px; font-size: 12px; color: #a8a29e; letter-spacing: .04em; }
.ps-sub b { color: #fde68a; font-weight: 600; }
.ps-wallet { text-align: right; flex-shrink: 0; }
.ps-wallet small { display: block; font-size: 9px; letter-spacing: .24em; text-transform: uppercase; color: #78716c; font-weight: 700; }
.ps-wallet span { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 15px; font-weight: 700; color: #fcd34d; }
.ps-x { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #78716c; border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.02); font-size: 15px; transition: color .15s, border-color .15s; flex-shrink: 0; }
.ps-x:hover { color: #fde68a; border-color: rgba(245,158,11,.45); }

/* Two panes side by side in a track; picking a tier slides to the buy-in pane. */
.ps-viewport { position: relative; overflow: hidden; flex: 1; min-height: 0; }
.ps-track { display: flex; width: 200%; height: 100%; transition: transform .38s cubic-bezier(.3,.9,.25,1); }
.ps-track.buy { transform: translateX(-50%); }
.ps-pane { width: 50%; overflow-y: auto; padding: 4px 24px 24px; }
@media (min-width: 768px) { .ps-pane { padding: 4px 32px 32px; } }
.ps-pane[inert] { visibility: hidden; transition: visibility 0s .38s; }

/* ---------- the roller ladder: one rung per Salon tier, cheapest first ---------- */
.ps-grid { display: flex; flex-direction: column; gap: 10px; }
.ps-grid > div { animation: ps-rung .36s cubic-bezier(.2,.9,.3,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes ps-rung { from { opacity: 0; transform: translateY(8px); } }

.ps-card { --tc: #d4d4d8; --tg: rgba(212,212,216,.16); --tb: rgba(113,113,122,.55);
    position: relative; width: 100%; text-align: left; cursor: pointer; overflow: hidden;
    display: grid; grid-template-columns: 64px minmax(0, 1fr) auto auto; align-items: center; gap: 18px;
    padding: 14px 18px 14px 14px; border-radius: 18px;
    background: linear-gradient(100deg, color-mix(in srgb, var(--tc) 9%, #121318) 0%, #0e0f13 38%, #0a0a0d 100%);
    border: 1px solid var(--tb);
    box-shadow: 0 10px 24px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.05), inset 0 -2px 0 rgba(0,0,0,.4);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
/* the tier's colour as a rail down the left edge, and a soft glow that rises on hover */
.ps-card::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, transparent, var(--tc), transparent); opacity: .8; }
.ps-card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity .2s;
    background: radial-gradient(ellipse 45% 120% at 6% 50%, var(--tg), transparent 70%); }
.ps-card:hover:not(.locked), .ps-card:focus-visible { transform: translateY(-2px); border-color: var(--tc); outline: none;
    box-shadow: 0 16px 34px rgba(0,0,0,.55), 0 0 22px var(--tg), inset 0 1px 0 rgba(255,255,255,.07); }
.ps-card:hover:not(.locked)::after, .ps-card:focus-visible::after { opacity: 1; }
.ps-card.locked { cursor: default; }
.ps-card.locked .ps-medal, .ps-card.locked .ps-price, .ps-card.locked .ps-name, .ps-card.locked .ps-badge { filter: saturate(.3); opacity: .55; }
.ps-card.home { border-color: color-mix(in srgb, var(--tc) 70%, transparent);
    box-shadow: 0 12px 28px rgba(0,0,0,.5), 0 0 0 1px color-mix(in srgb, var(--tc) 25%, transparent), 0 0 26px var(--tg), inset 0 1px 0 rgba(255,255,255,.06); }

/* Tier colours (poker_stakes.py `theme`), shared by the rungs and the buy-in panel. */
#ps-root .t-zinc   { --tc: #d4d4d8; --tg: rgba(212,212,216,.14); --tb: rgba(63,63,70,.9); }
#ps-root .t-blue   { --tc: #60a5fa; --tg: rgba(59,130,246,.18); --tb: rgba(59,130,246,.3); }
#ps-root .t-amber  { --tc: #fbbf24; --tg: rgba(245,158,11,.2);  --tb: rgba(245,158,11,.4); }
#ps-root .t-purple { --tc: #c084fc; --tg: rgba(168,85,247,.2);  --tb: rgba(168,85,247,.4); }
#ps-root .t-rose   { --tc: #fb7185; --tg: rgba(244,63,94,.24);  --tb: rgba(244,63,94,.5); }

/* The medal: a 2.5D chip stack in the tier colour with the Salon's numeral struck on the top chip. */
.ps-medal { position: relative; width: 64px; height: 58px; display: grid; place-items: center; }
.ps-stack { position: absolute; inset: 0; }
.ps-stack i { position: absolute; left: 6px; width: 52px; height: 20px; border-radius: 50%;
    background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--tc) 70%, #000), color-mix(in srgb, var(--tc) 35%, #000));
    box-shadow: 0 3px 0 color-mix(in srgb, var(--tc) 30%, #000), 0 6px 10px rgba(0,0,0,.55); }
.ps-stack i::before { content: ''; position: absolute; inset: 3px 7px; border-radius: 50%; border: 1.5px dashed rgba(255,255,255,.45); }
.ps-stack i:nth-child(1) { bottom: 4px; } .ps-stack i:nth-child(2) { bottom: 12px; left: 7px; } .ps-stack i:nth-child(3) { bottom: 20px; left: 5px; }
.ps-card:hover:not(.locked) .ps-stack i:nth-child(3) { transform: translateY(-3px); transition: transform .18s; }
.ps-medal b { position: relative; top: -1px; font-family: 'Cinzel', Georgia, serif; font-size: 12px; font-weight: 700; letter-spacing: .04em;
    color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.8); }

.ps-who { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ps-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ps-name { font-family: 'Cinzel', Georgia, serif; font-weight: 700; font-size: 17px; letter-spacing: .05em; color: var(--tc); }
.ps-badge { font-size: 9px; font-weight: 800; letter-spacing: .2em; padding: 3px 8px; border-radius: 999px; color: var(--tc);
    border: 1px solid var(--tb); background: rgba(0,0,0,.35); }
.ps-home { font-size: 9px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px;
    color: #1a1206; background: linear-gradient(180deg, #fff1b0, #e2b44a 55%, #a8741c); }
.ps-salon { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #78716c; font-weight: 700; }

.ps-price { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.ps-blinds { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 20px; font-weight: 700; color: #fafaf9; letter-spacing: -.01em; white-space: nowrap; }
.ps-blinds small { font-family: inherit; font-size: 10px; color: #78716c; font-weight: 600; letter-spacing: .16em; margin-left: 6px; }
.ps-range { font-size: 12px; color: #a8a29e; white-space: nowrap; }
.ps-range b { color: #e7e5e4; font-weight: 600; }

.ps-act { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 92px; height: 40px; padding: 0 14px;
    border-radius: 12px; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.ps-act svg { width: 15px; height: 15px; flex: none; }
.ps-act.go { color: #1a1206; background: linear-gradient(180deg, #fff1b0, #e2b44a 55%, #a8741c);
    box-shadow: 0 3px 0 #6b4a12, 0 8px 18px rgba(245,158,11,.18); transition: filter .15s; }
.ps-card:hover .ps-act.go, .ps-card:focus-visible .ps-act.go { filter: brightness(1.08); }
.ps-act.lock { color: #a8a29e; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.1); }
.ps-act.short { color: #fda4af; background: rgba(76,5,25,.35); border: 1px solid rgba(244,63,94,.3); letter-spacing: .08em; }

.ps-live { margin-top: 3px; display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: #a1a1aa; }
.ps-live b { color: #e7e5e4; font-weight: 600; }
.ps-live i { width: 7px; height: 7px; border-radius: 50%; background: #3f3f46; flex-shrink: 0; }
.ps-live.on i { background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.18); animation: ps-pulse 2s ease-in-out infinite; }
.ps-live.lock { color: #78716c; }
@keyframes ps-pulse { 50% { box-shadow: 0 0 0 5px rgba(52,211,153,.06); } }
.ps-broke { margin-top: 3px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 11px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase; color: #fda4af; }
.ps-broke a { letter-spacing: .04em; text-transform: none; font-weight: 600; color: #fcd34d; text-decoration: underline; text-underline-offset: 3px; }
.ps-foot { margin-top: 16px; font-size: 11px; color: #71717a; text-align: center; }
.ps-wallet em { display: block; margin-top: 4px; font-style: normal; font-size: 11px; color: #a8a29e; }
.ps-wallet em b { color: #fde68a; font-weight: 700; }

/* ---------- buy-in adjuster ---------- */
.ps-back { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
    color: #a8a29e; padding: 6px 0; }
.ps-back:hover { color: #fde68a; }
.ps-buy { margin-top: 8px; border-radius: 20px; padding: 22px; border: 1px solid rgba(245,158,11,.22);
    background: linear-gradient(180deg, #121217, #0a0a0d); box-shadow: inset 0 1px 0 rgba(255,236,179,.06), 0 16px 34px rgba(0,0,0,.5); }
.ps-buy-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.ps-amount { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: clamp(28px, 6vw, 42px); font-weight: 800; color: #fde68a;
    text-shadow: 0 2px 0 rgba(0,0,0,.6), 0 0 24px rgba(245,158,11,.25); line-height: 1.1; font-variant-numeric: tabular-nums; }
.ps-depth { font-size: 12px; color: #a8a29e; margin-top: 2px; }
.ps-depth b { color: #fbbf24; }

.ps-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 10px; border-radius: 999px; margin: 26px 0 8px; cursor: pointer;
    background: linear-gradient(90deg, #a8741c, #fbbf24 var(--fill, 0%), #1c1c21 var(--fill, 0%));
    box-shadow: inset 0 1px 3px rgba(0,0,0,.7), 0 1px 0 rgba(255,255,255,.05); }
.ps-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff4c2;
    background: radial-gradient(circle at 35% 30%, #fff1b0, #d49a2a 60%, #7a5210); box-shadow: 0 4px 10px rgba(0,0,0,.6), 0 0 0 4px rgba(245,158,11,.15); }
.ps-slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff4c2;
    background: radial-gradient(circle at 35% 30%, #fff1b0, #d49a2a 60%, #7a5210); box-shadow: 0 4px 10px rgba(0,0,0,.6); }
.ps-slider:focus-visible { outline: 2px solid rgba(251,191,36,.6); outline-offset: 6px; }
.ps-ends { display: flex; justify-content: space-between; font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 11px; color: #78716c; }

.ps-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; }
.ps-q { height: 40px; border-radius: 12px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: #e7e5e4;
    background: linear-gradient(180deg, #24211d, #121110); border: 1px solid rgba(212,175,55,.3); transition: filter .15s, border-color .15s; }
.ps-q:hover:not(:disabled) { filter: brightness(1.25); border-color: rgba(251,191,36,.6); }
.ps-q.on { color: #1a1206; background: linear-gradient(180deg, #fff1b0, #e2b44a 55%, #a8741c); border-color: transparent; }
.ps-q:disabled { opacity: .35; cursor: not-allowed; }

.ps-join { margin-top: 18px; width: 100%; height: 54px; border-radius: 14px; font-weight: 800; font-size: 14px; letter-spacing: .1em; color: #1a1206;
    background: linear-gradient(180deg, #fff1b0, #e2b44a 50%, #a8741c); box-shadow: 0 5px 0 #6b4a12, 0 12px 26px rgba(245,158,11,.25);
    transition: filter .15s, transform .08s, box-shadow .08s; }
.ps-join:hover:not(:disabled) { filter: brightness(1.08); }
.ps-join:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #6b4a12, 0 6px 14px rgba(245,158,11,.2); }
.ps-join:disabled { opacity: .5; cursor: wait; }
.ps-note { margin-top: 12px; font-size: 11px; color: #71717a; text-align: center; }
.ps-err { margin-top: 12px; font-size: 12px; color: #fda4af; background: rgba(76,5,25,.6); border: 1px solid rgba(244,63,94,.3); border-radius: 10px; padding: 8px 12px; }

/* Phones: bankroll + close ride above the title, the chip stack shrinks and the blinds stay on one line. */
@media (max-width: 560px) {
    .ps-head { flex-direction: column-reverse; gap: 10px; padding: 18px 18px 12px; }
    .ps-head > div:last-child { align-self: stretch; justify-content: space-between; }
    .ps-wallet { text-align: left; }
    .ps-pane { padding: 4px 18px 18px; }
    .ps-card { grid-template-columns: 40px minmax(0, 1fr) auto; align-items: start; gap: 8px 10px; padding: 12px 12px 12px 8px; }
    .ps-medal { width: 40px; height: 40px; }
    .ps-medal .ps-stack { transform: scale(.66); transform-origin: 0 100%; }
    .ps-medal b { top: 4px; left: -3px; font-size: 10px; }
    .ps-name { font-size: 15px; }
    .ps-badge, .ps-home { font-size: 8px; padding: 2px 6px; }
    .ps-salon { font-size: 10px; letter-spacing: .1em; }
    .ps-live { font-size: 11px; }
    .ps-price { grid-column: 2 / -1; grid-row: 2; align-items: flex-start; text-align: left; }
    .ps-act { grid-column: 3; grid-row: 1; min-width: 0; height: 32px; padding: 0 10px; font-size: 10px; letter-spacing: .1em; }
    .ps-blinds { font-size: 16px; }
    .ps-range { white-space: normal; font-size: 11px; }
    .ps-buy { padding: 16px; }
    .ps-q { font-size: 10px; letter-spacing: .02em; }
    .ps-join { font-size: 12px; letter-spacing: .06em; }
}

html.calm-motion #ps-root.open, html.calm-motion .ps-modal, html.calm-motion .ps-track, html.calm-motion .ps-card, html.calm-motion .ps-live.on i, html.calm-motion .ps-grid > div { animation: none; transition: none; }
