/* ============================================================
   Mivan?! — Stílus
   Fekete-sárga, pop-art, ragadós comic energy
   ============================================================ */

:root {
    --yellow:      #FFE500;
    --yellow-dark: #E6CE00;
    --black:       #111111;
    --white:       #FAFAFA;
    --gray:        #2A2A2A;
    --gray-mid:    #555555;
    --gray-light:  #E8E8E8;
    --red:         #FF3333;
    --green:       #00CC66;
    --radius:      12px;
    --shadow:      4px 4px 0px var(--black);
    --font-title:  'Bangers', cursive;
    --font-body:   'Nunito', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    background: var(--white);
    color: var(--black);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
    background: var(--black);
    border-bottom: 3px solid var(--yellow);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.nav-logo {
    font-family: var(--font-title);
    font-size: 2rem;
    color: var(--white);
    text-decoration: none;
    letter-spacing: 1px;
    flex: 1;
}
.nav-logo span { color: var(--yellow); }
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.2rem;
}
.nav-links a {
    color: var(--gray-light);
    text-decoration: none;
    font-weight: 700;
    font-size: .95rem;
    transition: color .15s;
}
.nav-links a:hover { color: var(--yellow); }
.admin-link { color: var(--yellow) !important; }
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: .25rem;
}
.mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--black);
    border-bottom: 3px solid var(--yellow);
    padding: 1rem 1.5rem;
    gap: .75rem;
}
.mobile-menu a {
    color: var(--gray-light);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.05rem;
}
.mobile-menu.open { display: flex; }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: .55rem 1.4rem;
    border-radius: var(--radius);
    font-weight: 800;
    font-family: var(--font-body);
    font-size: .95rem;
    cursor: pointer;
    text-decoration: none;
    border: 2px solid transparent;
    transition: transform .1s, box-shadow .1s;
    line-height: 1.2;
}
.btn:active { transform: translate(2px,2px); box-shadow: none !important; }

.btn-play {
    background: var(--yellow);
    color: var(--black);
    border-color: var(--black);
    box-shadow: var(--shadow);
}
.btn-play:hover { background: var(--yellow-dark); color: var(--black); }

/* Navbar-on belüli játssz gomb - szín override */
.nav-play-btn,
.nav-play-btn:hover,
.nav-play-btn:visited,
.nav-play-btn:focus {
    color: var(--black) !important;
}

.btn-primary {
    background: var(--yellow);
    color: var(--black);
    border-color: var(--black);
    box-shadow: var(--shadow);
    width: 100%;
    padding: .85rem;
    font-size: 1.1rem;
    text-align: center;
}
.btn-primary:hover { background: var(--yellow-dark); }

.btn-outline {
    background: transparent;
    color: var(--white);
    border-color: var(--white);
}
.btn-outline:hover { background: var(--white); color: var(--black); }

.btn-danger {
    background: var(--red);
    color: var(--white);
    border-color: var(--black);
    box-shadow: var(--shadow);
}
.btn-success {
    background: var(--green);
    color: var(--black);
    border-color: var(--black);
    box-shadow: var(--shadow);
}
.btn-sm { padding: .35rem .85rem; font-size: .85rem; }

/* ── Layout ─────────────────────────────────────────────── */
main { flex: 1; }

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}
.container-wide {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ── Hero ───────────────────────────────────────────────── */
.hero {
    background: var(--black);
    color: var(--white);
    padding: 4rem 1.5rem 3rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 20px,
        rgba(255,229,0,.04) 20px,
        rgba(255,229,0,.04) 40px
    );
    pointer-events: none;
}
.hero-title {
    font-family: var(--font-title);
    font-size: clamp(3.5rem, 10vw, 7rem);
    color: var(--yellow);
    text-shadow: 5px 5px 0 rgba(0,0,0,.5);
    letter-spacing: 2px;
    line-height: 1;
    position: relative;
    z-index: 1;
}
.hero-sub {
    font-size: 1.2rem;
    color: var(--gray-light);
    margin: 1rem 0 2rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}
.hero-play-btn {
    font-size: 1.3rem;
    padding: .85rem 2.5rem;
    position: relative;
    z-index: 1;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2.5rem;
    position: relative;
    z-index: 1;
}
.stat-item { text-align: center; }
.stat-num {
    font-family: var(--font-title);
    font-size: 2.5rem;
    color: var(--yellow);
    display: block;
    line-height: 1;
}
.stat-label { font-size: .85rem; color: var(--gray-mid); }

