/* =========================================================================
   Zero Tools — visual layer
   Loaded after style.css. Retints the panel to a violet/noir palette and
   adds the animated marketing chrome used on the landing page.
   ========================================================================= */

/* ---------------------------------------------------------------- ambiance */
body {
    background:
        radial-gradient(1100px 640px at 50% -14%, rgba(139, 92, 246, .30), transparent 62%),
        radial-gradient(900px 620px at 88% 6%, rgba(88, 28, 135, .38), transparent 66%),
        radial-gradient(760px 520px at 4% 28%, rgba(59, 7, 100, .40), transparent 70%),
        var(--bg);
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(139, 92, 246, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, .055) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 78%);
    opacity: .9;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: radial-gradient(60% 45% at 50% 110%, rgba(139, 92, 246, .16), transparent 70%);
}

.nav,
.page,
.admin-layout,
.landing,
.hero {
    position: relative;
    z-index: 1;
}

/* ---------------------------------------------------------------- typography */
h1,
h2,
h3 {
    letter-spacing: -.025em;
}

.section-label {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.section-label::before {
    content: "";
    width: 22px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--red));
}

.gradient-text {
    background: linear-gradient(100deg, #fff 12%, #c9a6ff 46%, #8b5cf6 74%, #fff 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmer 9s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ---------------------------------------------------------------- nav */
.nav {
    background: rgba(8, 4, 17, .72);
    backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid rgba(139, 92, 246, .16);
}

.nav::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, .55), transparent);
}

.landing-nav {
    background: transparent;
    border-bottom: 0;
}

.nav-link.active,
.nav-link:hover {
    color: #fff;
}

.nav-link.active {
    background: rgba(139, 92, 246, .16);
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .28);
}

/* ---------------------------------------------------------------- buttons */
.btn {
    border-radius: 11px;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease,
        border-color .18s ease, color .18s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border-color: rgba(201, 166, 255, .35);
    box-shadow: 0 10px 30px -14px rgba(139, 92, 246, .9);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 38px -14px rgba(139, 92, 246, 1);
    background: linear-gradient(135deg, #9d75f8, #7c3aed);
}

.btn-ghost {
    background: rgba(139, 92, 246, .07);
    border-color: rgba(139, 92, 246, .22);
}

.btn-ghost:hover {
    background: rgba(139, 92, 246, .14);
    border-color: rgba(139, 92, 246, .45);
}

/* ---------------------------------------------------------------- cards */
.card {
    background:
        linear-gradient(180deg, rgba(139, 92, 246, .06), transparent 42%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px -48px rgba(0, 0, 0, .9);
}

.card-title {
    letter-spacing: -.02em;
}

.pill {
    background: rgba(139, 92, 246, .10);
    border: 1px solid rgba(139, 92, 246, .24);
    border-radius: 999px;
}

.dot {
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(52, 211, 153, .6);
    animation: dot-pulse 2.6s ease-out infinite;
}

@keyframes dot-pulse {
    0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .55); }
    70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
    100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

/* ---------------------------------------------------------------- premium pill */
.balance-pill.is-premium {
    gap: 8px;
    padding: 5px 8px 5px 12px;
    background: linear-gradient(135deg, rgba(139, 92, 246, .22), rgba(109, 40, 217, .12));
    border-color: rgba(201, 166, 255, .40);
    box-shadow: 0 0 24px -8px rgba(139, 92, 246, .55);
}

.balance-infinity {
    font-size: 20px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-shadow: 0 0 18px rgba(201, 166, 255, .85);
}

.premium-tag {
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(201, 166, 255, .18);
    border: 1px solid rgba(201, 166, 255, .3);
    color: var(--accent-2);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ---------------------------------------------------------------- landing */
.landing {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px 90px;
}

.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .55;
    animation: drift 22s ease-in-out infinite;
}

.ambient-orb.one {
    width: 520px;
    height: 520px;
    top: -180px;
    left: 50%;
    margin-left: -260px;
    background: radial-gradient(circle, rgba(139, 92, 246, .55), transparent 68%);
}

.ambient-orb.two {
    width: 420px;
    height: 420px;
    top: 40%;
    right: -160px;
    background: radial-gradient(circle, rgba(109, 40, 217, .45), transparent 70%);
    animation-delay: -7s;
}

.ambient-orb.three {
    width: 380px;
    height: 380px;
    bottom: 4%;
    left: -140px;
    background: radial-gradient(circle, rgba(76, 29, 149, .55), transparent 70%);
    animation-delay: -13s;
}

@keyframes drift {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(24px, -28px, 0) scale(1.06); }
}

.hero-shell {
    position: relative;
    padding: 78px 0 46px;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(139, 92, 246, .10);
    border: 1px solid rgba(139, 92, 246, .30);
    color: var(--muted);
    font-size: 12.5px;
}

.hero-badge .dot {
    width: 6px;
    height: 6px;
}

.hero-shell h1 {
    margin: 26px auto 0;
    max-width: 860px;
    font-size: clamp(38px, 5.4vw, 66px);
    line-height: 1.06;
    font-weight: 600;
}

.hero-shell p.lede {
    margin: 20px auto 0;
    max-width: 620px;
    color: var(--muted);
    font-size: 16.5px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 30px;
}

.hero-actions .btn {
    padding: 12px 22px;
    font-size: 14px;
}

/* orbiting emblem */
.hero-orbit {
    position: relative;
    width: 100%;
    max-width: 460px;
    height: 240px;
    margin: 18px auto 0;
}

.hero-orbit .core {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 74px;
    height: 74px;
    margin: -37px 0 0 -37px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 35% 30%, rgba(201, 166, 255, .55), rgba(88, 28, 135, .65));
    border: 1px solid rgba(201, 166, 255, .5);
    box-shadow: 0 0 70px rgba(139, 92, 246, .7), inset 0 0 28px rgba(255, 255, 255, .25);
    animation: core-pulse 4.5s ease-in-out infinite;
}

