/* ═══════════════════════════════════════════════════════════════════════════
   style.css – Bedňák | Retro Pixel Art Theme
    Závislosti: Google Fonts – Pixelify Sans, Press Start 2P
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;700&family=Press+Start+2P&display=swap');

/* ── Základní reset a proměnné ────────────────────────────────────────────── */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0a0a0f;
    --bg2: #12101e;
    --bg3: #1a1830;
    --surface: #1e1b2e;
    --surface2: #2a2545;
    --border: #3a2f5e;
    --border2: #5a4a8e;
    --accent: #7aaeff;
    --accent2: #3a7aff;
    --green: #3aff6a;
    --yellow: #ffd070;
    --red: #ff4a4a;
    --text: #c8c0e8;
    --text2: #8880aa;
    --font: 'Pixelify Sans', 'Press Start 2P', monospace;
    --radius: 4px;
    --spacing: 1rem;
}


html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-weight: 400;
    font-size: 1.0rem;
    line-height: 1.6;
    -webkit-font-smoothing: none;
    image-rendering: pixelated;
}

/* Scrollbary */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg2);
}

::-webkit-scrollbar-thumb {
    background: var(--border2);
}

/* ── Utility ──────────────────────────────────────────────────────────────── */

.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.center {
    align-items: center;
    justify-content: center;
}

/* ── Obrazovky (SPA) ──────────────────────────────────────────────────────── */

.screen {
    display: none;
    position: fixed;
    inset: 0;
    flex-direction: column;
    overflow: hidden;
}

.screen.active {
    display: flex;
}

/* ── Scrollovatelný obsah obrazovky ───────────────────────────────────────── */
.screen-scroll {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing);
}

/* ── Nadpis hry (logo) ────────────────────────────────────────────────────── */

.game-title {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    text-align: center;
    color: var(--accent);
    text-shadow: 0 0 16px var(--accent2), 0 0 32px var(--accent2);
    letter-spacing: 4px;
    padding: 1.5rem 1rem 0.5rem;
    animation: pulse-glow 2.5s ease-in-out infinite;
}

.game-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text2);
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
}

@keyframes pulse-glow {

    0%,
    100% {
        text-shadow: 0 0 10px var(--accent2), 0 0 20px var(--accent2);
    }

    50% {
        text-shadow: 0 0 24px var(--accent), 0 0 48px var(--accent2);
    }
}

/* ── Tlačítka ─────────────────────────────────────────────────────────────── */

.btn {
    display: inline-block;
    background: var(--surface2);
    color: var(--text);
    border: 2px solid var(--border2);
    padding: 0.7em 1.4em;
    font-family: var(--font);
    font-size: 1.4rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    border-radius: var(--radius);
}

.btn:hover,
.btn:focus {
    background: var(--border);
    border-color: var(--accent);
    color: var(--accent);
    outline: none;
}

.btn:active {
    transform: translateY(2px);
}

.btn-primary {
    background: var(--accent2);
    border-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent);
    color: #000;
}

.btn-danger {
    border-color: var(--red);
    color: var(--red);
}

.btn-success {
    border-color: var(--green);
    color: var(--green);
}

.btn-icon {
    padding: 0.4em 0.7em;
    font-size: 1.4rem;
    line-height: 1;
}

/* ── MENU obrazovka ───────────────────────────────────────────────────────── */

#screen-menu {
    align-items: center;
    justify-content: flex-start;
    padding-top: 0;
}

.menu-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 0 1rem 1rem;
}

.menu-actions .btn {
    text-align: center;
    width: 100%;
    font-size: 1.5rem;
}

/* Banner obnovení hry */
#menu-restore-banner {
    display: none;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 0.5rem 0.7rem;
    margin: 0 1rem 0.5rem;
    font-size: 1.1rem;
    color: var(--yellow);
}

#menu-restore-banner .btn {
    font-size: 1.1rem;
    padding: 0.3em 0.8em;
}

/* ── VÝBĚR LEVELU ─────────────────────────────────────────────────────────── */

.screen-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 1rem;
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    flex-shrink: 0;
}

.screen-header h2 {
    font-size: 1.5rem;
    color: var(--accent);
    flex: 1;
}

.level-set-bar {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.level-set-bar select {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border2);
    font-family: var(--font);
    font-size: 1.3rem;
    padding: 0.3em 0.5em;
    border-radius: var(--radius);
}

/* Karty levelů */
#level-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.7rem;
    padding: 1rem;
}

