/* ═══════════════════════════════════════════
 *  NexShare — Space Theme (same DA as portfolio)
 * ═══════════════════════════════════════════ */

:root {
    --bg:              #030014;
    --surface:         #0a0025;

    --space-purple:       #7042f8;
    --space-purple-light: #b49bff;
    --space-purple-pale:  #e2d9f3;
    --space-cyan:         #06b6d4;
    --space-border:       #2A0E61;

    --text-main:  #e2d9f3;
    --text-muted: #9ca3af;

    --success: #86efac;
    --warning: #fcd34d;
    --danger:  #f87171;

    --border: rgba(112, 66, 248, 0.22);
    --glow:   rgba(112, 66, 248, 0.4);

    --font-main:    'DM Mono', monospace;
    --font-heading: 'Syne', sans-serif;
    --font-mono:    'DM Mono', monospace;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 999px;

    --ease-smooth: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

    --glass-bg:     rgba(3, 0, 20, 0.37);
    --glass-border: rgba(112, 66, 248, 0.38);
    --glass-blur:   blur(16px);

    --card-shadow:       0 10px 30px rgba(0,0,0,0.4);
    --card-shadow-hover: 0 0 30px rgba(112,66,248,0.3), 0 20px 60px rgba(42,14,97,0.5);

    --gradient-primary: linear-gradient(135deg, var(--space-purple) 0%, var(--space-cyan) 100%);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
    font-family: var(--font-main);
    font-size: 15px;
    background: var(--bg);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed; inset: 0; z-index: 1;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    opacity: .025;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed; inset: 0; z-index: 0;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(42,14,97,0.35) 0%, transparent 65%),
        radial-gradient(ellipse at 80% 100%, rgba(6,182,212,0.06) 0%, transparent 55%);
    pointer-events: none;
}

#star-canvas {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
}

main { position: relative; z-index: 2; }

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

.container {
    width: 100%; max-width: 1300px;
    margin: 0 auto; padding: 0 2rem;
}
@media (max-width: 768px) { .container { padding: 0 1.25rem; } }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(112,66,248,0.45); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(112,66,248,0.7); }
::selection { background: var(--space-purple); color: #fff; }

/* ── Header ── */
header {
    position: fixed; top: 0; width: 100%;
    padding: 1rem 0; z-index: 1000;
    transition: all .4s ease;
}
header.scrolled {
    padding: .65rem 0;
    background: rgba(3,0,20,0.27);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(112,66,248,0.15);
    box-shadow: 0 10px 40px rgba(42,14,97,0.5);
}
nav { display: flex; justify-content: space-between; align-items: center; }

.nav-right {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.session-menu-btn {
    border-color: rgba(112,66,248,.35);
    background: rgba(112,66,248,.1);
}

.session-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 1085;
    background: rgba(2, 0, 12, .22);
}

.session-menu-panel {
    position: fixed;
    right: max(1rem, calc((100vw - 1300px) / 2 + 2rem));
    top: 68px;
    width: min(360px, calc(100vw - 2rem));
    max-height: calc(100vh - 84px);
    overflow: auto;
    z-index: 1090;
    padding: .85rem;
    background: rgba(6, 3, 28, .96);
    border: 1px solid rgba(112,66,248,.28);
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(2, 0, 14, .6);
    animation: panel-in .22s var(--ease-smooth);
}

@keyframes panel-in {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

.session-banner {
    border: 1px solid rgba(112,66,248,0.16);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    background: rgba(5, 2, 24, 0.72);
    padding: .7rem;
}
.session-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .7rem;
}
.session-menu-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: .95rem;
}
.session-banner-inner {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: .8rem;
    padding: .2rem 0;
}
.network-quality {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .22rem .56rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.03);
    white-space: nowrap;
}
.network-quality-label {
    font-size: .7rem;
    color: var(--text-muted);
}
.network-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}
.network-bars i {
    width: 3px;
    border-radius: 3px;
    background: rgba(156,163,175,.45);
}
.network-bars i:nth-child(1) { height: 4px; }
.network-bars i:nth-child(2) { height: 8px; }
.network-bars i:nth-child(3) { height: 12px; }
.network-quality-info {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}
.network-quality-info i { font-size: .75rem; }
.network-quality-info:hover { color: var(--space-purple-light); }

