/* ═══════════════════════════════════════════
   Klips — Styles
   ═══════════════════════════════════════════ */

/* ─── Google Fonts ────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Theme Variables ─────────────────────── */
:root,
[data-theme="dark"] {
    --bg-primary: #0d0d14;
    --bg-secondary: #13131e;
    --bg-card: #17172a;
    --bg-card-hover: #1e1e35;
    --bg-input: #11111c;
    --bg-code: #0e0e19;
    --text-primary: #eeeef5;
    --text-secondary: #8a8aaa;
    --text-muted: #55556a;
    --accent: #7c6fff;
    --accent-hover: #9084ff;
    --accent-glow: rgba(124, 111, 255, 0.2);
    --accent-glow-strong: rgba(124, 111, 255, 0.35);
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.1);
    --error: #f87171;
    --error-bg: rgba(248, 113, 113, 0.1);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.1);
    --info: #60a5fa;
    --border: rgba(255, 255, 255, 0.06);
    --border-subtle: rgba(255, 255, 255, 0.03);
    --border-focus: rgba(124, 111, 255, 0.5);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 32px rgba(124, 111, 255, 0.15);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 7px;
    --glass: rgba(23, 23, 42, 0.85);
    --glass-border: rgba(255, 255, 255, 0.05);
    --header-bg: rgba(13, 13, 20, 0.85);
    --gradient-hero: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124,111,255,0.15) 0%, transparent 70%);
    --gradient-accent: linear-gradient(135deg, #7c6fff, #a78bfa);
}

[data-theme="light"] {
    --bg-primary: #f7f7fc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f3f3f9;
    --bg-input: #f0f0f8;
    --bg-code: #fafafe;
    --text-primary: #18182a;
    --text-secondary: #5a5a78;
    --text-muted: #9898b8;
    --accent: #6c63ff;
    --accent-hover: #5b52ee;
    --accent-glow: rgba(108, 99, 255, 0.12);
    --accent-glow-strong: rgba(108, 99, 255, 0.25);
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.08);
    --error: #dc2626;
    --error-bg: rgba(220, 38, 38, 0.08);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.08);
    --border: rgba(0, 0, 0, 0.07);
    --border-subtle: rgba(0, 0, 0, 0.03);
    --border-focus: rgba(108, 99, 255, 0.4);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 32px rgba(108, 99, 255, 0.1);
    --glass: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.05);
    --header-bg: rgba(247, 247, 252, 0.85);
    --gradient-hero: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(108,99,255,0.08) 0%, transparent 70%);
    --gradient-accent: linear-gradient(135deg, #6c63ff, #a78bfa);
}

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

html {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--gradient-hero);
    pointer-events: none;
    z-index: 0;
}

/* ─── Header ──────────────────────────────── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 28px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -0.04em;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--gradient-accent);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 12px var(--accent-glow-strong);
}

.logo-icon svg { display: block; }

.logo-text {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav { display: flex; align-items: center; gap: 6px; }

/* ─── Layout ──────────────────────────────── */
.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
    flex: 1;
}

.container-room {
    max-width: 820px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 65px);
    padding-top: 20px;
    padding-bottom: 0;
}

.view { display: none; flex: 1; }
.view-active { display: block; }
#room-view.view-active { display: flex; flex-direction: column; }

/* ─── Hero ────────────────────────────────── */
.hero {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 8px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--accent-glow);
    border: 1px solid rgba(124, 111, 255, 0.2);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 20px;
    letter-spacing: 0.02em;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    margin-bottom: 14px;
    line-height: 1.15;
}

.accent {
    background: var(--gradient-accent);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 460px;
    margin: 0 auto;
    line-height: 1.65;
}