.hero-orbit .core img {
    width: 34px;
    height: auto;
    filter: brightness(0) invert(1);
}

@keyframes core-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 60px rgba(139, 92, 246, .55), inset 0 0 24px rgba(255, 255, 255, .2); }
    50% { transform: scale(1.05); box-shadow: 0 0 100px rgba(139, 92, 246, .85), inset 0 0 30px rgba(255, 255, 255, .3); }
}

.hero-orbit .ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, .38);
    transform: scaleY(.42);
    box-shadow: 0 0 40px -18px rgba(139, 92, 246, .8) inset;
}

.hero-orbit .ring.r2 {
    inset: 34px 90px;
    border-style: dashed;
    border-color: rgba(201, 166, 255, .32);
}

.hero-orbit .satellite {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 14px rgba(201, 166, 255, .95);
    animation: orbit 16s linear infinite;
}

.hero-orbit .satellite.b {
    animation-duration: 24s;
    animation-delay: -8s;
    background: #8b5cf6;
}

@keyframes orbit {
    from { transform: rotate(0deg) translateX(150px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(150px) rotate(360deg); }
}

/* metrics strip */
.metric-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(12, 7, 24, .72);
    border: 1px solid rgba(139, 92, 246, .18);
    box-shadow: var(--glow);
    backdrop-filter: blur(10px);
}

.metric {
    padding: 10px 6px;
    text-align: center;
}

.metric .value {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -.02em;
}

.metric .label {
    margin-top: 2px;
    font-size: 11.5px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted-2);
}

/* sections */
.section {
    padding: 76px 0 0;
}

.section-head {
    max-width: 640px;
    margin-bottom: 30px;
}

.section-title {
    margin: 12px 0 0;
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.15;
}

.section-sub {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 15px;
}

/* bento */
.bento {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.bento-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(139, 92, 246, .07), transparent 46%), var(--surface);
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.bento-card:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, .45);
    box-shadow: 0 30px 60px -40px rgba(139, 92, 246, .8);
}

.bento-card.wide {
    grid-column: span 2;
}

.bento-card h3 {
    margin: 14px 0 6px;
    font-size: 16px;
    font-weight: 600;
}

.bento-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.6;
}

.bento-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: rgba(139, 92, 246, .14);
    border: 1px solid rgba(139, 92, 246, .3);
    color: var(--accent-2);
}

.bento-icon svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.mini-chart {
    margin-top: 18px;
    height: 96px;
    width: 100%;
    display: block;
    overflow: visible;
}

.mini-chart path.line {
    fill: none;
    stroke: url(#zg);
    stroke-width: 2.4;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, .8));
    stroke-dasharray: 620;
    stroke-dashoffset: 620;
    animation: draw 2.4s ease forwards;
}

.mini-chart path.area {
    fill: url(#zga);
    opacity: .55;
}

@keyframes draw {
    to { stroke-dashoffset: 0; }
}

.bar-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin-top: 20px;
    height: 74px;
}

.bar-row span {
    flex: 1;
    border-radius: 4px 4px 2px 2px;
    background: linear-gradient(180deg, rgba(201, 166, 255, .85), rgba(139, 92, 246, .12));
    animation: bar-grow 1.2s cubic-bezier(.2, .8, .2, 1) backwards;
}

@keyframes bar-grow {
    from { transform: scaleY(.12); opacity: .3; }
    to { transform: scaleY(1); opacity: 1; }
}

/* why grid */
.why-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.why-card {
    padding: 20px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
}

.why-card h3 {
    margin: 0 0 6px;
    font-size: 15px;
}

.why-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
}

/* plans */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: stretch;
}

.plan {
    position: relative;
    padding: 24px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(139, 92, 246, .06), transparent 40%), var(--surface);
    transition: transform .25s ease, border-color .25s ease;
}

.plan:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, .45);
}

.plan-featured {
    border-color: rgba(139, 92, 246, .65);
    background: linear-gradient(180deg, rgba(139, 92, 246, .18), rgba(88, 28, 135, .06) 46%), var(--surface);
    box-shadow: 0 40px 80px -50px rgba(139, 92, 246, .95);
}

.plan-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    transform: none;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    box-shadow: 0 8px 22px -10px rgba(139, 92, 246, .9);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #fff;
}

/* admin nav pill keeps the violet family */
.nav-link.admin-link {
    color: var(--accent-2);
    border: 1px solid rgba(201, 166, 255, .32);
    background: rgba(139, 92, 246, .12);
}

.nav-link.admin-link:hover {
    color: #fff;
    background: rgba(139, 92, 246, .24);
}

.plan-price .amount {
    font-size: 40px;
    font-weight: 600;
}

/* faq */
.faq {
    display: grid;
    gap: 10px;
}

.faq-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    overflow: hidden;
}

.faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 18px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: "+";
    color: var(--accent-2);
    font-size: 18px;
    line-height: 1;
    transition: transform .2s ease;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item p {
    margin: 0;
    padding: 0 18px 18px;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.65;
}

/* footer */
.footer {
    margin-top: 84px;
    border-top: 1px solid var(--border);
    padding-top: 36px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 28px;
}

.footer-col h4 {
    margin: 0 0 12px;
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted-2);
    font-weight: 600;
}

.footer-col a,
.footer-col span {
    display: block;
    padding: 4px 0;
    color: var(--muted);
    font-size: 13.5px;
}

.footer-col a:hover {
    color: #fff;
}

.footer-bottom {
    margin-top: 34px;
    padding-top: 18px;
    border-top: 1px solid rgba(39, 26, 69, .8);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    color: var(--muted-2);
    font-size: 12px;
}

/* reveal on scroll */
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1);
}

.reveal.in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal,
    .gradient-text,
    .ambient-orb,
    .hero-orbit .satellite,
    .hero-orbit .core,
    .dot,
    .mini-chart path.line {
        animation: none !important;
        transition: none !important;
        opacity: 1;
        transform: none;
    }
}