.network-quality.quality-low {
    border-color: rgba(248,113,113,.35);
    background: rgba(248,113,113,.08);
}
.network-quality.quality-low .network-quality-label { color: #fda4a4; }
.network-quality.quality-low .network-bars i:nth-child(1) { background: #f87171; }
.network-quality.quality-low .network-bars i:nth-child(2),
.network-quality.quality-low .network-bars i:nth-child(3) { background: rgba(248,113,113,.25); }

.network-quality.quality-medium {
    border-color: rgba(251,191,36,.32);
    background: rgba(251,191,36,.08);
}
.network-quality.quality-medium .network-quality-label { color: #fcd34d; }
.network-quality.quality-medium .network-bars i:nth-child(1),
.network-quality.quality-medium .network-bars i:nth-child(2) { background: #fbbf24; }
.network-quality.quality-medium .network-bars i:nth-child(3) { background: rgba(251,191,36,.25); }

.network-quality.quality-good {
    border-color: rgba(134,239,172,.3);
    background: rgba(134,239,172,.08);
}
.network-quality.quality-good .network-quality-label { color: #86efac; }
.network-quality.quality-good .network-bars i { background: #86efac; }

.compat-toggle {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    color: var(--text-muted);
    padding: .2rem .45rem;
    border: 1px solid rgba(112,66,248,.2);
    border-radius: var(--radius-pill);
    background: rgba(112,66,248,.06);
    white-space: nowrap;
}
.compat-toggle input { accent-color: var(--space-cyan); }

.session-badge {
    font-size: .72rem;
    padding: .22rem .62rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(112,66,248,0.3);
    color: var(--space-purple-light);
    background: rgba(112,66,248,0.12);
    white-space: nowrap;
}
.session-meta {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: .22rem;
    min-width: 0;
    width: 100%;
    font-size: .78rem;
}
.session-hint {
    color: var(--text-muted);
    font-size: .72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recv-transfer-stats {
    margin-top: .75rem;
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
    font-size: .72rem;
    color: var(--text-muted);
}

.recv-transfer-pill {
    padding: .16rem .5rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(6,182,212,.35);
    color: #7ee5ff;
    background: rgba(6,182,212,.1);
    font-weight: 700;
}

.recv-inline-stats {
    margin-top: .5rem;
    display: flex;
    align-items: center;
    gap: .55rem;
    flex-wrap: wrap;
    font-size: .72rem;
    color: var(--text-muted);
}
.session-banner.state-transfer .session-badge {
    color: #7ee5ff;
    border-color: rgba(6,182,212,0.45);
    background: rgba(6,182,212,0.14);
}
.session-banner.state-connected .session-badge {
    color: var(--success);
    border-color: rgba(134,239,172,0.45);
    background: rgba(134,239,172,0.12);
}
.session-banner.state-error .session-badge {
    color: var(--danger);
    border-color: rgba(248,113,113,0.42);
    background: rgba(248,113,113,0.14);
}

.btn-compact {
    padding: .36rem .8rem;
    font-size: .72rem;
}

.debug-panel {
    position: fixed;
    inset: 0;
    z-index: 9800;
    background: rgba(3,0,20,.78);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.debug-card {
    width: min(760px, 100%);
    max-height: 85vh;
    overflow: hidden;
    border: 1px solid rgba(112,66,248,.35);
    border-radius: var(--radius-xl);
    background: rgba(10,0,37,.92);
    box-shadow: 0 18px 70px rgba(0,0,0,.55);
    display: flex;
    flex-direction: column;
}
.debug-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1rem .75rem;
    border-bottom: 1px solid rgba(112,66,248,.2);
}
.debug-head h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: #fff;
}
.debug-summary {
    padding: .65rem 1rem;
    font-size: .75rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(112,66,248,.16);
}
.debug-throughput {
    padding: .7rem 1rem .5rem;
    border-bottom: 1px solid rgba(112,66,248,.16);
}
.debug-throughput-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .7rem;
    color: var(--text-muted);
    margin-bottom: .35rem;
}
.debug-throughput-meta {
    color: var(--space-cyan);
}
#debug-throughput-chart {
    width: 100%;
    height: 84px;
    display: block;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(112,66,248,.14);
    background: linear-gradient(180deg, rgba(112,66,248,.08), rgba(6,182,212,.03));
}
.debug-list {
    overflow: auto;
    padding: .6rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .45rem;
}
.debug-row {
    border: 1px solid rgba(112,66,248,.16);
    border-radius: var(--radius-sm);
    background: rgba(112,66,248,.05);
    padding: .5rem .6rem;
}
.debug-row-top {
    display: flex;
    justify-content: space-between;
    gap: .6rem;
    margin-bottom: .25rem;
    font-size: .68rem;
    color: var(--text-muted);
}
.debug-level {
    padding: .08rem .4rem;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255,255,255,.14);
    font-size: .62rem;
    text-transform: uppercase;
}
.debug-level.error { color: #fda4a4; border-color: rgba(248,113,113,.35); }
.debug-level.warn { color: #fcd34d; border-color: rgba(251,191,36,.35); }
.debug-level.info { color: #93c5fd; border-color: rgba(147,197,253,.3); }
.debug-msg {
    font-size: .77rem;
    color: var(--text-main);
    word-break: break-word;
}
.debug-meta {
    margin-top: .2rem;
    font-size: .68rem;
    color: var(--text-muted);
    word-break: break-word;
}
.debug-actions {
    display: flex;
    gap: .5rem;
    padding: .75rem 1rem 1rem;
    border-top: 1px solid rgba(112,66,248,.2);
}

.logo {
    display: flex; align-items: center; gap: .55rem;
    font-family: var(--font-heading);
    font-weight: 800; font-size: 1.4rem; letter-spacing: -1px;
    background: var(--gradient-primary);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}
.logo:hover { transform: translateY(-1px); }
.logo img {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(112,66,248,0.35));
}

.nav-badge {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .35rem .85rem;
    background: rgba(112,66,248,0.12);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-pill);
    font-size: .72rem; letter-spacing: .8px;
    color: var(--space-purple-light);
    backdrop-filter: blur(6px);
}
.nav-badge .live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%,100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .5; transform: scale(.8); }
}

/* ── Hero ── */
.hero {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 2;
    padding-top: 5rem;
}
.hero::before {
    content: '';
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    width: 70vw; height: 70vw;
    background: radial-gradient(circle, rgba(112,66,248,0.15) 0%, transparent 65%);
    z-index: -1; pointer-events: none; filter: blur(80px);
    animation: hero-pulse 6s ease-in-out infinite alternate;
}
@keyframes hero-pulse {
    from { opacity: .6; transform: translate(-50%,-50%) scale(1); }
    to   { opacity: 1;  transform: translate(-50%,-50%) scale(1.1); }
}
.hero-content {
    text-align: center;
    max-width: 760px;
    padding: 0 2rem;
}

.welcome-pill {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .4rem 1rem;
    background: rgba(3,0,20,0.4);
    border: 1px solid rgba(112,66,248,0.55);
    border-radius: 32px; backdrop-filter: blur(6px);
    font-family: var(--font-mono); font-size: .74rem; letter-spacing: 1px;
    color: var(--space-purple-light); margin-bottom: 1.75rem;
    box-shadow: inset 0 -7px 11px rgba(164,143,255,0.12);
}

.hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.7rem,6.2vw,5.35rem);
    line-height: .96;
    letter-spacing: -.05em;
    font-weight: 800;
    color: #fff; margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero h1 .hero-line {
    display: block;
    text-align: center;
}
.hero h1 .glow-word {
    display: block;
    width: auto;
    text-align: center;
    white-space: nowrap;
    background: linear-gradient(135deg, var(--space-purple-light) 0%, var(--space-cyan) 100%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 4s ease-in-out infinite alternate;
}
@keyframes gradient-shift {
    from { background-position: 0% 50%; }
    to   { background-position: 100% 50%; }
}
.hero p {
    font-size: clamp(.96rem, 1.1vw, 1.05rem);
    color: var(--text-muted);
    max-width: 580px;
    margin: 0 auto 2rem;
    line-height: 1.75;
}

.hero-steps {
    display: flex; justify-content: center; gap: .85rem 1rem;
    flex-wrap: wrap; margin-bottom: 2rem;
}
.step {
    display: flex; align-items: center; gap: .4rem;
    font-size: .78rem; color: var(--text-muted);
    padding: .35rem .7rem;
    border: 1px solid rgba(112,66,248,0.12);
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,.02);
}
.step-num {
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(112,66,248,0.2); border: 1px solid var(--glass-border);
    display: flex; align-items: center; justify-content: center;
    font-size: .65rem; color: var(--space-purple-light); flex-shrink: 0;
}
.step-arrow { color: rgba(112,66,248,0.4); font-size: .65rem; }

