:root {
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-color: #1e293b;
    --text-light: #64748b;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --border: #e2e8f0;
    --success: #16a34a;
    --error: #dc2626;
    --playing-bg: #dbeafe;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 1.25rem;
    line-height: 1.6;
}

#app-container {
    max-width: 900px;
    margin: 3rem auto;
    padding: 2.5rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

@media (max-width: 1024px) {
    #app-container { display: none !important; }
    #device-warning { display: block !important; padding: 4rem; text-align: center; }
}

h1 { font-size: 2.25rem; margin-top: 0; color: #0f172a; margin-bottom: 1.5rem; }
h2 { font-size: 1.75rem; margin-top: 0; }
.text-center { text-align: center; }

button, .btn {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

button:hover, .btn:hover { background-color: var(--primary-hover); transform: translateY(-1px); }
button:disabled, .btn.disabled { 
    background-color: var(--border); 
    color: var(--text-light); 
    cursor: not-allowed; 
    transform: none; 
}

.trial-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    margin-top: 2.5rem;
}

.option-card {
    border: 3px solid var(--border);
    border-radius: 12px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.2s ease-in-out;
}

.option-card.active { border-color: var(--primary); background-color: #f8fafc; }
.option-card h3 { margin-top: 0; font-size: 1.75rem; color: #334155; }

.player-controls { margin: 2rem 0; }

.play-btn {
    background-color: white;
    color: var(--text-color);
    border: 2px solid var(--border);
    width: 100%;
    padding: 1.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.play-btn {
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.play-btn:hover { background-color: #f1f5f9; border-color: #cbd5e1; }
.play-btn.playing { 
    background-color: var(--playing-bg); 
    border-color: var(--primary); 
    color: var(--primary);
    box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.06); 
}
.play-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.select-btn { width: 100%; margin-top: 1.5rem; padding: 1rem; }

.status-text { 
    text-align: center; 
    color: var(--text-light); 
    margin-top: 2rem; 
    font-size: 1.1rem;
    padding: 1rem;
    background-color: #f8fafc;
    border-radius: 8px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: var(--border);
    border-radius: 4px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--success);
    transition: width 0.3s ease;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

select, textarea, input[type="number"], input[type="text"] {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.125rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
}

textarea { resize: vertical; min-height: 120px; }
input[type="number"], input[type="text"] { box-sizing: border-box; }

/* Ramping-tone task: mirrors the white counting video used in the questionnaire */
.counter-display {
    width: 320px;
    height: 320px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 3px solid var(--border);
    border-radius: 12px;
    font-size: 10rem;
    font-weight: 400;
    color: black;
    font-variant-numeric: tabular-nums;
}

.alert {
    padding: 1rem;
    background-color: #fef2f2;
    color: var(--error);
    border-radius: 8px;
    border: 1px solid #fecaca;
    margin-bottom: 1.5rem;
}
