:root {
    --bg-dark: #0f172a;
    --glass-bg: rgba(30, 41, 59, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent: #eab308; /* Galo yellow/gold */
    --accent-hover: #ca8a04;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    user-select: none; /* Prevent text selection on mobile */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden; /* App-like feel */
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* Background Animation */
.bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: linear-gradient(135deg, #1e1b4b, #0f172a, #020617);
}

.floating-emoji {
    position: absolute;
    font-size: 2rem;
    opacity: 0.6;
    animation: floatUp 10s linear infinite;
}

@keyframes floatUp {
    0% { transform: translateY(110vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateY(-10vh) rotate(360deg); opacity: 0; }
}

/* Common Scene Layout */
.scene {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    transition: opacity 0.5s ease;
    z-index: 10;
}

.scene.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: -10;
}

.hidden {
    display: none !important;
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    text-align: center;
    max-width: 90%;
}

.glass-card h1 { font-size: 2.5rem; margin-bottom: 0.5rem; color: var(--accent); }
.glass-card h2 { font-size: 1.8rem; margin-bottom: 1.5rem; }
.glass-card p { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 1.5rem; }

input[type="text"] {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid rgba(255,255,255,0.2);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 1.2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    outline: none;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus {
    border-color: var(--accent);
}

button {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(234, 179, 8, 0.4);
    transition: transform 0.1s ease;
    width: 100%;
}

button:active {
    transform: scale(0.95);
}

.ready-btn-success {
    background: #10b981 !important; /* Emerald green */
    color: white !important;
    transform: none !important;
    cursor: default !important;
    box-shadow: none !important;
}

/* Puzzle Styles */
.puzzle-board {
    width: 360px;
    height: 360px;
    background: rgba(0,0,0,0.5);
    border: 2px dashed rgba(255,255,255,0.3);
    border-radius: 12px;
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
}

.puzzle-slot {
    border: 1px solid rgba(255,255,255,0.1);
    box-sizing: border-box;
}

.puzzle-pieces {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    width: 320px;
    background: var(--glass-bg);
    padding: 10px;
    border-radius: 12px;
}

.puzzle-piece {
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    touch-action: none;
    cursor: grab;
}
.puzzle-piece:active {
    cursor: grabbing;
}

.tap-puzzle-piece {
    transition: filter 0.1s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
}
.selected-piece {
    outline: 4px solid var(--accent);
    outline-offset: -4px;
    filter: brightness(1.3);
    z-index: 2;
    transform: scale(0.95);
    transition: transform 0.15s ease;
}

@keyframes puzzleGlow {
    0% { box-shadow: 0 0 5px #10b981; }
    50% { box-shadow: 0 0 30px 10px #10b981; }
    100% { box-shadow: 0 0 0px #10b981; }
}
.puzzle-success-glow {
    animation: puzzleGlow 1s ease-out forwards;
    z-index: 10;
}

.full-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bounce-in {
    animation: bounceIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.shadow-text {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    position: absolute;
    top: 50px;
}

/* Voting */
.vote-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.vote-btn {
    background: rgba(255,255,255,0.1);
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.vote-btn.selected {
    background: var(--accent);
    color: black;
}

/* Interactive Camera Background */
.full-screen-interactive {
    padding: 0;
    justify-content: flex-start;
}

.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -1;
}

#emoji-layer, #flash-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: auto; /* catch clicks */
}

/* Flashes */
.flash-active {
    background: white;
    opacity: 1 !important;
}

#flash-overlay {
    opacity: 0;
    transition: opacity 0.1s ease;
    background: white;
    pointer-events: none;
}

/* Continuous Text */
.giant-number {
    font-size: 15rem;
    color: var(--accent);
    text-shadow: 0 10px 30px rgba(234, 179, 8, 0.5);
}

.pulse {
    animation: pulseNumber 2s infinite ease-in-out;
}

@keyframes pulseNumber {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.text-marquee {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    height: 150px;
    display: flex;
    align-items: center;
}

#animated-text-part {
    font-size: 4rem;
    font-weight: 900;
    position: absolute;
    /* CSS animation applied dynamically via JS */
}

.moving-galo {
    position: absolute;
}

.iframe-container {
    padding: 0;
}

.iframe-container iframe {
    width: 100%;
    height: 100%;
}
