:root {
    --bg: #0b0f19;
    --bg-2: #101524;
    --panel: rgba(255, 255, 255, 0.05);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text: #e7ecf5;
    --muted: #94a3b8;
    --accent: #6d8dff;
    --accent-2: #a06dff;
    --danger: #ff6d8d;
    --gold: #ffcf6d;
}

* { box-sizing: border-box; }

body, html {
    margin: 0;
    padding: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.8rem; }

/* ---------- Lock screen ---------- */
.lock-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(109, 141, 255, 0.18), transparent 60%),
        radial-gradient(900px 500px at 80% 110%, rgba(160, 109, 255, 0.16), transparent 60%),
        var(--bg);
    z-index: 200;
}

.lock-card {
    width: min(92vw, 380px);
    background: var(--panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 36px 32px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.lock-logo {
    font-size: 2.4rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 8px;
}

.lock-card h1 {
    font-family: 'Sora', sans-serif;
    font-size: 1.4rem;
    margin: 0 0 6px;
}

.lock-card form { margin-top: 20px; display: flex; flex-direction: column; gap: 12px; }

.lock-card input[type="password"] {
    width: 100%;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    font-size: 1rem;
    outline: none;
}
.lock-card input[type="password"]:focus { border-color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    border-radius: 11px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text);
    background: transparent;
    transition: transform 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
}
.btn-primary:hover { filter: brightness(1.1); }

.btn-ghost {
    background: var(--panel);
    border-color: var(--panel-border);
    backdrop-filter: blur(10px);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

.btn-danger {
    background: rgba(255, 109, 141, 0.14);
    border-color: rgba(255, 109, 141, 0.35);
    color: var(--danger);
}
.btn-danger:hover { background: rgba(255, 109, 141, 0.22); }

/* ---------- Top bar ---------- */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    background: rgba(11, 15, 25, 0.6);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--panel-border);
}
.brand {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 9px;
}
.brand i {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.actions { display: flex; gap: 10px; }

/* ---------- Scroll proxy ---------- */
#scroll-proxy { height: 0; }

/* ---------- 3D viewport ---------- */
.viewport {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    perspective: 1100px;
    overflow: hidden;
}

.scene-wrapper {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out;
}

.scene {
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    will-change: transform;
}

/* ---------- 16:9 event card ---------- */
.event-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(88vw, 880px);
    aspect-ratio: 16 / 9;
    background: rgba(20, 25, 40, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    cursor: pointer;
    display: flex;
}

.event-card.confidential { border-color: rgba(255, 207, 109, 0.4); }

.event-card .glare {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center,
        rgba(255, 255, 255, 0.55) 0%,
        rgba(255, 255, 255, 0.08) 30%,
        transparent 60%);
    mix-blend-mode: overlay;
    opacity: 0.4;
    pointer-events: none;
    transition: transform 0.1s ease-out;
}

.card-content {
    position: relative;
    z-index: 2;
    flex: 1;
    padding: clamp(18px, 3.4vw, 42px);
    display: flex;
    flex-direction: column;
    pointer-events: none;
}

.card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.82rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.card-head .type {
    background: rgba(109, 141, 255, 0.16);
    color: #b9c8ff;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 600;
}
.card-head .date { margin-left: auto; }

.badge-conf {
    color: var(--gold);
    font-size: 1rem;
}

.card-content h2 {
    font-family: 'Sora', sans-serif;
    font-size: clamp(1.3rem, 3.2vw, 2.2rem);
    font-weight: 700;
    margin: 14px 0 8px;
    line-height: 1.15;
}

.card-content .desc {
    color: #c3cbd9;
    font-size: clamp(0.85rem, 1.4vw, 1rem);
    line-height: 1.5;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.card-foot { margin-top: auto; padding-top: 12px; }
.stars { color: var(--gold); font-size: 0.9rem; letter-spacing: 2px; }
.stars .off { opacity: 0.25; }

/* ---------- Empty state ---------- */
.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--muted);
    z-index: 5;
}
.empty-state i { font-size: 2.6rem; }
.empty-state p { margin: 10px 0 0; }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(20, 25, 40, 0.9);
    border: 1px solid var(--panel-border);
    color: var(--text);
    padding: 12px 20px;
    border-radius: 12px;
    z-index: 300;
    font-size: 0.9rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* ---------- Modal ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: rgba(5, 8, 15, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal {
    width: min(94vw, 560px);
    max-height: 92vh;
    overflow-y: auto;
    background: #12182a;
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 26px 26px 22px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6);
}
.modal h2 {
    font-family: 'Sora', sans-serif;
    margin: 0 0 18px;
    font-size: 1.25rem;
}

#event-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 0.82rem; color: var(--muted); }
.field input, .field select, .field textarea {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    padding: 11px 12px;
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field.check span {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 12px;
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    color: var(--text);
    font-size: 0.95rem;
}
.field.check input { width: auto; }

.modal-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}
.modal-actions .btn-danger { margin-left: auto; }
.modal-actions .btn-primary { margin-left: auto; }
.modal-actions .btn-danger + .btn-primary { margin-left: 0; }

.error { color: var(--danger); font-size: 0.85rem; margin: 0; }

@media (max-width: 560px) {
    .row { grid-template-columns: 1fr; }
    .actions .btn span-hint { display: none; }
}