/* ── Cards ──────────────────────────────────────────────── */
.card {
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: var(--font-title);
    font-size: 2rem;
    letter-spacing: 1px;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ── Top questions ──────────────────────────────────────── */
.question-list { list-style: none; }
.question-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1rem;
    border-bottom: 2px dashed var(--gray-light);
    transition: background .15s;
    border-radius: 6px;
}
.question-item:last-child { border-bottom: none; }
.question-item:hover { background: #FFF9C4; }
.q-rank {
    font-family: var(--font-title);
    font-size: 1.6rem;
    color: var(--yellow);
    text-shadow: 2px 2px 0 var(--black);
    min-width: 2rem;
    text-align: center;
}
.q-text {
    flex: 1;
    font-weight: 700;
    font-size: 1rem;
    color: var(--black);
    text-decoration: none;
}
.q-text:hover { color: var(--gray-mid); }
.q-count {
    font-size: .85rem;
    color: var(--gray-mid);
    white-space: nowrap;
}
.badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .78rem;
    font-weight: 800;
    border: 2px solid var(--black);
}
.badge-yellow { background: var(--yellow); color: var(--black); }
.badge-green  { background: var(--green);  color: var(--black); }
.badge-red    { background: var(--red);    color: var(--white); }
.badge-gray   { background: var(--gray-light); color: var(--black); }

/* ── Play oldal ─────────────────────────────────────────── */
.play-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}
.play-question-card {
    background: var(--black);
    color: var(--white);
    border: 3px solid var(--yellow);
    border-radius: var(--radius);
    box-shadow: 6px 6px 0 var(--yellow);
    padding: 2rem 2rem 1.5rem;
    margin-bottom: 2rem;
    position: relative;
}
.play-question-card::before {
    content: '❓';
    position: absolute;
    top: -18px;
    left: 1.5rem;
    font-size: 2rem;
    background: var(--black);
    padding: 0 .25rem;
}
.play-question-label {
    font-size: .85rem;
    color: var(--gray-mid);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: .5rem;
}
.play-question-text {
    font-family: var(--font-title);
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    color: var(--yellow);
    letter-spacing: 1px;
    line-height: 1.2;
}

.answer-form-wrap {
    display: flex;
    gap: .75rem;
    margin-bottom: 1rem;
}
.answer-input {
    flex: 1;
    padding: .85rem 1.1rem;
    border: 3px solid var(--black);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
}
.answer-input:focus {
    border-color: var(--yellow);
    box-shadow: 3px 3px 0 var(--yellow);
}
.answer-input::placeholder { color: #aaa; font-weight: 400; }

#answerMsg {
    min-height: 1.4rem;
    font-weight: 700;
    margin-bottom: .5rem;
}
.msg-ok  { color: var(--green); }
.msg-err { color: var(--red); }

