:root {
    --bg: #050912;
    --panel: rgba(255,255,255,0.04);
    --stroke: rgba(255,255,255,0.08);
    --text: #e8edf7;
    --muted: rgba(232,237,247,0.65);
    --accent: #7c3aed;
    --accent-2: #14b8a6;
    --danger: #ef4444;
    --gradient: linear-gradient(135deg, #7c3aed, #14b8a6);
    --glass: rgba(255,255,255,0.06);
    --shadow: 0 20px 60px rgba(0,0,0,0.45);
    --font: "Poppins", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font);
    background: radial-gradient(circle at 20% 20%, rgba(124,58,237,0.12), transparent 35%),
        radial-gradient(circle at 80% 10%, rgba(20,184,166,0.15), transparent 40%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.intro {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(5,9,18,0.88);
    backdrop-filter: blur(12px);
    z-index: 999;
}

.card {
    width: min(720px, 92vw);
    background: var(--glass);
    border: 1px solid var(--stroke);
    border-radius: 18px;
    padding: 1.6rem;
    box-shadow: var(--shadow);
    display: grid;
    gap: 0.75rem;
}

.card input {
    padding: 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.05);
    color: #e5e7eb;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem 0.5rem;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--gradient);
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #050912;
    letter-spacing: 0.08em;
}

.brand-title {
    font-weight: 800;
    letter-spacing: 0.05em;
}

.brand-sub {
    color: var(--muted);
    font-size: 0.9rem;
}

.top-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.kiosk {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 1.5rem 1.5rem;
}

.live {
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: 18px;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    box-shadow: var(--shadow);
}

.frame {
    background: #03050b;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    height: 70vh;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 18px 45px rgba(0,0,0,0.45);
}

.frame video,
.frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.frame video { z-index: 1; }
.frame img { z-index: 2; }

.frame video {
    object-fit: contain;
    background: #000;
}

.hint-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 20% 20%, rgba(59,130,246,0.08), transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(16,185,129,0.08), transparent 35%),
        #0b1020;
}

.auth-shell {
    width: min(460px, 92vw);
}

.auth-card {
    gap: 0.65rem;
}

.auth-card form {
    display: grid;
    gap: 0.55rem;
}

.auth-form {
    display: grid;
    gap: 0.55rem;
}

.divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-weight: 700;
}

.divider span {
    height: 1px;
    background: var(--stroke);
}

.button.secondary,
button.secondary {
    background: rgba(255,255,255,0.08);
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--stroke);
    border: 1px solid rgba(124,58,237,0.45);
}

.button.ghost,
button.ghost {
    background: transparent;
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--stroke);
}

.pin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.pin-dots {
    min-width: 96px;
    letter-spacing: 0.18em;
    font-weight: 800;
    text-align: right;
}

.pin-grid {
    display: grid;
    gap: 0.4rem;
}

.pin-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(70px, 1fr));
    gap: 0.35rem;
}

.pin-key {
    padding: 0.85rem;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,0.06);
    color: var(--text);
    font-weight: 800;
    cursor: pointer;
}

.pin-key:hover {
    background: rgba(255,255,255,0.1);
}

@media (max-width: 640px) {
    .pin-row {
        grid-template-columns: repeat(3, minmax(60px, 1fr));
    }
    .pin-key {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
}

.admin-console {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    display: grid;
    gap: 1rem;
}

.console-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.2rem;
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.console-actions {
    display: flex;
    gap: 0.5rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    color: var(--muted);
    margin: 0;
}

.console-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1rem;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.session-list {
    display: grid;
    gap: 0.65rem;
}

.session-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--stroke);
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
}

.session-meta {
    display: grid;
    gap: 0.1rem;
}

.session-actions {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.mono {
    font-family: "JetBrains Mono", "SFMono-Regular", "Menlo", monospace;
    font-weight: 700;
}

.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
}

.asset-chip {
    padding: 0.65rem;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,0.03);
    font-weight: 700;
}

.btn {
    padding: 0.65rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: var(--gradient);
    color: #050912;
    font-weight: 800;
    text-decoration: none;
}

.btn.ghost {
    background: transparent;
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--stroke);
}

.pill.danger,
button.pill.danger {
    background: rgba(239,68,68,0.16);
    color: #fecaca;
}

.pill a { color: inherit; text-decoration: none; }

.error {
    color: #fca5a5;
    font-weight: 700;
}

.auth-links {
    margin-top: 0.5rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
}