/* ─── Cards ───────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

.editor-card {
    padding: 0;
    box-shadow: var(--shadow), var(--shadow-glow);
    border-color: rgba(124, 111, 255, 0.12);
}

/* ─── Editor ──────────────────────────────── */
.editor {
    width: 100%;
    min-height: 180px;
    padding: 20px 22px;
    background: var(--bg-input);
    border: none;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    font-size: 0.95rem;
    line-height: 1.75;
    resize: vertical;
    outline: none;
    transition: background 0.2s;
    border-radius: var(--radius) var(--radius) 0 0;
}

.editor::placeholder { color: var(--text-muted); font-family: 'Outfit', sans-serif; }
.editor:focus { background: var(--bg-card); }

.editor-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 22px 0;
    min-height: 0;
}

.char-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    transition: color 0.2s;
}

.char-count.warn { color: var(--warning); }

.advanced-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    border: none;
    background: transparent;
    transition: color 0.15s, background 0.15s;
}

.advanced-toggle:hover { color: var(--text-primary); background: var(--bg-input); }
.advanced-toggle svg { transition: transform 0.2s; }
.advanced-toggle.open svg { transform: rotate(180deg); }

.editor-options {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 22px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.2s;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
    pointer-events: none;
}

.editor-options.visible {
    max-height: 80px;
    padding: 14px 22px;
    opacity: 1;
    pointer-events: all;
}

.editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 22px 18px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.expiry-quick {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.expiry-label {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 600;
}

.expiry-chip {
    padding: 7px 13px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    transition: all 0.15s;
}

.expiry-chip:hover { border-color: var(--accent); color: var(--accent); }
.expiry-chip.active { background: var(--accent-glow); border-color: var(--accent); color: var(--accent); }

.option-group { display: flex; align-items: center; gap: 8px; }
.option-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 600; white-space: nowrap; }

.editor-card .btn-primary {
    flex-shrink: 0;
    min-width: 140px;
}

/* ─── Inputs ──────────────────────────────── */
.input, .select {
    padding: 11px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus, .select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-small { max-width: 130px; }

.select {
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%237c6fff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* ─── Toggle ──────────────────────────────── */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1rem;
    user-select: none;
}

.toggle-input { display: none; }

.toggle-switch {
    width: 38px;
    height: 21px;
    background: var(--border);
    border-radius: 11px;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
    border: 1px solid var(--border);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 15px;
    height: 15px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

.toggle-input:checked + .toggle-switch { background: var(--accent); border-color: var(--accent); }
.toggle-input:checked + .toggle-switch::after { transform: translateX(17px); background: white; }

/* ─── Buttons ─────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all 0.18s;
    text-decoration: none;
    line-height: 1;
    letter-spacing: -0.01em;
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
    background: var(--gradient-accent);
    color: white;
    box-shadow: 0 2px 16px var(--accent-glow-strong);
}
.btn-primary:hover:not(:disabled) {
    box-shadow: 0 4px 24px var(--accent-glow-strong);
    transform: translateY(-1px);
    filter: brightness(1.05);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: var(--text-muted); }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { color: var(--text-primary); background: var(--bg-input); }

.btn-lg { padding: 13px 28px; font-size: 0.95rem; }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }

.btn-lang {
    padding: 5px 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: all 0.18s;
}
.btn-lang:hover { border-color: var(--accent); color: var(--accent); }

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: var(--radius-xs);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s;
}
.btn-icon:hover { background: var(--bg-input); color: var(--text-primary); }

.btn-send {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

/* ─── Divider ─────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ─── Room Create ─────────────────────────── */
.room-create-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-card-hover));
}
.room-create-card h2 { font-size: 1.15rem; margin-bottom: 6px; letter-spacing: -0.02em; font-weight: 800; }
.room-create-card p { color: var(--text-secondary); margin-bottom: 18px; font-size: 0.9rem; }

.room-create-form {
    display: flex;
    gap: 10px;
}
.room-create-form .input { flex: 1; }

/* ─── Trust Badges ────────────────────────── */
.trust-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
    padding: 16px 0;
    border-top: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.trust-item svg { color: var(--success); flex-shrink: 0; }