/* ---------------------------------------------------------------- admin guild */
.guild-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.mini-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.mini-stat {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.mini-stat span {
    display: block;
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.mini-stat strong {
    display: block;
    margin-top: 4px;
    font-size: 20px;
    font-weight: 600;
}

.guild-alert {
    margin: 0 0 14px;
    padding: 10px 13px;
    border-radius: 9px;
    background: var(--danger-soft);
    border: 1px solid rgba(244, 63, 94, .35);
    color: #fda4af;
    font-size: 12.5px;
}

.guild-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

.cell-user {
    display: flex;
    align-items: center;
    gap: 9px;
}

.member-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-strong);
    background: var(--surface-3);
    flex: 0 0 auto;
}

.member-avatar.fallback {
    display: inline-grid;
    place-items: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-2);
}

.member-list,
.event-list {
    max-height: 340px;
    overflow-y: auto;
    display: grid;
    gap: 4px;
}

.member-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
}

.member-row:nth-child(odd) {
    background: rgba(139, 92, 246, .05);
}

.event-row {
    display: grid;
    grid-template-columns: 10px 1fr auto auto;
    align-items: center;
    gap: 9px;
    padding: 8px 9px;
    border-radius: 8px;
    font-size: 13px;
}

.event-row:nth-child(odd) {
    background: rgba(139, 92, 246, .05);
}

.event-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.event-dot.join {
    background: var(--green);
    box-shadow: 0 0 10px rgba(52, 211, 153, .8);
}

.event-dot.leave {
    background: var(--danger);
    box-shadow: 0 0 10px rgba(244, 63, 94, .7);
}

.event-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-kind {
    font-size: 11.5px;
    color: var(--muted-2);
}

.event-time {
    font-size: 11.5px;
    color: var(--muted-2);
    white-space: nowrap;
}

/* ---------------------------------------------------------------- discord join */
.discord-card {
    border-color: rgba(139, 92, 246, .34);
    background:
        linear-gradient(115deg, rgba(88, 28, 135, .34), rgba(14, 8, 28, .92) 58%),
        var(--surface);
}

.inline-link {
    color: var(--accent-2);
    border-bottom: 1px solid rgba(201, 166, 255, .4);
}

.inline-link:hover {
    color: #fff;
}

/* ---------------------------------------------------------------- errors */
.alert-error,
.toast.error,
.form-hint.error {
    color: #fda4af;
    background: var(--danger-soft);
    border-color: rgba(244, 63, 94, .35);
}

.form-hint.error {
    background: none;
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 980px) {
    .bento,
    .plan-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bento-card.wide {
        grid-column: span 2;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .guild-columns {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .landing {
        padding: 0 16px 64px;
    }

    .hero-shell {
        padding-top: 48px;
    }

    .metric-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bento,
    .plan-grid,
    .why-grid,
    .mini-stats {
        grid-template-columns: 1fr;
    }

    .bento-card.wide {
        grid-column: span 1;
    }

    .hero-orbit {
        height: 150px;
        transform: scale(.72);
    }

    .section {
        padding-top: 52px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* =========================================================================
   Panel controls: announcements, tool states, poll bot, mission control
   ========================================================================= */

/* ---------------------------------------------------------------- announce */
.announce {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(139, 92, 246, .30);
    border-radius: 12px;
    background: rgba(139, 92, 246, .09);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
}

.announce-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, .16);
    flex: none;
}

.announce.success {
    border-color: rgba(52, 211, 153, .35);
    background: rgba(52, 211, 153, .08);
}

.announce.success .announce-dot {
    background: var(--green);
    box-shadow: 0 0 0 4px rgba(52, 211, 153, .16);
}

.announce.warning {
    border-color: rgba(251, 191, 36, .35);
    background: rgba(251, 191, 36, .08);
}

.announce.warning .announce-dot {
    background: var(--amber);
    box-shadow: 0 0 0 4px rgba(251, 191, 36, .16);
}

.announce.danger {
    border-color: rgba(244, 63, 94, .38);
    background: rgba(244, 63, 94, .09);
}

.announce.danger .announce-dot {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(244, 63, 94, .16);
}

.input:focus,
.textarea:focus,
.select:focus {
    border-color: rgba(201, 166, 255, .62);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .13);
    background: var(--surface-3);
}

/* ---------------------------------------------------------------- busy */
.busy-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid rgba(251, 191, 36, .32);
    border-radius: 12px;
    background: rgba(251, 191, 36, .07);
}

.busy-banner.hidden {
    display: none;
}

.busy-banner strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
}

.busy-banner span {
    font-size: 12.5px;
    color: var(--muted);
}

/* ---------------------------------------------------------------- tool state */
.service-btn {
    position: relative;
}

.service-flag {
    position: absolute;
    top: 5px;
    right: 6px;
    padding: 1px 5px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.5;
    pointer-events: none;
}

.service-flag.update {
    color: #fef3c7;
    background: rgba(251, 191, 36, .18);
    border: 1px solid rgba(251, 191, 36, .4);
}

.service-flag.off {
    color: #fecdd3;
    background: rgba(244, 63, 94, .18);
    border: 1px solid rgba(244, 63, 94, .4);
}

.tool-flag {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border: 1px solid rgba(251, 191, 36, .34);
    border-radius: 12px;
    background: rgba(251, 191, 36, .07);
}

.tool-flag.off {
    border-color: rgba(244, 63, 94, .36);
    background: rgba(244, 63, 94, .07);
}

.tool-flag-dot {
    width: 9px;
    height: 9px;
    margin-top: 5px;
    border-radius: 50%;
    flex: none;
    background: var(--amber);
    animation: toolflag-pulse 2.2s ease-out infinite;
}

.tool-flag.off .tool-flag-dot {
    background: var(--danger);
}

.tool-flag strong {
    display: block;
    font-size: 13px;
    margin-bottom: 2px;
}

.tool-flag span:not(.tool-flag-dot) {
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.45;
}

@keyframes toolflag-pulse {
    0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, .5); }
    70% { box-shadow: 0 0 0 7px rgba(251, 191, 36, 0); }
    100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

