:root {
    color-scheme: dark;
    --bg-main: #08030c;
    --text-main: #f5f0f5;
    --text-sub: #a395af;
    --text-light-sub: #c4b8cb;
    --text-dim: #7a6a85;
    --text-white: #ffffff;
    --btn-text: #1a0b2e;
    --theme-pink-mid: #ffe066;
    --theme-pink-light: #e0aaff;
    --theme-pink-a24: rgba(199, 125, 255, 0.24);
    --theme-pink-a40: rgba(255, 224, 102, 0.4);
    --grad: linear-gradient(135deg, #e0aaff, #9d4edd) !important;
    --btn-grad: linear-gradient(180deg, #fff3b0, #f5c518) !important;

    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --spring-strong: cubic-bezier(0.68, -0.55, 0.27, 1.55);
    --ease-enter: cubic-bezier(0.32, 0.72, 0, 1);
    --ease-exit: cubic-bezier(0.25, 1, 0.5, 1);

    --glass-blur: 20px;
    --glass-sat: 180%;
    --glass-bg: rgba(22, 14, 38, 0.55);
    --glass-bg-deep: rgba(18, 10, 30, 0.72);
    --glass-border: rgba(255, 255, 255, 0.16);
    --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.35),
                       inset 0 -1px 0 rgba(0, 0, 0, 0.38);
    --glass-shadow: 0 16px 48px rgba(0, 0, 0, 0.45),
                    0 4px 12px rgba(0, 0, 0, 0.3);

    --lgb: rgba(255, 230, 150, 0.18);
    --lgbs: rgba(255, 230, 150, 0.08);
    --lgh: rgba(255, 230, 150, 0.25);
    --white-a5: rgba(255, 255, 255, 0.05);
    --white-a18: rgba(255, 255, 255, 0.18);
    --white-a25: rgba(255, 255, 255, 0.25);
    --lgr: 26px;
    --mask-bg: rgba(8, 3, 15, 0.55);
    --fire: linear-gradient(135deg, #ff9a3c, #ff5c5c);
    --rec: linear-gradient(135deg, #3b82f6, #6366f1);
    --qual: linear-gradient(135deg, #a855f7, #7c3aed);
    --tag-shadow: 0 4px 12px rgba(50, 10, 80, 0.32);
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    -webkit-user-select: none; -webkit-touch-callout: none; user-select: none;
    -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale; touch-action: manipulation;
}

html, body {
    width: 100%; min-height: 100vh;
    overflow-x: hidden; overscroll-behavior-y: contain;
}
body {
    background: radial-gradient(120% 90% at 15% -10%, rgba(120, 40, 200, 0.12) 0, transparent 55%),
                radial-gradient(90% 70% at 100% 0, rgba(90, 30, 180, 0.08) 0, transparent 50%),
                var(--bg-main) !important;
    color: var(--text-main) !important;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0)) !important;
}

button { -webkit-appearance: none; appearance: none; border: none; background: none; font-family: inherit; }
img {
    -webkit-user-drag: none; user-drag: none; pointer-events: none;
    max-width: 100%; height: auto; backface-visibility: hidden; object-fit: cover;
}
*:focus { outline: none; }

body:not(.ui-ready) .top-nav,
body:not(.ui-ready) .bottom-nav,
body:not(.ui-ready) .page,
body:not(.ui-ready) #rain-container,
body:not(.ui-ready) .modal-mask,
body:not(.ui-ready) .toast-pill {
    visibility: hidden !important; opacity: 0 !important; pointer-events: none !important;
}

#app > .page { position: relative; z-index: 1; }

@keyframes fallDown {
    0% { transform: translate3d(0, -20vh, 0) rotate(var(--start-rot)); opacity: 0; }
    15% { opacity: 1; }
    85% { opacity: 1; }
    100% { transform: translate3d(0, 120vh, 0) rotate(calc(var(--start-rot) + 360deg)); opacity: 0; }
}
@keyframes themeCycle {
    0% { color: #ffe066; } 25% { color: #e0aaff; } 50% { color: #ff9a3c; }
    75% { color: #9d4edd; } 100% { color: #ffe066; }
}
@keyframes themeBgCycle {
    0% { background-color: #ffe066; } 25% { background-color: #e0aaff; }
    50% { background-color: #ff9a3c; } 75% { background-color: #9d4edd; }
    100% { background-color: #ffe066; }
}
@keyframes themeFlow {
    0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; }
}
@keyframes flowGrad {
    0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; }
}
@keyframes prePulse {
    0%, 100% { transform: scale(1); opacity: 0.92; }
    50% { transform: scale(1.08); opacity: 1; }
}

@keyframes cardPopIn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#rain-container {
    position: fixed; inset: 0; z-index: 0;
    pointer-events: none; overflow: hidden; filter: opacity(0.35);
}
.drop { position: absolute; top: -20vh; will-change: transform, opacity; animation: fallDown linear infinite; opacity: 0; }
.drop img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 20%; }

.top-nav {
    position: fixed !important; top: max(8px, env(safe-area-inset-top)) !important;
    left: 12px !important; right: 12px !important; height: 56px !important;
    border-radius: 22px !important; padding: 0 16px !important;
    display: flex !important; align-items: center !important;
    justify-content: space-between !important; overflow: hidden !important;
    z-index: 100 !important;
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-highlight), var(--glass-shadow) !important;
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) !important;
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) !important;
}
.brand {
    display: flex; align-items: center; gap: 8px;
    font-size: 17px; font-weight: 700; letter-spacing: 0.5px;
    flex: 1; height: 56px; overflow: hidden;
}
.top-nav .brand span { display: none !important; }
.brand-logo {
    width: 170px; height: 170px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: transparent !important; box-shadow: none !important; border: none !important;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }

