/* https://colorpalettes.net/color-palette-4784/ */

@font-face {
    font-family: "Lobster";
    src: url("./fonts/Lobster-Regular.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Manuale";
    src: url("./fonts/Manuale-VariableFont_wght.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Righteous";
    src: url("./fonts/Righteous-Regular.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-color: #015b76;
    --text-color: #fffff0;
    --lighter-line: #debab1;
    --darker-line: #ca6378;
    --alternative-color: #739842;
    --alternative-bg: #186447;
    --aside-color: #97c4c5;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: "Manuale", "Courier New", Courier, monospace;
    line-height: 1.5;
}

header,
main,
footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    align-content: center;
    margin: clamp(1rem, 3vw, 2.5rem);
    font-size: 1.2em;
}

/* titulek – zůstává velký, ale je responzivní */

h1 {
    font-family: "Lobster", system-ui, sans-serif;
    font-size: clamp(4rem, 10vw, 15rem);
    color: var(--lighter-line);
    text-align: center;
    text-shadow:
        2px 2px 2px var(--darker-line),
        5px 5px 5px var(--alternative-color);
}

/* odkazy */

a {
    color: var(--lighter-line);
    text-decoration: none;
}

a:hover {
    color: var(--darker-line);
}

/* navigace – max šířka, ale přizpůsobí se */

nav {
    display: block;
    width: 100%;
    max-width: 50rem;
    margin: 1rem auto;
    text-align: center;
    font-size: 1.1rem;
    color: var(--lighter-line);
}

/* postranní box – na desktop float, na mobil full width */

aside {
    width: 40%;
    padding-left: 0.5rem;
    margin-left: 0.5rem;
    float: right;
    box-shadow: inset 5px 0 5px -5px #29627e;
    font-style: italic;
    color: var(--aside-color);
}

aside > p {
    margin: 0.5rem;
    font-size: 1em;
}

/* kontejnery – místo pevné šířky fluidní max-width */

#title-container,
#subtitle-container,
#footer-container {
    display: block;
    width: 100%;
    max-width: 50rem;
    margin: 1em auto;
    text-align: center;
}

#title-container {
    border-top: 5px solid var(--darker-line);
    border-bottom: 5px solid var(--darker-line);
}

#footer-container {
    border-top: 5px solid var(--darker-line);
    padding-top: 1em;
    color: var(--lighter-line);
}

/* oprava display: flexbox -> flex */

#subtitle-container {
    display: flex;
    flex-direction: column;
    color: var(--darker-line);
}

#subtitle {
    display: block;
}

#author {
    display: block;
}

/* nadpisy */

h2,
h3 {
    font-family: "Righteous", system-ui, sans-serif;
    color: var(--lighter-line);
    margin-top: 0.5rem;
}

h3 {
    color: var(--darker-line);
}

/* seznam – opět max-width místo pevné šířky */

ul > li {
    list-style-type: none;
}

li {
    padding: 1em 0.5em;
    width: 100%;
    max-width: 50rem;
    margin: 0 auto;
}

ol {
    padding: 0em 1em;
}

ol > li {
    padding: 0.25em 0.5em;
}

ul > li:last-child {
    border-bottom: 2px solid var(--alternative-color);
}

.obligatory {
    border-bottom: 2px solid var(--darker-line);
}

.non-obligatory {
    border-bottom: 2px solid var(--alternative-color);
}

li h2,
section {
    padding: 1em 0;
}

section p {
    padding: 0.5em 0;
}

.motivation {
    font-family: "Righteous";
    font-size: 2em;
    color: var(--lighter-line);
    text-align: center;

    /* základní neon */
    text-shadow:
        0 0 2px var(--lighter-line),
        0 0 10px var(--alternative-color),
        3px 3px 3px var(--darker-line),
        6px 6px 6px var(--alternative-color);

    animation: neonFlicker 7.6s infinite;
}

/* nepravidelné “bliknutí” – simulace náhody */
@keyframes neonFlicker {
    0%,
    7%,
    9%,
    12%,
    100% {
        opacity: 1;
        filter: brightness(1.05);
        text-shadow:
            0 0 2px var(--lighter-line),
            0 0 10px var(--alternative-color),
            3px 3px 3px var(--darker-line),
            6px 6px 6px var(--alternative-color);
    }

    /* krátké výpadky / záblesky */
    8% {
        opacity: 0.55;
        filter: brightness(0.85);
        text-shadow:
            0 0 1px var(--lighter-line),
            2px 2px 2px var(--darker-line);
    }

    10% {
        opacity: 0.85;
        filter: brightness(1.35);
        text-shadow:
            0 0 3px var(--lighter-line),
            0 0 16px var(--alternative-color),
            0 0 28px var(--alternative-color),
            3px 3px 3px var(--darker-line);
    }

    11% {
        opacity: 0.35;
        filter: brightness(0.75);
        text-shadow: 1px 1px 2px var(--darker-line);
    }

    /* další shluk “poruchy” později v cyklu */
    48% {
        opacity: 0.9;
        filter: brightness(1.25);
    }
    49% {
        opacity: 0.4;
        filter: brightness(0.8);
    }
    50% {
        opacity: 1;
        filter: brightness(1.4);
    }
    52% {
        opacity: 0.7;
        filter: brightness(0.9);
    }
    53% {
        opacity: 1;
        filter: brightness(1.1);
    }
}