.tool-flag.off .tool-flag-dot {
    animation-name: toolflag-pulse-red;
}

@keyframes toolflag-pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, .5); }
    70% { box-shadow: 0 0 0 7px rgba(244, 63, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

.btn[disabled] {
    opacity: .45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ---------------------------------------------------------------- poll bot */
.poll-box {
    margin: 18px 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-2);
    overflow: hidden;
}

.poll-box-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.poll-box-head strong {
    display: block;
    font-size: 13.5px;
    margin-bottom: 2px;
}

.poll-box-head span {
    font-size: 12px;
    color: var(--muted-2);
}

.poll-options {
    display: flex;
    flex-direction: column;
}

.poll-option {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 13px 16px;
    border: 0;
    border-top: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: background .15s ease;
}

.poll-option:first-child {
    border-top: 0;
}

.poll-option:hover {
    background: rgba(139, 92, 246, .07);
}

.poll-option-fill {
    position: absolute;
    inset: 0 auto 0 0;
    background: linear-gradient(90deg, rgba(139, 92, 246, .22), rgba(139, 92, 246, .03));
    pointer-events: none;
    transition: width .5s ease;
}

.poll-option-label,
.poll-option-votes {
    position: relative;
    z-index: 1;
}

.poll-option-label {
    font-size: 13.5px;
    font-weight: 500;
}

.poll-option-votes {
    font-size: 11.5px;
    color: var(--muted-2);
    white-space: nowrap;
}

.poll-option.selected {
    background: rgba(139, 92, 246, .13);
    box-shadow: inset 3px 0 0 var(--red);
}

.poll-option.selected .poll-option-label::after {
    content: "selected";
    margin-left: 8px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(139, 92, 246, .22);
    color: var(--accent-2);
    font-size: 9.5px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.poll-empty {
    margin: 0;
    padding: 16px;
    font-size: 12.5px;
    color: var(--muted-2);
}

/* ---------------------------------------------------------------- mission */
body.mission-open {
    overflow: hidden;
}

@media (min-width: 721px) {
    body.mission-open .toast-wrap {
        right: auto;
        left: 20px;
    }
}

@media (max-width: 720px) {
    body.mission-open .toast-wrap {
        right: 14px;
        left: 14px;
        bottom: 64px;
        align-items: stretch;
    }

    body.mission-open .toast {
        max-width: none;
        min-width: 0;
    }
}

.mission {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.mission.hidden {
    display: none;
}

.mission-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 1, 8, .74);
    backdrop-filter: blur(6px);
}

.mission-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: min(540px, 100%);
    max-height: min(780px, calc(100vh - 48px));
    padding: 26px;
    border: 1px solid var(--border-strong);
    border-radius: 24px;
    background:
        radial-gradient(520px 260px at 50% -10%, rgba(139, 92, 246, .26), transparent 70%),
        linear-gradient(180deg, rgba(24, 15, 46, .99), rgba(9, 4, 20, .99));
    box-shadow: 0 40px 100px -40px rgba(0, 0, 0, .95);
    overflow: hidden;
    animation: mission-in .28s cubic-bezier(.2, .8, .3, 1);
}

@keyframes mission-in {
    from { transform: translateY(18px) scale(.98); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.mission-card::before {
    content: "";
    position: absolute;
    inset: -40% 20% auto;
    height: 220px;
    background: radial-gradient(closest-side, rgba(139, 92, 246, .30), transparent);
    pointer-events: none;
}

.mission-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: rgba(14, 8, 28, .7);
    color: var(--muted);
    cursor: pointer;
    transition: color .15s ease, border-color .15s ease;
}

.mission-close:hover {
    color: #fff;
    border-color: var(--border-strong);
}

.mission-close svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
}

.mission-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 34px 0;
    text-align: center;
}

.mission-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 12px 26px rgba(139, 92, 246, .35));
}

.mission-kicker {
    display: inline-block;
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--accent-2);
}

.mission-head h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
}

.mission-head p {
    margin: 4px 0 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--muted);
    min-height: 18px;
}

.mission-target {
    display: inline-block;
    margin-top: 6px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 2px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(139, 92, 246, .09);
    font-size: 11px;
    color: var(--muted);
}

.mission-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mission-progress-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.mission-progress-head span {
    font-size: 12px;
    color: var(--muted);
}

.mission-progress-head strong {
    font-size: 13px;
    color: var(--accent-2);
}

.mission-bar {
    height: 8px;
    border-radius: 999px;
    background: rgba(139, 92, 246, .14);
    overflow: hidden;
}

.mission-bar-fill {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7c3aed, #c4a6ff);
    transition: width .45s ease;
}

.mission-stats {
    display: flex;
    gap: 24px;
    justify-content: center;
}

.mission-stats strong {
    display: block;
    font-size: 17px;
    line-height: 1.1;
}

.mission-stats span {
    font-size: 10px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.mission-feed {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 7px;
    min-height: 90px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(6, 3, 13, .55);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}

.mission-feed::-webkit-scrollbar {
    width: 6px;
}

.mission-feed::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 999px;
}

.mission-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(139, 92, 246, .12);
    border-radius: 10px;
    background: rgba(19, 12, 37, .72);
    animation: mission-row-in .24s ease;
}

@keyframes mission-row-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.mission-avatar {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: none;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(139, 92, 246, .4), rgba(139, 92, 246, .12));
    border: 1px solid rgba(201, 166, 255, .25);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #e9e1ff;
}

.mission-avatar.muted {
    background: rgba(124, 107, 159, .16);
    border-color: var(--border);
    color: var(--muted-2);
}

.mission-avatar.chat {
    background: linear-gradient(135deg, rgba(52, 211, 153, .32), rgba(52, 211, 153, .08));
    border-color: rgba(52, 211, 153, .3);
    color: #d1fae5;
}

.mission-avatar.poll,
.mission-avatar.view {
    background: linear-gradient(135deg, rgba(251, 191, 36, .3), rgba(251, 191, 36, .08));
    border-color: rgba(251, 191, 36, .3);
    color: #fef3c7;
}