.bottom-nav {
    position: fixed !important;
    left: 12px !important; right: 12px !important;
    bottom: max(12px, env(safe-area-inset-bottom)) !important;
    height: 64px !important; padding: 0 12px !important;
    display: flex !important;
    align-items: flex-end !important;
    justify-content: space-around !important;
    overflow: visible !important;
    z-index: 100 !important;
    box-sizing: border-box !important;
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 28px !important;
    box-shadow: var(--glass-highlight), var(--glass-shadow) !important;
    -webkit-backdrop-filter: blur(24px) saturate(200%) !important;
    backdrop-filter: blur(24px) saturate(200%) !important;
}

.liquid-indicator {
    position: absolute;
    bottom: 10px;
    left: 50%;
    width: 28px;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ffe066, #e0aaff, #ff9a3c, #9d4edd, #ffe066);
    background-size: 300% 100%;
    animation: themeFlow 6s linear infinite;
    box-shadow: 0 0 10px rgba(255, 224, 102, 0.6), 0 0 20px rgba(157, 78, 221, 0.4);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition: left 420ms var(--spring), width 420ms var(--spring), opacity 200ms ease;
}

.nav-item {
    flex: 1 !important; height: 100% !important;
    display: flex !important; flex-direction: column !important;
    align-items: center !important; justify-content: flex-end !important;
    padding: 0 0 16px 0 !important;
    position: relative !important;
    color: var(--text-sub) !important;
    cursor: pointer !important;
    overflow: visible !important;
    -webkit-tap-highlight-color: transparent;
    transition: transform 120ms linear;
}
.nav-item:active { transform: scale(0.94); }

.nav-wrap {
    position: absolute !important; top: -18px !important; left: 50% !important;
    transform: translateX(-50%) !important;
    width: 48px !important; height: 48px !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    z-index: 2 !important;
    transition: transform 350ms var(--spring) !important;
}
.nav-item.active .nav-wrap { transform: translateX(-50%) translateY(-4px) scale(1.08) !important; }
.nav-wrap img {
    width: 100% !important; height: 100% !important; object-fit: contain !important;
    display: block !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)) !important;
    transition: filter 300ms ease !important;
}
.nav-item.active .nav-wrap img { filter: drop-shadow(0 0 8px rgba(255, 224, 102, 0.5)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)) !important; }

