/*
 * LoliCord, a Discord client mod
 * Copyright (c) 2026 Vendicated and contributors
 * SPDX-License-Identifier: GPL-3.0-or-later
 */

:root {
    --bg: #09090b;
    --surface: rgba(255, 255, 255, 0.025);
    --surface-hover: rgba(255, 255, 255, 0.045);
    --input: rgba(255, 255, 255, 0.04);
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.14);
    --text: #e4e4e7;
    --header: #fafafa;
    --muted: #8b8b94;
    --faint: #5a5a63;
    --primary: #f4f4f5;
    --primary-text: #09090b;
    --accent: #ff4f9a;
    --accent-2: #8b6cff;
    --accent-soft: rgba(255, 79, 154, 0.14);
    --danger: #ff4655;
    --warning: #f5b544;
    --positive: #3ddc84;
    --radius: 14px;
    --sans: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: "Geist Mono", ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
    color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(900px 500px at 15% -10%, rgba(255, 79, 154, 0.10), transparent 60%),
        radial-gradient(800px 500px at 100% 0%, rgba(139, 108, 255, 0.08), transparent 60%),
        var(--bg);
    color: var(--text);
    font: 14px/1.5 var(--sans);
    -webkit-font-smoothing: antialiased;
    display: flow-root;
    position: relative;
    z-index: 0;
    overflow-x: hidden;
}

::selection { background: rgba(255, 79, 154, 0.35); color: #fff; }

/* =========================================================
   Background layers
   ========================================================= */

/* fine grid, fades out towards the bottom */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 56px 56px;
    opacity: 0.3;
    mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%);
    animation: grid-pan 40s linear infinite;
}
@keyframes grid-pan { to { background-position: 56px 56px; } }

/* drifting aurora */
body::after {
    content: "";
    position: fixed;
    inset: -20%;
    z-index: -3;
    pointer-events: none;
    background:
        radial-gradient(35% 30% at 25% 20%, rgba(255, 79, 154, 0.14), transparent 70%),
        radial-gradient(30% 28% at 75% 15%, rgba(139, 108, 255, 0.11), transparent 70%),
        radial-gradient(25% 25% at 50% 85%, rgba(255, 79, 154, 0.06), transparent 70%);
    filter: blur(40px);
    animation: aurora 26s ease-in-out infinite alternate;
}
@keyframes aurora {
    0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
    50%  { transform: translate3d(4%, 3%, 0) rotate(6deg) scale(1.08); }
    100% { transform: translate3d(-3%, 5%, 0) rotate(-4deg) scale(1.04); }
}

#fx, #burst {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
#fx { z-index: -2; }
#burst { z-index: 90; }

#cursor-glow {
    position: fixed;
    left: 0;
    top: 0;
    width: 520px;
    height: 520px;
    margin: -260px 0 0 -260px;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(circle, rgba(255, 79, 154, 0.10), rgba(139, 108, 255, 0.05) 40%, transparent 70%);
    opacity: 0;
    transition: opacity 0.6s;
    will-change: transform;
}
#cursor-glow.on { opacity: 1; }

/* =========================================================
   Splash (pure CSS, removes itself)
   ========================================================= */

#splash {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: var(--bg);
    pointer-events: none;
    animation: splash-out 0.6s var(--ease-in) 0.85s forwards;
}
#splash > * { grid-area: 1 / 1; }
#splash .brand-mark.big {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    font-size: 32px;
    animation: splash-mark 1.2s var(--ease-spring) both;
}
.splash-ring {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    opacity: 0;
    animation: ring 1.1s var(--ease-out) 0.2s;
}
.splash-ring.r2 { border-color: var(--accent-2); animation-delay: 0.35s; }
@keyframes splash-mark {
    0%   { transform: scale(0.2) rotate(-25deg); opacity: 0; filter: blur(8px); }
    55%  { transform: scale(1.08) rotate(4deg); opacity: 1; filter: none; }
    100% { transform: scale(1) rotate(0); }
}
@keyframes ring {
    from { transform: scale(0.8); opacity: 0.9; }
    to   { transform: scale(4); opacity: 0; }
}
@keyframes splash-out {
    to { opacity: 0; visibility: hidden; transform: scale(1.04); }
}