.class-test {
    display: block;
    position: relative;
    padding-left: 35px;
    margin-bottom: 1em;
    cursor: pointer;
    font-size: 0.9em;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Hide the browser's default radio button */
.class-test input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.quiz-options li {
    border: none;
    padding: 0;
}

/* Create a custom radio button */
.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 15px;
    width: 15px;
    background-color: transparent;
    border: 2px solid var(--aside-color);
    border-radius: 50%;
}

/* On mouse-over, add a grey background color */
.class-test:hover input ~ .checkmark {
    background-color: var(--lighter-line);
}

/* When the radio button is checked, add a blue background */
.class-test input:checked ~ .checkmark {
    background-color: var(--aside-color);
}

/* Create the indicator (the dot/circle - hidden when not checked) */
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

/* Show the indicator (dot/circle) when checked */
.class-test input:checked ~ .checkmark:after {
    display: block;
}

/* Style the indicator (dot/circle) */
.class-test .checkmark:after {
    top: 1px;
    left: 1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: var(--darker-line);
}

/*Checkbox*/

/* Create a custom checkbox */
.checkmarkbox {
    position: absolute;
    top: 0;
    left: 0;
    height: 15px;
    width: 15px;
    background-color: transparent;
    border: 2px solid var(--aside-color);
}

/* On mouse-over, add a grey background color */
.class-test:hover input ~ .checkmarkbox {
    background-color: var(--lighter-line);
}

/* When the checkbox is checked, add a blue background */
.class-test input:checked ~ .checkmarkbox {
    background-color: var(--darker-line);
}

/* Create the checkmark/indicator (hidden when not checked) */
.checkmarkbox:after {
    content: "";
    position: absolute;
    display: none;
}

/* Show the checkmark when checked */
.class-test input:checked ~ .checkmarkbox:after {
    display: block;
}

/* Style the checkmark/indicator */
.class-test .checkmarkbox:after {
    left: 5px;
    top: -2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
}

/* BLOCKQUOTE – základní vzhled */
blockquote.collapsible-quote {
    position: relative;
    margin: 1.5rem 2rem 1.5rem 0; /* odsazení od pravé strany */
    padding: 0.75rem 1.5rem 0.75rem 0.75rem;
    border-right: 4px solid #3b8fb8; /* čára vpravo */
    color: #b3b3b3; /* šedý text, čitelný na černé */
    font-style: italic;
    background: transparent;
    cursor: pointer;
    max-width: 60rem;
}

/* text uvnitř */
blockquote.collapsible-quote p {
    margin-bottom: 0.5rem;
}

/* „meta“ část – autor, zdroj, reference */
blockquote .quote-meta {
    margin-top: 0.25rem;
    text-align: right;
    font-size: 0.9rem;
    color: #3b8fb8; /* stejná barva pro autora, zdroj i referenci */
}

blockquote .quote-author {
    font-weight: bold;
}

blockquote .quote-source {
    font-style: italic;
}

blockquote .quote-reference {
    font-weight: normal;
}

/* collapsed / expanded stavy (jen pro případ, že si to budeš chtít stylově rozlišit) */
blockquote.collapsible-quote .quote-full {
    display: none;
}

blockquote.collapsible-quote.expanded .quote-preview {
    display: none;
}

blockquote.collapsible-quote.expanded .quote-full {
    display: block;
}

/* drobný hover efekt */
blockquote.collapsible-quote:hover {
    border-right-width: 5px;
}

blockquote.collapsible-quote::after {
    font-style: normal;
    content: "▼";
    position: absolute;
    bottom: 0.4rem;
    left: 0.5rem;
    font-size: 1.2rem;
    color: #3b8fb8;
}
blockquote.collapsible-quote.expanded::after {
    content: "▲";
}

.portfolio-card {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 2px solid var(--darker-line);
    border-radius: 14px;
    overflow: hidden;
    font-family:
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    font-size: 15px;
    line-height: 1.35;
    background: var(--bg-color);
    color: var(--text-color);
}

