@tailwind base;
@tailwind components;
@tailwind utilities;

/* ===========================
   QuizLand — app.css
   =========================== */

:root {
    --red:    #ff5757;
    --orange: #ff9f43;
    --yellow: #ffd32a;
    --green:  #0be881;
    --blue:   #0fbcf9;
    --purple: #d742f5;
    --pink:   #ff5fa2;
    --dark:   #1c1c2e;
    --bg:     #f7f3ff;
    --card-shadow: 0 6px 0 rgba(0,0,0,0.18);
}

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

body {
    background: var(--bg);
    font-family: 'Nunito', sans-serif;
    color: var(--dark);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

body::before {
    content: '';
    position: fixed; inset: 0;
    background-image:
        radial-gradient(circle, #ffd32a 2px, transparent 2px),
        radial-gradient(circle, #ff5757 2px, transparent 2px),
        radial-gradient(circle, #0fbcf9 2px, transparent 2px),
        radial-gradient(circle, #0be881 2px, transparent 2px);
    background-size: 120px 120px, 80px 80px, 100px 100px, 90px 90px;
    background-position: 10px 10px, 50px 40px, 25px 70px, 70px 20px;
    opacity: 0.2;
    pointer-events: none; z-index: 0;
}

/* ===== NAVBAR ===== */
.navbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 40px; height: 68px;
    background: #fff;
    border-bottom: 3px solid var(--dark);
    box-shadow: 0 3px 0 var(--dark);
    position: sticky; top: 0; z-index: 100;
}
.logo {
    font-family: 'Baloo 2', cursive;
    font-size: 26px; font-weight: 800;
    display: flex; align-items: center; gap: 2px;
    text-decoration: none; color: inherit;
}
.logo .q  { color: var(--red); }
.logo .u  { color: var(--orange); }
.logo .i  { color: #c9a800; }
.logo .z  { color: #0a9e55; }
.logo .o  { color: var(--blue); }
.logo .land { color: var(--dark); }
.footer .logo .land { color: #fff; }
.logo-badge {
    background: var(--red); color: #fff;
    font-family: 'Nunito', sans-serif;
    font-size: 10px; font-weight: 800;
    padding: 2px 7px; border-radius: 50px;
    margin-left: 6px; margin-top: -14px;
}
.nav-links { display: flex; gap: 4px; }
.nav-link {
    padding: 8px 16px; border-radius: 50px;
    font-size: 14px; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
    color: #666; text-decoration: none;
}
.nav-link:hover, .nav-link.active { background: var(--dark); color: #fff; }
.nav-right { display: flex; gap: 10px; align-items: center; }
.nav-streak {
    display: flex; align-items: center; gap: 6px;
    background: #fff9e6; border: 2px solid var(--yellow);
    padding: 6px 14px; border-radius: 50px;
    font-size: 13px; font-weight: 800; color: #b37800;
}
.login-btn {
    background: var(--dark); color: #fff;
    padding: 10px 22px; border-radius: 50px;
    font-size: 14px; font-weight: 800; cursor: pointer;
    border: 2px solid var(--dark);
    box-shadow: 0 3px 0 rgba(0,0,0,0.4);
    transition: all 0.2s; text-decoration: none;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 5px 0 rgba(0,0,0,0.4); }

/* ===== HERO ===== */
.hero {
    position: relative; z-index: 1;
    padding: 56px 40px 44px;
    display: grid; grid-template-columns: 1fr 420px;
    gap: 40px; align-items: center;
    max-width: 1200px; margin: 0 auto;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.hero-pill {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fff3cd; border: 2px solid var(--yellow);
    color: #996600; padding: 6px 16px; border-radius: 50px;
    font-size: 13px; font-weight: 800; margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}
.hero-title {
    font-family: 'Baloo 2', cursive;
    font-size: 54px; font-weight: 800; line-height: 1.05;
}
.hero-title em {
    font-style: normal; position: relative;
}
.hero-title em::after {
    content: ''; position: absolute; bottom: 2px; left: 0; right: 0;
    height: 8px; background: var(--yellow); opacity: 0.5; z-index: -1; border-radius: 4px;
}
.hero-sub { font-size: 16px; color: #666; margin-top: 16px; line-height: 1.6; max-width: 420px; }
.hero-btns { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

.btn-main {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--red); color: #fff;
    padding: 14px 28px; border-radius: 50px;
    font-size: 16px; font-weight: 900; cursor: pointer; text-decoration: none;
    border: 2px solid var(--dark); box-shadow: 0 5px 0 var(--dark); transition: all 0.15s;
}
.btn-main:hover  { transform: translateY(-3px); box-shadow: 0 8px 0 var(--dark); }
.btn-main:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--dark); }

.btn-sec {
    display: inline-flex; align-items: center; gap: 8px;
    background: #fff; color: var(--dark);
    padding: 14px 28px; border-radius: 50px;
    font-size: 16px; font-weight: 800; cursor: pointer; text-decoration: none;
    border: 2px solid var(--dark); box-shadow: 0 5px 0 var(--dark); transition: all 0.15s;
}
.btn-sec:hover { transform: translateY(-3px); box-shadow: 0 8px 0 var(--dark); }

.hero-stats { display: flex; gap: 20px; margin-top: 32px; }
.stat-chip {
    background: #fff; border: 2px solid var(--dark);
    border-radius: 16px; padding: 14px 20px;
    box-shadow: 3px 3px 0 var(--dark); text-align: center;
}
.stat-num { font-family: 'Baloo 2', cursive; font-size: 26px; font-weight: 800; }
.stat-num.r { color: var(--red); }
.stat-num.b { color: var(--blue); }
.stat-num.g { color: #0a9e55; }
.stat-lbl { font-size: 12px; color: #888; font-weight: 700; margin-top: 2px; }

/* Hero card */
.hero-card {
    background: #fff; border: 3px solid var(--dark);
    border-radius: 28px; padding: 28px;
    box-shadow: 6px 6px 0 var(--dark);
    position: relative; overflow: hidden;
}
.hero-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px;
    background: linear-gradient(90deg, var(--red), var(--orange), var(--yellow), #0a9e55, var(--blue), var(--purple));
}
.hc-label { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: #aaa; margin-bottom: 16px; }
.hc-emoji-big { font-size: 64px; display: block; margin-bottom: 16px; }
.hc-title { font-family: 'Baloo 2', cursive; font-size: 24px; font-weight: 800; line-height: 1.2; }
.hc-meta { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.hc-tag {
    background: var(--bg); border: 2px solid var(--dark);
    padding: 5px 12px; border-radius: 50px;
    font-size: 12px; font-weight: 800; color: var(--dark);
    display: inline-block;
}
.hc-play {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--green); color: var(--dark);
    border: 2px solid var(--dark); box-shadow: 3px 3px 0 var(--dark);
    padding: 14px; border-radius: 16px;
    font-size: 15px; font-weight: 900; cursor: pointer; text-decoration: none;
    margin-top: 20px; transition: all 0.15s;
}
.hc-play:hover { transform: translateY(-2px); box-shadow: 5px 5px 0 var(--dark); }
.hc-players { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; color: #888; font-weight: 700; }
.avatar-row { display: flex; }
.avatar { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; margin-left: -8px; font-size: 14px; display: flex; align-items: center; justify-content: center; background: #eee; }
.avatar:first-child { margin-left: 0; }

/* ===== SECTIONS ===== */
.section { padding: 32px 40px; max-width: 1200px; margin: 0 auto; position: relative; z-index: 1; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-family: 'Baloo 2', cursive; font-size: 26px; font-weight: 800; }
.see-all { font-size: 14px; font-weight: 800; color: var(--red); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ===== CATEGORY CARDS ===== */
.cats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@keyframes popIn {
    0% { opacity: 0; transform: scale(0.8) translateY(20px); }
    70% { transform: scale(1.04) translateY(-3px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.cat-card {
    border-radius: 24px; padding: 26px 20px 22px;
    cursor: pointer; border: 3px solid var(--dark);
    box-shadow: var(--card-shadow); transition: all 0.18s;
    position: relative; overflow: hidden; text-decoration: none;
    display: block;
    animation: popIn 0.4s cubic-bezier(0.34,1.56,0.64,1) both;
}
.cat-card:hover { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 12px 0 rgba(0,0,0,0.18); }
.cat-card.c1 { background: #ff7b7b; } .cat-card.c2 { background: #ffa94d; }
.cat-card.c3 { background: #69db7c; } .cat-card.c4 { background: #4dabf7; }
.cat-card.c5 { background: #cc5de8; } .cat-card.c6 { background: #ff6fa3; }
.cat-card.c7 { background: #ffd43b; } .cat-card.c8 { background: #38d9a9; }
.cat-badge {
    position: absolute; top: 14px; right: 14px;
    background: rgba(0,0,0,0.15); color: #fff;
    padding: 3px 10px; border-radius: 50px; font-size: 11px; font-weight: 800;
}
.cat-icon { font-size: 52px; display: block; margin-bottom: 12px; line-height: 1; }
.cat-name { font-family: 'Baloo 2', cursive; font-size: 20px; font-weight: 800; color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,0.2); }
.cat-count { font-size: 13px; color: rgba(255,255,255,0.8); font-weight: 700; margin-top: 4px; }
.cat-arrow { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: rgba(255,255,255,0.3); border-radius: 50%; margin-top: 14px; font-size: 16px; color: #fff; font-weight: 900; }
.cat-card:nth-child(1) { animation-delay: .05s; } .cat-card:nth-child(2) { animation-delay: .1s; }
.cat-card:nth-child(3) { animation-delay: .15s; } .cat-card:nth-child(4) { animation-delay: .2s; }
.cat-card:nth-child(5) { animation-delay: .25s; } .cat-card:nth-child(6) { animation-delay: .3s; }
.cat-card:nth-child(7) { animation-delay: .35s; } .cat-card:nth-child(8) { animation-delay: .4s; }

/* ===== LEADERBOARD ===== */
.leaderboard {
    background: var(--dark); color: #fff;
    margin: 0 40px 32px; border-radius: 24px; padding: 24px 28px;
    display: flex; gap: 24px; align-items: center;
    position: relative; z-index: 1; border: 3px solid var(--dark); box-shadow: var(--card-shadow);
}
.lb-title { font-family: 'Baloo 2', cursive; font-size: 18px; font-weight: 800; white-space: nowrap; }
.lb-list { display: flex; gap: 12px; flex: 1; }
.lb-item { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.07); border-radius: 50px; padding: 8px 16px 8px 10px; flex: 1; }
.lb-pos { font-size: 16px; } .lb-avatar { width: 32px; height: 32px; border-radius: 50%; font-size: 18px; display: flex; align-items: center; justify-content: center; }
.lb-info { flex: 1; } .lb-name { font-size: 13px; font-weight: 800; } .lb-score { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 1px; }
.lb-pts { font-family: 'Baloo 2', cursive; font-size: 18px; font-weight: 800; color: var(--yellow); }

/* ===== QUIZ CARDS ===== */
.quiz-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.quiz-card { background: #fff; border: 2px solid var(--dark); border-radius: 20px; overflow: hidden; box-shadow: 4px 4px 0 var(--dark); cursor: pointer; transition: all 0.18s; }
.quiz-card:hover { transform: translateY(-4px); box-shadow: 6px 8px 0 var(--dark); }
.quiz-card-top { height: 90px; display: flex; align-items: center; justify-content: center; font-size: 48px; position: relative; }
.qct1 { background: linear-gradient(135deg, #ff7b7b, #ff5757); }
.qct2 { background: linear-gradient(135deg, #ffd43b, #ffa94d); }
.qct3 { background: linear-gradient(135deg, #4dabf7, #339af0); }
.qct4 { background: linear-gradient(135deg, #69db7c, #40c057); }
.qct5 { background: linear-gradient(135deg, #cc5de8, #ae3ec9); }
.qct6 { background: linear-gradient(135deg, #ff6fa3, #f03e3e); }
.diff-badge { position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 50px; color: #fff; }
.quiz-card-body { padding: 16px 18px; }
.quiz-card-title { font-family: 'Baloo 2', cursive; font-size: 17px; font-weight: 700; line-height: 1.2; }
.quiz-card-meta { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.qm-chip { background: var(--bg); border: 1.5px solid #e0e0e0; padding: 4px 10px; border-radius: 50px; font-size: 11px; font-weight: 700; color: #666; }
.quiz-card-footer { padding: 12px 18px; border-top: 2px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; }
.q-players { font-size: 12px; color: #aaa; font-weight: 700; }
.q-play-btn { background: var(--dark); color: #fff; padding: 7px 18px; border-radius: 50px; font-size: 12px; font-weight: 800; cursor: pointer; transition: all 0.15s; text-decoration: none; }
.q-play-btn:hover { background: var(--red); }

/* ===== QUIZ PLAY PAGE ===== */
.quiz-question-card {
    background: #fff; border: 2px solid var(--dark); border-radius: 20px;
    padding: 28px; margin-bottom: 20px;
    box-shadow: 4px 4px 0 var(--dark);
}
.answers-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answer-btn {
    display: flex; align-items: center; gap: 14px;
    background: #fff; border: 2px solid var(--dark);
    border-radius: 16px; padding: 16px 20px;
    font-family: 'Nunito', sans-serif; font-size: 15px; font-weight: 700;
    cursor: pointer; text-align: left; transition: all 0.15s;
    box-shadow: 3px 3px 0 var(--dark);
}
.answer-btn:hover:not(:disabled) { background: var(--bg); transform: translateY(-2px); box-shadow: 5px 5px 0 var(--dark); }
.answer-btn:disabled { cursor: default; }
.answer-btn.selected { background: #e8f4ff; border-color: var(--blue); }
.answer-btn.correct  { background: #d3f9d8; border-color: #40c057; box-shadow: 3px 3px 0 #40c057; }
.answer-btn.wrong    { background: #ffe3e3; border-color: var(--red); box-shadow: 3px 3px 0 var(--red); }
.answer-letter {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; min-width: 32px;
    background: var(--bg); border: 2px solid var(--dark);
    border-radius: 8px; font-size: 14px; font-weight: 900;
}
.text-red { color: var(--red); }

/* ===== FLASH ===== */
.flash { position: fixed; top: 80px; right: 20px; z-index: 200; padding: 12px 20px; border-radius: 12px; font-weight: 700; border: 2px solid var(--dark); box-shadow: 3px 3px 0 var(--dark); }
.flash-success { background: #d3f9d8; color: #1a6b2a; }

/* ===== FOOTER ===== */
.footer { background: var(--dark); color: #fff; padding: 28px 40px; margin-top: 40px; border-top: 3px solid rgba(255,255,255,0.1); }
.footer-inner { max-width: 1200px; margin: 0 auto; text-align: center; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; }
    .cats-grid { grid-template-columns: repeat(2, 1fr); }
    .quiz-grid { grid-template-columns: 1fr 1fr; }
    .lb-list { flex-direction: column; }
    .leaderboard { flex-direction: column; align-items: flex-start; margin: 0 16px 24px; }
    .answers-grid { grid-template-columns: 1fr; }
    .navbar { padding: 0 16px; }
    .nav-links { display: none; }
    .hero { padding: 32px 16px 24px; }
    .section { padding: 24px 16px; }
}
@media (max-width: 600px) {
    .cats-grid { grid-template-columns: repeat(2, 1fr); }
    .quiz-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 38px; }
}

/* ===== BURGER ===== */
.burger-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 200;
}
.burger-btn span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--dark);
    border-radius: 3px;
    transition: all 0.3s;
}
.burger-btn.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger-btn.active span:nth-child(2) { opacity: 0; }
.burger-btn.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

.mobile-menu {
    display: none;
    position: absolute;
    top: 68px;
    left: 0; right: 0;
    background: #fff;
    border-bottom: 3px solid var(--dark);
    box-shadow: 0 6px 0 var(--dark);
    padding: 12px 16px;
    z-index: 99;
    flex-direction: column;
}
.mobile-link {
    display: block;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--dark);
    text-decoration: none;
    border-radius: 12px;
    transition: background 0.2s;
}
.mobile-link:hover, .mobile-link.active { background: var(--bg); }

@media (max-width: 900px) {
    .nav-links { display: none; }
    .nav-right { display: none; }
    .burger-btn { display: flex; }
    .mobile-menu { display: flex; }
}

/* ===== DASHBOARD ===== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.dashboard-result-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
}
.dashboard-cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .dashboard-result-row {
        flex-wrap: wrap;
        gap: 10px;
        padding: 14px 16px;
    }
    .dashboard-cat-grid {
        grid-template-columns: 1fr;
    }
}


.share-btn {
    background: var(--bg);
    border: 2px solid var(--dark);
    padding: 7px 14px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--dark);
}
.share-btn:hover { background: var(--red); border-color: var(--red); color: #fff; }
.share-btn:hover svg { stroke: #fff; }