/* =========================================================
   Typography & brand
   ========================================================= */

h1, h2 { color: var(--header); margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 600; }

.eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 6px;
}
.muted { color: var(--muted); font-weight: 400; }

/* letters of [data-split] headings */
.ch {
    display: inline-block;
    white-space: pre;
    animation: ch-in 0.8s var(--ease-out) backwards;
    animation-delay: calc(var(--d, 0s) + 0.15s + var(--i, 0) * 28ms);
}
@keyframes ch-in {
    from { opacity: 0; transform: translateY(0.6em) rotate(8deg); filter: blur(6px); }
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--header); letter-spacing: -0.01em; }
.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font: 700 13px var(--mono);
    color: var(--primary-text);
    background: linear-gradient(135deg, #fff 0%, #ffc2dc 100%);
    box-shadow: 0 0 24px rgba(255, 79, 154, 0.35);
    animation: mark-glow 4s ease-in-out infinite;
}
@keyframes mark-glow { 50% { box-shadow: 0 0 34px rgba(255, 79, 154, 0.6); } }
.brand-tag {
    font: 500 11px var(--mono);
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 8px;
}

/* =========================================================
   Layout
   ========================================================= */

.nav {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    background: rgba(9, 9, 11, 0.65);
    border-bottom: 1px solid var(--line);
}
.nav::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
    background-size: 200% 100%;
    opacity: 0.6;
    animation: line-flow 5s linear infinite;
}
@keyframes line-flow { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.nav-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

main { max-width: 1360px; margin: 0 auto; padding: 36px 20px 64px; }

.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 30px; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 40px -24px rgba(0, 0, 0, 0.8);
    position: relative;
    isolation: isolate;
}
.card > h2, .card-head { margin-bottom: 14px; }
.card-head > .row { flex: 1 1 auto; justify-content: flex-end; }
.card-head > .row #search { flex: 0 1 280px; }

.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.row.between h2 { margin: 0; }
#create-form input { flex: 1 1 260px; }
#search { flex: 0 1 280px; }

/* =========================================================
   Login
   ========================================================= */

.login {
    max-width: 400px;
    margin: 14vh auto 0;
    padding: 32px 28px 26px;
}
.login .brand { margin-bottom: 28px; }
.login h1 { margin-bottom: 4px; font-size: 26px; }
.login .muted { margin: 0 0 24px; }
.login form { display: grid; gap: 10px; }
.login button[type="submit"] { margin-top: 6px; width: 100%; }

.login.reveal { animation: login-in 0.9s var(--ease-out) var(--d, 0s) backwards; }
@keyframes login-in {
    from { opacity: 0; transform: translateY(24px) scale(0.96); filter: blur(8px); }
}
.login.shake { animation: shake 0.5s var(--ease-out); }
@keyframes shake {
    15% { transform: translateX(-10px) rotate(-1deg); }
    35% { transform: translateX(8px) rotate(1deg); }
    55% { transform: translateX(-6px); }
    75% { transform: translateX(3px); }
}
.login.out { animation: login-out 0.55s var(--ease-in) forwards; }
@keyframes login-out {
    to { opacity: 0; transform: scale(1.08); filter: blur(12px); }
}

