:root {
    --bg-color: #0f172a;
    --stage-bg: rgba(30, 41, 59, 0.5);
    --bar-bg: rgba(15, 23, 42, 0.8);
    --accent-color: #38bdf8;
    --text-color: #f8fafc;
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 100% 100%, hsla(225,39%,30%,1) 0, transparent 50%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: 600px;
}

.stage-window {
    position: relative;
    width: 400px;
    height: 400px;
    background: var(--stage-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    overflow: hidden;
}

.collection-bar {
    width: 100%;
    height: 80px;
    background: var(--bar-bg);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0 1rem;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.letter {
    position: absolute;
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
    user-select: none;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
}

.letter-collected {
    position: static !important;
    font-size: 2rem;
    text-shadow: none;
    transform: none !important;
}

.timer-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.timer-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    transition: width 0.1s linear;
}

.phase-indicator {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: #38bdf8;
}

#status-msg {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    text-align: center;
    border-radius: 24px;
}

.btn-start {
    background: linear-gradient(135deg, #38bdf8 0%, #818cf8 100%);
    border: none;
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.25rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-start:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.wave-counter {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1.2rem;
    font-weight: 800;
    opacity: 0.8;
}

.prep-mode .letter {
    filter: blur(4px) grayscale(100%);
    opacity: 0.5;
}

.action-mode .letter {
    filter: none;
    opacity: 1;
}