.portfolio-card thead th {
    text-align: left;
    padding: 12px 14px;
    background: var(--alternative-bg);
    color: var(--text-color);
    border-bottom: 2px solid var(--darker-line);
    font-weight: 800;
    letter-spacing: 0.2px;
}

.portfolio-card tbody th,
.portfolio-card tbody td {
    vertical-align: top;
    padding: 12px 14px;
    border-bottom: 1px solid var(--lighter-line);
}

.portfolio-card tbody tr:last-child th,
.portfolio-card tbody tr:last-child td {
    border-bottom: 0;
}

.portfolio-card tbody th {
    width: 38%;
    background: var(--bg-color);
    color: var(--text-color);
    font-weight: 700;
}

.portfolio-card .hint {
    margin-top: 6px;
    font-weight: 500;
    font-size: 13px;
    color: var(--aside-color);
}

.portfolio-card .field {
    min-height: 64px;
    padding: 10px 10px;
    border: 2px dashed var(--lighter-line);
    border-radius: 12px;
    background: var(--alternative-bg);
    color: var(--text-color);
    outline: none;
}

.portfolio-card .field:focus {
    border-style: solid;
    border-color: var(--alternative-color);
    box-shadow: 0 0 0 3px var(--alternative-color);
}

/* Mobile-friendly stacking */
@media (max-width: 700px) {
    .portfolio-card tbody th {
        width: 100%;
        display: block;
        border-bottom: 0;
        padding-bottom: 6px;
    }
    .portfolio-card tbody td {
        display: block;
        padding-top: 0;
    }
}

/* Optional: button styling using your palette */
.copy-btn {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 2px solid var(--darker-line);
    background: var(--alternative-bg);
    color: var(--text-color);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.copy-btn:hover {
    border-color: var(--alternative-color);
}
.copy-btn:active {
    transform: translateY(1px);
}
.copy-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--alternative-color);
}

/* Base: use on <section class="infobox"> ... <h3>Title</h3><p>Body</p> ... </section> */
section.infobox,
section.examplebox {
    border: 2px solid var(--darker-line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-color);
    color: var(--text-color);
    font-family:
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    font-size: 15px;
    line-height: 1.4;
    margin: 12px 0;
}

/* Title */
section.infobox > h3,
section.examplebox > h3 {
    margin: 0;
    padding: 10px 14px;
    background: var(--alternative-bg);
    color: var(--text-color);
    font-weight: 800;
    letter-spacing: 0.2px;
    border-bottom: 2px solid var(--darker-line);
}

/* Body */
section.infobox > p,
section.infobox > ul,
section.infobox > ol,
section.examplebox > p,
section.examplebox > ul,
section.examplebox > ol {
    margin: 10px 14px;
}

/* Lists spacing */
section.infobox > ul,
section.infobox > ol,
section.examplebox > ul,
section.examplebox > ol {
    padding-left: 18px;
}

/* Inline emphasis + links */
section.infobox em,
section.examplebox em {
    color: var(--aside-color);
}

section.infobox a,
section.examplebox a {
    color: var(--alternative-color);
    text-decoration: underline;
}

/* Example variant (optional visual difference) */
section.examplebox {
    border-color: var(--lighter-line);
}

section.examplebox > h3 {
    border-bottom-color: var(--lighter-line);
}

/* Mobile */
@media (max-width: 700px) {
    section.infobox > h3,
    section.examplebox > h3 {
        padding: 10px 12px;
    }

    section.infobox > p,
    section.infobox > ul,
    section.infobox > ol,
    section.examplebox > p,
    section.examplebox > ul,
    section.examplebox > ol {
        margin: 10px 12px;
    }
}

/* Fix: make the title background reach the top edge even if the browser collapses margins */
section.infobox,
section.examplebox {
    padding: 0; /* ensure no inner padding pushes the title down */
}

section.infobox > h3,
section.examplebox > h3 {
    margin: 0; /* prevent margin-collapsing with the section */
    padding: 10px 14px;
}

/* Extra-safe: create a new block formatting context to avoid any margin-collapsing edge cases */
section.infobox,
section.examplebox {
    display: flow-root;
}

#motivator {
    font-style: italic;
    margin: 1rem auto;
    width: 60%;
    font-size: 1rem;
}

img {
    width: 90%;
    margin: 1em auto;
    display: block;
}

/* --- Dialog traits: laděno na styl "infobox" ze site.css --- */
.dialog-traits__hint {
    margin: 10px 14px;
    color: var(--aside-color);
    font-size: 0.95em;
}

.dialog-traits__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 0 14px 12px 14px;
}