label {
    font: 500 11px var(--mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.field { position: relative; }
.field input { width: 100%; padding-right: 44px; }
.field .icon-btn { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; }

/* =========================================================
   Stats
   ========================================================= */

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
    perspective: 900px;
}
.stat {
    position: relative;
    isolation: isolate;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.6s var(--ease-out), border-color 0.2s, background 0.2s;
}
.stat.tilting { transition: transform 0.1s linear, border-color 0.2s, background 0.2s; }
.stat:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.stat .eyebrow { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.stat strong {
    display: inline-block;
    font: 600 28px var(--mono);
    color: var(--header);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.stat strong.bump { animation: bump 0.55s var(--ease-spring); }
@keyframes bump { 40% { transform: scale(1.2); color: #fff; text-shadow: 0 0 18px rgba(255, 79, 154, 0.8); } }

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); position: relative; }
.dot.good { background: var(--positive); box-shadow: 0 0 10px var(--positive); }
.dot.bad { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.dot.accent { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.dot.good::after, .dot.accent::after, .dot.bad::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: inherit;
    animation: ping 2.2s var(--ease-out) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: 0.8; } 80%, 100% { transform: scale(3.2); opacity: 0; } }

@media (max-width: 720px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-head h1 { font-size: 24px; }
    .card-head > .row #search { flex: 1 1 100%; }
    .nav-inner { padding: 10px 16px; }
    #logout { padding: 8px 12px; white-space: nowrap; }
    .nav .brand-tag { display: none; }
}
.nav-inner > .row { flex-wrap: nowrap; }

/* =========================================================
   Pointer spotlight + glowing edge on cards
   ========================================================= */

.card::after, .stat::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.35s;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 79, 154, 0.09), transparent 45%);
}
.card::before, .stat::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 150, 200, 0.6), transparent 60%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.card:hover::after, .stat:hover::after,
.card:hover::before, .stat:hover::before { opacity: 1; }

/* =========================================================
   Controls
   ========================================================= */

input, select {
    background: var(--input);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    min-width: 0;
    transition: border-color 0.2s, box-shadow 0.3s var(--ease-out), background 0.2s;
}
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: var(--line-strong); }
input:focus, select:focus {
    outline: none;
    border-color: rgba(255, 79, 154, 0.6);
    box-shadow: 0 0 0 4px var(--accent-soft), 0 0 30px -6px rgba(255, 79, 154, 0.45);
    background: rgba(255, 255, 255, 0.06);
}
select option { background: #18181b; }

button {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: var(--primary);
    color: var(--primary-text);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transform: translate(var(--tx, 0px), var(--ty, 0px));
    transition: transform 0.35s var(--ease-out), background 0.2s, border-color 0.2s, box-shadow 0.3s, color 0.2s;
}
button:hover { background: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 8px 30px -6px rgba(255, 79, 154, 0.55); }
button:active { transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(0.95); transition-duration: 0.08s; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { cursor: default; }

/* sheen sweep on primary buttons */
button.magnetic::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 79, 154, 0.35) 50%, transparent 70%);
    transform: translateX(-120%);
    pointer-events: none;
}
button.magnetic:hover::after {
    transform: translateX(120%);
    transition: transform 0.8s var(--ease-out);
}

button.secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-color: var(--line);
    font-weight: 500;
}
button.secondary:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--line-strong); box-shadow: 0 6px 20px -10px rgba(0, 0, 0, 0.9); }

button.danger { background: transparent; color: var(--danger); font-weight: 500; }
button.danger:hover { background: rgba(255, 70, 85, 0.12); box-shadow: 0 0 20px -6px rgba(255, 70, 85, 0.6); }

button.danger-solid { background: var(--danger); color: #fff; }
button.danger-solid:hover { background: #ff5d6a; box-shadow: 0 8px 30px -6px rgba(255, 70, 85, 0.7); }

button.ghost { background: transparent; color: var(--muted); border-color: transparent; }
button.ghost:hover { color: var(--header); background: rgba(255, 255, 255, 0.06); box-shadow: none; }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
}
.icon-btn.sm { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn > * { grid-area: 1 / 1; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.sm svg { width: 15px; height: 15px; }
button svg { transition: transform 0.45s var(--ease-spring), opacity 0.25s; }

/* icon swaps: eye / eye-off and sound on / off */
.i-eye-off, .i-off { opacity: 0; transform: scale(0.4) rotate(-45deg); }
[aria-pressed="true"] > .i-eye { opacity: 0; transform: scale(0.4) rotate(45deg); }
[aria-pressed="true"] > .i-eye-off { opacity: 1; transform: none; }
#sound[aria-pressed="false"] > .i-on { opacity: 0; transform: scale(0.4) rotate(45deg); }
#sound[aria-pressed="false"] > .i-off { opacity: 1; transform: none; }

.eye-all { display: inline-flex; align-items: center; gap: 8px; }
.eye-all svg { width: 16px; height: 16px; }
.eye-all .i-eye-off { margin-left: -24px; }

/* click ripple */
.ripple {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--s);
    height: var(--s);
    margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 79, 154, 0.55), rgba(255, 79, 154, 0) 70%);
    pointer-events: none;
    z-index: -1;
    animation: ripple 0.65s var(--ease-out) forwards;
}
button.secondary .ripple, button.ghost .ripple { background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent 70%); }
@keyframes ripple { from { transform: scale(0); opacity: 1; } to { transform: scale(1); opacity: 0; } }