/* ─── Features ────────────────────────────── */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 40px;
}

.feature {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 18px;
    text-align: center;
}

.feature-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-glow);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    color: var(--accent);
}

.feature h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
    font-family: 'Outfit', sans-serif;
}

.feature p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
    font-family: 'Outfit', sans-serif;
}

@media (max-width: 560px) {
    .features { grid-template-columns: 1fr; gap: 10px; }
    .feature { padding: 16px; display: flex; align-items: flex-start; gap: 14px; text-align: left; }
    .feature-icon { margin: 0; flex-shrink: 0; }
}

/* ─── Share View ──────────────────────────── */
.share-card {
    text-align: center;
    max-width: 620px;
    margin: 0 auto;
}

.share-qr-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 20px 0 8px;
}

#share-qr-canvas {
    display: inline-block;
    line-height: 0;
}

#share-qr-canvas img,
#share-qr-canvas canvas {
    border-radius: 8px;
    border: 8px solid white;
    display: block;
    image-rendering: pixelated;
}

.share-qr-hint {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 10px;
    font-weight: 500;
}

.btn-full { width: 100%; justify-content: center; }

.share-success-icon {
    width: 64px;
    height: 64px;
    background: var(--success-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--success);
    animation: popIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.share-card h2 { font-size: 1.6rem; margin-bottom: 8px; letter-spacing: -0.03em; font-weight: 900; }
.share-info { color: var(--text-secondary); margin-bottom: 24px; line-height: 1.55; font-size: 1rem; }

.share-url-group {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.share-url-input {
    flex: 1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.82rem;
    min-width: 0;
}

.share-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ─── Clip View ───────────────────────────── */
.clip-meta {
    display: flex;
    gap: 7px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-lang { background: var(--accent-glow); color: var(--accent); border: 1px solid rgba(124,111,255,0.2); }
.badge-time { background: var(--bg-input); color: var(--text-muted); }
.badge-expiry { background: var(--warning-bg); color: var(--warning); }
.badge-burn { background: var(--error-bg); color: var(--error); }

.clip-code {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.84rem;
    line-height: 1.75;
    margin-bottom: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.clip-code code { background: none; padding: 0; }

.clip-code-small {
    padding: 12px 16px;
    max-height: 200px;
    margin-bottom: 0;
    font-size: 0.8rem;
}

.clip-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.burn-warning {
    background: var(--error-bg);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--error);
    font-size: 0.88rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.error-msg {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ─── PIN Prompt ──────────────────────────── */
.pin-prompt { text-align: center; padding: 32px 16px; }
.pin-icon { font-size: 2.5rem; margin-bottom: 16px; }
.pin-prompt h3 { margin-bottom: 8px; font-weight: 800; font-size: 1.1rem; }
.pin-prompt p { color: var(--text-secondary); margin-bottom: 24px; font-size: 0.9rem; }

.pin-input-group {
    display: flex;
    gap: 10px;
    max-width: 300px;
    margin: 0 auto 12px;
}

.pin-input-group .input {
    flex: 1;
    text-align: center;
    font-size: 1.1rem;
    letter-spacing: 0.2em;
    font-family: 'JetBrains Mono', monospace;
}

.pin-error { color: var(--error); font-size: 0.84rem; min-height: 20px; }

/* ─── Room View ───────────────────────────── */
.room-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.room-info h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.room-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-top: 5px;
    font-weight: 500;
}

.room-actions { display: flex; gap: 8px; align-items: center; }

.status-indicator {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.status-connecting { background: var(--warning); animation: pulse 1.5s infinite; }
.status-connected { background: var(--success); }
.status-disconnected { background: var(--error); }
.status-reconnecting { background: var(--warning); animation: pulse 1s infinite; }
.status-error { background: var(--error); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

.room-clips {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.room-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 40px;
    gap: 12px;
}
.room-empty-icon { font-size: 2.5rem; opacity: 0.4; }

.room-clip {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    border: 1px solid var(--border);
    animation: slideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.room-clip-mine {
    background: linear-gradient(135deg, rgba(124,111,255,0.08), rgba(124,111,255,0.04));
    border-color: rgba(124, 111, 255, 0.15);
    margin-left: 32px;
}
.room-clip-other { background: var(--bg-card); margin-right: 32px; }

.room-clip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.room-clip-time { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }
.room-clip-who {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
}
.room-clip-header .btn-icon { width: 26px; height: 26px; margin-left: auto; }

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.room-input-bar {
    display: flex;
    gap: 10px;
    padding: 14px 0 18px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    align-items: flex-end;
}

.room-textarea {
    flex: 1;
    resize: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.84rem;
    min-height: 44px;
    max-height: 120px;
    border-radius: var(--radius-sm);
}

/* ─── Toast Notifications ─────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    background: var(--glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-lg);
    font-size: 0.88rem;
    font-weight: 500;
    transform: translateX(calc(100% + 32px));
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s;
    max-width: 340px;
    opacity: 0;
}

.toast-visible { transform: translateX(0); opacity: 1; }

.toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

.toast-success .toast-icon { background: var(--success-bg); color: var(--success); }
.toast-error .toast-icon { background: var(--error-bg); color: var(--error); }
.toast-info .toast-icon { background: var(--accent-glow); color: var(--accent); }

/* ─── Modal ───────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.modal-visible { opacity: 1; pointer-events: all; }

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-lg);
    max-width: 380px;
    width: 90%;
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
    from { transform: scale(0.92) translateY(12px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ─── QR Code ─────────────────────────────── */
.qr-container { text-align: center; }
.qr-container h3 { margin-bottom: 20px; font-weight: 800; }
#qr-canvas-container {
    display: inline-block;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border: 8px solid white;
    line-height: 0;
}
#qr-canvas-container img,
#qr-canvas-container canvas {
    display: block;
    image-rendering: pixelated;
}
.qr-url { font-size: 0.8rem; color: var(--text-muted); word-break: break-all; margin-bottom: 20px; font-family: 'JetBrains Mono', monospace; }

/* ─── Loading Spinner ─────────────────────── */
.loading { text-align: center; padding: 56px; }
.loading p { color: var(--text-secondary); margin-top: 16px; font-size: 0.9rem; }

.spinner {
    width: 30px;
    height: 30px;
    border: 2.5px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Footer ──────────────────────────────── */
footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 28px 24px;
    position: relative;
    z-index: 1;
}

.footer-inner {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
    color: var(--text-secondary);
    text-decoration: none;
}

.footer-logo-icon {
    width: 22px;
    height: 22px;
    background: var(--gradient-accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.footer-disclaimer {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 560px;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s;
}
.footer-link:hover { color: var(--accent); }

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ─── Responsive ──────────────────────────── */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.85rem; }
    .subtitle { font-size: 0.95rem; }

    .editor-options.visible { flex-direction: column; align-items: stretch; gap: 12px; }
    .share-url-group { flex-direction: column; }
    .room-create-form { flex-direction: column; }

    .room-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .room-clip-mine { margin-left: 0; }
    .room-clip-other { margin-right: 0; }

    .toast-container { left: 16px; right: 16px; bottom: 16px; }
    .toast { max-width: none; }
    .container { padding: 24px 16px; }
    .trust-strip { gap: 14px; }
    .expiry-quick { gap: 4px; }
}

@media (max-width: 380px) {
    .hero h1 { font-size: 1.6rem; }
    .header { padding: 12px 16px; }
}

/* ─── Scrollbar ───────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Selection ───────────────────────────── */
::selection { background: var(--accent-glow-strong); color: var(--text-primary); }

/* ─── Focus ───────────────────────────────── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) { outline: none; }