.mission-row-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.mission-row-body strong {
    font-size: 11.5px;
    font-weight: 600;
}

.mission-row-body span {
    font-size: 11px;
    color: var(--muted-2);
    line-height: 1.35;
}

.mission-chat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
    padding: 6px 10px;
    border-radius: 4px 12px 12px 12px;
    background: rgba(52, 211, 153, .08);
    border: 1px solid rgba(52, 211, 153, .16);
}

.mission-chat strong {
    font-size: 10px;
    color: var(--green);
    font-weight: 600;
}

.mission-chat span {
    font-size: 11.5px;
    color: var(--text);
    line-height: 1.4;
    word-break: break-word;
}

.mission-chat span.mission-chat-status {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .02em;
    color: #6ee7b7;
}

.mission-chat span.mission-chat-quote {
    font-size: 11px;
    color: var(--muted);
    font-style: italic;
}

.mission-pill {
    flex: none;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    white-space: nowrap;
}

.mission-pill.ok {
    color: #a7f3d0;
    background: rgba(52, 211, 153, .13);
    border: 1px solid rgba(52, 211, 153, .28);
}

.mission-pill.soft {
    color: var(--muted);
    background: rgba(139, 92, 246, .10);
    border: 1px solid var(--border);
}

.mission-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 2px;
}

.mission-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--accent-2);
}

.mission-status.is-waiting {
    color: var(--amber);
}

.mission-status.is-done {
    color: var(--green);
}

.mission-card.is-complete {
    border-color: rgba(52, 211, 153, .34);
    box-shadow: -40px 0 90px -50px rgba(0, 0, 0, .95), 0 0 70px -30px rgba(52, 211, 153, .35);
}

.mission-card.is-complete .mission-bar-fill {
    background: linear-gradient(90deg, #10b981, #6ee7b7);
}

.mission-card.is-complete .mission-progress-head strong {
    color: #6ee7b7;
}

/* ---------------------------------------------------------------- gate */
.gate {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.gate.hidden {
    display: none;
}

.gate-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 1, 8, .78);
    backdrop-filter: blur(7px);
}

.gate-card {
    position: relative;
    width: min(440px, 100%);
    padding: 26px;
    border: 1px solid var(--border-strong);
    border-radius: 20px;
    background:
        radial-gradient(420px 200px at 50% -10%, rgba(139, 92, 246, .26), transparent 70%),
        var(--surface-2);
    box-shadow: 0 50px 110px -50px #000;
    animation: mission-in .24s ease;
}

.gate-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    padding: 4px 10px;
    border: 1px solid rgba(201, 166, 255, .32);
    border-radius: 999px;
    background: rgba(139, 92, 246, .12);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--accent-2);
}

.gate-badge svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gate-card h2 {
    margin: 0 0 8px;
    font-size: 21px;
}

.gate-card > p {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--muted);
}

.gate-card > p.gate-wait {
    margin: -8px 0 18px;
    padding: 9px 12px;
    border: 1px solid rgba(251, 191, 36, .3);
    border-radius: 9px;
    background: rgba(251, 191, 36, .07);
    font-size: 12px;
    color: #fcd34d;
}

.gate-card > p.gate-wait:empty {
    display: none;
}

.gate-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 22px;
}

.gate-step {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.gate-step-dot {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, .35);
    background: rgba(139, 92, 246, .12);
    font-size: 10.5px;
    font-weight: 700;
    color: var(--accent-2);
}

.gate-step strong {
    display: block;
    font-size: 12.5px;
    margin-bottom: 1px;
}

.gate-step span {
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--muted-2);
}

.gate-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ---------------------------------------------------------------- notice page */
.notice-shell {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px 20px;
}

.notice-card {
    width: min(520px, 100%);
    padding: 38px 34px;
    border: 1px solid var(--border-strong);
    border-radius: 22px;
    background:
        radial-gradient(520px 240px at 50% -10%, rgba(139, 92, 246, .28), transparent 70%),
        var(--surface-2);
    box-shadow: 0 50px 120px -60px #000;
    text-align: center;
}

.notice-badge {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin: 0 auto 20px;
    border-radius: 18px;
    border: 1px solid rgba(201, 166, 255, .34);
    background: linear-gradient(135deg, rgba(139, 92, 246, .3), rgba(139, 92, 246, .08));
    color: var(--accent-2);
}

.notice-badge.ban {
    border-color: rgba(244, 63, 94, .38);
    background: linear-gradient(135deg, rgba(244, 63, 94, .26), rgba(244, 63, 94, .06));
    color: #fda4af;
}

.notice-logo {
    width: 104px;
    height: 104px;
    margin: 0 auto 18px;
    display: grid;
    place-items: center;
}

.notice-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 14px 30px rgba(139, 92, 246, .45));
    animation: notice-float 4.5s ease-in-out infinite;
}

@keyframes notice-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
    .notice-logo img { animation: none; }
}

.notice-badge svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.notice-card .section-label {
    margin-bottom: 8px;
}

.notice-card h1 {
    margin: 0 0 12px;
    font-size: 26px;
}

.notice-text {
    margin: 0 auto;
    max-width: 400px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--muted);
}

.notice-pulse {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 22px 0 10px;
}

.notice-pulse span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-2);
    animation: notice-bounce 1.4s ease-in-out infinite;
}

.notice-pulse span:nth-child(2) {
    animation-delay: .18s;
}

.notice-pulse span:nth-child(3) {
    animation-delay: .36s;
}

@keyframes notice-bounce {
    0%, 100% { transform: translateY(0); opacity: .5; }
    50% { transform: translateY(-5px); opacity: 1; }
}

.notice-hint {
    margin: 0 0 4px;
    font-size: 11.5px;
    color: var(--muted-2);
}

.notice-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