/* ── Eredmények ─────────────────────────────────────────── */
.results-wrap { display: none; }
.results-title {
    font-family: var(--font-title);
    font-size: 1.6rem;
    margin-bottom: 1rem;
    letter-spacing: 1px;
}
.result-bar-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .65rem;
}
.result-rank {
    font-family: var(--font-title);
    font-size: 1.3rem;
    color: var(--gray-mid);
    min-width: 1.8rem;
    text-align: right;
}
.result-rank.gold   { color: #FFD700; }
.result-rank.silver { color: #C0C0C0; }
.result-rank.bronze { color: #CD7F32; }
.result-bar-outer {
    flex: 1;
    background: var(--gray-light);
    border: 2px solid var(--black);
    border-radius: 6px;
    height: 36px;
    position: relative;
    overflow: hidden;
}
.result-bar-inner {
    height: 100%;
    background: var(--yellow);
    border-right: 2px solid var(--black);
    transition: width .6s cubic-bezier(.4,0,.2,1);
    width: 0;
}
.result-bar-item:nth-child(1) .result-bar-inner { background: #FFD700; }
.result-bar-item:nth-child(2) .result-bar-inner { background: #E8E8E8; }
.result-bar-item:nth-child(3) .result-bar-inner { background: #CD7F32; }
.result-text {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 800;
    font-size: .9rem;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: calc(100% - 50px);
}
.result-votes {
    font-weight: 800;
    font-size: .9rem;
    min-width: 3rem;
    text-align: right;
    color: var(--gray-mid);
}

/* ── Auth oldalak ───────────────────────────────────────── */
.auth-wrap {
    max-width: 420px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}
.auth-card {
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem 2rem;
}
.auth-title {
    font-family: var(--font-title);
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 1.75rem;
    letter-spacing: 1px;
}
.auth-title span { color: var(--yellow); }

.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block;
    font-weight: 800;
    margin-bottom: .4rem;
    font-size: .95rem;
}
.form-control {
    width: 100%;
    padding: .75rem 1rem;
    border: 3px solid var(--black);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    background: var(--white);
}
.form-control:focus {
    border-color: var(--yellow);
    box-shadow: 3px 3px 0 var(--yellow);
}
.form-hint {
    font-size: .82rem;
    color: var(--gray-mid);
    margin-top: .3rem;
}
.form-error {
    background: #FFE0E0;
    border: 2px solid var(--red);
    border-radius: 8px;
    padding: .75rem 1rem;
    color: var(--red);
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: .95rem;
}
.form-success {
    background: #E0FFE8;
    border: 2px solid var(--green);
    border-radius: 8px;
    padding: .75rem 1rem;
    color: #008040;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: .95rem;
}
.auth-footer {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .9rem;
    color: var(--gray-mid);
}
.auth-footer a { color: var(--black); font-weight: 700; }

/* ── Submit kérdés ──────────────────────────────────────── */
.submit-wrap {
    max-width: 600px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

/* ── Admin ──────────────────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 67px);
}
.admin-sidebar {
    width: 230px;
    background: var(--black);
    color: var(--white);
    padding: 2rem 1rem;
    flex-shrink: 0;
}
.admin-sidebar-title {
    font-family: var(--font-title);
    font-size: 1.3rem;
    color: var(--yellow);
    padding: 0 .5rem .75rem;
    border-bottom: 2px solid var(--gray);
    margin-bottom: 1rem;
    letter-spacing: 1px;
}
.admin-nav a {
    display: block;
    color: var(--gray-light);
    text-decoration: none;
    padding: .6rem .75rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: .95rem;
    transition: background .15s, color .15s;
    margin-bottom: .25rem;
}
.admin-nav a:hover, .admin-nav a.active {
    background: var(--gray);
    color: var(--yellow);
}
.admin-content {
    flex: 1;
    padding: 2rem;
    overflow-x: auto;
}
.admin-page-title {
    font-family: var(--font-title);
    font-size: 2rem;
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
}
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem 1.5rem;
    text-align: center;
}
.stat-card-num {
    font-family: var(--font-title);
    font-size: 2.5rem;
    color: var(--black);
    display: block;
}
.stat-card-label { font-size: .85rem; color: var(--gray-mid); font-weight: 600; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .92rem;
    background: var(--white);
    border: 3px solid var(--black);
    border-radius: var(--radius);
    overflow: hidden;
}
.admin-table th {
    background: var(--black);
    color: var(--white);
    padding: .75rem 1rem;
    text-align: left;
    font-weight: 800;
    white-space: nowrap;
}
.admin-table td {
    padding: .7rem 1rem;
    border-bottom: 2px solid var(--gray-light);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: #FFF9C4; }
.action-btns { display: flex; gap: .4rem; flex-wrap: wrap; }

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
    background: var(--black);
    color: var(--gray-mid);
    text-align: center;
    padding: 2rem 1.5rem;
    border-top: 3px solid var(--yellow);
}
.footer-logo {
    font-family: var(--font-title);
    font-size: 1.5rem;
    color: var(--white);
    display: block;
    margin-bottom: .5rem;
}
.footer-logo span { color: var(--yellow); }
.footer-small { font-size: .8rem; margin-top: .3rem; }

/* ── Animációk ──────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp .4s ease forwards; }

@keyframes popIn {
    0%   { transform: scale(.8); opacity: 0; }
    70%  { transform: scale(1.05); }
    100% { transform: scale(1);   opacity: 1; }
}
.pop-in { animation: popIn .35s ease forwards; }

/* ── Üzenetek ───────────────────────────────────────────── */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 2px solid var(--black);
    font-weight: 700;
    margin-bottom: 1rem;
}
.alert-info    { background: #E8F0FF; border-color: #4466CC; color: #2244AA; }
.alert-success { background: #E0FFE8; border-color: var(--green); color: #006633; }
.alert-error   { background: #FFE0E0; border-color: var(--red);   color: #CC0000; }

/* ── Reklám blokkok ─────────────────────────────────────── */
.ad-block {
    width: 100%;
    text-align: center;
    margin: 1rem 0;
    position: relative;
}
.ad-label {
    font-size: .7rem;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: .3rem;
}
.ad-top {
    background: #f5f5f5;
    border-top: 2px solid #e0e0e0;
    border-bottom: 2px solid #e0e0e0;
    padding: .75rem 1rem;
}
.ad-middle {
    padding: .5rem 0;
    margin: 1.5rem 0;
}
.ad-bottom {
    background: #f5f5f5;
    border-top: 2px solid #e0e0e0;
    padding: .75rem 1rem;
}
/* Placeholder megjelenítés (fejlesztés alatt) */
.ad-placeholder {
    display: inline-block;
    background: #e8e8e8;
    border: 2px dashed #bbb;
    border-radius: 8px;
    padding: 1rem 2rem;
    color: #999;
    font-size: .9rem;
    font-weight: 600;
    min-width: 280px;
    min-height: 60px;
    line-height: 2;
}

/* ── Responsive ─────────────────────────────────────────── */

/* Tablet: 700px - 1024px */
@media (max-width: 1024px) {
    .container, .container-wide {
        padding: 1.5rem 1.25rem;
    }
    .stat-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mobil: max 700px */
@media (max-width: 700px) {

    /* Navbar */
    .nav-links  { display: none; }
    .nav-toggle { display: block; }
    .nav-inner  { height: 56px; padding: 0 1rem; }
    .nav-logo   { font-size: 1.6rem; }

    /* Mobile menu */
    .mobile-play-link {
        color: var(--yellow) !important;
        font-weight: 900;
        font-size: 1.1rem;
    }

    /* Hero */
    .hero { padding: 2.5rem 1rem 2rem; }
    .hero-title { font-size: clamp(2.8rem, 14vw, 4.5rem); }
    .hero-sub   { font-size: 1rem; margin-bottom: 1.5rem; }
    .hero-play-btn { font-size: 1.1rem; padding: .75rem 1.75rem; width: 100%; max-width: 320px; }
    .hero-stats { gap: 1.25rem; margin-top: 2rem; flex-wrap: wrap; justify-content: center; }
    .hero-stats .stat-num   { font-size: 1.8rem; }
    .hero-stats .stat-label { font-size: .78rem; }

    /* Container */
    .container, .container-wide, .play-wrap, .submit-wrap {
        padding: 1rem;
    }

    /* Kártyák */
    .card { padding: 1.25rem 1rem; }

    /* Hogy működik rács */
    .how-grid {
        grid-template-columns: 1fr !important;
        gap: .85rem !important;
    }

    /* Top kérdések lista */
    .question-item {
        flex-wrap: wrap;
        gap: .4rem;
        padding: .7rem .5rem;
    }
    .q-rank  { font-size: 1.3rem; min-width: 1.6rem; }
    .q-text  { font-size: .9rem; flex: 1 1 60%; }
    .q-count { font-size: .78rem; }

    /* Section title */
    .section-title { font-size: 1.5rem; }

    /* Play oldal */
    .answer-form-wrap { flex-direction: column; }
    .answer-input { font-size: 1rem; }
    #submitBtn { width: 100%; }

    /* Auth oldalak */
    .auth-wrap { margin: 1.5rem auto; padding: 0 1rem; }
    .auth-card { padding: 1.75rem 1.25rem; }
    .auth-title { font-size: 1.8rem; }

    /* Stat kártyák admin */
    .stat-cards { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
    .stat-card  { padding: 1rem; }
    .stat-card-num { font-size: 2rem; }

    /* Admin */
    .admin-layout   { flex-direction: column; }
    .admin-sidebar  { width: 100%; padding: 1rem; }
    .admin-sidebar-title { margin-bottom: .5rem; }
    .admin-nav      { display: flex; flex-wrap: wrap; gap: .4rem; }
    .admin-nav a    { padding: .4rem .65rem; font-size: .85rem; }
    .admin-content  { padding: 1rem; }
    .admin-page-title { font-size: 1.5rem; }

    /* Admin táblázat scroll */
    .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Reklám */
    .ad-placeholder { min-width: 0; width: 100%; font-size: .8rem; padding: .75rem; }
    .ad-top, .ad-bottom { padding: .5rem; }

    /* CTA gombok */
    .cta-btns {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: .75rem;
    }
    .cta-btns .btn { width: 100%; max-width: 300px; text-align: center; }
}

/* Extra kis mobil: max 400px */
@media (max-width: 400px) {
    .hero-stats { gap: .85rem; }
    .hero-stats .stat-num { font-size: 1.5rem; }
    .badge { font-size: .7rem; padding: .15rem .45rem; }
}