.session-card {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 0.75rem;
    background: rgba(255,255,255,0.03);
    display: grid;
    gap: 0.35rem;
}

.session-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.toggle-row {
    display: grid;
    gap: 0.25rem;
}

.inline-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.session-id {
    font-family: "JetBrains Mono", "SFMono-Regular", "Menlo", monospace;
    letter-spacing: 0.02em;
    font-weight: 800;
}

.truncate {
    max-width: 12ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.danger-button {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    padding: 0.55rem 0.9rem;
}

.placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    color: rgba(229,231,235,0.7);
    background: linear-gradient(180deg, rgba(15,23,42,0.8), rgba(17,24,39,0.8));
}

.actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.intro-actions {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.35rem;
}

.intro-actions button,
.intro-actions .button {
    width: 100%;
    justify-content: center;
}

.button,
button {
    padding: 0.9rem 1.35rem;
    border: none;
    border-radius: 12px;
    background: var(--gradient);
    color: #050912;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease, opacity 0.2s;
    box-shadow: 0 10px 25px rgba(124,58,237,0.35);
}

.primary {
    background: linear-gradient(135deg, #22d3ee, #6366f1);
    color: #041024;
    box-shadow: 0 10px 30px rgba(34,211,238,0.35);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(124,58,237,0.35);
}

.controls {
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: 18px;
    padding: 1rem;
    display: grid;
    gap: 0.75rem;
    box-shadow: var(--shadow);
}

.session-id {
    font-weight: 700;
    letter-spacing: 0.08em;
}

.qr-wrapper {
    width: 120px;
    height: 120px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
}

.qr-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-row {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.25rem;
}

.thumb-btn {
    width: 96px;
    height: 128px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    overflow: hidden;
    background: #0b1020;
    padding: 0;
    cursor: pointer;
    position: relative;
}

.thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    border: none;
    background: rgba(0,0,0,0.6);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: 700;
}

label, p {
    margin: 0;
}

select {
    width: 100%;
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: var(--text);
}

.overlay-list {
    display: grid;
    gap: 0.35rem;
}

.overlay-list label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.note {
    font-size: 0.9rem;
    color: rgba(229,231,235,0.7);
}

.kiosk-keyboard {
    display: grid;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.kbd-row {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
}

.kbd-key {
    flex: 0 0 auto;
    min-width: 48px;
    padding: 0.7rem 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: rgba(255,255,255,0.07);
    color: var(--text);
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    font-size: 0.95rem;
}

.kbd-key.ghost {
    background: rgba(255,255,255,0.03);
    min-width: 80px;
}

@media (max-width: 640px) {
    .kbd-key {
        min-width: 38px;
        padding: 0.6rem 0.65rem;
        font-size: 0.85rem;
    }
    .kbd-key.ghost {
        min-width: 65px;
    }
}

.kbd-key:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}

.duration-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-top: 0.5rem;
}

.duration-btn {
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: var(--gradient);
    color: #050912;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.duration-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(124,58,237,0.4);
}

@media (max-width: 640px) {
    .duration-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .duration-btn {
        padding: 0.85rem;
        font-size: 0.9rem;
    }
}

.muted {
    color: var(--muted);
}

#status {
    min-height: 1.5rem;
    font-weight: 600;
}

#status[data-variant="error"] { color: #fca5a5; }
#status[data-variant="success"] { color: #6ee7b7; }
#status[data-variant="info"] { color: #93c5fd; }

.hidden {
    display: none !important;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.thumb {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #0b1020;
    border: 1px solid rgba(255,255,255,0.1);
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

@media (min-width: 768px) {
    .kiosk {
        grid-template-columns: 2fr 1fr;
        align-items: start;
    }
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--text);
    font-weight: 700;
    font-size: 0.9rem;
}

.pill-soft {
    background: rgba(124,58,237,0.14);
    color: #c4b5fd;
}

.pill-link {
    text-decoration: none;
    background: rgba(20,184,166,0.14);
    color: #a7f3d0;
}

.muted-link {
    color: var(--muted);
    word-break: break-all;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 25% 20%, rgba(124,58,237,0.15), transparent 40%),
        radial-gradient(circle at 80% 15%, rgba(20,184,166,0.2), transparent 35%),
        #050912;
}

.auth-shell {
    width: min(520px, 92vw);
}

.auth-card {
    gap: 0.65rem;
}

.auth-card form {
    display: grid;
    gap: 0.55rem;
}