.btn-hero {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .88rem 2.1rem;
    background: var(--gradient-primary);
    border: none; border-radius: var(--radius-pill);
    color: #fff; font-family: var(--font-main); font-size: .88rem;
    cursor: pointer; transition: all .3s var(--ease-smooth);
    box-shadow: 0 0 30px rgba(112,66,248,0.35);
}
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 0 40px rgba(112,66,248,0.55); }

/* ── Transfer Section ── */
.transfer-section { padding: 4rem 0 6rem; position: relative; z-index: 2; }

.mobile-action-tabs {
    display: none;
    margin-bottom: 1rem;
    padding: .2rem;
    border: 1px solid rgba(112,66,248,0.2);
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,.03);
    gap: .25rem;
}
.mobile-tab {
    flex: 1;
    border: none;
    border-radius: var(--radius-pill);
    padding: .55rem .9rem;
    color: var(--text-muted);
    background: transparent;
    font-family: var(--font-main);
    font-size: .82rem;
}
.mobile-tab.active {
    background: rgba(112,66,248,0.22);
    color: #fff;
}

.transfer-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 1.5rem; align-items: start;
}
@media (max-width: 900px) { .transfer-grid { grid-template-columns: 1fr; } }

/* ── Glass Card ── */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--card-shadow);
    padding: 1.75rem;
    transition: box-shadow .3s var(--ease-smooth), border-color .3s;
    position: relative;
    overflow: hidden;
}
.glass-card:hover { box-shadow: var(--card-shadow-hover); border-color: rgba(112,66,248,0.55); }
.glass-card::before {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle at top left, rgba(112,66,248,0.12), transparent 42%),
                radial-gradient(circle at bottom right, rgba(6,182,212,0.08), transparent 36%);
    pointer-events: none;
}
.glass-card > * { position: relative; z-index: 1; }