.nav-txt {
    position: relative !important;
    font-size: 14px !important; color: var(--text-dim); margin: 0 !important;
    line-height: 1 !important; text-align: center !important;
    transition: all 300ms var(--spring) !important;
    z-index: 1 !important;
}
.nav-item.active .nav-txt {
    color: var(--text-white);
    transform: translateY(-3px) !important;
    animation: themeCycle 6s linear infinite;
}

.nav-item::after { display: none !important; }

.nav-item.nav-disabled { cursor: not-allowed !important; }
.nav-item.nav-disabled .nav-wrap { filter: grayscale(1) !important; opacity: 0.45 !important; }
.nav-item.nav-disabled .nav-txt { color: #5a5463 !important; }
.nav-badge {
    position: absolute !important; top: 6px !important; left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 9px !important; line-height: 1 !important; font-weight: 700 !important;
    padding: 3px 5px !important; border-radius: 6px !important;
    background: rgba(50, 50, 60, 0.82) !important; color: #f0edf3 !important;
    border: 1px solid rgba(255, 255, 255, 0.20) !important;
    z-index: 3 !important; white-space: nowrap !important; pointer-events: none !important;
}

.page { display: none; padding-top: 72px; }
.page.active { display: block; }
.container { padding: 0 16px; }

.banner {
    display: block; width: 100%; border-radius: 28px !important;
    overflow: hidden; margin-bottom: 14px;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-highlight), var(--glass-shadow) !important;
}
.banner img { width: 100%; display: block; border-radius: 28px !important; }

.marquee {
    display: flex; align-items: center; height: 38px;
    overflow: hidden; margin-bottom: 18px; border-radius: 14px !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-highlight) !important;
}
.marquee-cut { flex: 0 0 40px; height: 100%; background: var(--grad) !important; display: flex; align-items: center; justify-content: center; }
.mic { width: 16px; height: 16px; fill: none; stroke: var(--text-white); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.marquee-body {
    flex: 1; overflow: hidden; height: 100%; position: relative;
    background: var(--glass-bg) !important;
    backdrop-filter: blur(12px) !important; -webkit-backdrop-filter: blur(12px) !important;
}
#marqueeTrack { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; white-space: nowrap; font-size: 16px; font-weight: 700; }
#marqueeTrack span {
    display: inline-block;
    background: linear-gradient(90deg, #ffe066, #e0aaff, #ff9a3c, #9d4edd, #ffe066);
    background-size: 300% 100%;
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: themeFlow 6s linear infinite;
}

.sec-title {
    text-align: center; font-size: 23px !important; font-weight: 800 !important;
    letter-spacing: 1.2px !important; margin: 6px 0 20px;
}
.sec-title::after {
    content: ""; display: block; width: 56px; height: 2px; border-radius: 2px;
    background: var(--grad) !important;
    box-shadow: 0 0 12px var(--theme-pink-a40), 0 0 24px rgba(255, 224, 102, 0.18) !important;
    margin: 8px auto 0;
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.pcard, .dcard, .tcard, .test-content, .modal-box {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--lgr) !important;
    box-shadow: var(--glass-highlight), var(--glass-shadow) !important;
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) !important;
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) !important;
    transition: transform 120ms linear, box-shadow 200ms ease, filter 200ms ease;
    will-change: transform;
    -webkit-tap-highlight-color: transparent;
}

.pcard:active, .tcard:active, .dcard:active, .contact-item:active {
    transform: scale(0.96) !important;
    box-shadow: var(--glass-highlight), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    transition: transform 100ms linear, box-shadow 100ms linear;
}

.pcard:not(:active), .tcard:not(:active), .dcard:not(:active), .contact-item:not(:active) {
    transition: transform 400ms var(--spring), box-shadow 400ms var(--spring), filter 300ms ease;
}

.pcard.pressed, .tcard.pressed, .dcard.pressed, .contact-item.pressed {
    box-shadow: var(--glass-highlight),
                0 0 0 4px rgba(255, 224, 102, 0.15),
                0 0 24px rgba(157, 78, 221, 0.3),
                var(--glass-shadow) !important;
}

