/*
Theme Name: QuizMaster NoLogin
Theme URI: https://quiz.com/
Author: AI Assistant
Description: A modern quiz contest theme inspired by Quiz.com. Features instant play without login requirements.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: quizmaster
*/

/* --- CSS VARIABLES & RESET --- */
:root {
    --primary: #6c5ce7; /* Modern Purple */
    --primary-dark: #4834d4;
    --accent: #00cec9; /* Teal/Cyan for highlights */
    --secondary: #2d3436; /* Dark text */
    --bg-body: #f4f7f6;
    --bg-card: #ffffff;
    --text-gray: #636e72;
    --danger: #ff7675;
    --success: #00b894;
    --shadow: 0 10px 20px rgba(0,0,0,0.08);
    --radius: 12px;
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-body);
    color: var(--secondary);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }

/* --- HEADER --- */
header {
    background: var(--bg-card);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.logo span { color: var(--secondary); }

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    font-weight: 600;
    color: var(--text-gray);
    font-size: 0.95rem;
}

.nav-links a:hover { color: var(--primary); }

/* --- HERO SECTION --- */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 6rem 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 10%, transparent 10%);
    background-size: 30px 30px;
    transform: rotate(45deg);
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
}

.hero-btns { display: flex; justify-content: center; gap: 1rem; }

.btn-large {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 50px;
    font-weight: 700;
    transition: 0.3s;
}

.btn-white { background: white; color: var(--primary); }
.btn-white:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,0,0,0.2); }

/* --- STATS BAR --- */
.stats-bar {
    background: var(--bg-card);
    max-width: 1000px;
    margin: -2.5rem auto 4rem;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    text-align: center;
    position: relative;
    z-index: 10;
}

.stat-item h3 { font-size: 2rem; color: var(--primary); margin-bottom: 0.2rem; }
.stat-item p { color: var(--text-gray); font-size: 0.9rem; font-weight: 600; text-transform: uppercase; }

/* --- SECTIONS COMMON --- */
.section-container {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 0 1.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.section-title h2 { font-size: 2rem; color: var(--secondary); margin-bottom: 0.5rem; }
.section-title p { color: var(--text-gray); }
.view-all { color: var(--primary); font-weight: 700; font-size: 0.9rem; }

/* --- LIVE CONTESTS --- */
.contest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.contest-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
    border: 1px solid rgba(0,0,0,0.05);
}

.contest-card:hover { transform: translateY(-5px); }

.contest-header {
    height: 160px;
    background: #dfe6e9;
    position: relative;
}

.contest-header img { width: 100%; height: 100%; object-fit: cover; }

.prize-tag {
    position: absolute;
    top: 1rem; right: 1rem;
    background: #ffeaa7;
    color: #d35400;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.contest-body { padding: 1.5rem; }

.contest-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; }
.contest-meta { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--text-gray); margin-bottom: 1.5rem; }
.contest-meta span { display: flex; align-items: center; gap: 4px; }

.progress-bar {
    background: #eee;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    position: relative;
}
.progress-fill {
    background: var(--success);
    height: 100%;
    border-radius: 4px;
    width: 65%;
}

.contest-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.participants { font-size: 0.8rem; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.avatars { display: flex; }
.avatars img {
    width: 24px; height: 24px; border-radius: 50%; border: 2px solid white;
    margin-left: -8px;
}

/* --- FEATURED QUIZZES --- */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.quiz-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: 0.3s;
    cursor: pointer;
}

.quiz-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.quiz-thumb {
    height: 140px;
    width: 100%;
    object-fit: cover;
}

.quiz-info { padding: 1rem; }
.quiz-cat { color: var(--primary); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; margin-bottom: 0.3rem; }
.quiz-name { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.5rem; line-height: 1.3; }
.quiz-stats { font-size: 0.8rem; color: var(--text-gray); display: flex; gap: 10px; }

/* --- LEADERBOARD --- */
.leaderboard-section { background: white; padding: 4rem 0; }
.leaderboard-container {
    max-width: 800px;
    margin: 0 auto;
    background: #f8f9fa;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.leader-row {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: white;
    margin-bottom: 0.8rem;
    border-radius: 8px;
    border-left: 5px solid transparent;
}

.leader-row:nth-child(2) { border-left-color: #fdcb6e; background: #fffdf5; }
.leader-row:nth-child(3) { border-left-color: #b2bec3; }
.leader-row:nth-child(4) { border-left-color: #cd7f32; }

.rank { font-weight: 800; font-size: 1.2rem; width: 40px; color: var(--text-gray); }
.user-info { flex-grow: 1; display: flex; align-items: center; gap: 10px; }
.user-info img { width: 35px; height: 35px; border-radius: 50%; }
.score { font-weight: 700; color: var(--primary); }

/* --- FOOTER --- */
footer {
    background: var(--secondary);
    color: #b2bec3;
    padding: 4rem 1.5rem 1rem;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto 3rem;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
}

.footer-col h4 { color: white; margin-bottom: 1.2rem; font-size: 1.1rem; }
.footer-col ul li { margin-bottom: 0.8rem; }
.footer-col a:hover { color: var(--primary); }

.footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    font-size: 0.85rem;
}

/* --- GAME MODAL --- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    animation: popIn 0.3s ease;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-game {
    position: absolute;
    top: 1rem; right: 1.5rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #aaa;
}

.game-header { margin-bottom: 2rem; text-align: center; }
.progress-game { width: 100%; background: #eee; height: 6px; border-radius: 3px; margin-bottom: 1rem; }
.progress-fill-game { background: var(--primary); height: 100%; width: 0%; transition: width 0.3s; border-radius: 3px; }

.question-text { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--secondary); }

.options-grid { display: grid; gap: 1rem; }
.option-btn {
    padding: 1rem;
    border: 2px solid #dfe6e9;
    border-radius: 8px;
    background: white;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: var(--secondary);
    transition: 0.2s;
}

.option-btn:hover { border-color: var(--primary); background: #f0f3ff; }
.option-btn.correct { background: var(--success); color: white; border-color: var(--success); }
.option-btn.wrong { background: var(--danger); color: white; border-color: var(--danger); }

.game-result { text-align: center; }
.score-circle {
    width: 120px; height: 120px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    margin: 0 auto 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.5rem; }
    .stats-bar { grid-template-columns: 1fr; gap: 2rem; }
    .nav-links { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
}