/*
Theme Name: KvizBOX
Description: WordPress tema za KvizBOX s naslovnicom, pravilima i ugrađenim prikazom igre.
Version: 1.3.0
Requires at least: 5.8
Requires PHP: 7.4
Text Domain: kvizbox-tema
*/

:root {
    color-scheme: dark;
    --background: #090c21;
    --surface: #121630;
    --line: #303653;
    --text: #f8f7ff;
    --muted: #c2c6df;
    --accent: #ffd051;
    --violet: #cbb6ff;
}

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

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font: 1rem/1.65 system-ui, sans-serif;
}

a { color: var(--accent); }
a:focus-visible { outline: 3px solid var(--violet); outline-offset: 4px; }
img { max-width: 100%; height: auto; }
.wrap { width: min(100% - 3rem, 73rem); margin-inline: auto; }

.skip-link {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 101;
    padding: 0.5rem 1rem;
    background: var(--background);
    transform: translateY(-200%);
}

.skip-link:focus { transform: none; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--line);
    background: var(--background);
}

.admin-bar .site-header { top: 32px; }
#sadrzaj, #pravila, #bonus { scroll-margin-top: 8rem; }

@media (max-width: 782px) {
    .admin-bar .site-header { top: 46px; }
}

@media (max-width: 600px) {
    .admin-bar .site-header { top: 0; }
}

.header-inner, .footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding-block: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    text-decoration: none;
}

.brand strong { color: var(--accent); }
.footer-inner .brand { gap: 0; }

.brand-logo {
    width: 2.75rem;
    height: 2.75rem;
    flex: none;
    object-fit: contain;
}

.site-nav, .hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 1rem; }
.site-nav a:not(.button) { color: var(--muted); text-decoration: none; }
.site-nav a:not(.button):hover { color: var(--text); text-decoration: underline; }

.button {
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 0.65rem;
    padding: 0.55rem 1rem;
    background: var(--accent);
    color: #181222;
    font-weight: 750;
    text-decoration: none;
}

.button:hover { background: #ffe291; }
.button-small { min-height: 2.65rem; }
.button-outline { border-color: var(--line); background: transparent; color: var(--text); }
.button-outline:hover { background: var(--surface); border-color: var(--violet); }

.hero {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: clamp(2rem, 7vw, 6rem);
    padding-block: clamp(2.75rem, 7vw, 6rem);
}

h1, h2, h3 { margin: 0; line-height: 1.12; }
h1, h2 { letter-spacing: -0.055em; }
h1 { font-size: clamp(2.6rem, 7vw, 5.4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.3rem; }

.hero h1 em { display: block; color: var(--accent); font-style: normal; }
.hero p { max-width: 33rem; margin: 1.35rem 0 1.75rem; color: var(--muted); font-size: 1.15rem; }

.hero-art {
    overflow: hidden;
    width: min(100%, 25rem);
    justify-self: center;
    border: 1px solid #554287;
    border-radius: 1.4rem;
    background: #0a0831;
    box-shadow: 0 1rem 4rem #4d28865c;
}

.hero-art img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center 39%; }

.rules-section, .play-section {
    padding-block: clamp(3rem, 7vw, 5rem);
    border-block: 1px solid var(--line);
    background: var(--surface);
}

.rules-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1.6rem; }
.rules-grid article { padding: 1.35rem; border: 1px solid var(--line); border-radius: 0.85rem; background: var(--background); }
.rule-icon { display: block; margin-bottom: 0.65rem; color: var(--violet); font-size: 1.65rem; }
.rules-grid p, .bonus p, .bonus li span, .play-section > .wrap > p { color: var(--muted); }
.rules-grid p { margin-bottom: 0; }

.bonus {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 1.5rem 3rem;
    align-items: center;
    padding-block: clamp(3rem, 7vw, 5rem);
}

.bonus ul { list-style: none; padding: 0; margin: 0; }
.bonus li { display: grid; gap: 0.15rem; padding: 0.75rem 0.9rem; border-top: 1px solid var(--line); }
.bonus li:last-child { border-bottom: 1px solid var(--line); }
.bonus li strong { color: var(--violet); }

.play-section { text-align: center; }

.game-status { padding: 1rem; border: 1px dashed var(--line); border-radius: 0.75rem; }
.site-footer { padding-block: 0.6rem; }
.site-footer a:not(.brand) { color: var(--muted); }
.content-page, .front-content { padding-block: 3rem; }
.content-page article + article { margin-top: 2rem; }
.entry-content { overflow-wrap: anywhere; }

@media (max-width: 48rem) {
    .hero, .bonus { grid-template-columns: 1fr; }
    .hero-art { width: min(100%, 22rem); justify-self: start; }
    .rules-grid { grid-template-columns: 1fr; }
}

@media (max-width: 30rem) {
    .wrap { width: calc(100% - 2rem); }
    .site-nav { gap: 0.5rem 0.85rem; }
}

.kvizbox-game-page { overflow-anchor: none; }

.game-stage-pane {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0.75rem clamp(0.5rem, 3vw, 2rem);
    background: #f7f8fc;
}

.game-stage-quiz {
    max-width: 38rem;
    margin-inline: auto;
    color-scheme: light;
}

.game-stage-quiz #tn-wrapper #tn-quiz {
    width: 100%;
    max-width: none;
    margin: 0;
}

.game-stage-quiz .tn-intro-image {
    max-height: 55vh;
    object-fit: contain;
    background: #0a0831;
}

.game-stage-exit {
    position: fixed;
    z-index: 2;
    top: 0.75rem;
    right: 0.75rem;
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    font-size: 1.5rem;
    line-height: 1;
    text-decoration: none;
}

.admin-bar .game-stage-exit { top: calc(var(--wp-admin--admin-bar--height, 32px) + 0.75rem); }
.game-stage:has(#tn-exit-btn) .game-stage-exit { display: none; }
.game-stage-pane > .game-status { margin: 4rem auto 0; max-width: 35rem; background: var(--surface); }

@media (max-width: 40rem) {
    .game-stage-quiz #tn-wrapper #tn-quiz { border-radius: 0.85rem; }
    .game-stage-pane:not(:has(#tn-exit-btn)) { padding-top: 4rem; }
}

.game-stage-info {
    padding: 1.5rem clamp(1.5rem, 4vw, 4rem) 3rem;
    background: var(--background);
}

.game-stage-copy { max-width: 39rem; margin-top: 2rem; }
.game-stage-copy h1 { font-size: clamp(2.6rem, 6vw, 5.4rem); }
.game-stage-copy h1 em { display: block; color: var(--accent); font-style: normal; }
.game-stage-copy p { max-width: 32rem; color: var(--muted); font-size: 1.125rem; }

@media (min-width: 56rem) {
    .game-stage {
        display: grid;
        grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
        grid-template-areas: "info quiz";
        background: var(--background);
    }

    .game-stage-info {
        grid-area: info;
        align-self: start;
        position: sticky;
        top: var(--wp-admin--admin-bar--height, 0px);
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
    }

    .game-stage-copy { margin-block: auto; padding-block: 2.5rem; }
    .game-stage-pane { grid-area: quiz; padding: 1rem clamp(1rem, 2.5vw, 2.25rem); }
}