.level-card {
    --level-preview-opacity: 0.16;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 0.8rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.level-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--level-preview-image);
    background-repeat: no-repeat;
    background-position: center;
    background-size: calc(100% - 12px) calc(100% - 12px);
    opacity: var(--level-preview-opacity);
    transition: opacity 0.15s ease;
    pointer-events: none;
}

.level-card>* {
    position: relative;
    z-index: 1;
}

.level-card:hover {
    --level-preview-opacity: 0.34;
    border-color: var(--accent);
    background: var(--surface2);
}

.level-card:active {
    transform: scale(0.96);
}

.level-card.locked {
    opacity: 0.4;
    cursor: default;
}

.level-card.done {
    border-color: var(--green);
}

.level-card-num {
    font-size: 1.8rem;
    color: var(--accent);
    margin-bottom: 0.3rem;
}

.level-card-name {
    font-size: 1rem;
    color: var(--text2);
    margin-bottom: 0.4rem;
    word-break: break-word;
}

.level-card-stars {
    font-size: 1.4rem;
}

.level-card-best {
    font-size: 1rem;
    color: var(--yellow);
    margin-top: 0.3rem;
}

/* ── HRA ──────────────────────────────────────────────────────────────────── */

#screen-game {
    flex-direction: column;
    align-items: center;
}

#screen-game>.game-hud,
#screen-game>#game-canvas-container,
#screen-game>.game-dpad {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

#screen-level-select>*,
#screen-settings>*,
#screen-leaderboard>*,
#screen-editor>* {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* HUD – horní lišta */
.game-hud {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 44px;
}

.hud-label {
    font-size: 0.9rem;
    color: var(--text2);
}

.hud-value {
    font-size: 1.5rem;
    color: var(--accent);
}

.hud-level-name {
    flex: 1;
    text-align: center;
    font-size: 1.1rem;
    color: var(--yellow);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-actions {
    display: flex;
    gap: 0.3rem;
    margin-left: auto;
}

/* Canvas kontejner */
#game-canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0.5rem;
    background: var(--bg);
}

#game-canvas {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: block;
    max-width: 100%;
    max-height: 100%;
}

/* Mobilní D-pad */
.game-dpad {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0.5rem;
    background: var(--bg2);
    border-top: 2px solid var(--border);
    flex-shrink: 0;
}

.dpad-row {
    display: flex;
    gap: 2px;
}