.pcard .plogo, .pcard .pname,
.tcard .tic, .tcard .tn,
.dcard .d-icon, .dcard .dinfo {
    transition: transform 300ms var(--spring);
}
.pcard:active .plogo, .pcard:active .pname,
.tcard:active .tic, .tcard:active .tn,
.dcard:active .d-icon, .dcard:active .dinfo {
    transform: scale(1.04);
}

.pcard { padding: 22px 14px 16px; display: flex; flex-direction: column; align-items: center; position: relative; }
.tag {
    position: absolute; top: -10px; right: 8px;
    color: var(--text-white); font-size: 11px; font-weight: 700;
    padding: 4px 12px; border-radius: 999px !important; z-index: 5;
    border: 1px solid var(--lgh) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), var(--tag-shadow) !important;
}
.tag-fire { background: var(--fire); }
.tag-rec { background: var(--rec); }
.tag-qual { background: var(--qual); }
.tag-green { background: linear-gradient(135deg, #06d6a0, #0aa5c4); }

.plogo, .tic {
    border-radius: 20px !important;
    background: linear-gradient(180deg, rgba(255, 224, 102, 0.10), rgba(255, 255, 255, 0.03)) !important;
    border: 1px solid rgba(255, 224, 102, 0.16) !important;
    box-shadow: inset 0 1px 0 var(--white-a18), 0 4px 14px rgba(10, 3, 18, 0.18) !important;
    overflow: hidden; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.plogo { width: 60px; height: 60px; margin-bottom: 10px; }
.plogo img, .tic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pname { font-size: 15px; margin-bottom: 14px; font-weight: 650 !important; }

.pbtn, .modal-ok {
    border-radius: 999px !important;
    background: var(--btn-grad) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44), inset 0 -2px 6px rgba(80, 15, 40, 0.24), 0 8px 22px var(--theme-pink-a24) !important;
    color: var(--btn-text) !important; font-weight: 650 !important; cursor: pointer;
    position: relative !important; overflow: hidden !important;
    transition: transform 120ms linear, box-shadow 120ms linear;
    will-change: transform;
}
.pbtn { width: 100%; padding: 9px; font-size: 14px; }
.modal-ok { width: 100%; padding: 13px; font-size: 15px; }
.pbtn:active, .modal-ok:active { transform: scale(0.94) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 2px 6px rgba(0, 0, 0, 0.2) !important; transition: transform 80ms linear, box-shadow 80ms linear; }
.pbtn:not(:active), .modal-ok:not(:active) { transition: transform 350ms var(--spring), box-shadow 350ms var(--spring); }
.pbtn::after, .modal-ok::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.4) 45%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}
.pbtn:active::after, .modal-ok:active::after { transform: translateX(120%); }

