body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top, #111827 0, #020617 55%, #000 100%);
    color: #e5e7eb;
    min-height: 100vh;
}

.page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2.5rem 1.5rem 3rem;
    box-sizing: border-box;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.8rem;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.12);
    color: #7dd3fc;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

h1 {
    margin: 0 0 0.5rem;
    color: #f9fafb;
    font-size: 1.9rem;
}

.subtitle {
    margin: 0;
    color: #9ca3af;
    max-width: 640px;
}

.card {
    width: 100%;
    max-width: 720px;
    background: rgba(15, 23, 42, 0.92);
    border-radius: 1.5rem;
    padding: 1.75rem 1.75rem 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
    box-sizing: border-box;
}

.mode-toggle {
    display: flex;
    justify-content: center;
    padding: 0.2rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(55, 65, 81, 0.9);
    margin-bottom: 0.9rem;
}

.mode-info-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.mode-info-link {
    border: none;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    color: #9ca3af;
    font-size: 0.75rem;
    cursor: pointer;
}

.mode-info-link:hover {
    color: #e5e7eb;
}

.mode-button {
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    cursor: pointer;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mode-button.active {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: #f9fafb;
}

.mode-button:disabled {
    opacity: 0.4;
    cursor: default;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.control-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.control-row.secondary {
    grid-template-columns: 2fr 1fr;
    align-items: center;
}

@media (max-width: 768px) {
    .control-row {
        grid-template-columns: 1fr;
    }

    .control-row.secondary {
        grid-template-columns: 1fr;
        row-gap: 1rem;
    }
}

.control label {
    display: block;
    font-size: 0.85rem;
    color: #9ca3af;
    margin-bottom: 0.4rem;
}

.control-inputs {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    border-radius: 0.75rem;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(55, 65, 81, 0.9);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.control-inputs.active {
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.5);
    background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), rgba(15, 23, 42, 0.9));
}

.control-inputs input[type="range"] {
    flex: 1;
    accent-color: #38bdf8;
}

.control-inputs input[type="number"] {
    width: 100%;
    padding: 0.3rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    font-size: 0.88rem;
    text-align: center;
}

.control-inputs input[type="number"]:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.5);
}

.volume-control .control-inputs {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

#volume-display {
    font-size: 0.85rem;
    color: #d1d5db;
    min-width: 44px;
    text-align: right;
}

.playback {
    display: flex;
    justify-content: flex-end;
}

#play-button {
    min-width: 120px;
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ecfdf5;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 15px 30px rgba(22, 163, 74, 0.4);
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
}

#play-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 40px rgba(22, 163, 74, 0.5);
}

#play-button.playing {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 15px 30px rgba(185, 28, 28, 0.45);
}

.hint {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

.key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.05rem 0.35rem;
    border-radius: 0.35rem;
    border: 1px solid rgba(148, 163, 184, 0.6);
    font-size: 0.7rem;
    background: rgba(15, 23, 42, 0.9);
    margin: 0 1px;
}

.no-web-audio {
    font-size: 0.9rem;
    color: #f87171;
}

.no-web-audio p {
    margin: 0;
}

.streaming {
    margin-top: 1.25rem;
    font-size: 0.9rem;
}

.streaming-copy {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #d1d5db;
}

.streaming audio {
    width: 100%;
}

.mode-info-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.7);
    z-index: 40;
}

.mode-info-overlay[hidden] {
    display: none !important;
}

.mode-info-overlay:not([hidden]) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mode-info-dialog {
    max-width: 480px;
    width: 90%;
    background: rgba(15, 23, 42, 0.98);
    border-radius: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    padding: 1.5rem 1.5rem 1.25rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
}

.mode-info-title {
    margin: 0 0 0.6rem;
    font-size: 1.1rem;
    color: #f9fafb;
}

.mode-info-lead {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: #e5e7eb;
}

.mode-info-body {
    margin: 0 0 0.9rem;
    font-size: 0.8rem;
    color: #9ca3af;
}

.mode-info-close {
    border: none;
    border-radius: 999px;
    padding: 0.35rem 0.95rem;
    font-size: 0.8rem;
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.8);
    cursor: pointer;
}

.mode-info-close:hover {
    background: rgba(30, 64, 175, 0.8);
}


