:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #ec4899;
    --accent: #06b6d4;
    --bg-dark: #0b0f19;
    --card-bg: rgba(22, 30, 49, 0.75);
    --card-border: rgba(255, 255, 255, 0.12);
    --text-main: #f8fafc;
    --text-sub: #94a3b8;
    --success: #10b981;
    --error: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', 'Poppins', -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 72, 153, 0.12) 0px, transparent 50%),
        radial-gradient(at 50% 50%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.main-header {
    padding: 1.25rem 5%;
    background: rgba(11, 15, 25, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #a5b4fc, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px var(--primary-glow);
}

.container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    position: relative;
    z-index: 1;
    flex: 1;
}

.hero-section {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeIn 0.8s ease;
}

.hero-section h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.hero-section p {
    color: var(--text-sub);
    font-size: 1rem;
}

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 28px;
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 25px 60px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.3rem;
}

.author {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 1.2rem;
}

.card-body p {
    color: var(--text-sub);
    line-height: 1.6;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.card-footer {
    display: flex;
    gap: 12px;
}

.btn-main {
    flex: 2;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-main:active {
    transform: scale(0.97);
}

.btn-main:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.5);
    transform: translateY(-2px);
}

.btn-outline {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.quiz-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

#q-number {
    font-weight: 800;
    color: var(--accent);
    font-size: 1.1rem;
    background: rgba(6, 182, 212, 0.1);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

#timer {
    font-weight: 800;
    font-size: 1.1rem;
    color: #f43f5e;
    background: rgba(244, 63, 94, 0.1);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

#question-text {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 1.5rem;
    color: #fff;
}

.image-viewer {
    position: relative;
    margin: 1.5rem 0;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.img-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#main-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

.img-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(8px);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.prev { left: 12px; }
.next { right: 12px; }

.img-nav:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.help-zone {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 1.5rem 0;
}

.info-btn-modern {
    background: rgba(255, 255, 255, 0.05);
    color: #a5b4fc;
    border: 1px solid rgba(165, 180, 252, 0.2);
    width: 48px;
    height: 48px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-btn-modern:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-3px) rotate(5deg);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.answer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

.ans-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 1.2rem 1rem;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: left;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 1.4;
    display: flex;
    align-items: center;
}

.ans-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.correct {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border-color: #10b981 !important;
    color: white !important;
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
    animation: pulseSuccess 0.4s ease;
}

.wrong {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border-color: #ef4444 !important;
    color: white !important;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

@keyframes pulseSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 15, 0.85);
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 1rem;
    overflow-y: auto;
}

.modal-content {
    max-width: 440px;
    margin: 80px auto;
    position: relative;
    animation: modalPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.5rem;
    border: none;
    background: rgba(255,255,255,0.08);
    color: var(--text-sub);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.close-modal:hover {
    background: rgba(255,255,255,0.2);
    color: white;
}

input[type="text"], input[type="email"], textarea {
    width: 100%;
    padding: 14px 18px;
    margin: 8px 0 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: white;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

input:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.custom-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-sub);
    margin: 10px 0 20px;
}

.custom-checkbox input {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    flex-shrink: 0;
    position: relative;
    transition: 0.2s;
    margin-top: 2px;
}

.custom-checkbox input:checked ~ .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.custom-checkbox input:checked ~ .checkmark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
}

.table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 0.95rem;
}

.score-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.85rem;
}

.report-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 99;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 10px 18px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.85rem;
    backdrop-filter: blur(10px);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-btn:hover {
    background: #ef4444;
    color: white;
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-2px);
}

.cookie-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9999;
    padding: 1rem 5%;
}

.cookie-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.cookie-content span {
    font-size: 0.85rem;
    color: var(--text-sub);
}

.btn-cookies {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
}

.confetti {
    position: absolute;
    width: 100px;
    height: 100px;
    animation: fall 3s linear forwards;
    z-index: 100;
}

@keyframes fall {
    to { transform: translateY(500px) rotate(360deg); opacity: 0; }
}

.page { display: none; }
.active { display: block; animation: fadeIn 0.4s ease; }
.hidden { display: none !important; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
    .hero-section h1 { font-size: 1.75rem; }
    .hero-section p { font-size: 0.9rem; }
    .glass-card { padding: 1.25rem; border-radius: 22px; }
    .answer-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    .image-viewer { height: 220px; }
    .card-footer { flex-direction: column; }
    .cookie-content { flex-direction: column; text-align: center; }
    .btn-cookies { width: 100%; }
    .report-btn { bottom: 15px; left: 15px; padding: 8px 14px; font-size: 0.8rem; }
}