.dpad-btn {
    width: 52px;
    height: 52px;
    background: var(--surface2);
    border: 2px solid var(--border2);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.dpad-btn:active {
    background: var(--border);
}

.dpad-center {
    background: transparent !important;
    border-color: transparent !important;
}

/* Na mobilech zobrazit D-pad */
@media (max-width: 640px) {
    .game-dpad {
        display: flex;
    }
}

/* ── MODÁLNÍ OKNA ─────────────────────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.88);
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-box {
    background: var(--surface);
    border: 2px solid var(--border2);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 420px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 0 40px rgba(58, 122, 255, 0.25);
}

.modal-title {
    font-size: 1.8rem;
    color: var(--accent);
    text-align: center;
    text-shadow: 0 0 8px var(--accent2);
}

.modal-row {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-stat {
    text-align: center;
}

.modal-stat-label {
    font-size: 1rem;
    color: var(--text2);
}

.modal-stat-value {
    font-size: 2rem;
    color: var(--yellow);
    display: block;
}

.modal-stars {
    font-size: 2rem;
    text-align: center;
}

/* Input */
.modal-input {
    width: 100%;
    background: var(--bg2);
    border: 2px solid var(--border2);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.4rem;
    padding: 0.6em;
    border-radius: var(--radius);
    outline: none;
}

.modal-input:focus {
    border-color: var(--accent);
}

.modal-input.shake {
    animation: shake 0.4s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

/* ── EDITOR ───────────────────────────────────────────────────────────────── */

#screen-editor {
    flex-direction: column;
}

.editor-layout {
    display: grid;
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(220px, 260px);
    flex: 1;
    overflow: hidden;
    gap: 0;
}

/* Postranní panely */
.editor-sidebar {
    min-width: 0;
    background: var(--surface);
    overflow-y: auto;
    padding: 0.8rem 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.editor-sidebar>div {
    width: 100%;
}

.editor-sidebar-left {
    border-right: 2px solid var(--border);
}

.editor-sidebar-right {
    border-left: 2px solid var(--border);
}

.editor-sidebar h3 {
    font-size: 1.1rem;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.3rem;
}

.editor-panel-toggle {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    background: var(--bg2);
    color: var(--text);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    padding: 0.65rem 0.8rem;
    font-family: var(--font);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
}

.editor-panel-toggle:hover,
.editor-panel-toggle:focus {
    border-color: var(--accent);
    color: var(--accent);
    outline: none;
}

.editor-panel-toggle[aria-expanded="true"] {
    border-color: var(--accent);
    color: var(--accent);
}

.editor-panel-toggle-icon {
    font-size: 1.15rem;
    line-height: 1;
    transition: transform 0.16s ease;
}

.editor-panel-toggle[aria-expanded="true"] .editor-panel-toggle-icon {
    transform: rotate(180deg);
}

.editor-sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.editor-sidebar-content>div,
.editor-sidebar-section {
    width: 100%;
}

/* Paleta dlaždic */
.palette-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.palette-tile {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg2);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1.4rem;
    transition: border-color 0.1s;
    user-select: none;
}

.palette-tile span {
    font-size: 0.9rem;
    color: var(--text2);
    margin-top: 2px;
}

.palette-tile.active {
    border-color: var(--accent);
}

.palette-tile:hover {
    border-color: var(--border2);
}

/* Formulář velikosti gridu */
.editor-size-form {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.editor-size-form label {
    font-size: 1rem;
    color: var(--text2);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.editor-size-form input[type="number"] {
    background: var(--bg2);
    border: 1px solid var(--border2);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.4rem;
    padding: 0.3em;
    width: 100%;
    border-radius: var(--radius);
}

.editor-toolbar {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.editor-toolbar .btn {
    font-size: 1.1rem;
    padding: 0.4em;
    text-align: center;
    width: 100%;
}

.editor-sidebar .btn,
.editor-sidebar .modal-input,
.editor-sidebar .editor-standard-select,
.editor-sidebar .editor-code-area,
.editor-sidebar .editor-size-form input[type="number"] {
    width: 100%;
    box-sizing: border-box;
}

/* Mřížka editoru */
.editor-canvas-wrap {
    min-width: 0;
    overflow: auto;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0.5rem;
    background: var(--bg);
}

#editor-grid {
    --editor-cell-size: 31px;
    display: grid;
    gap: 1px;
    background: var(--border);
    border: 2px solid var(--border);
    flex-shrink: 0;
    user-select: none;
    grid-auto-rows: var(--editor-cell-size);
}

#editor-grid.rmb-floor-mode {
    border-color: var(--green);
    box-shadow: 0 0 0 2px rgba(58, 255, 106, 0.25);
}

.editor-cell {
    width: var(--editor-cell-size);
    height: var(--editor-cell-size);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.55rem;
    cursor: crosshair;
    transition: opacity 0.1s;
}

.editor-axis {
    width: var(--editor-cell-size);
    height: var(--editor-cell-size);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #151223;
    color: var(--text2);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    user-select: none;
}

.editor-axis-corner {
    color: var(--accent);
}

.editor-axis-row,
.editor-axis-col {
    opacity: 0.95;
}

@media (max-width: 1400px) {
    .editor-layout {
        grid-template-columns: minmax(200px, 230px) minmax(0, 1fr) minmax(200px, 230px);
    }

    #editor-grid {
        --editor-cell-size: 30px;
    }

    .editor-cell {
        font-size: 1.45rem;
    }

    .editor-axis {
        font-size: 0.95rem;
    }
}

@media (max-width: 420px) {
    .palette-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .palette-tile {
        min-height: 64px;
    }
}

@media (max-width: 1220px) {
    .editor-layout {
        grid-template-columns: minmax(185px, 210px) minmax(0, 1fr) minmax(185px, 210px);
    }

    .editor-sidebar {
        padding: 0.7rem 0.5rem;
    }

    #editor-grid {
        --editor-cell-size: 28px;
    }

    .editor-cell {
        font-size: 1.3rem;
    }

    .editor-axis {
        font-size: 0.9rem;
    }
}

.editor-cell:hover {
    opacity: 0.8;
}

.editor-rmb-indicator {
    margin-top: 6px;
    font-size: 1rem;
    color: var(--text2);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 0.25rem 0.35rem;
    transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.editor-rmb-indicator.active {
    color: var(--green);
    border-color: var(--green);
    background: rgba(58, 255, 106, 0.09);
}

/* Výsledek AI testu */
.editor-test-result {
    font-size: 1rem;
    padding: 0.5rem;
    border-radius: var(--radius);
    background: var(--bg2);
    border: 1px solid var(--border);
    min-height: 2.5em;
    color: var(--text2);
}

.editor-test-result.ok {
    color: var(--green);
    border-color: var(--green);
}

.editor-test-result.fail {
    color: var(--red);
    border-color: var(--red);
}

.editor-test-result.loading {
    color: var(--yellow);
}

.editor-test-result.error {
    color: var(--red);
}

/* Export/Import kód */
.editor-code-area {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border2);
    color: var(--text);
    font-family: monospace;
    font-size: 1.2rem;
    padding: 0.4em;
    resize: vertical;
    min-height: 3rem;
    border-radius: var(--radius);
}

