:root {
    --primary: #FFD700;
    /* Gold */
    --primary-glow: rgba(255, 215, 0, 0.4);
    --secondary: #4F46E5;
    /* Indigo */
    --accent: #EC4899;
    /* Pink/Purple for pop */
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --text-light: #F8FAFC;
    --text-dim: #94A3B8;
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);

    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', sans-serif;
    --font-ui: 'Outfit', sans-serif;
}

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

body {
    background-color: var(--bg-darker);
    color: var(--text-light);
    font-family: var(--font-body);
    overflow: hidden;
    /* Prevent scrolling, app-like feel */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Animation */
.background-mesh {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.mesh-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite alternate;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: var(--secondary);
    top: -10%;
    left: -10%;
    animation-delay: 0s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: var(--accent);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: var(--primary);
    top: 40%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(30px, 50px);
    }
}

/* Layout */
#app {
    width: 100%;
    max-width: 600px;
    /* Mobile first but restrained on desktop */
    height: 100%;
    max-height: 900px;
    position: relative;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.screen {
    width: 100%;
    height: 100%;
    display: none;
    /* Controlled by JS */
    flex-direction: column;
    animation: fadeIn 0.5s ease-out;
}

.screen.active {
    display: flex;
}

/* Components */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
}

.full-center {
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-grow: 1;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
}

h1 {
    font-size: 2.5rem;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.8rem;
}

p {
    line-height: 1.6;
    color: var(--text-dim);
}

.subtitle {
    text-transform: uppercase;
    letter-spacing: 3px;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Inputs & Buttons */
.setup-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

input,
select {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-family: var(--font-ui);
    font-size: 1rem;
    transition: all 0.3s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Fix for dropdown options visibility */
option {
    background-color: var(--bg-dark);
    color: white;
}

optgroup {
    background-color: var(--bg-dark);
    color: var(--primary);
    font-weight: 800;
    font-style: normal;
}

label {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: -0.5rem;
    display: block;
    text-align: left;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    border: none;
    font-family: var(--font-ui);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary {
    background: linear-gradient(135deg, var(--primary), #D4AF37);
    color: var(--bg-darker);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn.primary.glow:hover {
    box-shadow: 0 0 30px var(--primary-glow);
}

.btn.secondary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn.small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(1);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

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

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

/* GAME SCREEN SPECIFIC */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
}

.team-badge {
    font-weight: 700;
    font-family: var(--font-ui);
    color: var(--accent);
}

.timer-container {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timer-circle {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.timer-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 6;
}

.timer-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 6;
    stroke-dasharray: 283;
    /* 2 * PI * 45 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

#time-left {
    position: absolute;
    font-weight: 700;
    font-size: 1.1rem;
    font-family: var(--font-ui);
}

.clue-container {
    text-align: center;
    margin: 1rem 0;
}

.clue-text {
    font-size: 1.2rem;
    font-style: italic;
    color: white;
    margin-top: 1rem;
    border-left: 3px solid var(--primary);
    padding-left: 1rem;
}

.interaction-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-row {
    display: flex;
    gap: 1rem;
}

.token-container {
    display: inline-flex;
    gap: 0.3rem;
    margin: 0 0.5rem;
}

.token {
    font-size: 1.2rem;
}

.token.used {
    filter: grayscale(100%);
    opacity: 0.3;
}

.feedback {
    min-height: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.feedback.error {
    color: #f87171;
}

.feedback.success {
    color: #4ade80;
}

.hint-box {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    animation: fadeIn 0.3s;
}

.hidden {
    display: none !important;
}

/* RESULT SCREEN */
.verse-reveal {
    background: black;
    /* Scroll-like color could be nice, but stick to premium dark */
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    text-align: center;
}

.scripture {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: white;
    margin-bottom: 0.5rem;
}

.reference {
    display: block;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.icebreaker-section {
    background: rgba(79, 70, 229, 0.1);
    padding: 1rem;
    border-radius: 12px;
    border-left: 4px solid var(--secondary);
}

.icebreaker-section h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--secondary);
    font-family: var(--font-ui);
}

.final-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin: 2rem 0;
}

.stat-box {
    display: flex;
    flex-direction: column;
}

.stat-box .value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

/* RESPONSIVE */
@media (max-width: 400px) {
    h1 {
        font-size: 2rem;
    }

    .glass-card {
        padding: 1.5rem;
    }
}