:root {
    --primary: #6C5CE7;
    --primary-dark: #5A4BD1;
    --primary-light: #A29BFE;
    --accent: #FF6B6B;
    --accent-light: #FD79A8;
    --success: #00C896;
    --warning: #FDCB6E;
    --bg: #FAFBFF;
    --bg-dark: #0F0C29;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #FFFFFF;
    --text: #2D3436;
    --muted: #636E72;
    --border: rgba(255, 255, 255, 0.35);
    --gradient-primary: linear-gradient(135deg, #6C5CE7 0%, #A29BFE 100%);
    --gradient-text: linear-gradient(135deg, #6C5CE7, #FF6B6B, #FD79A8);
    --gradient-hero: linear-gradient(135deg, #0F0C29 0%, #1A1A3E 50%, #24243E 100%);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--gradient-hero);
    overflow-x: hidden;
}

.page-shell {
    position: relative;
    min-height: 100vh;
    padding: 24px 0 48px;
    overflow: hidden;
}

.hero-bg-shapes {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 999px;
    filter: blur(80px);
    opacity: 0.35;
}

.shape-1 {
    width: 320px;
    height: 320px;
    background: var(--primary);
    top: -90px;
    right: -70px;
}

.shape-2 {
    width: 260px;
    height: 260px;
    background: var(--accent);
    bottom: 8%;
    left: -80px;
}

.shape-3 {
    width: 220px;
    height: 220px;
    background: var(--primary-light);
    top: 36%;
    left: 55%;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 940px;
    margin: 0 auto;
    padding: 0 16px;
}

.hero-card,
.session-card,
.session-panel,
.settings {
    background: var(--surface);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(10, 12, 35, 0.18);
}

.hero-card {
    color: white;
    text-align: center;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.26), rgba(255, 107, 107, 0.16));
    padding: 28px 20px;
    margin-bottom: 18px;
}

.hero-card h1 {
    margin: 8px 0 12px;
    font-size: clamp(2rem, 7vw, 3.4rem);
    line-height: 1.08;
}

.hero-card p {
    max-width: 680px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(1rem, 3.8vw, 1.12rem);
}

.hero-badge,
.section-tag {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-badge {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
}

.section-tag {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 10px 24px rgba(108, 92, 231, 0.22);
}

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

.session-card,
.session-panel,
.settings {
    padding: 18px;
    margin-bottom: 18px;
}

.section-heading {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.section-heading h2,
.section-heading h3,
.panel-heading h2 {
    margin: 0;
    line-height: 1.2;
}

.section-heading.compact {
    margin-bottom: 14px;
}

.panel-heading {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.preset-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.preset-btn,
.start-btn,
.test-btn,
.help-btn,
.control-btn {
    border: none;
    cursor: pointer;
    font: inherit;
    border-radius: 18px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.preset-btn,
.start-btn,
.test-btn,
.help-btn {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 14px 30px rgba(108, 92, 231, 0.22);
}

.preset-btn {
    padding: 18px 14px;
    text-align: center;
    font-weight: 700;
    min-height: 96px;
}

.preset-btn small {
    display: inline-block;
    margin-top: 6px;
    font-weight: 500;
    opacity: 0.9;
}

.preset-btn:hover,
.start-btn:hover,
.test-btn:hover,
.help-btn:hover,
.control-btn:hover {
    transform: translateY(-2px);
}

.custom-session {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(253, 121, 168, 0.08));
    border: 1px solid rgba(108, 92, 231, 0.1);
    border-radius: 20px;
    padding: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.name-group {
    grid-column: 1 / -1;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.input-group label {
    font-weight: 600;
    color: var(--text);
}

input,
select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(108, 92, 231, 0.16);
    background: rgba(255, 255, 255, 0.92);
    font: inherit;
    color: var(--text);
}

input:focus,
select:focus {
    outline: 3px solid rgba(108, 92, 231, 0.14);
    border-color: var(--primary);
}

.start-btn,
.test-btn,
.help-btn,
.control-btn {
    min-height: 50px;
    padding: 12px 18px;
    font-weight: 700;
}

.start-btn {
    width: 100%;
    margin-top: 6px;
}

.progress-container {
    border-radius: 20px;
    padding: 14px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 245, 255, 0.95));
    border: 1px solid rgba(108, 92, 231, 0.08);
}

.progress-bar {
    width: 100%;
    height: 16px;
    background: rgba(108, 92, 231, 0.14);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 14px;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #00C896, #6C5CE7, #FD79A8);
    transition: width 0.4s ease;
}

.session-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stat {
    padding: 14px;
    border-radius: 18px;
    background: white;
    box-shadow: inset 0 0 0 1px rgba(108, 92, 231, 0.08);
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-bottom: 6px;
}

.stat-value {
    font-size: clamp(1.15rem, 4vw, 1.6rem);
    font-weight: 800;
    color: var(--text);
}

.controls,
.button-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.controls > *,
.button-row > * {
    flex: 1 1 180px;
}

.control-btn.pause {
    background: linear-gradient(135deg, #FDCB6E, #FFB142);
    color: #1f2430;
    box-shadow: 0 14px 30px rgba(253, 203, 110, 0.24);
}

.control-btn.stop {
    background: linear-gradient(135deg, #FF6B6B, #FD79A8);
    color: white;
    box-shadow: 0 14px 30px rgba(255, 107, 107, 0.22);
}

.message-display {
    margin-top: 14px;
    padding: 16px;
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(255, 107, 107, 0.08));
    border: 1px dashed rgba(108, 92, 231, 0.28);
    font-weight: 600;
}

.wake-lock-info,
.mobile-voice-info {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.08), rgba(255, 255, 255, 0.88));
    border: 1px solid rgba(108, 92, 231, 0.1);
    border-radius: 18px;
    padding: 14px;
    margin-bottom: 12px;
}

.wake-lock-info p,
.mobile-voice-info p,
.mobile-voice-info li {
    margin: 0;
    color: var(--text);
}

.mobile-voice-info ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .page-shell {
        padding-top: 14px;
    }

    .container {
        padding: 0 12px;
    }

    .hero-card,
    .session-card,
    .session-panel,
    .settings {
        border-radius: 20px;
        padding: 16px;
    }

    .preset-buttons,
    .form-grid,
    .settings-grid,
    .session-stats {
        grid-template-columns: 1fr;
    }

    .preset-btn {
        min-height: 88px;
    }

    .controls,
    .button-row {
        flex-direction: column;
    }
}

@media (max-width: 420px) {
    .hero-card h1 {
        font-size: 1.95rem;
    }

    .hero-badge,
    .section-tag {
        font-size: 0.72rem;
        padding: 7px 12px;
    }

    .preset-btn,
    .start-btn,
    .test-btn,
    .help-btn,
    .control-btn {
        border-radius: 16px;
    }
}