/* ---------------------------------------------------------------- gate/mission responsive */
@media (max-width: 720px) {
    .mission {
        padding: 0;
    }

    .mission-card {
        width: 100%;
        height: 100%;
        border-radius: 0;
        padding: 22px 18px;
    }

    .mission-head {
        padding: 2px 26px 0;
    }

    .mission-logo {
        width: 54px;
        height: 54px;
    }

    .mission-head h2 {
        font-size: 19px;
    }

    .mission-stats {
        gap: 18px;
    }

    .notice-card {
        padding: 30px 22px;
    }
}

/* ---------------------------------------------------------------- mobile nav */
@media (max-width: 720px) {
    .nav-inner {
        flex-wrap: wrap;
        height: auto;
        padding: 9px 14px 8px;
        row-gap: 6px;
    }

    .nav-links {
        order: 3;
        width: 100%;
        margin: 0;
        justify-content: flex-start;
        gap: 3px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: 12.5px;
    }

    .nav-links .nav-link span {
        display: inline;
    }

    .nav-right {
        margin-left: auto;
        gap: 8px;
    }

    .brand img {
        height: 30px;
    }

    .balance-pill {
        padding: 4px 10px;
        font-size: 12px;
    }
}

/* ---------------------------------------------------------------- admin controls */
.control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.switch-row.compact {
    gap: 8px;
}

.switch-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex: none;
    border-radius: 999px;
    background: rgba(124, 107, 159, .28);
    border: 1px solid var(--border);
    transition: background .2s ease, border-color .2s ease;
}

.switch span {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #cfc3ea;
    transition: transform .2s ease, background .2s ease;
}

.switch-row input:checked + .switch {
    background: linear-gradient(135deg, #9d75f8, #7c3aed);
    border-color: rgba(201, 166, 255, .5);
    box-shadow: 0 0 18px -6px rgba(139, 92, 246, .9);
}

.switch-row input:checked + .switch span {
    transform: translateX(18px);
    background: #fff;
}

.switch-row input:focus-visible + .switch {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
}

.switch-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.switch-text strong {
    font-size: 13px;
}

.switch-text em {
    font-style: normal;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--muted-2);
}

.control-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.tool-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tool-row {
    display: grid;
    grid-template-columns: 140px auto 140px 210px minmax(160px, 1fr);
    align-items: center;
    gap: 14px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: rgba(19, 12, 37, .55);
}

.tool-row-name strong {
    display: block;
    font-size: 13px;
}

.tool-row-name span {
    font-size: 10.5px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.state-picker {
    display: inline-flex;
    padding: 3px;
    gap: 3px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.state-picker button {
    padding: 5px 11px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.state-picker button:hover {
    color: var(--text);
    background: var(--surface-2);
}

.state-picker button.active[data-state="on"] {
    color: #d1fae5;
    background: rgba(52, 211, 153, .16);
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .34);
}

.state-picker button.active[data-state="update"] {
    color: #fef3c7;
    background: rgba(251, 191, 36, .16);
    box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .36);
}

.state-picker button.active[data-state="off"] {
    color: #fecdd3;
    background: rgba(244, 63, 94, .16);
    box-shadow: inset 0 0 0 1px rgba(244, 63, 94, .38);
}

.tool-note {
    width: 100%;
    font-size: 12.5px;
}

.tool-premium {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.tool-premium input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tool-premium-box {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    flex: none;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--surface);
    transition: background .15s ease, border-color .15s ease;
}

.tool-premium input:checked + .tool-premium-box {
    background: linear-gradient(135deg, #9d75f8, #7c3aed);
    border-color: rgba(201, 166, 255, .5);
}

.tool-premium input:checked + .tool-premium-box::after {
    content: "";
    width: 8px;
    height: 4px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(-45deg) translateY(-1px);
}

.tool-premium input:checked ~ span:last-child {
    color: var(--accent-2);
}

.tool-limits {
    display: flex;
    gap: 8px;
}

.tool-limits label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.tool-limits .input {
    width: 100%;
    padding: 7px 9px;
    font-size: 12px;
}

@media (max-width: 1280px) {
    .tool-row {
        grid-template-columns: 1fr 1fr;
    }

    .tool-note {
        grid-column: 1 / -1;
    }
}

@media (max-width: 980px) {
    .control-grid {
        grid-template-columns: 1fr;
    }

    .tool-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .state-picker {
        justify-self: start;
    }

    .tool-limits {
        max-width: 320px;
    }
}


/* =========================================================================
   Dashboard rail + rewards
   ========================================================================= */

.page.dash-page {
    max-width: 1180px;
    padding-top: 26px;
}

.dash-layout {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.dash-main {
    min-width: 0;
}

.dash-side {
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(139, 92, 246, .08), transparent 46%),
        rgba(14, 8, 28, .82);
    box-shadow: 0 24px 70px -46px rgba(139, 92, 246, .8);
    backdrop-filter: blur(14px);
}

.dash-side-label {
    padding: 7px 10px 9px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.dash-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}

.dash-nav-item svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.dash-nav-item:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: rgba(139, 92, 246, .14);
}

.dash-nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(139, 92, 246, .26), rgba(109, 40, 217, .14));
    border-color: rgba(139, 92, 246, .34);
    box-shadow: inset 0 0 0 1px rgba(201, 166, 255, .06), 0 12px 30px -22px rgba(139, 92, 246, 1);
}

.dash-nav-item .heart-icon {
    color: #f472b6;
    transition: fill .2s ease, color .2s ease;
}

.dash-nav-item.has-rewards .heart-icon {
    color: #fb7185;
    fill: rgba(251, 113, 133, .88);
    filter: drop-shadow(0 0 9px rgba(244, 63, 94, .75));
    animation: rewardHeartbeat 1.15s ease-in-out infinite;
}

.dash-nav-item.has-rewards {
    animation: rewardShake 3.4s cubic-bezier(.36, .07, .19, .97) infinite;
    transform-origin: 50% 50%;
}

.reward-badge {
    display: grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    margin-left: auto;
    padding: 0 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fb7185, #dc2626);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, .16), 0 0 20px rgba(244, 63, 94, .75);
    animation: rewardBadgePulse 1.5s ease-in-out infinite;
}