button.loading { color: transparent !important; pointer-events: none; }
button.loading::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(9, 9, 11, 0.2);
    border-top-color: var(--primary-text);
    animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================
   Keys (masked by default)
   ========================================================= */

.key-cell { display: inline-flex; align-items: center; gap: 8px; }
.key-text {
    font: 500 13px var(--mono);
    color: var(--header);
    letter-spacing: 0.02em;
    white-space: pre;
    display: inline-block;
    transition: color 0.3s, text-shadow 0.3s;
}
.key-text.masked { color: var(--faint); }
.key-text.scrambling { color: var(--accent); text-shadow: 0 0 12px rgba(255, 79, 154, 0.6); }
.key-text.copyable { cursor: pointer; border-radius: 6px; padding: 2px 6px; margin: -2px -6px; }
.key-text.copyable:hover { background: rgba(255, 79, 154, 0.12); color: #fff; }
.key-text.masked.copyable:hover { color: var(--accent); }

/* =========================================================
   New key banner
   ========================================================= */

.created {
    margin-top: 14px;
    display: flex;
    gap: 14px;
    align-items: center;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
/* rotating gradient border */
.created::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 200%;
    aspect-ratio: 1;
    z-index: -2;
    background: conic-gradient(from 0deg, transparent 0 55%, var(--accent) 72%, var(--accent-2) 84%, transparent 100%);
    animation: border-spin 4s linear infinite;
}
@keyframes border-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to   { transform: translate(-50%, -50%) rotate(360deg); }
}
.created::after {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: -1;
    border-radius: 11px;
    background: linear-gradient(90deg, #1c0e16, #120f1d 60%, #0e0e11);
}
.created:not([hidden]) { animation: created-in 0.7s var(--ease-spring) backwards; }
@keyframes created-in { from { opacity: 0; transform: translateY(-10px) scale(0.97); filter: blur(4px); } }
.created-label { font: 500 11px var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.created .key-text { font-size: 18px; font-weight: 600; }
.created .row { margin-left: auto; }

/* =========================================================
   Table
   ========================================================= */

.table-wrap {
    overflow-x: auto;
    margin: 4px -20px -20px;
    border-top: 1px solid var(--line);
}
table { width: 100%; border-collapse: collapse; }
th {
    text-align: left;
    font: 500 11px var(--mono);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--faint);
    background: rgba(255, 255, 255, 0.015);
}
th, td { padding: 12px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
tbody tr { transition: background 0.2s; }
tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
tbody tr:last-child td { border-bottom: 0; }
td { color: var(--text); }
td:nth-child(2) { white-space: normal; min-width: 150px; max-width: 240px; color: var(--muted); }
td:nth-child(n+4):not(:last-child) { font: 12px var(--mono); color: var(--muted); }

tbody tr td:first-child { position: relative; }
tbody tr td:first-child::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(var(--accent), var(--accent-2));
    box-shadow: 0 0 10px var(--accent);
    transform: scaleY(0);
    transition: transform 0.35s var(--ease-out);
}
tbody tr:hover td:first-child::before { transform: scaleY(1); }

.actions { text-align: right; width: 1%; }
.actions button { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.actions button + button { margin-left: 6px; }

tbody tr.enter {
    animation: row-in 0.6s var(--ease-out) backwards;
    animation-delay: calc(var(--d, 0s) + 0.1s + var(--i, 0) * 50ms);
}
@keyframes row-in { from { opacity: 0; transform: translateY(8px); filter: blur(3px); } }

tbody tr.flash td { animation: flash 2.4s ease-out; }
@keyframes flash {
    0%, 25% { background: rgba(255, 79, 154, 0.16); }
    100%    { background: transparent; }
}

tbody tr.leaving { animation: row-out 0.42s var(--ease-in) forwards; }
@keyframes row-out { to { opacity: 0; transform: translateX(40px); filter: blur(4px); } }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    font: 500 12px var(--sans);
    border: 1px solid;
    transition: transform 0.3s var(--ease-spring), box-shadow 0.3s;
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.good { color: var(--positive); background: rgba(61, 220, 132, 0.08); border-color: rgba(61, 220, 132, 0.25); }
.pill.good::before { animation: blink 2s ease-in-out infinite; }
.pill.bad { color: var(--danger); background: rgba(255, 70, 85, 0.08); border-color: rgba(255, 70, 85, 0.25); }
.pill.warn { color: var(--warning); background: rgba(245, 181, 68, 0.08); border-color: rgba(245, 181, 68, 0.25); }
tr:hover .pill { transform: translateX(3px); box-shadow: 0 0 16px -4px currentColor; }
@keyframes blink { 50% { opacity: 0.35; } }

#empty { text-align: center; padding: 32px 0 12px; margin: 0; }
.error { color: var(--danger); min-height: 1.2em; margin: 0; font-size: 13px; }

/* =========================================================
   Entrance
   ========================================================= */

@keyframes rise {
    from { opacity: 0; transform: translateY(18px) scale(0.985); filter: blur(6px); }
}
.reveal {
    animation: rise 0.8s var(--ease-out) backwards;
    animation-delay: calc(var(--d, 0s) + var(--i, 0) * 80ms);
}
.nav.reveal { animation-name: nav-in; }
@keyframes nav-in { from { opacity: 0; transform: translateY(-100%); } }

/* =========================================================
   Modal
   ========================================================= */

.modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(5, 5, 7, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fade-in 0.3s var(--ease-out);
}
.modal.closing { animation: fade-out 0.22s var(--ease-in) forwards; }
.modal-card {
    width: min(420px, 100%);
    background: linear-gradient(180deg, #131316, #0d0d10);
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    padding: 24px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9), 0 0 60px -20px rgba(255, 70, 85, 0.35);
    animation: modal-in 0.5s var(--ease-spring);
}
.modal.closing .modal-card { animation: modal-out 0.22s var(--ease-in) forwards; }
.modal-card h2 { font-size: 18px; margin-bottom: 6px; }
.modal-card p { margin: 0 0 22px; word-break: break-word; }
.modal-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    font: 700 18px var(--mono);
    color: var(--danger);
    background: rgba(255, 70, 85, 0.12);
    border: 1px solid rgba(255, 70, 85, 0.3);
    animation: icon-pop 0.6s var(--ease-spring) 0.1s backwards;
}
.modal-actions { justify-content: flex-end; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(20px) scale(0.92); filter: blur(6px); } }
@keyframes modal-out { to { opacity: 0; transform: translateY(10px) scale(0.96); } }
@keyframes icon-pop { from { transform: scale(0) rotate(-30deg); } }

/* =========================================================
   Toast
   ========================================================= */

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    z-index: 95;
    transform: translateX(-50%);
    background: rgba(20, 20, 24, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--header);
    border: 1px solid var(--line-strong);
    padding: 11px 18px 11px 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    animation: toast-in 0.5s var(--ease-spring);
}
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 12px var(--positive); }
.toast.error::before { background: var(--danger); box-shadow: 0 0 12px var(--danger); }
.toast-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform-origin: left;
    animation: toast-timer 2.6s linear forwards;
}
.toast.error .toast-bar { background: var(--danger); }
.toast.out { animation: toast-out 0.28s var(--ease-in) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 20px) scale(0.9); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 12px) scale(0.96); } }
@keyframes toast-timer { to { transform: scaleX(0); } }

/* =========================================================
   Reduced motion: stop endless movement, keep short feedback
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    body::after, body::before, .brand-mark, .dot::after, .pill.good::before,
    .nav::after, .created::before { animation: none !important; }
    #cursor-glow { display: none; }
}
