/* ============================================
   BEFORE — Pre-Event Regulation | PNEUOMA
   Arrive ready. Every time.
   ============================================ */

:root {
    /* Clean Modern Theme */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #334155;
    
    /* Accent Colors */
    --accent-gold: #f59e0b;
    --accent-gold-glow: rgba(245, 158, 11, 0.3);
    --accent-teal: #14b8a6;
    --accent-blue: #3b82f6;
    
    /* Goal Colors */
    --goal-confident: #f472b6;
    --goal-calm: #06b6d4;
    --goal-focused: #8b5cf6;
    --goal-energized: #f59e0b;
    
    /* Text */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Success */
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.3);
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Game Container */
.game-container {
    width: 100%;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Navigation */
.game-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
    background: linear-gradient(180deg, var(--bg-primary) 0%, transparent 100%);
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--text-primary);
}

.timer-display {
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--accent-gold);
}

.timer-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-gold);
    font-variant-numeric: tabular-nums;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* ========== TITLE SCREEN ========== */
.title-screen {
    background: radial-gradient(ellipse at center, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.title-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
}

.clock-visual {
    position: relative;
    width: 300px;
    height: 300px;
}

.clock-face {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border: 3px solid var(--accent-gold);
    border-radius: 50%;
}

.clock-hand {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 70px;
    background: var(--accent-gold);
    transform-origin: bottom center;
    transform: translateX(-50%);
    animation: clock-tick 5s linear infinite;
}

@keyframes clock-tick {
    from { transform: translateX(-50%) rotate(0deg); }
    to { transform: translateX(-50%) rotate(360deg); }
}

.clock-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--accent-gold);
    border-radius: 50%;
}

.clock-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--accent-gold-glow) 0%, transparent 70%);
    border-radius: 50%;
    animation: glow-pulse 3s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

.title-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.title-eyebrow {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-gold);
    margin-bottom: 12px;
}

.game-title {
    font-size: 5rem;
    font-weight: 200;
    letter-spacing: 4px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-tagline {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.title-description {
    max-width: 400px;
    margin-bottom: 40px;
}

.title-description p {
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Buttons */
.btn-primary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--accent-gold) 0%, #d97706 100%);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px var(--accent-gold-glow);
}

.btn-primary.btn-large {
    padding: 20px 48px;
    font-size: 1.2rem;
}

.btn-secondary {
    padding: 14px 28px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--text-muted);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: var(--accent-gold);
    color: var(--text-primary);
}

.title-meta {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

.meta-item {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: 6px 12px;
    border: 1px solid var(--bg-card);
    border-radius: 20px;
}

/* ========== EVENT & GOAL SELECTION ========== */
.event-screen,
.goal-screen {
    background: var(--bg-primary);
    padding: 80px 20px 20px;
}

.event-content,
.goal-content {
    max-width: 700px;
    width: 100%;
    text-align: center;
}

.section-title {
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 8px;
}

.section-subtitle {
    color: var(--text-muted);
    margin-bottom: 40px;
}

.event-grid,
.goal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.event-card,
.goal-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.event-card:hover,
.goal-card:hover {
    background: var(--bg-card);
    border-color: var(--accent-gold);
    transform: translateY(-4px);
}

.event-card.selected,
.goal-card.selected {
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px var(--accent-gold-glow);
}

.event-icon,
.goal-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.event-name,
.goal-name {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.event-desc,
.goal-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========== PREP SESSION ========== */
.prep-screen {
    background: var(--bg-primary);
}

#prepCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.prep-header {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 50;
}

.event-badge,
.goal-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: 20px;
    font-size: 0.9rem;
}

.badge-icon {
    font-size: 1.2rem;
}

.phase-display {
    position: relative;
    z-index: 50;
    text-align: center;
    margin-bottom: 30px;
}

.phase-name {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 8px;
    color: var(--accent-gold);
}

.phase-instruction {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Breathing Circle */
.breath-circle {
    position: relative;
    z-index: 50;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    border: 3px solid var(--accent-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 4s ease-in-out, border-color 0.5s ease;
}

.breath-circle.inhale {
    transform: scale(1.3);
}

.breath-circle.exhale {
    transform: scale(1);
}

.breath-circle.hold {
    transform: scale(1.3);
}

.circle-text {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--text-primary);
}

/* Affirmation */
.affirmation {
    position: relative;
    z-index: 50;
    margin-top: 40px;
    padding: 20px 40px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border-left: 4px solid var(--accent-gold);
    max-width: 400px;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.affirmation.visible {
    opacity: 1;
}

.affirmation-text {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-primary);
}

/* Session Progress */
.session-progress {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    text-align: center;
}

.progress-track {
    width: 300px;
    height: 4px;
    background: var(--bg-card);
    border-radius: 2px;
    margin-bottom: 16px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-gold), var(--success));
    transition: width 0.3s ease;
}

.progress-phases {
    display: flex;
    justify-content: space-between;
    gap: 20px;
}

.phase-dot {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}

.phase-dot.active {
    color: var(--accent-gold);
}

.phase-dot.complete {
    color: var(--success);
}

/* ========== READY SCREEN ========== */
.ready-screen {
    background: radial-gradient(ellipse at center, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.ready-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.ready-icon {
    width: 120px;
    height: 120px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    animation: ready-pulse 2s ease-in-out infinite;
    box-shadow: 0 0 60px var(--success-glow);
}

@keyframes ready-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.checkmark {
    font-size: 4rem;
    color: white;
}

.ready-title {
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 10px;
}

.ready-message {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.ready-state {
    margin-bottom: 30px;
}

.state-achieved {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
    background: var(--bg-secondary);
    border: 2px solid var(--success);
    border-radius: 50px;
}

.state-icon {
    font-size: 2rem;
}

.state-name {
    font-size: 1.3rem;
    font-weight: 500;
}

.ready-affirmation {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 400px;
}

.ready-actions {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    .game-title {
        font-size: 3rem;
    }

    .event-grid,
    .goal-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .breath-circle {
        width: 150px;
        height: 150px;
    }

    .prep-header {
        flex-wrap: wrap;
        justify-content: center;
    }

    .progress-track {
        width: 250px;
    }
}

