* {
    box-sizing: border-box;
}

:root {
    color-scheme: dark;
    --bg: #0b0d10;
    --panel: #15191e;
    --panel2: #1b2027;
    --border: #2a313a;
    --text: #f4f7fa;
    --muted: #8d98a5;
    --accent: #ff7a00;
    --accent2: #19d4e8;
    --danger: #e34b4b;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top right, rgba(25, 212, 232, .09), transparent 30rem),
        radial-gradient(circle at top left, rgba(255, 122, 0, .08), transparent 28rem),
        var(--bg);
    color: var(--text);
}

.topbar {
    min-height: 76px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(11, 13, 16, .88);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand {
    font-size: 20px;
    font-weight: 800;
}

.sub {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
}

.container {
    width: min(1100px, calc(100% - 32px));
    margin: 42px auto;
}

.hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 52px);
    line-height: 1;
    margin: 0 0 10px;
}

.hero p {
    margin: 0;
    color: var(--muted);
}

.upload-box {
    display: flex;
    gap: 10px;
}

.file-picker {
    display: flex;
    align-items: center;
    border: 1px dashed var(--border);
    background: var(--panel);
    border-radius: 10px;
    padding: 10px 14px;
    cursor: pointer;
}

.file-picker input {
    display: none;
}

.btn {
    border: 1px solid var(--border);
    background: var(--panel2);
    color: var(--text);
    border-radius: 9px;
    padding: 10px 14px;
    cursor: pointer;
    font: inherit;
    font-weight: 650;
    transition: .15s ease;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: #46515e;
}

.btn.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #111;
}

.btn.ghost {
    background: transparent;
}

.btn.danger {
    background: rgba(227, 75, 75, .12);
    border-color: rgba(227, 75, 75, .35);
    color: #ff9090;
}

.btn.full {
    width: 100%;
}

.sound-list {
    display: grid;
    gap: 12px;
}

.sound-card {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(280px, 420px) auto;
    gap: 18px;
    align-items: center;
    padding: 17px;
    background: rgba(21, 25, 30, .9);
    border: 1px solid var(--border);
    border-radius: 13px;
}

.sound-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sound-info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sound-info span {
    color: var(--muted);
    font-size: 12px;
}

audio {
    width: 100%;
    height: 36px;
}

.actions {
    display: flex;
    gap: 8px;
}

.actions form {
    margin: 0;
}

.flash {
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 20px;
}

.flash.ok {
    background: rgba(42, 163, 80, .12);
    border: 1px solid rgba(42, 163, 80, .35);
}

.flash.error {
    background: rgba(227, 75, 75, .12);
    border: 1px solid rgba(227, 75, 75, .35);
}

.empty {
    color: var(--muted);
    text-align: center;
    padding: 70px 20px;
    border: 1px dashed var(--border);
    border-radius: 14px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .68);
    backdrop-filter: blur(7px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 50;
}

.modal.open {
    display: flex;
}

.modal-card {
    width: min(420px, 100%);
    padding: 28px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #11151a;
    position: relative;
    box-shadow: 0 30px 100px rgba(0, 0, 0, .45);
}

.modal-card h2 {
    margin: 0 0 6px;
}

.modal-card p {
    margin: 0 0 22px;
    color: var(--muted);
}

.close {
    position: absolute;
    right: 14px;
    top: 10px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 28px;
    cursor: pointer;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
}

.login-form input {
    width: 100%;
    border: 1px solid var(--border);
    background: #0d1014;
    color: var(--text);
    border-radius: 9px;
    padding: 11px 12px;
    outline: none;
}

.login-form input:focus {
    border-color: var(--accent2);
}

.inline-form {
    margin: 0;
}

@media (max-width: 820px) {
    .hero {
        align-items: stretch;
        flex-direction: column;
    }

    .upload-box {
        flex-direction: column;
    }

    .sound-card {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-wrap: wrap;
    }

    .actions .btn {
        flex: 1;
    }
}
