/* LuckyParty app-shell v1 — permanent theme + app-like polish. Visual layer only; no logic.
   Not loaded by: monopoly_011026, lucky-event, wheel, draw-guess, fruit-merge, admin. */
:root{
  --lp-bg:#08050c;--lp-surface:#140e1c;--lp-surface-2:#1c1328;--lp-line:rgba(255,255,255,.08);
  --lp-text:#f6f2fa;--lp-muted:#9a8da6;--lp-violet:#8f5cff;--lp-indigo:#5e85ff;
  --lp-grad:linear-gradient(135deg,#9a68ff,#5e85ff);
  --lp-ok:#35d49a;--lp-err:#ff5d70;
  --lp-ease:cubic-bezier(.22,.78,.24,1);--lp-spring:cubic-bezier(.34,1.56,.64,1);
}
html{background:var(--lp-bg);-webkit-tap-highlight-color:transparent;overscroll-behavior:none;-webkit-text-size-adjust:100%}
body{-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}
a,button,label,summary,[role=button]{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button,a{-webkit-user-select:none;user-select:none}
::selection{background:rgba(143,92,255,.42)}
*{scrollbar-width:none}*::-webkit-scrollbar{display:none}
:focus-visible{outline:2px solid var(--lp-violet);outline-offset:2px}
input,textarea{caret-color:var(--lp-violet)}

/* ---- Bottom tab bar (home / voice / more) ---- */
nav.app-nav,nav.voice-page-nav{
  view-transition-name:lp-nav;
  background:rgba(12,8,18,.93)!important;
  -webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);
  border-top:1px solid var(--lp-line)!important;
  box-shadow:0 -10px 30px rgba(0,0,0,.28);
}
nav.app-nav a,nav.voice-page-nav a{
  position:relative;z-index:1;font-size:11px!important;font-weight:700!important;letter-spacing:.2px;
  color:var(--lp-muted)!important;
  transition:color .22s var(--lp-ease),scale .18s var(--lp-ease);
}
nav.app-nav a.active,nav.voice-page-nav a.active{color:#fff!important}
/* until JS has placed the sliding indicator, the page's own active background stays visible (never an empty bar) */
nav.lp-ind a,nav.lp-ind a.active{background:none!important}
nav.app-nav svg,nav.voice-page-nav svg{width:23px!important;height:23px!important;transition:transform .35s var(--lp-spring)}
nav.app-nav a.active svg,nav.voice-page-nav a.active svg{transform:translateY(-1px) scale(1.08);filter:drop-shadow(0 2px 8px rgba(143,92,255,.55))}
nav.app-nav a:active,nav.voice-page-nav a:active{scale:.92}
/* sliding indicator, positioned by app-shell.js */
nav.app-nav::before,nav.voice-page-nav::before{
  content:"";position:absolute;z-index:0;left:0;top:6px;bottom:calc(6px + env(safe-area-inset-bottom));
  width:var(--ind-w,0);opacity:var(--ind-o,0);transform:translateX(var(--ind-x,0));border-radius:15px;pointer-events:none;
  background:linear-gradient(145deg,rgba(150,94,255,.30),rgba(78,99,255,.16));
  box-shadow:inset 0 0 0 1px rgba(170,130,255,.18);
}
nav.lp-nav-ready::before{transition:transform .46s cubic-bezier(.34,1.25,.5,1),width .3s var(--lp-ease),opacity .2s}   /* slides past the target, springs back */
nav.lp-jelly::before{animation:lpIndJelly .46s ease both}
@keyframes lpIndJelly{0%{scale:1 1}28%{scale:1.08 .95}62%{scale:.985 1.025}100%{scale:1 1}}
nav a.lp-arrive svg{animation:lpIconPop .55s var(--lp-spring) .12s both}
@keyframes lpIconPop{0%{transform:scale(.78)}60%{transform:scale(1.1)}100%{transform:translateY(-1px) scale(1.08)}}
/* the moment a tab is touched: label + icon respond in the OLD page; the indicator itself glides in the NEW page */
nav a.lp-opt svg{transform:translateY(-1px) scale(1.16)!important;transition:transform .16s var(--lp-spring)}
nav:has(a.lp-opt) a.active:not(.lp-opt){color:var(--lp-muted)!important}

/* ---- Page transitions (cross-document View Transitions) ---- */
::view-transition-old(lp-nav){display:none}
::view-transition-new(lp-nav){animation:none}
html[data-lp-dir]::view-transition-old(root){animation:lpO 90ms linear both}
html[data-lp-dir]::view-transition-new(root){animation:lpN 150ms linear both}
html[data-lp-dir=fwd]::view-transition-new(root){animation:lpInR 150ms var(--lp-ease) both}
html[data-lp-dir=back]::view-transition-new(root){animation:lpInL 150ms var(--lp-ease) both}
@keyframes lpO{to{opacity:0}}@keyframes lpN{from{opacity:0}}
@keyframes lpInR{from{opacity:0;transform:translate3d(10px,0,0)}}
@keyframes lpInL{from{opacity:0;transform:translate3d(-10px,0,0)}}
/* browsers without cross-document VT: soft fade-in on the dark canvas instead of a hard cut */
html.lp-no-vt body{animation:lpFade .24s ease both}
@keyframes lpFade{from{opacity:0}}

/* ---- Staggered fade-up reveal for page blocks (uses `translate`, never clobbers transform) ---- */
.lp-rise{animation:lpRise .26s var(--lp-ease) both;animation-delay:calc(var(--lp-i,0)*26ms)}
@keyframes lpRise{from{opacity:0;translate:0 8px}to{opacity:1;translate:0 0}}

/* ---- Instant tap response: the tab lights up and the content dims the moment you tap, before the next page is ready ---- */
nav.app-nav a.lp-opt,nav.voice-page-nav a.lp-opt{color:#fff!important}
html.lp-leaving :is(body>main,body>.page){opacity:.6;transition:opacity .12s ease}
/* instant destination skeleton shown on the CURRENT page the moment a tab is tapped */
.lp-shim{position:fixed;left:0;right:0;top:0;bottom:calc(66px + env(safe-area-inset-bottom));z-index:900;padding:calc(16px + env(safe-area-inset-top)) 14px 0;background:var(--lp-bg);overflow:hidden;display:flex;flex-direction:column;gap:8px;opacity:0;transition:opacity .08s linear}
.lp-shim.in{opacity:1}
.lp-shim .lp-data-skeleton-card{flex:0 0 auto}
.lp-shim .lp-bar{height:30px;min-height:30px;width:42%;border-radius:10px;margin-bottom:6px}

/* ---- Press feedback for non-button tappables (uses `scale`, safe with existing transforms) ---- */
.lp-pressed{scale:.972;transition:scale .12s var(--lp-ease),background-color .12s;filter:brightness(1.07)}
[data-lp-tap]{transition:scale .3s var(--lp-spring)}

/* ---- Three-state buttons: loading / success / error (hooks into LuckyButtonStates) ---- */
button.lp-btn-state-success,button.lp-btn-state-error{display:inline-flex!important;align-items:center;justify-content:center;gap:6px}
button.lp-btn-state-success{background:linear-gradient(135deg,#1fb67d,var(--lp-ok))!important;color:#03140d!important;border-color:transparent!important;animation:lpPop .45s var(--lp-spring)}
button.lp-btn-state-error{background:linear-gradient(135deg,#d93a52,var(--lp-err))!important;color:#fff!important;border-color:transparent!important;animation:lpShake .42s ease}
button.lp-btn-state-success::before{content:"✓";font-weight:900;animation:lpPop .5s var(--lp-spring) .05s both}
button.lp-btn-state-error::before{content:"✕";font-weight:900}
@keyframes lpPop{0%{transform:scale(.92)}55%{transform:scale(1.06)}100%{transform:scale(1)}}
@keyframes lpShake{0%,100%{transform:translateX(0)}20%{transform:translateX(-5px)}40%{transform:translateX(5px)}60%{transform:translateX(-3px)}80%{transform:translateX(3px)}}

/* ---- Room: request popups above every layer, dialogs demoted while a popup is up ---- */
html body #voiceRoomFriendRequestOverlay.show,html body #voiceRoomFreeMicRequestOverlay.show{z-index:2147483640!important}
dialog.lp-demoted{z-index:2147483300!important}
dialog.lp-demoted-fix{position:fixed!important;inset:0!important;margin:auto!important}

/* ---- Network status pill ---- */
.lp-net{position:fixed;left:50%;top:calc(10px + env(safe-area-inset-top));z-index:2147483600;translate:-50% -140%;
  padding:8px 14px;border-radius:99px;font:700 12px/1 Inter,"PingFang SC","Microsoft YaHei",sans-serif;color:#fff;
  background:rgba(40,24,56,.92);border:1px solid rgba(255,255,255,.12);box-shadow:0 8px 24px rgba(0,0,0,.4);
  -webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);pointer-events:none;
  transition:translate .38s var(--lp-spring),background .25s}
.lp-net.show{translate:-50% 0}
.lp-net.ok{background:rgba(24,110,80,.92)}


/* ---- Upload ring (avatar / cover / room photo / DM image) ---- */
.lp-ring{position:absolute;inset:0;z-index:6;display:grid;place-items:center;background:rgba(8,5,12,.5);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);border-radius:inherit;pointer-events:none;animation:lpFade .18s ease both}
.lp-ring svg{grid-area:1/1;width:44px;height:44px;overflow:visible}
.lp-ring circle{fill:none;stroke-width:3.2}
.lp-ring .t{stroke:rgba(255,255,255,.22)}
.lp-ring .p{stroke:#fff;stroke-linecap:round;stroke-dasharray:113.1;stroke-dashoffset:113.1;transform:rotate(-90deg);transform-origin:22px 22px;transition:stroke .2s,stroke-dashoffset .25s ease}
.lp-ring .n{grid-area:1/1;font:800 11px/1 Inter,"PingFang SC",sans-serif;color:#fff;font-variant-numeric:tabular-nums;white-space:nowrap}
.lp-ring .n svg{display:block;width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.lp-ring.ok .p{stroke:var(--lp-ok)}.lp-ring.ok .n{color:var(--lp-ok);font-size:17px;animation:lpPop .45s var(--lp-spring)}
.lp-ring.bad{pointer-events:auto;cursor:pointer;background:rgba(60,10,20,.62)}
.lp-ring.bad .p{stroke:var(--lp-err);stroke-dashoffset:0}.lp-ring.bad .n{color:var(--lp-err);font-size:22px}
.private-image-uploading .lp-ring svg{width:34px;height:34px}
.private-image-uploading .private-image-spinner{display:none!important}
.private-image-retry{background:var(--lp-err)!important;color:#fff!important;border-color:transparent!important;animation:lpShake .42s ease}
.lp-xf{z-index:3;pointer-events:none;transition:opacity .55s ease;opacity:1}
.lp-sent-badge{position:absolute;right:6px;bottom:6px;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;background:var(--lp-ok);color:#03140d;animation:lpPop .45s var(--lp-spring) both,lpFade .3s ease 1.1s reverse forwards}
.lp-sent-badge svg{display:block;width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2.7;stroke-linecap:round;stroke-linejoin:round}

/* ---- Text bubble states ---- */
.lp-ghost{opacity:.82;transition:opacity .2s}.lp-ghost.failed{opacity:1}
.voice-chat-line.lp-ghost .voice-chat-avatar{width:32px;height:32px;min-width:32px;flex:0 0 32px;border-radius:50%;object-fit:cover;background:#15101c}
.lp-state{display:inline-flex;align-items:center;justify-content:center;gap:3px;margin:0;flex:0 0 auto;vertical-align:middle;color:var(--lp-muted)}
.lp-dots{width:22px;height:22px}
.lp-dots i{width:4px;height:4px;border-radius:50%;background:currentColor;animation:lpDot 1s infinite ease-in-out}
.lp-dots i:nth-child(2){animation-delay:.15s}.lp-dots i:nth-child(3){animation-delay:.3s}
@keyframes lpDot{0%,80%,100%{opacity:.25;scale:.8}40%{opacity:1;scale:1.15}}
.lp-bang{display:grid!important;place-items:center!important;width:22px;height:22px;min-width:22px;border-radius:50%;border:0;padding:0;margin:0;background:var(--lp-err);color:#fff;cursor:pointer;animation:lpShake .42s ease}.lp-bang svg,.voice-chat-send-retry svg{display:block;width:14px;height:14px;overflow:visible;fill:none;stroke:currentColor;stroke-width:2.7;stroke-linecap:round;stroke-linejoin:round}.lp-bang svg circle,.voice-chat-send-retry svg circle{fill:currentColor;stroke:none}
/* Room-photo upload state: the preview, progress ring and percentage live inside the actual chat bubble. */
.voice-chat-line.voice-chat-local-photo-uploading,.voice-chat-line.voice-chat-local-photo-failed{align-items:center;min-width:0;max-width:100%;box-sizing:border-box}
.voice-chat-line.voice-chat-local-photo-failed .voice-chat-content{flex:0 1 auto;max-width:calc(100% - 39px);min-width:0}
.voice-chat-photo-row{display:flex;align-items:center;gap:7px;min-width:0;width:fit-content;max-width:100%}
.voice-chat-room-image{position:relative!important;overflow:hidden!important;max-width:min(150px,42vw)!important}
.voice-photo-upload-overlay{position:absolute;inset:0;z-index:3;display:grid;place-items:center;background:rgba(8,5,12,.48);pointer-events:none}
.voice-photo-upload-overlay svg{grid-area:1/1;width:44px;height:44px;overflow:visible}
.voice-photo-upload-overlay circle{fill:none;stroke-width:3.2}
.voice-photo-upload-track{stroke:rgba(255,255,255,.24)}
.voice-photo-upload-progress{stroke:#fff;stroke-linecap:round;stroke-dasharray:113.1;stroke-dashoffset:113.1;transform:rotate(-90deg);transform-origin:22px 22px;transition:stroke-dashoffset .2s ease}
.voice-photo-upload-number{grid-area:1/1;color:#fff;font:800 10px/1 Inter,"PingFang SC",sans-serif;font-variant-numeric:tabular-nums;white-space:nowrap}
.voice-photo-upload-number svg{display:block;width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.voice-photo-upload-overlay.is-success .voice-photo-upload-number{color:#58dda7}
.voice-chat-send-retry{display:grid;place-items:center;align-self:center;flex:0 0 22px;width:22px;height:22px;min-width:22px;padding:0;border:0;border-radius:50%;background:var(--lp-err);color:#fff;cursor:pointer;animation:lpShake .42s ease}
.voice-chat-send-retry:focus-visible,.lp-bang:focus-visible{outline:2px solid #fff;outline-offset:2px}
.lp-pop{animation:lpMsgPop .34s var(--lp-spring) both}
@keyframes lpMsgPop{from{opacity:.0;translate:0 8px;scale:.96}}
.lp-shake{animation:lpShake .42s ease}

/* ---- Pending bubble = the REAL bubble layout; the status icon hangs outside it (absolute), so it never changes wrapping ---- */
.voice-chat-ghost-message-row{display:block;position:relative;width:fit-content;max-width:100%;min-width:0}
.voice-chat-ghost-message-row>.lp-state{position:absolute;left:calc(100% + 7px);top:50%;translate:0 -50%;width:22px;height:22px;margin:0}
.voice-chat-ghost-message-row.lp-state-in>.lp-state{left:auto;right:-7px;top:auto;bottom:-9px;translate:none}
.voice-chat-line.lp-ghost .voice-chat-content>b{display:inline-block;width:fit-content;max-width:100%}
.private-message-row.mine.lp-ghost .private-message-bubble{position:relative}
.private-message-row.mine.lp-ghost .private-message-bubble>.lp-state{position:absolute;right:calc(100% + 7px);top:50%;translate:0 -50%;width:22px;height:22px;margin:0}
.private-message-row.mine.lp-ghost .private-message-bubble.lp-state-in>.lp-state{right:auto;left:-7px;top:auto;bottom:-9px;translate:none}

/* ---- Sending dots: ALWAYS a horizontal row (the room row sets .lp-state to grid, which stacked them vertically) ---- */
.lp-state.lp-dots,.voice-chat-ghost-message-row>.lp-state.lp-dots,.private-message-row.mine.lp-ghost>.lp-state.lp-dots{display:inline-flex!important;flex-direction:row!important;align-items:center;justify-content:center;gap:3px;width:22px;height:22px}
.lp-state.lp-dots i{flex:0 0 auto;display:block}

/* ---- Room cover tile while uploading: new image shown, ring on top, no label/spinner swap ---- */
.voice-room-cover-preview-btn.lp-cover-uploading,.voice-room-cover-preview-btn.lp-cover-uploading:disabled{opacity:1!important;pointer-events:none}
.voice-room-cover-preview-btn.lp-cover-uploading>span:not(.lp-ring){opacity:0!important}
.lp-ring.lp-ring-out{animation:lpRingOut .2s ease forwards}
@keyframes lpRingOut{to{opacity:0}}

/* ---- Long-press copy ---- */
.voice-chat-text-body,.private-message-bubble{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
.lp-copy{position:fixed;z-index:2147483645;translate:-50% 0;padding:9px 16px;border:0;border-radius:12px;background:#241a31;color:#fff;font:700 13px/1 Inter,"PingFang SC",sans-serif;box-shadow:0 8px 24px rgba(0,0,0,.45),inset 0 0 0 1px rgba(255,255,255,.1);animation:lpMsgPop .22s var(--lp-spring) both}
.lp-copy.ok{background:#14543f}.lp-copy.bad{background:#6b1f2b}

@media(prefers-reduced-motion:reduce){
  .lp-rise,html.lp-no-vt body,button.lp-btn-state-success,button.lp-btn-state-error,button.lp-btn-state-success::before{animation:none}
  nav.lp-nav-ready::before,.lp-net,[data-lp-tap]{transition:none}
  nav.lp-jelly::before,nav a.lp-arrive svg,.lp-pop,.lp-ring,.lp-copy{animation:none}
}