.sender-card {
    border-color: rgba(112,66,248,0.42);
    box-shadow: 0 12px 40px rgba(12, 0, 32, 0.4), 0 0 0 1px rgba(112,66,248,0.08) inset;
}
.sender-card::after {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(112,66,248,.35), rgba(6,182,212,.18), rgba(255,255,255,0));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: .9;
}
.sender-card.transfer-mode .panel-title,
.sender-card.transfer-mode .drop-zone,
.sender-card.transfer-mode #file-list,
.sender-card.transfer-mode #file-footer,
.sender-card.transfer-mode .long-notice {
    display: none;
}
.sender-card.transfer-mode #share-panel {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}
.sender-card.transfer-mode #share-panel-body {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}
.sender-card.transfer-mode #share-panel-done {
    display: block;
}
.receiver-card {
    border-color: rgba(6,182,212,0.18);
}
.receiver-card::before {
    background: radial-gradient(circle at top right, rgba(6,182,212,0.1), transparent 40%),
                radial-gradient(circle at bottom left, rgba(112,66,248,0.08), transparent 38%);
}
.receiver-card:focus-within {
    border-color: rgba(6,182,212,0.38);
    box-shadow: 0 0 0 1px rgba(6,182,212,0.08) inset, 0 12px 40px rgba(12, 0, 32, 0.4);
}

.panel-title {
    font-family: var(--font-heading); font-size: 1rem; font-weight: 700; color: #fff;
    margin-bottom: 1.25rem; display: flex; align-items: center; gap: .6rem;
}
.panel-title i { color: var(--space-purple-light); font-size: 1rem; }

/* ── File input — caché via CSS (pas d'attribut hidden) ── */
#file-input {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    pointer-events: none;
}
.browse-label {
    display: inline-flex; align-items: center; gap: .45rem;
    margin-bottom: 1rem;
    padding: .68rem 1.05rem;
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(112,66,248,0.28);
    color: var(--text-main);
    box-shadow: 0 0 18px rgba(112,66,248,0.12);
    transition: all .25s var(--ease-smooth);
}
.browse-label:hover {
    background: rgba(112,66,248,0.12);
    border-color: rgba(112,66,248,0.5);
    transform: translateY(-1px);
    box-shadow: 0 0 24px rgba(112,66,248,0.22);
}

/* ── Drop Zone ── */
.drop-zone {
    border: 2px dashed rgba(112,66,248,0.3);
    border-radius: var(--radius-lg);
    padding: 2.2rem 1.4rem; text-align: center;
    cursor: pointer; transition: all .3s var(--ease-smooth);
    background: rgba(112,66,248,0.03); position: relative; overflow: hidden;
}
.drop-zone.has-files {
    border-style: solid;
    border-color: rgba(112,66,248,0.45);
    background: linear-gradient(180deg, rgba(112,66,248,0.08), rgba(112,66,248,0.03));
    transform: translateY(-1px);
}
.drop-zone.has-files .drop-icon {
    animation-duration: 2.2s;
    filter: drop-shadow(0 0 16px rgba(112,66,248,0.65));
}
.drop-zone::after {
    content: '';
    position: absolute; inset: 0;
    background: var(--gradient-primary);
    opacity: 0; transition: opacity .3s; border-radius: inherit;
    pointer-events: none;
}
.drop-zone.dragover, .drop-zone:hover {
    border-color: var(--space-purple);
    background: rgba(112,66,248,0.08);
}
.drop-zone.dragover::after { opacity: 0.04; }