.dash-side-foot {
    margin-top: 8px;
    padding: 12px 10px 4px;
    border-top: 1px dashed rgba(139, 92, 246, .18);
}

.dash-side-hint {
    display: block;
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--muted-2);
}

@keyframes rewardShake {
    0%, 54%, 100% { transform: translateX(0) rotate(0) scale(1); }
    58% { transform: translateX(-4px) rotate(-2deg) scale(1.02); }
    62% { transform: translateX(4px) rotate(2deg) scale(1.02); }
    66% { transform: translateX(-3px) rotate(-1.5deg) scale(1.015); }
    70% { transform: translateX(3px) rotate(1.5deg) scale(1.015); }
    74% { transform: translateX(-2px) rotate(-1deg) scale(1.01); }
    78% { transform: translateX(2px) rotate(1deg) scale(1.01); }
    82% { transform: translateX(0) rotate(0) scale(1); }
}

@keyframes rewardHeartbeat {
    0%, 100% { transform: scale(1); }
    18% { transform: scale(1.2); }
    30% { transform: scale(.96); }
    42% { transform: scale(1.12); }
    56% { transform: scale(1); }
}

@keyframes rewardBadgePulse {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 3px rgba(244, 63, 94, .16), 0 0 20px rgba(244, 63, 94, .7); }
    50% { transform: scale(1.08); box-shadow: 0 0 0 5px rgba(244, 63, 94, .1), 0 0 28px rgba(244, 63, 94, .95); }
}

/* ---------------------------------------------------------------- rewards view */
.dash-view {
    animation: dashViewIn .3s ease both;
}

@keyframes dashViewIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.rewards-shell {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rewards-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 4px 2px 0;
}

.rewards-head h1 {
    margin: 8px 0 0;
    font-size: clamp(26px, 2.4vw, 34px);
    font-weight: 650;
}

.rewards-head p {
    margin: 7px 0 0;
    max-width: 560px;
    color: var(--muted);
    font-size: 14px;
}

.rewards-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    padding: 12px 16px;
    border: 1px solid rgba(244, 63, 94, .28);
    border-radius: 15px;
    background: linear-gradient(135deg, rgba(244, 63, 94, .14), rgba(139, 92, 246, .09));
    box-shadow: 0 18px 48px -30px rgba(244, 63, 94, 1);
}

.rewards-summary-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(244, 63, 94, .16);
    box-shadow: inset 0 0 0 1px rgba(244, 63, 94, .28);
}

.rewards-summary-icon svg {
    width: 20px;
    height: 20px;
    fill: #fb7185;
}

.rewards-summary strong {
    display: block;
    font-size: 23px;
    line-height: 1.05;
}

.rewards-summary div > span {
    font-size: 11.5px;
    color: var(--muted);
}

.rewards-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.rewards-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 56px 24px;
    text-align: center;
    border: 1px dashed var(--border-strong);
    border-radius: 20px;
    background:
        radial-gradient(60% 90% at 50% 0%, rgba(139, 92, 246, .1), transparent 70%),
        rgba(14, 8, 28, .55);
}

.rewards-empty-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    margin-bottom: 10px;
    border-radius: 18px;
    border: 1px solid rgba(139, 92, 246, .3);
    background: rgba(139, 92, 246, .12);
    color: var(--accent-2);
}

.rewards-empty-icon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.rewards-empty strong {
    font-size: 16px;
}

.rewards-empty p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.reward-card {
    --reward-accent: #a78bfa;
    --reward-tint: rgba(139, 92, 246, .16);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background:
        radial-gradient(120% 100% at 0% 0%, var(--reward-tint), transparent 58%),
        linear-gradient(180deg, rgba(255, 255, 255, .015), transparent 40%),
        var(--surface);
    box-shadow: 0 26px 70px -48px rgba(0, 0, 0, .9);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.reward-card.kind-followers { --reward-accent: #a78bfa; --reward-tint: rgba(139, 92, 246, .18); }
.reward-card.kind-premium { --reward-accent: #fbbf24; --reward-tint: rgba(251, 191, 36, .15); }
.reward-card.kind-coins { --reward-accent: #facc15; --reward-tint: rgba(250, 204, 21, .14); }

.reward-card:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, .34);
    box-shadow: 0 34px 90px -48px rgba(139, 92, 246, .75);
}

.reward-card.pending {
    border-color: rgba(244, 63, 94, .26);
    box-shadow: 0 0 0 1px rgba(244, 63, 94, .08), 0 30px 80px -50px rgba(244, 63, 94, .9);
}

.reward-card.pending::before {
    content: "";
    position: absolute;
    inset: -60% -30%;
    pointer-events: none;
    background: radial-gradient(closest-side, rgba(244, 63, 94, .16), transparent 70%);
    animation: rewardAura 5.5s ease-in-out infinite;
}

@keyframes rewardAura {
    0%, 100% { transform: translate3d(0, 0, 0) scale(.9); opacity: .45; }
    50% { transform: translate3d(6%, 4%, 0) scale(1.1); opacity: .85; }
}

.reward-card-head {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.reward-type-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--reward-accent) 42%, transparent);
    background: color-mix(in srgb, var(--reward-accent) 15%, transparent);
    color: var(--reward-accent);
    box-shadow: 0 0 26px -10px var(--reward-accent);
}