.dgrid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.dcard {
    padding: 16px 18px; display: flex; flex-direction: row; align-items: center; gap: 14px;
    cursor: pointer; position: relative; overflow: hidden; min-height: 96px !important;
    border-radius: 22px !important;
}
.dcard.maintenance { filter: grayscale(1) opacity(0.55) !important; cursor: not-allowed !important; }
.dcard.maintenance:active { transform: none !important; }
.dcard.maintenance .d-enter { display: none !important; }
.dcard.maintenance .dt { display: flex !important; align-items: center !important; gap: 8px !important; }
.maint-badge {
    display: inline-flex !important; align-items: center !important; flex-shrink: 0 !important;
    font-size: 11px !important; font-weight: 700 !important; line-height: 1 !important;
    padding: 3px 8px !important; border-radius: 999px !important;
    background: rgba(170, 170, 180, 0.22) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important; color: #e6e2ea !important;
}
.dcard-top { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 64px; }
.d-icon { width: 42px; height: 42px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.d-icon img { width: 32px; height: 32px; object-fit: contain; display: block; filter: drop-shadow(0 0 6px rgba(255, 224, 102, 0.35)); }
.dinfo { flex: 1; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding-left: 6px; gap: 6px; min-width: 0; }
.dt { font-size: 16px; font-weight: 650 !important; line-height: 1.2; }
.d-sub { font-size: 12px; color: var(--text-dim) !important; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.d-enter { flex-shrink: 0; font-size: 22px; color: var(--theme-pink-mid) !important; font-weight: 600; line-height: 1; transition: transform 200ms var(--spring); }
.dcard:active .d-enter { transform: translateX(4px); }

.tgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tcard { padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; }
.tic { width: 52px; height: 52px; }
.tn { font-size: 14px; font-weight: 500; color: var(--text-white); }
.pnote { margin-top: 10px; font-size: 11px; line-height: 1.5; color: var(--text-dim); text-align: center; letter-spacing: 0.2px; padding: 0 2px; opacity: 0.85; }

.test-content {
    padding: 40px 28px; min-height: 420px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 18px; position: relative;
}
.close-btn, .modal-close {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: all 200ms var(--spring);
    position: absolute; top: 14px; right: 14px;
    -webkit-backdrop-filter: blur(12px) !important; backdrop-filter: blur(12px) !important;
}
.close-btn:active, .modal-close:active { transform: scale(0.85); background: var(--white-a25) !important; }
.close-btn svg, .modal-close svg { width: 16px; height: 16px; stroke: var(--text-white); stroke-width: 2.5; fill: none; stroke-linecap: round; }
#testBody { display: none; flex-direction: column; align-items: center; gap: 12px; padding: 0 8px; }
#testBody p { font-size: 22px; color: var(--text-sub); line-height: 1.8; max-width: 320px; white-space: pre-line; }

.modal-mask {
    position: fixed; inset: 0; background: var(--mask-bg) !important;
    -webkit-backdrop-filter: blur(10px) saturate(120%) !important;
    backdrop-filter: blur(10px) saturate(120%) !important;
    display: flex; align-items: center; justify-content: center; padding: 32px;
    opacity: 0; pointer-events: none;
    transition: opacity 280ms var(--ease-enter);
    z-index: 2000;
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal-box {
    max-width: 420px; width: 100%; padding: 36px 28px 28px;
    text-align: center; position: relative;
    background: var(--glass-bg-deep) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 28px !important;
    box-shadow: var(--glass-highlight), var(--glass-shadow) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
    backdrop-filter: blur(28px) saturate(180%) !important;
    transform: scale(0.85); opacity: 0;
    transition: transform 450ms var(--spring), opacity 300ms var(--ease-enter);
}
.modal-mask.show .modal-box { transform: scale(1); opacity: 1; }
.modal-box h3 { font-size: 20px; margin-bottom: 12px; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.modal-box p { font-size: 14px; color: var(--text-sub); line-height: 1.7; margin-bottom: 24px; }

#entryModal { z-index: 10000 !important; }
#entryModal .modal-box { padding: 0 0 28px 0 !important; overflow: hidden !important; }
#entryModal .modal-ad { width: 100%; margin-bottom: 20px; line-height: 0; }
#entryModal .modal-ad img { width: 100%; display: block; }
#entryModal .modal-box h3 { margin: 0 28px 12px !important; }
#entryModal .modal-box p { margin: 0 28px 24px !important; font-size: 16px !important; line-height: 1.8 !important; color: var(--text-light-sub) !important; }
#entryModal .modal-ok { width: calc(100% - 56px) !important; margin: 0 28px !important; border-radius: 14px !important; padding: 14px !important; background: var(--grad) !important; color: var(--text-white) !important; }

.toast-pill {
    position: fixed; left: 50%; top: 50%;
    transform: translateX(-50%) translateY(calc(-50% + 44px)) scale(0.8);
    background: var(--glass-bg-deep) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-highlight), 0 14px 36px rgba(10, 3, 18, 0.46) !important;
    border-radius: 999px !important;
    color: var(--text-white); font-size: 14px; font-weight: 500;
    padding: 12px 28px; z-index: 5000;
    opacity: 0; pointer-events: none;
    transition: transform 550ms var(--spring), opacity 350ms var(--ease-enter);
    white-space: nowrap;
    -webkit-backdrop-filter: blur(18px) saturate(160%) !important;
    backdrop-filter: blur(18px) saturate(160%) !important;
}
.toast-pill.show { transform: translateX(-50%) translateY(-50%) scale(1); opacity: 1; }

.stg { opacity: 0; }
.stg.animate {
    animation: cardPopIn 420ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.stg.stg-ready { opacity: 1; }

@media (max-width: 380px) {
    body .top-nav { left: 8px !important; right: 8px !important; }
    body .bottom-nav { left: 8px !important; right: 8px !important; bottom: max(8px, env(safe-area-inset-bottom)) !important; }
}
@media (min-width: 720px) {
    body .container { max-width: 520px; margin-left: auto; margin-right: auto; }
    body .top-nav { left: 50% !important; right: auto !important; width: min(520px, calc(100% - 24px)) !important; transform: translateX(-50%) !important; }
    body .bottom-nav { left: 50% !important; right: auto !important; width: min(520px, calc(100% - 24px)) !important; transform: translateX(-50%) !important; }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body .top-nav, body .bottom-nav, body .modal-box, body .toast-pill,
    body .pcard, body .dcard, body .tcard, body .test-content {
        background: rgba(18, 10, 30, 0.96) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    #rain-container { display: none !important; }
    .stg { opacity: 1 !important; transform: none !important; animation: none !important; }
    .liquid-indicator { transition: none !important; }
}

.float-contact-btn {
    position: fixed !important; right: 16px !important;
    bottom: calc(112px + env(safe-area-inset-bottom, 0)) !important;
    width: 56px !important; height: 56px !important; border-radius: 50% !important;
    background: var(--glass-bg-deep) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-highlight), 0 8px 24px rgba(0, 0, 0, 0.5) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    z-index: 99 !important;
    display: flex !important; align-items: center !important; justify-content: center !important;
    cursor: pointer !important;
    transition: transform 200ms var(--spring), opacity 200ms ease !important;
}
.float-contact-btn:active { transform: scale(0.85) !important; opacity: 0.8 !important; }
.float-contact-icon { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; pointer-events: none; }

.contact-panel {
    max-width: 460px !important; padding: 0 !important;
    background: var(--glass-bg-deep) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 24px !important; overflow: hidden !important;
    margin-bottom: 80px !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
    backdrop-filter: blur(28px) saturate(180%) !important;
}
.contact-header {
    display: flex !important; align-items: center !important;
    justify-content: space-between !important; padding: 28px 20px !important;
    border-bottom: 1px solid var(--lgbs) !important;
}
.contact-header-left { display: flex !important; align-items: center !important; gap: 12px !important; }
.contact-header-icon { width: 48px !important; height: 48px !important; border-radius: 50% !important; }
.contact-header-text { text-align: left !important; }
.contact-header-text h3 { font-size: 19px !important; font-weight: 700 !important; color: var(--text-white) !important; margin: 0 0 4px !important; -webkit-text-fill-color: var(--text-white) !important; background: none !important; }
.contact-header-text p { font-size: 12px !important; color: var(--text-sub) !important; margin: 0 !important; }
.contact-header .modal-close { position: relative !important; top: auto !important; right: auto !important; width: 36px !important; height: 36px !important; }
.contact-list-title { padding: 24px 20px 12px !important; font-size: 12px !important; color: var(--text-sub) !important; text-align: left !important; }
.contact-list { padding: 0 20px 36px 20px !important; display: flex !important; flex-direction: column !important; gap: 18px !important; }
.contact-item {
    display: flex !important; align-items: center !important; gap: 16px !important;
    padding: 22px 18px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 16px !important;
    box-shadow: var(--glass-highlight) !important;
    cursor: pointer !important;
    transition: transform 120ms linear, box-shadow 200ms ease;
}
.contact-item:active { transform: scale(0.97) !important; }
.contact-item:not(:active) { transition: transform 380ms var(--spring), box-shadow 380ms var(--spring); }
.contact-item-icon { width: 48px !important; height: 48px !important; flex-shrink: 0 !important; }
.contact-item-info { flex: 1 !important; min-width: 0 !important; text-align: left !important; }
.contact-item-name { font-size: 15px !important; font-weight: 600 !important; color: var(--text-white) !important; display: flex !important; align-items: center !important; gap: 6px !important; margin-bottom: 4px !important; }
.status-dot { width: 6px !important; height: 6px !important; border-radius: 50% !important; background: #06d6a0 !important; box-shadow: 0 0 6px #06d6a0 !important; display: inline-block !important; }
.contact-item-id { font-size: 13px !important; color: var(--text-sub) !important; margin-bottom: 4px !important; }
.contact-item-desc { font-size: 12px !important; color: rgba(255, 255, 255, 0.3) !important; }
.contact-item-btn.copy-btn {
    flex-shrink: 0 !important; padding: 6px 14px !important;
    border-radius: 999px !important;
    background: var(--btn-grad) !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44) !important;
    color: var(--btn-text) !important; font-size: 13px !important; font-weight: 650 !important;
    cursor: pointer !important;
    transition: transform 120ms linear !important;
}
.contact-item-btn.copy-btn:active { transform: scale(0.92) !important; }
.contact-item-btn.copy-btn:not(:active) { transition: transform 350ms var(--spring) !important; }

#preloader {
    position: fixed; inset: 0; z-index: 99999;
    display: grid; place-items: center;
    background: radial-gradient(120% 90% at 50% 0, rgba(120, 40, 200, 0.18), transparent 60%), #08030c;
    transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1);
    will-change: transform;
}
#preloader.is-done { transform: translateY(-100%); pointer-events: none; }

.term-shell {
    width: min(560px, calc(100vw - 32px));
    height: clamp(420px, 68svh, 760px);
    display: flex; flex-direction: column;
    border-radius: 22px; overflow: hidden;
    background: rgba(10, 5, 18, 0.82);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-highlight), var(--glass-shadow);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
#preloader.is-done .term-shell {
    opacity: 0;
    transform: translateY(-14px) scale(0.98);
}

.term-bar {
    position: relative; flex-shrink: 0; height: 48px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 14px; overflow: hidden;
}
.term-bar .brand {
    display: flex; gap: 0.05em;
    font-size: 15px; font-weight: 800; letter-spacing: 0.24em; line-height: 1;
    white-space: nowrap;
}
.term-bar .brand span {
    display: inline-block;
    background: linear-gradient(180deg, #ffffff, #e0aaff 60%, #9d4edd);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0; transform: translateY(8px) rotate(4deg);
    animation: termLetterIn 0.6s cubic-bezier(0.2, 0.9, 0.25, 1) forwards;
}
.term-bar .brand span:nth-child(1) { animation-delay: 0.00s; }
.term-bar .brand span:nth-child(2) { animation-delay: 0.05s; }
.term-bar .brand span:nth-child(3) { animation-delay: 0.10s; }
.term-bar .brand span:nth-child(4) { animation-delay: 0.15s; }
.term-bar .brand span:nth-child(5) { animation-delay: 0.20s; }
.term-bar .brand span:nth-child(6) { animation-delay: 0.25s; }
.term-bar .brand span:nth-child(7) { animation-delay: 0.30s; }
@keyframes termLetterIn { to { opacity: 1; transform: none; } }

.rule {
    flex-shrink: 0; height: 12px; overflow: hidden; white-space: nowrap;
    padding: 0 16px;
    font-family: ui-monospace, Menlo, Monaco, Consolas, monospace;
    font-size: 11px; line-height: 12px; letter-spacing: 3px;
    color: rgba(224, 170, 255, 0.20);
    -webkit-mask-image: linear-gradient(90deg, #000 72%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 72%, transparent 100%);
}
.rule::before {
    content: "==============================================================================================================";
}

.term-body {
    flex: 1; min-height: 0; overflow-y: auto;
    padding: 10px 18px;
    font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12.5px; line-height: 2;
    color: #b3a4c4;
    scrollbar-width: none; -ms-overflow-style: none;
}
.term-body::-webkit-scrollbar { display: none; }

.log-line {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    opacity: 0; transform: translateY(5px);
    animation: logIn 0.35s ease forwards;
}
.log-line .lg-tag { color: #e0aaff; margin-right: 6px; }
.log-line .ok     { color: #6ee7b7; }
.log-line .warn   { color: #ffe066; }
@keyframes logIn { to { opacity: 1; transform: none; } }

.steps {
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    gap: 12px; padding: 12px 16px;
    font-size: 13.5px; letter-spacing: 0.5px;
}
.step { color: rgba(255, 255, 255, 0.20); transition: color 0.4s ease, text-shadow 0.4s ease; }
.step.done { color: rgba(224, 170, 255, 0.55); }
.step.active {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(224, 170, 255, 0.85), 0 0 22px rgba(157, 78, 221, 0.5);
}
.sep { color: rgba(255, 255, 255, 0.12); font-size: 12px; letter-spacing: 1px; }

.foot { flex-shrink: 0; display: flex; align-items: center; gap: 14px; padding: 14px 18px 18px; }
.meter {
    flex: 1; height: 4px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(0, 0, 0, 0.4);
    overflow: hidden;
}
.meter i {
    display: block; width: 100%; height: 100%; border-radius: 999px;
    background: linear-gradient(90deg, #9d4edd, #e0aaff);
    box-shadow: 0 0 10px rgba(157, 78, 221, 0.6), 0 0 20px rgba(224, 170, 255, 0.28);
    transform: scaleX(0); transform-origin: left center;
    will-change: transform;
}
.pct {
    min-width: 44px; text-align: right;
    font-size: 12px; font-weight: 700; letter-spacing: 2px;
    color: var(--text-light-sub);
    font-variant-numeric: tabular-nums;
}

@media (prefers-reduced-motion: reduce) {
    .term-bar .brand span { animation: none; opacity: 1; transform: none; }
    #preloader { transition-duration: 0.01ms; }
}

.tool-tabs {
    display: flex !important; gap: 8px !important; margin: 0 0 22px !important;
    padding: 5px !important;
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 999px !important;
    box-shadow: var(--glass-highlight), 0 6px 20px rgba(10, 3, 18, 0.26) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    backdrop-filter: blur(16px) !important;
}
.tool-tab {
    flex: 1 !important; text-align: center !important; padding: 10px 0 !important;
    border-radius: 999px !important; font-size: 14px !important; font-weight: 650 !important;
    letter-spacing: 1px !important; color: var(--text-dim) !important;
    cursor: pointer !important; background: transparent !important; border: none !important;
    transition: color 250ms var(--spring), box-shadow 250ms var(--spring), transform 120ms linear;
}
.tool-tab:active { transform: scale(0.95); }
.tool-tab.active {
    color: var(--btn-text) !important;
    background: linear-gradient(90deg, #ffe066, #e0aaff, #ff9a3c, #9d4edd, #ffe066) !important;
    background-size: 300% 100% !important;
    animation: themeFlow 6s linear infinite;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44), 0 6px 16px var(--theme-pink-a24) !important;
    transition: color 300ms var(--spring), box-shadow 300ms var(--spring);
}
.tool-panel { display: none !important; }
.tool-panel.active { display: block !important; }

.info-card {
    background: var(--glass-bg) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--lgr) !important;
    box-shadow: var(--glass-highlight), var(--glass-shadow) !important;
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) !important;
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat)) !important;
    padding: 0 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 0;
    border-bottom: 1px solid var(--white-a18);
    transition: background 200ms ease;
}
.info-row:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-sub);
    font-size: 15px;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.info-value {
    color: var(--text-white);
    font-size: 15px;
    font-weight: 500;
    text-align: right;
    flex-grow: 1;
    word-break: break-all;
    line-height: 1.4;
    padding-left: 20px;
    transition: opacity 200ms ease;
}

.info-row.clickable, .info-value.clickable { cursor: pointer; }
.info-row.clickable:active, .info-value.clickable:active { opacity: 0.6; }
.info-row.clickable:active { background: rgba(255, 255, 255, 0.03); }