.drop-icon {
    font-size: 2.5rem; color: var(--space-purple-light);
    margin-bottom: .75rem; display: block;
    filter: drop-shadow(0 0 12px rgba(112,66,248,0.5));
    position: relative; z-index: 1;
    animation: float 3s ease-in-out infinite;
}
@keyframes float {
    0%,100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}
.drop-text {
    position: relative; z-index: 1; color: var(--text-main);
    font-size: .92rem; margin-bottom: .35rem;
    font-weight: 600;
}
.drop-sub {
    position: relative; z-index: 1; color: var(--text-muted);
    font-size: .78rem; margin-bottom: 1.15rem;
}

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .6rem 1.25rem; border-radius: var(--radius-pill);
    font-family: var(--font-main); font-size: .84rem; letter-spacing: .3px;
    cursor: pointer; border: none; transition: all .25s var(--ease-smooth);
    position: relative; z-index: 1;
}
.btn-primary {
    background: var(--gradient-primary); color: #fff;
    box-shadow: 0 0 20px rgba(112,66,248,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 0 30px rgba(112,66,248,0.5); }
.drop-zone:active,
.browse-label:active,
.btn:active {
    transform: translateY(0) scale(.985);
}
.btn-primary:focus-visible,
.browse-label:focus-visible,
.file-remove:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible,
.btn-hero:focus-visible {
    outline: 2px solid rgba(182, 163, 255, 0.85);
    outline-offset: 2px;
}
.btn-secondary {
    background: rgba(255,255,255,.06); color: var(--text-main);
    border: 1px solid var(--glass-border);
}
.btn-secondary:hover { background: rgba(112,66,248,0.12); border-color: var(--space-purple); }
.btn-danger {
    background: rgba(248,113,113,.12); color: var(--danger);
    border: 1px solid rgba(248,113,113,.25);
}
.btn-danger:hover { background: rgba(248,113,113,.2); }

/* ── File List ── */
.file-list {
    margin-top: .75rem; display: flex; flex-direction: column; gap: .4rem;
    max-height: 200px; overflow-y: auto;
}
.file-item {
    display: flex; align-items: center; gap: .65rem;
    padding: .55rem .8rem;
    background: rgba(112,66,248,0.06);
    border: 1px solid rgba(112,66,248,0.15);
    border-radius: var(--radius-md); font-size: .8rem;
    animation: slide-in .25s var(--ease-smooth);
    transition: transform .2s var(--ease-smooth), border-color .2s var(--ease-smooth), background .2s var(--ease-smooth);
}
.file-item:hover {
    transform: translateY(-2px);
    background: rgba(112,66,248,0.08);
    border-color: rgba(112,66,248,0.3);
}
@keyframes slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.file-icon { font-size: 1rem; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { color: var(--text-main); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { color: var(--text-muted); font-size: .7rem; }
.file-remove {
    background: none; border: none; cursor: pointer;
    color: var(--text-muted); font-size: .85rem;
    padding: .15rem .3rem; border-radius: 4px; transition: color .2s, transform .2s var(--ease-smooth); flex-shrink: 0;
}
.file-remove:hover { color: var(--danger); transform: rotate(8deg) scale(1.05); }

.file-list-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: .6rem;
}
.file-list-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: .6rem; flex-wrap: wrap; gap: .5rem;
}
.file-count { font-size: .73rem; color: var(--text-muted); }

/* ── Share Panel ── */
.share-panel {
    margin-top: 1.25rem; padding-top: 1.25rem;
    border-top: 1px solid rgba(112,66,248,0.15);
    animation: fade-up .4s var(--ease-smooth);
}
.share-panel.hidden { display: none; }
@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.code-block {
    text-align: center; margin-bottom: 1rem;
}
.code-label {
    font-size: .7rem; letter-spacing: 1.5px; color: var(--text-muted);
    text-transform: uppercase; display: block; margin-bottom: .5rem;
}
.code-value {
    font-family: var(--font-heading); font-size: 2.6rem; font-weight: 800;
    letter-spacing: .2em;
    background: var(--gradient-primary);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1; margin-bottom: .75rem;
    filter: drop-shadow(0 0 20px rgba(112,66,248,0.4));
}
.code-actions { display: flex; gap: .5rem; justify-content: center; }

.session-proof {
    margin-top: .45rem;
    font-size: .72rem;
    color: var(--text-muted);
    letter-spacing: .04em;
}

#qr-container {
    display: flex; justify-content: center; align-items: center;
    margin: .9rem 0;
    padding: .7rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(112,66,248,0.16);
    background: linear-gradient(180deg, rgba(112,66,248,0.08), rgba(6,182,212,0.04));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
#qr-container canvas {
    display: block;
    width: 150px !important;
    height: 150px !important;
    border-radius: var(--radius-md);
    border: 1px solid rgba(112,66,248,0.25);
    padding: 8px;
    background: rgba(10,0,37,0.95);
    box-shadow: 0 0 26px rgba(112,66,248,0.14);
}