@media (max-width: 700px) {
    .dialog-traits__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.dialog-traits__chip {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 12px;
    border: 2px solid var(--darker-line);
    background: var(--alternative-bg);
    color: var(--text-color);
    font: inherit;
    cursor: pointer;
    line-height: 1.2;
    min-height: 48px;
}

.dialog-traits__chip small {
    display: block;
    margin-top: 6px;
    color: var(--aside-color);
    font-size: 0.85em;
}

.dialog-traits__chip:hover {
    border-color: var(--alternative-color);
}

.dialog-traits__chip:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--alternative-color);
}

.dialog-traits__chip[aria-pressed="true"] {
    border-color: var(--alternative-color);
    background: var(--bg-color);
}

.dialog-traits__panel {
    margin: 0 14px 14px 14px;
    border: 2px dashed var(--lighter-line);
    border-radius: 12px;
    background: var(--alternative-bg);
    color: var(--text-color);
}

.dialog-traits__panel-inner {
    padding: 12px 12px;
}

.dialog-traits__panel-title {
    font-family: "Righteous", system-ui, sans-serif;
    color: var(--lighter-line);
    font-size: 1.05em;
    margin-bottom: 6px;
}

.dialog-traits__panel-body {
    margin-top: 6px;
}

.dialog-traits__panel-meta {
    margin-top: 10px;
    color: var(--aside-color);
    font-size: 0.95em;
}

.dialog-traits__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.dialog-traits__tag {
    display: inline-block;
    border: 1px solid var(--darker-line);
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 0.85em;
    background: var(--bg-color);
    color: var(--text-color);
}

/* --- Floating nav (pravý dolní roh) --- */
.floating-nav {
    position: fixed;
    right: clamp(0.75rem, 2vw, 1.25rem);
    bottom: clamp(0.75rem, 2vw, 1.25rem);
    z-index: 9999;

    width: min(22rem, calc(100vw - 1.5rem));
    max-width: 22rem;

    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;

    color: var(--text-color);
}

/* malé “≡” tlačítko */
.floating-nav__toggle {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 2px solid var(--darker-line);
    background: var(--alternative-bg);
    color: var(--text-color);
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
}

.floating-nav__toggle:hover {
    border-color: var(--alternative-color);
}

.floating-nav__toggle:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--alternative-color);
}

/* panel */
.floating-nav__panel {
    border: 2px solid var(--darker-line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-color);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

/* titulek tématu */
.floating-nav__topic {
    display: block;
    padding: 10px 12px;
    background: var(--alternative-bg);
    border-bottom: 2px solid var(--darker-line);

    font-family: "Righteous", system-ui, sans-serif;
    color: var(--text-color);
    text-decoration: none;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floating-nav__topic:hover {
    color: var(--lighter-line);
}

/* tlačítka sekcí */
.floating-nav__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px;
}

.floating-nav__btn {
    border-radius: 12px;
    border: 2px solid var(--darker-line);
    background: var(--alternative-bg);
    color: var(--text-color);
    font: inherit;
    cursor: pointer;
    padding: 8px 10px;
    line-height: 1.1;
    text-align: center;
}

.floating-nav__btn:hover {
    border-color: var(--alternative-color);
}

.floating-nav__btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--alternative-color);
}

.floating-nav__btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    filter: saturate(0.6);
}

/* meta řádek */
.floating-nav__meta {
    padding: 0 12px 12px 12px;
    color: var(--aside-color);
    font-size: 0.95em;
}

/* sbalený stav */
.floating-nav.is-collapsed {
    grid-template-columns: auto;
    width: auto;
    max-width: none;
}

.floating-nav.is-collapsed .floating-nav__panel {
    display: none;
}

/* mobil: panel přes celou šířku dole */
@media (max-width: 700px) {
    .floating-nav {
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
        max-width: none;
        grid-template-columns: auto 1fr;
    }

    .floating-nav__actions {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .floating-nav__btn {
        padding: 8px 6px;
        font-size: 0.95em;
    }
}

/* respektuj reduced motion */
@media (prefers-reduced-motion: reduce) {
    .floating-nav__btn,
    .floating-nav__toggle {
        scroll-behavior: auto;
    }
}

/* Floating nav nesmí dědit obecné aside "pravé okno" */
aside.floating-nav {
    width: auto;
    padding-left: 0;
    margin-left: 0;
    float: none;
    box-shadow: none; /* odstraní tu svislou čáru vlevo */
    font-style: normal; /* volitelné: ať není kurzívou */
    color: var(--text-color); /* volitelné: sjednocení */
}

.game-illustration {
    width: 50%;
    filter: invert(100%);
}