.editor-standard-select {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border2);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.1rem;
    padding: 0.35em;
    border-radius: var(--radius);
}

/* Na mobilech – editor sidebar schovaný do zápatí / horizontálně */
@media (max-width: 600px) {
    .editor-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(280px, clamp(320px, 52vh, 430px)) auto auto;
        overflow-y: auto;
        align-content: start;
    }

    .editor-sidebar {
        width: 100%;
        height: auto;
        padding: 0.5rem;
        gap: 0.5rem;
        overflow-y: auto;
        max-height: min(38vh, 340px);
        -webkit-overflow-scrolling: touch;
    }

    .editor-sidebar-left {
        order: 2;
        border-right: none;
        border-top: 2px solid var(--border);
    }

    .editor-sidebar-right {
        order: 3;
        border-left: none;
        border-top: 2px solid var(--border);
    }

    .editor-panel-toggle {
        display: flex;
    }

    .editor-sidebar-content {
        gap: 0.65rem;
        min-height: min-content;
    }

    .editor-sidebar-left.editor-sidebar-collapsed .editor-sidebar-content {
        gap: 0;
    }

    .editor-sidebar-left.editor-sidebar-collapsed .editor-sidebar-section:not(.editor-sidebar-section-palette) {
        display: none;
    }

    .editor-sidebar-right.editor-sidebar-collapsed .editor-sidebar-content {
        display: none;
    }

    .editor-canvas-wrap {
        order: 1;
        min-height: clamp(280px, 52vh, 430px);
        max-height: clamp(280px, 52vh, 430px);
        align-items: flex-start;
        justify-content: flex-start;
    }

    .palette-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .palette-tile {
        aspect-ratio: auto;
        min-height: 58px;
        padding: 0.2rem 0.1rem;
    }

    .palette-tile span {
        font-size: 0.72rem;
    }

    .editor-cell {
        font-size: 1.2rem;
    }

    #editor-grid {
        --editor-cell-size: 24px;
    }

    .editor-axis {
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    #editor-grid {
        --editor-cell-size: 22px;
    }

    .editor-cell {
        font-size: 1.05rem;
    }

    .editor-axis {
        font-size: 0.76rem;
    }
}

/* ── ŽEBŘÍČEK ─────────────────────────────────────────────────────────────── */

.lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.lb-table th,
.lb-table td {
    padding: 0.6em 0.4em;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.lb-table th {
    color: var(--accent);
    font-size: 1rem;
}

.lb-table tr.lb-self td {
    color: var(--yellow);
}

.lb-loading,
.lb-empty {
    font-size: 1.1rem;
    color: var(--text2);
    text-align: center;
    padding: 1.5rem;
}

.lb-offline {
    font-size: 1rem;
    color: var(--red);
    display: block;
    margin-bottom: 0.3rem;
}

.lb-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
    font-size: 1.1rem;
}

.lb-filter select {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border2);
    font-family: var(--font);
    font-size: 1.1rem;
    padding: 0.3em 0.5em;
    border-radius: var(--radius);
    flex: 1;
}

/* ── NASTAVENÍ ────────────────────────────────────────────────────────────── */

.settings-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.settings-section h3 {
    font-size: 1.3rem;
    color: var(--text2);
    margin-bottom: 0.3rem;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1.1rem;
}

.settings-val {
    color: var(--yellow);
}

/* ── PATIČKA ──────────────────────────────────────────────────────────────── */

.game-footer {
    padding: 0.3rem 1rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.3rem;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.game-footer:hover {
    opacity: 1;
}

.footer-authors {
    font-size: 0.9rem;
    color: var(--text2);
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.footer-authors a {
    color: var(--text2);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-authors a:hover {
    color: var(--accent);
}

.footer-version {
    font-size: 0.9rem;
    color: var(--border2);
}

/* ── Responsivita ─────────────────────────────────────────────────────────── */

@media (max-width: 400px) {
    html {
        font-size: 56.25%;
        /* ~9px */
    }

    .game-title {
        font-size: 2.2rem;
    }

    .dpad-btn {
        width: 44px;
        height: 44px;
        font-size: 1.8rem;
    }
}

@media (min-width: 900px) {
    #level-cards {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Pulsující cíl – volitelná CSS-only animace */
@keyframes goal-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}