/* ── Status Row ── */
.status-row {
    display: flex; align-items: center; gap: .6rem;
    padding: .6rem .9rem;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: var(--radius-md); font-size: .78rem; color: var(--text-muted);
}
.status-dot {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    background: var(--text-muted); transition: background .3s;
}
.status-dot.waiting   { background: var(--warning); animation: pulse-dot 1.5s ease-in-out infinite; }
.status-dot.connected { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.transfer  { background: var(--space-cyan); animation: pulse-dot 1s ease-in-out infinite; }
.status-dot.error     { background: var(--danger); }

/* ── Expiry ── */
.expiry-bar { height: 3px; background: rgba(255,255,255,.06); border-radius: 100px; overflow: hidden; margin-top: .6rem; }
.expiry-fill { height: 100%; background: linear-gradient(to right, var(--success), var(--warning)); border-radius: 100px; transition: width 1s linear; }
.expiry-label { font-size: .68rem; color: var(--text-muted); text-align: right; margin-top: .2rem; }

/* ── Receive Panel ── */
.code-input-wrap { display: flex; gap: .6rem; margin-bottom: .75rem; }
.code-input {
    flex: 1; background: rgba(255,255,255,.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); padding: .7rem 1rem;
    color: var(--text-main); font-family: var(--font-heading);
    font-size: 1.1rem; letter-spacing: .15em; text-transform: uppercase;
    transition: border-color .25s; outline: none; cursor: text;
}
.code-input:focus { border-color: var(--space-purple); box-shadow: 0 0 0 3px rgba(112,66,248,0.15); }
.code-input::placeholder { color: rgba(156,163,175,0.4); letter-spacing: .08em; font-size: .88rem; }

@media (max-width: 768px) {
    header { padding: .75rem 0; }
    nav { gap: .75rem; }
    .nav-badge { display: none; }

    .hero {
        min-height: auto;
        padding: 6.5rem 0 3.5rem;
    }
    .hero-content { padding: 0 1rem; }
    .hero h1 {
        font-size: clamp(2.4rem, 12vw, 4rem);
        line-height: .94;
    }
    .hero p {
        max-width: 32rem;
        line-height: 1.65;
        margin-bottom: 1.5rem;
    }
    .hero-steps {
        flex-direction: column;
        align-items: center;
        gap: .45rem;
        margin-bottom: 1.5rem;
    }
    .step-arrow { display: none; }
    .btn-hero { width: 100%; justify-content: center; max-width: 260px; }

    .session-menu-panel {
        right: .5rem;
        left: .5rem;
        top: 62px;
        width: auto;
        max-height: calc(100vh - 74px);
        padding: .65rem;
        border-radius: 12px;
    }
    .session-banner-inner {
        gap: .5rem;
        padding: .2rem 0;
    }
    .session-badge {
        font-size: .66rem;
        padding: .18rem .45rem;
    }
    .session-meta {
        font-size: .7rem;
    }
    #session-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    .session-hint {
        white-space: normal;
    }
    .session-banner .btn-compact {
        width: 100%;
        justify-content: center;
        padding: .34rem .58rem;
        font-size: .68rem;
        min-height: 30px;
    }
    .network-quality,
    .compat-toggle {
        width: 100%;
        justify-content: space-between;
    }
    .network-quality {
        gap: .35rem;
        padding: .2rem .45rem;
    }
    .network-quality-label {
        font-size: .64rem;
    }
    .compat-toggle {
        display: inline-flex;
    }
    #reconnect-now-btn {
        width: 100%;
        justify-content: center;
        margin-top: .15rem;
    }

    .nav-right .nav-badge {
        display: none;
    }

    .transfer-section { padding: 2.5rem 0 4.5rem; }
    .mobile-action-tabs {
        display: flex;
    }
    .glass-card { padding: 1.25rem; }
    .sender-card,
    .receiver-card {
        border-radius: 20px;
    }
    .drop-zone { padding: 1.75rem 1rem; }
    .drop-icon { font-size: 2.1rem; }
    .drop-text { font-size: .88rem; }
    .drop-sub { font-size: .72rem; margin-bottom: .95rem; }
    .browse-label { width: 100%; justify-content: center; }
    .drop-zone.has-files { transform: none; }

    .code-input-wrap { flex-direction: column; }
    .code-input { width: 100%; }
    .code-input-wrap .btn { width: 100%; justify-content: center; }
    .recv-transfer-stats {
        font-size: .68rem;
        gap: .45rem;
    }
    .recv-inline-stats {
        font-size: .68rem;
        gap: .45rem;
    }

    .share-panel {
        margin-top: 1rem;
        padding-top: 1rem;
    }
    .code-value {
        font-size: clamp(2rem, 9vw, 2.6rem);
        letter-spacing: .12em;
        word-break: break-word;
    }
    #qr-container {
        margin: .8rem 0;
        padding: .55rem;
    }
    #qr-container canvas {
        width: 132px !important;
        height: 132px !important;
    }
    .status-row {
        font-size: .75rem;
        align-items: flex-start;
    }
    .expiry-label {
        text-align: center;
    }

    .code-actions, .incoming-actions, .flex-gap {
        flex-direction: column;
        width: 100%;
    }
    .code-actions .btn, .incoming-actions .btn, .flex-gap .btn {
        width: 100%;
        justify-content: center;
    }

    .transfer-section.mobile-send .receiver-card {
        display: none;
    }
    .transfer-section.mobile-receive .sender-card {
        display: none;
    }

    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        align-items: stretch;
    }
    .toast { max-width: none; }

    .debug-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .debug-head .btn {
        width: 100%;
        justify-content: center;
    }
    .debug-actions {
        flex-direction: column;
    }
    .debug-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ── Incoming ── */
