/* ─── Variables (ACTotal Theme) ─── */
:root {
    --bg-start: #3B82F6;
    /* Blue 500 */
    --bg-wait: #EF4444;
    /* Red 500 */
    --bg-go: #10B981;
    /* Emerald 500 */
    --bg-result: #111827;
    /* Gray 900 */

    --text: #ffffff;
    --text-dim: #9ca3af;
    --radius-sm: 12px;
}

/* ─── Base Reset ─── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    overflow: hidden;
    /* Prevent dragging on mobile */
    /* Select none to prevent confusing highlighting while fast tapping */
    user-select: none;
    -webkit-user-select: none;
}

/* ─── Top Floating Header ─── */
.float-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    pointer-events: none;
    /* Let clicks pass through except on children */
}

.btn-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(4px);
    transition: all .2s;
    pointer-events: auto;
    /* Re-enable pointer events */
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.4);
}

.record-badge {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(4px);
    font-weight: 600;
    font-size: 0.95rem;
    pointer-events: auto;
}

/* ─── Massive Tap Area ─── */
.tap-area {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.1s;
    /* Fast visual transition, no delay for the user though */
    padding: 2rem;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 500px;
    pointer-events: none;
    /* Make sure text doesn't interfere with the tap area fast clicks */
}

/* ─── Typography Elements ─── */
.state-icon {
    font-size: 4rem;
    line-height: 1;
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.state-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    line-height: 1.1;
}

.state-desc {
    font-size: 1.2rem;
    font-weight: 500;
    opacity: 0.9;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

/* Minor pulse animation for the "Tap to start" prompt */
@keyframes pulse {

    0%,
    100% {
        opacity: 0.9;
    }

    50% {
        opacity: 0.5;
    }
}

/* ─── Logic Themed States ─── */
/* 1. START STATE */
.state-start {
    background-color: var(--bg-start);
}

/* 2. WAITING STATE */
.state-wait {
    background-color: var(--bg-wait);
}

/* 3. GO STATE */
.state-go {
    background-color: var(--bg-go);
}

/* 4. RESULT STATE */
.state-result {
    background-color: var(--bg-result);
}

.state-result .content-wrapper {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.state-result .state-title {
    font-size: 3.5rem;
    color: var(--bg-go);
}

/* 5. EARLY RESULT STATE */
.state-early {
    background-color: var(--bg-result);
}

.state-early .content-wrapper {
    animation: errorShake 0.4s ease-in-out;
}

.state-early .state-title {
    color: var(--bg-wait);
}

/* Pop animation for result */
@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes errorShake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}