/* ClearVue Test Runner — Mobile-first styles */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    background: #0a0a0a;
    color: #f5f5f7;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* --- Header / Progress --- */

.test-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #0a0a0a;
    padding: 1rem 1.5rem 0.75rem;
    border-bottom: 1px solid #1d1d1f;
}

.test-header .brand {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #48484a;
    margin-bottom: 0.5rem;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #1d1d1f;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: #f5f5f7;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: #86868b;
}

/* --- Test Content Area --- */

.test-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
    text-align: center;
}

.test-body h2 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.test-body .test-description {
    font-size: 1rem;
    color: #a1a1a6;
    line-height: 1.5;
    max-width: 24rem;
    margin-bottom: 2rem;
}

/* --- Camera Preview --- */

.camera-preview {
    width: 100%;
    max-width: 20rem;
    aspect-ratio: 3 / 4;
    background: #1d1d1f;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    position: relative;
}

.camera-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-preview .camera-label {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #f5f5f7;
    background: rgba(0,0,0,0.5);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.camera-error {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 0.875rem;
    color: #ff453a;
    padding: 1rem;
}

/* --- Touch Grid --- */

.touch-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 4px;
    width: 100%;
    max-width: 20rem;
    aspect-ratio: 2 / 3;
    margin-bottom: 2rem;
}

.touch-cell {
    background: #1d1d1f;
    border-radius: 6px;
    transition: background 0.15s;
}

.touch-cell.touched {
    background: #30d158;
}

.touch-counter {
    font-size: 0.875rem;
    color: #86868b;
    margin-bottom: 1rem;
}

/* --- Audio Visualizer --- */

.audio-status {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.audio-status.recording { color: #ff453a; }
.audio-status.playing { color: #30d158; }

.audio-timer {
    font-size: 3rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin-bottom: 2rem;
}

/* --- Speaker Tone --- */

.tone-indicator {
    width: 6rem;
    height: 6rem;
    border-radius: 50%;
    background: #1d1d1f;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    transition: background 0.2s, box-shadow 0.2s;
}

.tone-indicator.active {
    background: #30d158;
    box-shadow: 0 0 40px rgba(48, 209, 88, 0.3);
}

.tone-indicator .icon {
    font-size: 2rem;
}

/* --- Action Buttons --- */

.test-actions {
    padding: 1rem 1.5rem 2rem;
    display: flex;
    gap: 0.75rem;
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
}

.btn {
    flex: 1;
    padding: 1rem;
    font-size: 1.0625rem;
    font-weight: 600;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
    font-family: inherit;
}

.btn:active { opacity: 0.7; }
.btn:disabled { opacity: 0.3; cursor: not-allowed; }

.btn-pass {
    background: #30d158;
    color: #0a0a0a;
}

.btn-fail {
    background: #ff453a;
    color: #f5f5f7;
}

.btn-skip {
    background: #1d1d1f;
    color: #86868b;
}

.btn-start {
    background: #f5f5f7;
    color: #0a0a0a;
}

/* --- Results Screen --- */

.results-screen {
    padding: 2rem 1.5rem;
    max-width: 28rem;
    margin: 0 auto;
    width: 100%;
}

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

.results-header .brand {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #48484a;
    margin-bottom: 0.5rem;
}

.results-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.results-score {
    font-size: 1rem;
    color: #a1a1a6;
    margin-bottom: 0.25rem;
}

.results-timestamp {
    font-size: 0.75rem;
    color: #48484a;
    font-variant-numeric: tabular-nums;
}

.results-list {
    list-style: none;
    margin-bottom: 2rem;
}

.results-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 0;
    border-bottom: 1px solid #1d1d1f;
}

.results-list li:last-child { border-bottom: none; }

.result-name {
    font-size: 0.9375rem;
    font-weight: 500;
}

.result-badge {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
}

.result-badge.pass {
    background: rgba(48, 209, 88, 0.15);
    color: #30d158;
}

.result-badge.fail {
    background: rgba(255, 69, 58, 0.15);
    color: #ff453a;
}

.result-badge.skipped {
    background: rgba(134, 134, 139, 0.15);
    color: #86868b;
}

.results-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.results-actions .btn {
    flex: none;
    width: 100%;
}

.results-footer {
    text-align: center;
    padding: 2rem 0;
    font-size: 0.75rem;
    color: #48484a;
}

/* --- Utility --- */

.hidden { display: none !important; }
