/*
 * lobby.css — REDESIGNED 2026-09-09 to match an explicit reference mockup
 * (see lobby.js header comment): top-corner HUD, two prev/next carousels
 * on the left, a fanned "hand of cards" menu on the right, 4 shortcut
 * icons bottom-left + settings bottom-right. Full replacement of the old
 * two-column (stats panel + tab-switching side panel) layout — none of
 * the old .lobby-* classes are reused; this file only defines .lb2-*.
 */

.app-screen { overflow-y: auto; } /* this page can get tall on narrow viewports — let it scroll instead of clipping */

/* ── Top bar ─────────────────────────────────────────────────────────────── */

.lb2-topbar {
    position: relative; z-index: 2; flex-shrink: 0;
    display: flex; align-items: flex-start; justify-content: space-between;
    padding: 18px 24px 0;
    gap: 14px; flex-wrap: wrap;
}

.lb2-avatar-row { display: flex; align-items: center; gap: 13px; cursor: pointer; }
.lb2-avatar {
    width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
    border: 2.5px solid rgba(255,216,138,.4); background: rgba(0,0,0,.35);
    display: flex; align-items: center; justify-content: center;
    transition: border-color .15s, transform .15s;
}
.lb2-avatar-row:hover .lb2-avatar { border-color: rgba(255,216,138,.8); transform: scale(1.04); }
.lb2-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.lb2-avatar-fallback { font-family: var(--font-title); font-size: 25px; font-weight: 800; color: var(--c-cream); }