.incoming-card {
    padding: 1rem; background: rgba(112,66,248,0.06);
    border: 1px solid rgba(112,66,248,0.2);
    border-radius: var(--radius-lg); animation: fade-up .3s var(--ease-smooth);
    margin-top: .75rem;
}
.incoming-label { font-size: .7rem; letter-spacing: 1px; color: var(--text-muted); text-transform: uppercase; margin-bottom: .6rem; }
.incoming-file-list { display: flex; flex-direction: column; gap: .35rem; margin-bottom: .75rem; }
.incoming-total { font-size: .73rem; color: var(--text-muted); padding-top: .5rem; border-top: 1px solid rgba(255,255,255,.06); margin-bottom: .75rem; }
.incoming-actions { display: flex; gap: .5rem; }

.manual-dl-list {
    margin-top: .9rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.manual-dl-link {
    justify-content: center;
    width: 100%;
}

/* ── Progress Overlay ── */
.progress-overlay {
    position: fixed; inset: 0; z-index: 500;
    display: flex; align-items: center; justify-content: center;
    background: rgba(3,0,20,0.88); backdrop-filter: blur(8px);
    animation: fade-in .3s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.progress-overlay.hidden { display: none; }

.progress-card { max-width: 460px; width: 90%; text-align: center; }
.progress-card h3 { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 700; color: #fff; margin-bottom: .35rem; }
.progress-sub { font-size: .78rem; color: var(--text-muted); margin-bottom: 1.5rem; }

.progress-bar-track {
    height: 6px; background: rgba(255,255,255,.07);
    border-radius: 100px; overflow: hidden; margin-bottom: .6rem;
}
.progress-bar-fill {
    height: 100%; width: 0%;
    background: var(--gradient-primary);
    border-radius: 100px; transition: width .25s ease;
    position: relative; overflow: hidden;
}
.progress-bar-fill::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    from { transform: translateX(-100%); }
    to   { transform: translateX(200%); }
}
.progress-stats {
    display: flex; justify-content: space-between;
    font-size: .75rem; color: var(--text-muted); margin-bottom: 1rem;
}
.progress-percent { color: var(--space-purple-light); font-weight: 600; }
.progress-files-list {
    display: flex; flex-direction: column; gap: .3rem;
    text-align: left; max-height: 130px; overflow-y: auto; margin-bottom: 1rem;
}
.prog-file-row {
    display: flex; align-items: center; gap: .55rem;
    font-size: .76rem; padding: .35rem .6rem;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,.03); color: var(--text-muted);
}
.prog-file-row.active { background: rgba(112,66,248,.1); color: #fff; }
.prog-file-row.done   { color: var(--success); }

/* ── Done State ── */
.done-icon {
    font-size: 3rem; color: var(--success);
    filter: drop-shadow(0 0 16px var(--success));
    margin-bottom: .75rem; display: block;
    animation: pop-in .5s var(--ease-bounce);
}
@keyframes pop-in {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
.done-title { font-family: var(--font-heading); font-size: 1.2rem; font-weight: 700; color: #fff; margin-bottom: .35rem; }
.done-sub { font-size: .8rem; color: var(--text-muted); margin-bottom: 1.25rem; }

/* ── Connecting spinner ── */
.spinner {
    width: 28px; height: 28px;
    border: 2px solid rgba(112,66,248,.2);
    border-top-color: var(--space-purple);
    border-radius: 50%; animation: spin .8s linear infinite;
    margin: 0 auto .75rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Features Grid ── */
.features-section { padding: 2rem 0 6rem; position: relative; z-index: 2; }
.section-label { font-size: .7rem; letter-spacing: 2px; text-transform: uppercase; color: var(--space-purple-light); text-align: center; margin-bottom: .6rem; }
.section-title { font-family: var(--font-heading); font-size: clamp(1.5rem,3vw,2.1rem); font-weight: 800; text-align: center; color: #fff; margin-bottom: .6rem; }
.section-sub { text-align: center; color: var(--text-muted); font-size: .88rem; max-width: 460px; margin: 0 auto 2.25rem; }

.features-grid {
    display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem;
}
@media (max-width: 900px) { .features-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 540px) { .features-grid { grid-template-columns: 1fr; } }

.feature-card { padding: 1.5rem; text-align: center; transition: all .3s var(--ease-smooth); }
.feature-card:hover { transform: translateY(-4px); }
.feature-icon {
    font-size: 1.75rem; margin-bottom: .65rem; display: block;
    background: var(--gradient-primary);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.feature-title { font-family: var(--font-heading); font-size: .92rem; font-weight: 700; color: #fff; margin-bottom: .35rem; }
.feature-desc { font-size: .76rem; color: var(--text-muted); line-height: 1.6; }

/* ── Long storage notice ── */
.long-notice {
    display: flex; align-items: flex-start; gap: .75rem;
    padding: .9rem 1.1rem;
    background: rgba(6,182,212,.06);
    border: 1px solid rgba(6,182,212,.2);
    border-radius: var(--radius-lg);
    font-size: .78rem; color: var(--text-muted); margin-top: 1rem;
}
.long-notice i { color: var(--space-cyan); font-size: 1rem; flex-shrink: 0; margin-top: .1rem; }
.long-notice strong { color: var(--space-cyan); }

/* ── Footer ── */
footer {
    position: relative; z-index: 2;
    border-top: 1px solid rgba(112,66,248,0.1);
    padding: 1.75rem 0; text-align: center;
}
.footer-logo {
    font-family: var(--font-heading); font-weight: 800; font-size: 1.1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: .35rem;
}
.footer-text { font-size: .73rem; color: var(--text-muted); }

/* ── Toasts ── */
.toast-container {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    z-index: 9000; display: flex; flex-direction: column; gap: .4rem;
    pointer-events: none;
}
.toast {
    padding: .65rem 1rem;
    background: rgba(3,0,20,0.92);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md); backdrop-filter: blur(12px);
    font-size: .78rem; color: var(--text-main);
    display: flex; align-items: center; gap: .55rem;
    box-shadow: var(--card-shadow); max-width: 300px;
    animation: toast-in .35s var(--ease-bounce);
    pointer-events: all;
}
@keyframes toast-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}
.toast.success { border-color: rgba(134,239,172,.3); }
.toast.error   { border-color: rgba(248,113,113,.3); }
.toast.info    { border-color: rgba(6,182,212,.3); }
.toast i { font-size: .95rem; flex-shrink: 0; }
.toast.success i { color: var(--success); }
.toast.error   i { color: var(--danger); }
.toast.info    i { color: var(--space-cyan); }

/* ── Utility ── */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); font-size: .78rem; }
.mt-sm { margin-top: .5rem; }
.mt-md { margin-top: 1rem; }
.flex-gap { display: flex; gap: .5rem; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    #star-canvas { display: none !important; }
}
