/* Wspólny wygląd wszystkich stron: „wyklejanka”.
   Kartki, taśma, naklejki i kredki na kremowym papierze. Świadomie jeden, jasny wygląd (bez trybu ciemnego).
   Tokeny mają te same nazwy, których używają style stron (--surface-*, --text-*, --fill-*),
   więc strona dokłada tylko swoje komponenty. Ładowany przed <style> strony.
   Czcionka zabawowa (--font-play): nagłówki, przyciski, liczby. Treść zadań i dłuższe teksty: --font. */

/* Grandstander i Lexend - pliki lokalnie (bez Google Fonts), licencja OFL w fonts/.
   Fira Sans w fonts/ jest dla plakatów (marketing/plakaty) */
@font-face { font-family: "Grandstander"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/grandstander-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Grandstander"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/grandstander-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Grandstander"; font-style: normal; font-weight: 800; font-display: swap; src: url(/fonts/grandstander-latin-ext-800-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Grandstander"; font-style: normal; font-weight: 800; font-display: swap; src: url(/fonts/grandstander-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Grandstander"; font-style: normal; font-weight: 900; font-display: swap; src: url(/fonts/grandstander-latin-ext-900-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Grandstander"; font-style: normal; font-weight: 900; font-display: swap; src: url(/fonts/grandstander-latin-900-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/lexend-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/lexend-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/lexend-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/lexend-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/lexend-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/lexend-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/lexend-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Lexend"; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/lexend-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
    --font: "Lexend", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-play: "Grandstander", "Comic Sans MS", "Chalkboard SE", cursive;

    --surface-0: #fbf1e1;   /* kremowy papier */
    --surface-1: #ffffff;   /* kartka */
    --surface-2: #f7e9d3;   /* dymki AI, treść zadania, pola */
    --surface-3: #ecdcc2;   /* tło pasków postępu */
    --text-primary: #2b2350;
    --text-secondary: #5a4f86;
    --text-muted: #6a5f92;
    --fill-accent: #5838c4;        /* fiolet: przyciski, zaznaczenie, linki */
    --fill-accent-hover: #452b9e;
    --fill-success: #1f7560;
    --fill-danger: #b83a3a;
    --on-accent: #ffffff;
    --marker: #ffc93c;             /* żółty: główne wezwanie do działania i wyróżnienia */
    --on-marker: #2b2350;
    --night: #2b2350;              /* granatowe pasy */
    --night-text: #e2dcff;
    --note: #fff59a;               /* żółta karteczka */
    --warn-bg: #fff3cf;
    --warn-text: #6b4e00;
    --border: #e8d9c0;
    --border-strong: #b9aedb;

    /* Kolory kredek. Ciemniejsze wersje (-d) mają kontrast 4,5:1 z białym napisem, jasne są tylko do ozdób */
    --red: #ff6b6b;    --red-d: #b83a3a;
    --yellow: #ffc93c; --yellow-d: #d9a21e;
    --mint: #4cc9a6;   --mint-d: #1f7560;
    --violet: #7b5cf0; --violet-d: #5838c4;
    --blue: #3fa9f5;   --blue-d: #1b6fad;
    --pink: #ff8fb1;

    --radius: 12px;
    --radius-card: 16px;
    --shadow-card: 0 14px 30px -14px rgba(43, 35, 80, 0.38);
    --shadow-paper: 0 3px 0 rgba(43, 35, 80, 0.14);
    color-scheme: light;
}

/* html body - wygrywa z „background” i „font-family” w stylach stron */
html body {
    font-family: var(--font);
    background-color: var(--surface-0);
    color: var(--text-primary);
    overflow-x: clip;   /* obrócone kartki nie mogą dawać poziomego przewijania */
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; }

h1, h2, h3 { font-family: var(--font-play); font-weight: 800; text-wrap: balance; }
.play { font-family: var(--font-play); }

:focus-visible { outline: 3px solid var(--blue-d); outline-offset: 2px; }

/* Żółta kredka pod słowem - kluczowe słowa nagłówków. Oszczędnie: 1-2 na ekran */
.hl {
    background-image: linear-gradient(transparent 58%, var(--marker) 58%, var(--marker) 94%, transparent 94%);
    padding: 0 0.12em;
    margin: 0 -0.06em;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* Logo: gwiazdka i nazwa na białej plakietce, lekko krzywo */
.logo-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px 6px 8px;
    background: var(--surface-1);
    border-radius: 999px;
    box-shadow: 0 3px 0 rgba(43, 35, 80, 0.25);
    transform: rotate(-2deg);
}
.wordmark { font-family: var(--font-play); font-weight: 900; letter-spacing: 0; color: var(--text-primary); }

/* Główne wezwanie do działania (jedno na ekran): naklejka z białą obwódką */
.btn-marker {
    font-family: var(--font-play);
    font-weight: 800;
    background: var(--marker);
    color: var(--on-marker);
    border: 4px solid #ffffff;
    border-radius: 20px;
    box-shadow: 0 0 0 3px var(--night), 0 6px 0 3px var(--night);
    transition: transform 0.15s;
}
.btn-marker:hover:not(:disabled) { transform: translateY(-2px) rotate(-1deg); background: var(--marker); }
.btn-marker:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 3px var(--night), 0 2px 0 3px var(--night); }
.btn-marker small { font-family: var(--font); }

/* Pasek taśmy na górze kartki - rodzic musi mieć position: relative */
.tape::before {
    content: "";
    position: absolute;
    top: -15px;
    left: 38%;
    width: 110px;
    height: 30px;
    background: rgba(255, 201, 60, 0.75);
    transform: rotate(-4deg);
    pointer-events: none;
}

/* Klocki z literami (ozdoba strony startowej) */
.blocks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.blk {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(46px, 11vw, 66px);
    aspect-ratio: 10 / 11;
    border-radius: 14px;
    font-family: var(--font-play);
    font-weight: 900;
    font-size: clamp(32px, 7.5vw, 46px);
    line-height: 1;
    color: #ffffff;
}
.blk:nth-child(1) { background: var(--red); box-shadow: 0 5px 0 var(--red-d); transform: rotate(-6deg); }
.blk:nth-child(2) { background: var(--yellow); box-shadow: 0 5px 0 var(--yellow-d); color: var(--on-marker); transform: rotate(4deg) translateY(6px); }
.blk:nth-child(3) { background: #2f9a7c; box-shadow: 0 5px 0 var(--mint-d); transform: rotate(-3deg); }
.blk:nth-child(4) { background: var(--violet); box-shadow: 0 5px 0 var(--violet-d); transform: rotate(7deg) translateY(4px); }
.blk:nth-child(5) { background: #1f7cc0; box-shadow: 0 5px 0 var(--blue-d); transform: rotate(-4deg); }

/* Odpowiedzi A-E: kolorowe kółka z białą obwódką. Kolory w kolejności odpowiedzi; strony nadpisują je przy .wrong i .correct */
.choice-letter {
    font-family: var(--font-play);
    font-weight: 900;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 2px var(--night);
    color: #ffffff;
}
.choice-btn:nth-child(5n+1) .choice-letter { background: var(--red-d); }
.choice-btn:nth-child(5n+2) .choice-letter { background: var(--mint-d); }
.choice-btn:nth-child(5n+3) .choice-letter { background: var(--blue-d); }
.choice-btn:nth-child(5n+4) .choice-letter { background: var(--violet-d); }
.choice-btn:nth-child(5n) .choice-letter { background: var(--night); }

/* Poziom trudności: słupki jak zasięg zamiast kolorowych kółek (data-l: 1, 2, 3, mix = wszystkie) */
.lvl { display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; flex-shrink: 0; }
.lvl i { width: 5px; border-radius: 2px; background: var(--surface-3); }
.lvl i:nth-child(1) { height: 7px; }
.lvl i:nth-child(2) { height: 12px; }
.lvl i:nth-child(3) { height: 18px; }
.lvl[data-l="1"] i:nth-child(-n+1),
.lvl[data-l="2"] i:nth-child(-n+2),
.lvl[data-l="3"] i { background: var(--fill-accent); }
.lvl[data-l="mix"] i { background: color-mix(in srgb, var(--fill-accent) 45%, var(--surface-3)); }

@media (prefers-reduced-motion: reduce) {
    .btn-marker { transition: none; }
}