.lb2-xp-wrap { min-width: 180px; }
.lb2-name { font-size: 14px; font-weight: 700; color: var(--c-cream); margin-bottom: 5px; }
.lb2-xp-track { width: 190px; max-width: 40vw; height: 9px; border-radius: 5px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,216,138,.2); overflow: hidden; }
.lb2-xp-fill { height: 100%; background: linear-gradient(90deg,#a35a10,#f0883e); border-radius: 5px; transition: width .3s ease; }
.lb2-xp-label { font-size: 11.5px; letter-spacing: .5px; color: rgba(255,232,160,.6); margin-top: 4px; font-family: var(--font-mono); }

.lb2-currencies { display: flex; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.lb2-chip {
    display: flex; align-items: center; gap: 7px;
    background: rgba(0,0,0,.4); border: 1.5px solid var(--chip-color, rgba(255,216,138,.25));
    border-radius: 999px; padding: 7px 15px 7px 11px;
}
.lb2-chip .ic { width: 20px; height: 20px; background-size: contain; background-repeat: no-repeat; background-position: center; image-rendering: pixelated; flex-shrink: 0; }
.lb2-chip-val { font-family: var(--font-mono); font-size: 14px; font-weight: 800; color: var(--c-cream); }
.lb2-chip-lbl { font-size: 10.5px; letter-spacing: .5px; color: rgba(255,232,160,.5); }

/* ── Main split: carousels left, fan right ──────────────────────────────── */

.lb2-main {
    position: relative; z-index: 2; flex: 1 1 auto;
    display: flex; align-items: stretch; gap: 20px;
    padding: 16px 24px; min-height: 0;
    overflow-y: auto; overflow-x: hidden; /* safety net: on a viewport too short for both carousels + the fan, this scrolls the middle section instead of the old bug where a fixed-height fan silently painted over .lb2-bottom's icons */
    flex-wrap: wrap;
}

.lb2-left { display: flex; flex-direction: column; gap: 14px; width: 360px; max-width: 100%; flex-shrink: 0; }

.lb2-carousel {
    background: rgba(0,0,0,.28); border: 1px solid rgba(255,216,138,.15);
    border-radius: 14px; padding: 12px 12px 14px;
}
.lb2-carousel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.lb2-carousel-title { font-family: var(--font-title); font-size: 12px; font-weight: 800; letter-spacing: 1.5px; color: var(--c-cream); }
.lb2-car-arrow {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    background: rgba(255,216,138,.12); border: 1px solid rgba(255,216,138,.25);
    color: var(--c-cream); font-size: 12.5px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, transform .15s;
}
.lb2-car-arrow:hover:not(:disabled) { background: rgba(255,216,138,.25); transform: scale(1.08); }
.lb2-car-arrow:disabled { opacity: .3; cursor: default; }

.lb2-carousel-body { min-height: 128px; }
.lb2-carousel-empty { font-size: 12.5px; color: rgba(255,232,160,.45); text-align: center; padding: 26px 8px; }
.lb2-carousel-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.lb2-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,216,138,.25); transition: background .2s, width .2s; }
.lb2-dot.active { background: var(--c-orange); width: 16px; border-radius: 3px; }

/* ── Banner cards (gacha/raffle/event) — one visible at a time ─────────── */

.lb2-banner {
    position: relative; overflow: hidden; border-radius: 12px;
    display: flex; gap: 11px; align-items: flex-start; padding: 13px;
    cursor: pointer; transition: transform .15s;
}
.lb2-banner[data-action]:hover { transform: translateY(-2px); }
.lb2-banner-glow { position: absolute; inset: -40% -20% auto auto; width: 70%; height: 140%; border-radius: 50%; filter: blur(30px); opacity: .35; pointer-events: none; }
.lb2-banner-gacha { background: linear-gradient(135deg, rgba(124,63,209,.18), rgba(58,36,16,.3)); border: 1px solid rgba(124,63,209,.35); }
.lb2-banner-gacha .lb2-banner-glow { background: #7c3fd1; }
.lb2-banner-raffle { background: linear-gradient(135deg, rgba(43,138,62,.18), rgba(58,36,16,.3)); border: 1px solid rgba(43,138,62,.35); }
.lb2-banner-raffle .lb2-banner-glow { background: #2b8a3e; }
.lb2-banner-event { background: linear-gradient(135deg, rgba(200,100,26,.18), rgba(58,36,16,.3)); border: 1px solid rgba(200,100,26,.35); cursor: default; }
.lb2-banner-event .lb2-banner-glow { background: #c8641a; }

.lb2-banner-icon { font-size: 30px; flex-shrink: 0; position: relative; z-index: 1; }
.lb2-banner-body { flex: 1; min-width: 0; position: relative; z-index: 1; }
.lb2-banner-title { font-size: 13px; font-weight: 800; color: var(--c-cream); margin-bottom: 3px; }
.lb2-banner-main { font-size: 12.5px; color: #ffd88a; margin-bottom: 6px; }
.lb2-banner-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 7px; }
.lb2-banner-cost { font-size: 11px; color: rgba(255,232,160,.6); }
.lb2-banner-cta { font-size: 11px; font-weight: 800; color: var(--c-orange); letter-spacing: .5px; }

.lb2-pity { margin-top: 5px; display: flex; align-items: center; gap: 8px; }
.lb2-pity-track { flex: 1; height: 5px; border-radius: 3px; background: rgba(0,0,0,.35); overflow: hidden; }
.lb2-pity-fill { height: 100%; background: #7c3fd1; }
.lb2-pity span { font-size: 10px; color: rgba(255,232,160,.5); white-space: nowrap; }

.lb2-event-tag { font-size: 9px; font-weight: 800; letter-spacing: .5px; border-radius: 4px; padding: 2px 7px; display: inline-block; margin-bottom: 5px; }
.lb2-event-desc { font-size: 11.5px; color: rgba(255,232,160,.6); line-height: 1.4; margin-bottom: 6px; }
.lb2-event-progress { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.lb2-event-progress-track { flex: 1; height: 6px; border-radius: 3px; background: rgba(0,0,0,.35); overflow: hidden; }
.lb2-event-progress-fill { height: 100%; background: linear-gradient(90deg,#a35a10,#f0883e); }
.lb2-event-progress-lbl { font-size: 10px; color: rgba(255,232,160,.5); white-space: nowrap; font-family: var(--font-mono); }
.lb2-event-claimed { margin-top: 8px; font-size: 12px; color: #5fd97a; font-weight: 700; }
.lb2-event-hint { margin-top: 8px; font-size: 11.5px; color: rgba(255,232,160,.5); }
.lb2-event-claim-btn {
    margin-top: 8px; width: 100%; padding: 9px 8px; border-radius: 8px; border: none; cursor: pointer;
    background: linear-gradient(180deg,#c8641a,#8a4308); color: #fff8ec; font-size: 12px; font-weight: 800; letter-spacing: .5px;
    transition: filter .15s;
}
.lb2-event-claim-btn:hover:not(:disabled) { filter: brightness(1.08); }
.lb2-event-claim-btn:disabled { opacity: .6; cursor: default; }

/* ── Card stack menu (horizontal swipe/arrow carousel) ──────────────────── */
/* REPLACED the old rotate()-fan per explicit user request: "geser kiri
   kanan aja, yang aktif yang paling depan, sisanya seperti dibelakang
   kartu yang aktif" — plus arrow buttons and a bit of a size bump. The
   active card (.is-active, toggled by applyFanPositions() in lobby.js)
   sits centered/full-size in front; the rest are translateX'd sideways and
   scaled down via inline styles so they read as a stack peeking out behind
   it, not a spread hand of cards. Height only ever needs to fit ONE card
   now (not 6 spread across a whole row), which also structurally avoids
   the earlier viewport-height overflow bug — nothing here depends on vh. */

/* .lb2-fan-wrap stretches to fill .lb2-main's full remaining width/height
   (flex:1 + the row's align-items:stretch) — .lb2-fan-panel then fills
   THAT completely, so the whole card-stack widget occupies the large area
   the user marked, not just a small box floating in the middle of it. */
.lb2-fan-wrap { flex: 1; min-width: 300px; display: flex; min-height: 0; padding: 4px; }

.lb2-fan-panel {
    width: 100%; height: 100%;
    background: rgba(0,0,0,.22); border: 1px solid rgba(255,216,138,.12); border-radius: 22px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
    padding: 22px;
}

.lb2-fan-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: 100%; max-width: 760px; }

.lb2-fan-arrow {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    background: rgba(255,216,138,.12); border: 1px solid rgba(255,216,138,.25);
    color: var(--c-cream); font-size: 15px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .15s, transform .15s;
    position: relative; z-index: 120; /* the now-wider-offset side cards (z-index up to 100) can visually spill toward the row's edges on narrower viewports — this guarantees the arrows stay clickable on top regardless */
}
.lb2-fan-arrow:hover { background: rgba(255,216,138,.25); transform: scale(1.08); }
.lb2-fan-arrow:active { transform: scale(.94); }

.lb2-fan {
    position: relative; flex: 1; max-width: 480px; height: min(420px, 46vh);
    touch-action: pan-y; /* horizontal drag reaches our JS; vertical drag still scrolls the page normally */
    user-select: none; cursor: grab;
}
.lb2-fan:active { cursor: grabbing; }

/* Card size +20% and the stack offset/scale-step tuning both live in
   lobby.js (FAN_STACK_OFFSET/FAN_STACK_SCALE_STEP) — width/height/margin
   here must stay in sync with those since margin is a static half-size
   anchor offset, not something the JS can compute for us. Transition
   swapped for a smoother "ease-out-expo"-style curve with a touch more
   travel time (was a plain .2/.8/.2/1 ease) — reads noticeably less
   mechanical/linear when stepping the carousel. */
.lb2-card {
    position: absolute; left: 50%; top: 50%;
    width: 228px; height: 336px; margin: -168px 0 0 -114px;
    cursor: pointer;
    transition: transform .4s cubic-bezier(.16,1,.3,1), opacity .28s ease;
    will-change: transform;
}
.lb2-card-inner {
    position: relative;
    width: 100%; height: 100%; border-radius: 20px;
    background: linear-gradient(165deg, rgba(58,36,16,.92), rgba(20,12,5,.95));
    border: 1.5px solid rgba(255,216,138,.3);
    box-shadow: 0 16px 36px rgba(0,0,0,.45);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    padding: 18px 12px;
    transition: border-color .2s, box-shadow .2s, filter .3s;
}
/* "N rewards ready" pill — only the ALBUM card sets it. Non-interactive so
   it never steals a click/drag from the fan (see fanCardHtml() in lobby.js). */
.lb2-card-badge {
    position: absolute; top: 10px; right: 10px; pointer-events: none;
    min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(180deg,#f0883e,#c8641a); color: #fff8ec;
    font-family: var(--font-mono); font-size: 12.5px; font-weight: 800;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.lb2-card:not(.is-active) .lb2-card-inner { filter: brightness(.62); }
.lb2-card.is-active .lb2-card-inner { border-color: rgba(255,216,138,.7); box-shadow: 0 22px 46px rgba(0,0,0,.55), 0 0 0 1px rgba(255,216,138,.15); }
.lb2-card-icon { width: 55px; height: 55px; color: #ffd88a; }
.lb2-card-label { font-family: var(--font-title); font-size: 15px; font-weight: 800; letter-spacing: 1.3px; color: var(--c-cream); text-align: center; }
.lb2-card[data-action="goto-play"] .lb2-card-inner { background: linear-gradient(165deg, rgba(200,100,26,.55), rgba(20,12,5,.95)); }
.lb2-card[data-action="goto-play"] .lb2-card-icon,
.lb2-card[data-action="goto-play"] .lb2-card-label { color: #fff3d6; }

/* ── Bottom shortcuts ────────────────────────────────────────────────────── */

.lb2-bottom {
    position: relative; z-index: 2; flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 22px 16px;
}
.lb2-shortcuts { display: flex; gap: 10px; }
.lb2-icon-btn {
    width: 50px; height: 50px; border-radius: 12px; cursor: pointer;
    background: rgba(0,0,0,.35); border: 1px solid rgba(255,216,138,.2);
    color: #ffd88a; display: flex; align-items: center; justify-content: center;
    transition: background .15s, transform .15s;
}
.lb2-icon-btn svg { width: 22px; height: 22px; }
.lb2-icon-btn:hover { background: rgba(255,216,138,.15); transform: translateY(-2px); }

/* ── Modal layer (Mail / Settings) ──────────────────────────────────────── */

.lb2-modal-layer:empty { display: none; }
.lb2-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(10,5,2,.72);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.lb2-modal {
    width: 100%; max-width: 380px; max-height: 82vh; overflow-y: auto;
    background: linear-gradient(165deg, #241a12, #150f0a);
    border: 1px solid rgba(255,216,138,.25); border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.lb2-modal-head {
    position: sticky; top: 0; z-index: 1;
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 18px; background: rgba(20,12,5,.92);
    border-bottom: 1px solid rgba(255,216,138,.15);
    font-family: var(--font-title); font-weight: 800; font-size: 13px; letter-spacing: 1px; color: var(--c-cream);
}
.lb2-modal-close { cursor: pointer; color: rgba(255,232,160,.6); font-size: 14px; transition: color .15s; }
.lb2-modal-close:hover { color: var(--c-cream); }
.lb2-modal-body { padding: 16px 18px 20px; }
.lb2-modal-subhead { font-size: 11px; letter-spacing: 1.5px; color: rgba(255,232,160,.45); margin: 14px 0 8px; }
.lb2-modal-subhead:first-child { margin-top: 0; }

.lb2-mail-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,216,138,.1); }
.lb2-mail-row:last-child { border-bottom: none; }
.lb2-mail-icon { font-size: 20px; flex-shrink: 0; }
.lb2-mail-info { flex: 1; min-width: 0; }
.lb2-mail-title { font-size: 13px; font-weight: 700; color: var(--c-cream); }
.lb2-mail-sub { font-size: 11.5px; color: rgba(255,232,160,.5); margin-top: 2px; }
.lb2-mail-right { font-size: 11.5px; color: var(--c-orange); font-weight: 700; flex-shrink: 0; }

.lb2-slider { margin-bottom: 12px; }
.lb2-slider-row { display: flex; justify-content: space-between; font-size: 12px; color: rgba(255,232,160,.65); margin-bottom: 5px; }
.lb2-slider-track { height: 6px; border-radius: 3px; background: rgba(0,0,0,.35); overflow: hidden; }
.lb2-slider-fill { height: 100%; background: linear-gradient(90deg,#a35a10,#f0883e); }
.lb2-toggle-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-size: 12.5px; color: rgba(255,232,160,.75); }
.lb2-toggle { width: 38px; height: 21px; border-radius: 11px; background: rgba(0,0,0,.4); border: 1px solid rgba(255,216,138,.25); position: relative; cursor: pointer; transition: background .2s; }
.lb2-toggle-knob { position: absolute; top: 1.5px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: rgba(255,232,160,.5); transition: left .2s, background .2s; }
.lb2-toggle.on { background: rgba(200,100,26,.4); border-color: rgba(200,100,26,.6); }
.lb2-toggle.on .lb2-toggle-knob { left: 19px; background: #ffd88a; }
.lb2-logout-btn { background: rgba(163,41,29,.18) !important; border-color: rgba(163,41,29,.4) !important; color: #ff8a7a !important; }

/* ── Toast ───────────────────────────────────────────────────────────────── */

.lb2-toast {
    position: fixed; left: 50%; bottom: 90px; z-index: 300;
    transform: translate(-50%, 12px); opacity: 0;
    background: rgba(20,12,5,.95); border: 1px solid rgba(255,216,138,.3);
    border-radius: 10px; padding: 10px 18px; font-size: 12px; color: var(--c-cream);
    transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap;
}
.lb2-toast.show { opacity: 1; transform: translate(-50%, 0); }
.lb2-toast-success { border-color: rgba(43,138,62,.5); }
.lb2-toast-error { border-color: rgba(163,41,29,.5); color: #ff8a7a; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@container (max-width: 860px) {
    /* THE ACTUAL BUG behind "kartu di lobby tidak bisa di klik" (2026-09-09),
       found via headless-browser inspection, not guessed: .lb2-main's base
       rule carries flex-wrap:wrap (meant for the wide row layout, so
       .lb2-left/.lb2-fan-wrap can wrap onto their own line on a merely-
       narrow-but-still-row viewport). Once flex-direction switches to
       column here, flex-wrap:wrap means "wrap onto a new COLUMN" instead —
       so whenever the stacked .lb2-left + .lb2-fan-wrap content was taller
       than the available height (extremely common — .lb2-fan-wrap alone
       has a 420px min-height at this breakpoint), flexbox pushed
       .lb2-fan-wrap into a second column sitting to the RIGHT of
       .lb2-left, past the viewport's right edge — and since .lb2-main also
       has overflow-x:hidden, that whole card menu became genuinely
       unreachable, not just visually off — confirmed empirically:
       elementFromPoint() at the active card's computed center returned
       null because the card's real x-position was ~400px past a 400px-
       wide viewport. flex-wrap:nowrap here makes column mode just stack
       normally (.lb2-main's own overflow-y:auto handles anything still
       too tall vertically, which is what that rule was always meant for). */
    .lb2-main { flex-direction: column; flex-wrap: nowrap; }
    .lb2-left { width: 100%; }
    .lb2-fan-wrap { min-width: 0; min-height: 420px; padding-top: 8px; }
}
@container (max-width: 480px) {
    .lb2-topbar { padding: 12px 14px 0; }
    .lb2-currencies { justify-content: flex-start; }
    .lb2-bottom { padding: 0 14px 14px; flex-wrap: wrap; gap: 10px; }
    .lb2-fan-wrap { min-width: 0; min-height: 300px; }
    .lb2-fan-panel { padding: 12px; border-radius: 16px; gap: 10px; }
    .lb2-fan { height: 240px; }
    .lb2-card { width: 150px; height: 218px; margin: -109px 0 0 -75px; }
    .lb2-card-icon { width: 36px; height: 36px; }
    .lb2-card-label { font-size: 12.5px; }
    .lb2-fan-arrow { width: 36px; height: 36px; font-size: 12px; }
}
