:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --success-color: #22c55e;
    --error-color: #ef4444;
    --ad-bg: #1e293b;
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding-bottom: 60px; /* Space for bottom banner */
}

/* Dynamic Background Blobs */
.blob {
    position: absolute;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 10s infinite alternate ease-in-out;
}

.blob-1 {
    top: 10%;
    left: 10%;
    width: 300px;
    height: 300px;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    border-radius: 50%;
}

.blob-2 {
    bottom: 10%;
    right: 10%;
    width: 400px;
    height: 400px;
    background: linear-gradient(to right, #ec4899, #f43f5e);
    border-radius: 50%;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

/* Glassmorphism Panels */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

#game-container {
    width: 90%;
    max-width: 800px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    z-index: 10;
    transition: all 0.3s ease;
}

/* Header & Stats */
.game-header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 20px;
}

.stat-badge {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-color);
}

/* Question Section */
.question-section {
    text-align: center;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

#question-text {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.3;
}

.hint-box {
    background: rgba(234, 179, 8, 0.1);
    color: #facc15;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 1rem;
    display: inline-block;
    margin: 0 auto;
    border: 1px solid rgba(234, 179, 8, 0.2);
    animation: fadeIn 0.4s ease;
}

/* Input Section */
.input-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#answer-input {
    width: 100%;
    padding: 20px;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid var(--panel-border);
    border-radius: 16px;
    color: white;
    text-align: center;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}

#answer-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

/* Shake Animation for Wrong Answer */
.shake-error {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    border-color: var(--error-color) !important;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.2) !important;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.button-group {
    display: flex;
    gap: 15px;
}

.btn {
    flex: 1;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.primary-btn {
    background: var(--accent-color);
    color: white;
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.primary-btn:disabled {
    background: var(--text-secondary);
    transform: none;
    cursor: not-allowed;
    opacity: 0.7;
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.secondary-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

.secondary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Overlays & Transition Screens */
.overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(5px);
    opacity: 1;
    transition: opacity 0.4s ease;
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.transition-panel, .ad-panel {
    width: 90%;
    max-width: 600px;
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transform: translateY(0) scale(1);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.overlay.hidden .transition-panel, .overlay.hidden .ad-panel {
    transform: translateY(50px) scale(0.9);
}

.result-icon {
    font-size: 4rem;
    margin-bottom: -10px;
}

.success-text { color: var(--success-color) !important; }
.error-text { color: var(--error-color) !important; }

.timer-large {
    font-size: 3rem;
    font-weight: 800;
    color: var(--error-color);
    font-variant-numeric: tabular-nums;
}

.explanation-box {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 16px;
    text-align: left;
    border-left: 4px solid var(--accent-color);
}

.explanation-box h3 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.explanation-box p {
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Ads */
.ad-badge, .ad-badge-small {
    background: #eab308;
    color: #000;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-block;
}

.ad-mockup {
    width: 100%;
    height: 250px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-weight: 600;
    margin: 20px 0;
}

.bottom-banner-ad {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--ad-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--panel-border);
    z-index: 50;
    color: var(--text-secondary);
    font-weight: 600;
    gap: 15px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsiveness */
@media (max-width: 600px) {
    #question-text { font-size: 1.5rem; }
    .game-header { flex-direction: column; align-items: stretch; }
    .button-group { flex-direction: column; }
}

/* Prize Mode Styles */
body.prize-mode {
    --bg-color: #064e3b;
    --panel-bg: rgba(6, 78, 59, 0.7);
    --panel-border: rgba(250, 204, 21, 0.3);
    --accent-color: #facc15;
    --accent-hover: #eab308;
}

body.prize-mode .blob-1 {
    background: linear-gradient(to right, #10b981, #facc15);
}

body.prize-mode .blob-2 {
    background: linear-gradient(to right, #fbbf24, #10b981);
}

body.prize-mode .stat-value {
    color: var(--accent-color);
}

/* Prize Banner Styles */
.prize-banner {
    background: linear-gradient(90deg, #facc15, #fbbf24, #facc15);
    color: #000;
    font-weight: 800;
    text-align: center;
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(250, 204, 21, 0.4);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 4px 15px rgba(250, 204, 21, 0.4); }
    50% { transform: scale(1.02); box-shadow: 0 6px 25px rgba(250, 204, 21, 0.6); }
    100% { transform: scale(1); box-shadow: 0 4px 15px rgba(250, 204, 21, 0.4); }
}

.prize-star {
    margin: 0 10px;
}