.reward-type-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reward-kicker {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.reward-title {
    margin: 3px 0 0;
    font-size: 21px;
    font-weight: 650;
    letter-spacing: -.02em;
}

.reward-note {
    position: relative;
    margin: 15px 0 0;
    min-height: 21px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.reward-foot {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 18px;
}

.reward-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.reward-status::before {
    content: "";
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.reward-status.pending { color: #fecdd3; background: rgba(244, 63, 94, .15); box-shadow: inset 0 0 0 1px rgba(244, 63, 94, .3); }
.reward-status.claimed { color: #a7f3d0; background: rgba(52, 211, 153, .12); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, .26); }
.reward-status.cancelled { color: var(--muted); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }

.reward-date {
    margin-left: auto;
    font-size: 11px;
    color: var(--muted-2);
    white-space: nowrap;
}

.reward-claim {
    margin-left: auto;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fb7185, #be123c);
    border-color: rgba(251, 113, 133, .42);
    box-shadow: 0 12px 34px -18px rgba(244, 63, 94, .95);
}

.reward-claim:hover {
    background: linear-gradient(135deg, #fda4af, #e11d48);
    box-shadow: 0 18px 44px -18px rgba(244, 63, 94, 1);
}

.reward-card.claimed-card {
    opacity: .82;
}

.reward-card.claimed-card:hover {
    transform: none;
}

/* ---------------------------------------------------------------- reward modal */
.reward-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 20px;
}

.reward-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 1, 9, .78);
    backdrop-filter: blur(12px);
}

.reward-modal-card {
    position: relative;
    width: min(440px, 100%);
    padding: 26px;
    border: 1px solid rgba(251, 113, 133, .3);
    border-radius: 22px;
    background:
        radial-gradient(90% 80% at 50% 0%, rgba(244, 63, 94, .16), transparent 65%),
        var(--surface-2);
    box-shadow: 0 40px 120px -40px rgba(244, 63, 94, .75);
    animation: rewardModalIn .26s cubic-bezier(.2, .9, .25, 1.1) both;
}

@keyframes rewardModalIn {
    from { opacity: 0; transform: translateY(14px) scale(.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.reward-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}

.reward-modal-close:hover {
    color: #fff;
    border-color: var(--border-strong);
}

.reward-modal-close svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.reward-modal-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    border: 1px solid rgba(251, 113, 133, .34);
    background: rgba(244, 63, 94, .15);
    color: #fb7185;
    box-shadow: 0 0 36px -12px rgba(244, 63, 94, .9);
}

.reward-modal-icon svg {
    width: 27px;
    height: 27px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reward-modal-icon.is-premium {
    border-color: rgba(251, 191, 36, .4);
    background: rgba(251, 191, 36, .14);
    color: #fbbf24;
    box-shadow: 0 0 36px -12px rgba(251, 191, 36, .9);
}

.reward-modal-icon.is-coins {
    border-color: rgba(250, 204, 21, .4);
    background: rgba(250, 204, 21, .14);
    color: #facc15;
    box-shadow: 0 0 36px -12px rgba(250, 204, 21, .9);
}

.reward-modal-card h2 {
    margin: 15px 0 4px;
    font-size: 22px;
}

.reward-modal-card > p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.55;
}

.reward-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* ---------------------------------------------------------------- coin burst + celebration */
.reward-burst-layer {
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    overflow: hidden;
}

.coin-burst {
    position: fixed;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 28%, #fffbe6, #fde047 38%, #f59e0b 68%, #b45309);
    box-shadow: 0 0 14px rgba(250, 204, 21, .9), inset 0 -2px 2px rgba(120, 53, 15, .55);
    will-change: transform, opacity;
}

.reward-celebrate {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.reward-celebrate-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 28px 38px;
    text-align: center;
    border: 1px solid rgba(251, 191, 36, .4);
    border-radius: 24px;
    background: rgba(8, 4, 17, .92);
    box-shadow: 0 40px 130px -30px rgba(251, 191, 36, .55), 0 0 0 1px rgba(255, 255, 255, .04) inset;
    animation: rewardCelebrateIn .55s cubic-bezier(.2, 1.1, .3, 1.25) both;
}

.reward-celebrate-card.is-coins {
    border-color: rgba(250, 204, 21, .45);
    box-shadow: 0 40px 130px -30px rgba(250, 204, 21, .65);
}

.reward-celebrate-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 4px;
    border-radius: 20px;
    background: rgba(251, 191, 36, .16);
    color: #fbbf24;
    box-shadow: 0 0 40px -10px rgba(251, 191, 36, .9);
}

.reward-celebrate-icon svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reward-celebrate-card strong {
    font-size: 20px;
    letter-spacing: -.02em;
}

.reward-celebrate-card span:last-child {
    color: var(--muted);
    font-size: 13px;
}

@keyframes rewardCelebrateIn {
    from { opacity: 0; transform: translateY(16px) scale(.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.balance-pill.reward-hit {
    animation: rewardBalancePop .8s cubic-bezier(.2, .9, .25, 1.2);
}

@keyframes rewardBalancePop {
    0% { transform: scale(1); }
    30% { transform: scale(1.16); box-shadow: 0 0 0 4px rgba(250, 204, 21, .22), 0 0 34px rgba(250, 204, 21, .55); }
    62% { transform: scale(.98); }
    100% { transform: scale(1); }
}

/* ---------------------------------------------------------------- rewards responsive */
@media (max-width: 980px) {
    .page.dash-page {
        padding: 18px 16px 64px;
    }

    .dash-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .dash-side {
        position: static;
        flex-direction: row;
        align-items: center;
        gap: 6px;
        margin: 0 auto;
        width: 100%;
        max-width: 900px;
        padding: 8px;
        overflow-x: auto;
    }

    .dash-side-label,
    .dash-side-foot {
        display: none;
    }

    .dash-nav-item {
        width: auto;
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 10px 14px;
    }

    .reward-badge {
        margin-left: 2px;
    }

    .rewards-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .rewards-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .rewards-summary {
        width: 100%;
    }

    .reward-card {
        padding: 17px;
    }

    .reward-foot {
        flex-wrap: wrap;
    }

    .reward-claim {
        width: 100%;
        margin-left: 0;
        order: 3;
    }

    .reward-date {
        margin-left: 0;
    }

    .reward-modal-card {
        padding: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dash-nav-item.has-rewards,
    .dash-nav-item.has-rewards .heart-icon,
    .reward-badge,
    .reward-card.pending::before,
    .dash-view {
        animation: none !important;
    }
}
