/* PDF Table Reader — společné styly */

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0;
    padding: 0;
    /* Sub11.5 — sjednocené pozadí s KonecSanonu.cz (hex-glow wallpaper +
       fialový overlay). Linear-gradient je položený NA wallpaper přes
       multiple backgrounds (CSS spec: nejprve top vrstva, pak níže). */
    /* Design v2 (I-2): raster JPEG tapeta nahrazena CSS aurora (0 assetů,
       bez background-attachment:fixed jank). */
    background-color: #0c0a1d;
    background-image:
        linear-gradient(180deg, rgba(30, 27, 75, 0.55) 0%, rgba(46, 16, 101, 0.45) 50%, rgba(30, 27, 75, 0.55) 100%),
        radial-gradient(45% 55% at 18% 22%, rgba(139, 92, 246, 0.22), transparent 70%),
        radial-gradient(45% 55% at 82% 28%, rgba(217, 70, 239, 0.16), transparent 70%),
        radial-gradient(50% 60% at 60% 85%, rgba(79, 70, 229, 0.20), transparent 70%);
    color: #f1f5f9;
    font-size: 14px;
    min-height: 100vh;
}

header.app-header {
    background: #1a1a2e;
    color: #fff;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

header.app-header h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #7eb8f7;
}

.app-header-title {
    flex: 1;
    text-align: center;
    margin: 0 16px;
    font-size: 18px;
    font-weight: 600;
    color: #7eb8f7;
    letter-spacing: -0.2px;
}
.app-header-title:empty {
    display: none;
}

header.app-header nav a {
    color: #ccd;
    text-decoration: none;
    margin-left: 20px;
    font-size: 14px;
    padding: 6px 10px;
    border-radius: 4px;
    transition: background 0.15s;
}

header.app-header nav a:hover,
header.app-header nav a.active {
    background: #2a2a4e;
    color: #fff;
}

/* Ikona domečku vlevo v hlavičce */
.nav-home-btn {
    background: transparent;
    color: #ccd;
    border: 1px solid transparent;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.nav-home-btn:hover,
.nav-home-btn.active {
    background: #2a2a4e;
    color: #fff;
}

/* Dropdown s hrami v navigaci */
.nav-games-wrap {
    position: relative;
    display: inline-flex;
    margin-left: 12px;
}
.nav-games-btn {
    background: transparent;
    color: #ccd;
    border: 1px solid transparent;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    transition: background 0.15s, color 0.15s;
    box-shadow: none;
}
.nav-games-btn:hover,
.nav-games-btn[aria-expanded="true"] {
    background: #2a2a4e;
    color: #fff;
    box-shadow: none;
}
.nav-games-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    min-width: 170px;
    max-height: 70vh;
    overflow-y: auto;
    display: none;
    z-index: 1000;
}
.nav-games-menu.open { display: block; }
.nav-games-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    color: #e2e8f0;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    margin-left: 0;
    transition: background 0.15s, color 0.15s;
}
.nav-games-menu a:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}
.nav-games-menu .game-icon {
    font-size: 17px;
    width: 22px;
    text-align: center;
}
main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
}

/* HRA SE MÁ VEJÍT DO OKNA BEZ ROLOVÁNÍ (zadání uživatele k Hrám v2).
   Změřeno přes všech 54 her na 390/355/768: rolovalo 16–28 z nich, a to
   VŽDY kvůli tomu, co je POD hrou — herní plocha sama se do okna vejde
   pokaždé. Hlavní viník byl žebříček (130 px, řeší `leaderboard.js`),
   druhý je tenhle rámeček: 2× 24 px odsazení + nadpis s mezerou pod ním
   dělaly dalších ~70 px.

   Platí jen pro hrubý ukazatel (prst). Na myši je místa dost a titulek
   ani vzdušnost není proč osekávat. `!important` je tu nutné zlo:
   `.game-wrap` si definuje každá hra ve vlastním `<style>` v hlavičce,
   tedy PO tomhle souboru, takže by bez něj pravidlo prohrálo na pořadí. */
@media (pointer: coarse) {
    main {
        padding: 8px 10px;
    }
    main > h2 {
        font-size: 17px;
        margin-bottom: 4px;
        /* Vpravo nahoře sedí tři pevná tlačítka (snímek, zvuk, celá
           obrazovka) o šířce 40 px od x = 244 do 380. Nadpis se pod ně
           podlézal a byl napůl nečitelný — „TETRIS — klasic▩▩ ▩▩". Vada
           je starší než tenhle balíček (ověřeno na stavu před ním), jen ji
           nikdo neměřil. Odsazení nechává text skončit před nimi. */
        padding-right: 150px;
    }
    main > .game-wrap {
        margin-top: 2px !important;
    }
}

h2 {
    margin-top: 0;
    /* Sub11.5 — světlejší pro nový dark hex glow background */
    color: #f1f5f9;
    font-size: 22px;
    font-weight: 600;
}

/* Karty */
.card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 18px 22px;
    margin-bottom: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
                0 2px 8px rgba(15, 23, 42, 0.03);
}

.card h3 {
    margin-top: 0;
    color: #333;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

/* Dlaždice na homepage */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.tile {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 22px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
                0 2px 8px rgba(15, 23, 42, 0.03);
}

.tile:hover {
    border-color: #7eb8f7;
    box-shadow: 0 4px 14px rgba(126, 184, 247, 0.2);
    transform: translateY(-2px);
}

.tile .icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.tile h3 {
    margin: 4px 0 8px 0;
    color: #1a1a2e;
    font-size: 18px;
}

.tile p {
    color: #666;
    margin: 0;
    line-height: 1.5;
    font-size: 13px;
}

/* ══════════════════════════════════════════════════════════════════════════
   TLAČÍTKA — moderní sjednocený systém
   ══════════════════════════════════════════════════════════════════════════

   Použití:
     <button class="btn">Text</button>               ← primary (modrá)
     <button class="btn btn-secondary">Text</button>
     <button class="btn btn-success">Text</button>
     <button class="btn btn-danger">Text</button>
     <button class="btn btn-ghost">Text</button>     ← průhledné, jen text

   Velikosti:
     <button class="btn btn-sm">…</button>   ← malé
     <button class="btn">…</button>          ← default (medium)
     <button class="btn btn-lg">…</button>   ← velké

   S ikonou (gap je automatický):
     <button class="btn"><svg>…</svg><span>Uložit</span></button>

   Icon-only (čtverec, jen ikona):
     <button class="btn btn-icon" title="Smazat"><svg>…</svg></button>
*/

/* Atribut `hidden` musí přebít base `display: inline-flex` níže — jinak
   zůstane tlačítko se `[hidden]` viditelné. */
button[hidden], .btn[hidden] { display: none !important; }

button, .btn {
    /* Base */
    background: #2563eb;                    /* blue-600 */
    color: #fff;
    border: 1px solid transparent;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.01em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08),
                inset 0 1px 0 rgba(255, 255, 255, 0.12);
    -webkit-user-select: none;
    user-select: none;
    white-space: nowrap;
}

button:hover, .btn:hover {
    background: #1d4ed8;                    /* blue-700 */
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25),
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
button:active, .btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}
button:focus-visible, .btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35),
                0 1px 2px rgba(15, 23, 42, 0.08);
}
button:disabled, .btn[disabled] {
    background: #cbd5e1;
    color: #64748b;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* SVG ikony uvnitř tlačítek — jednotná velikost a stroke */
button svg, .btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    stroke: currentColor;
    flex-shrink: 0;
}

/* ── Varianty ──────────────────────────────────────────────────────────── */

button.secondary, .btn.secondary, button.btn-secondary, .btn-secondary {
    background: #e2e8f0;                    /* slate-200 */
    color: #1e293b;                         /* slate-800 */
}
button.secondary:hover, .btn.secondary:hover,
button.btn-secondary:hover, .btn-secondary:hover {
    background: #cbd5e1;                    /* slate-300 */
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}
button.secondary:focus-visible, .btn.secondary:focus-visible,
button.btn-secondary:focus-visible, .btn-secondary:focus-visible {
    box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.3);
}

button.danger, .btn.danger, button.btn-danger, .btn-danger {
    background: #dc2626;                    /* red-600 */
}
button.danger:hover, .btn.danger:hover,
button.btn-danger:hover, .btn-danger:hover {
    background: #b91c1c;                    /* red-700 */
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}
button.danger:focus-visible, .btn.danger:focus-visible,
button.btn-danger:focus-visible, .btn-danger:focus-visible {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.35);
}

button.success, .btn.success, button.btn-success, .btn-success {
    background: #059669;                    /* emerald-600 */
}
button.success:hover, .btn.success:hover,
button.btn-success:hover, .btn-success:hover {
    background: #047857;                    /* emerald-700 */
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}
button.success:focus-visible, .btn.success:focus-visible,
button.btn-success:focus-visible, .btn-success:focus-visible {
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.35);
}

/* Import do Centrály s fasovacím listem — indigo (jen Junker).
   Výrazně odlišené od základního .btn-primary (blue-600), aby bylo
   na první pohled jasné, že je to jiná akce. */
button.btn-central-fas, .btn-central-fas {
    background: #4f46e5;                    /* indigo-600 */
}
button.btn-central-fas:hover, .btn-central-fas:hover {
    background: #4338ca;                    /* indigo-700 */
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.30);
}
button.btn-central-fas:focus-visible, .btn-central-fas:focus-visible {
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.35);
}

button.btn-ghost, .btn-ghost {
    background: transparent;
    color: #475569;
    box-shadow: none;
    border-color: transparent;
}
button.btn-ghost:hover, .btn-ghost:hover {
    background: rgba(148, 163, 184, 0.18);
    box-shadow: none;
}

/* ── Velikosti ─────────────────────────────────────────────────────────── */

button.btn-sm, .btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
    gap: 5px;
}
button.btn-sm svg, .btn-sm svg {
    width: 14px;
    height: 14px;
}
button.btn-lg, .btn-lg {
    padding: 11px 20px;
    font-size: 14px;
    border-radius: 10px;
    gap: 9px;
}
button.btn-lg svg, .btn-lg svg {
    width: 18px;
    height: 18px;
}

/* ── Icon-only (čtvercové tlačítko jen s ikonou) ──────────────────────── */

button.btn-icon, .btn-icon {
    padding: 7px;
    width: 32px;
    height: 32px;
    border-radius: 7px;
    gap: 0;
    flex-shrink: 0;
}
button.btn-icon.btn-sm, .btn-icon.btn-sm {
    width: 28px;
    height: 28px;
    padding: 5px;
}
button.btn-icon.btn-lg, .btn-icon.btn-lg {
    width: 40px;
    height: 40px;
    padding: 10px;
}

/* Skupina přilehlých tlačítek (pro akce v tabulkách) */
.btn-group {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

/* Formulářové prvky */
input[type="text"], input[type="number"], select, textarea {
    padding: 7px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: #1e293b;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

label {
    display: inline-block;
    margin-right: 8px;
    font-weight: 500;
}

/* Tabulky */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    margin-top: 10px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04),
                0 2px 6px rgba(15, 23, 42, 0.03);
}

th {
    background: linear-gradient(180deg, #1f2945 0%, #10172a 100%);
    color: #f1f5f9;
    padding: 11px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-bottom: 2px solid #0a0a1e;
}

td {
    padding: 9px 14px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 13px;
    color: #1e293b;
}

tbody tr:last-child td {
    border-bottom: none;
}

tr:nth-child(even) td {
    background: #f8fafc;
}

tr:hover td {
    background: #eff6ff;
}

.empty {
    color: #999;
    font-style: italic;
    padding: 20px;
    text-align: center;
}

.status {
    padding: 8px 12px;
    border-radius: 6px;
    margin: 8px 0;
    font-weight: 500;
}

.status.ok    { background: #dff0d8; color: #226622; }
.status.err   { background: #f2dede; color: #9b2020; }
.status.warn  { background: #fcf8e3; color: #8a6d3b; }
.status.info  { background: #d9edf7; color: #31708f; }

/* ══════════════════════════════════════════════════════════════════════════
   TABS — jednoduchý PageControl (záložky + panely)
   ══════════════════════════════════════════════════════════════════════════

   Použití:
     <div class="tabs">
         <button class="tab active" data-tab="a">Tab A</button>
         <button class="tab"        data-tab="b">Tab B</button>
     </div>
     <div class="tab-panel active" data-panel="a">…</div>
     <div class="tab-panel"        data-panel="b" hidden>…</div>

   Přepínání řeší JS (viz processor.js — initTabs()).
*/

.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid #d0d5dc;
    margin-bottom: 14px;
}

.tabs .tab {
    /* override .btn defaultů */
    background: transparent;
    color: #475569;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 9px 16px;
    font-weight: 600;
    font-size: 13px;
    box-shadow: none;
    margin-bottom: -1px;       /* překrytí spodní hraniční čáry */
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tabs .tab:hover {
    background: rgba(148, 163, 184, 0.12);
    color: #1e293b;
    box-shadow: none;
}

.tabs .tab.active {
    background: #fff;
    color: #1a1a2e;
    border-color: #d0d5dc;
    border-bottom-color: #fff;  /* "spojí se" s panelem pod ním */
}

.tabs .tab:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.tab-panel[hidden] { display: none; }

/* Log výstup */
.log-output {
    background: #1a1a2e;
    color: #aaffaa;
    font-family: "JetBrains Mono", "Fira Code", Consolas, "Courier New", monospace;
    font-size: 12px;
    padding: 14px;
    border-radius: 8px;
    white-space: pre;
    overflow: auto;
    max-height: 300px;
}

/* Progress bar */
.progress {
    height: 12px;
    background: #eee;
    border-radius: 6px;
    overflow: hidden;
    margin: 10px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #34d399, #059669);
    transition: width 0.3s;
}

/* ── Result modal (HOTOVO / chyba importu do Centrály) ───────────────── */
.result-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}
.result-backdrop.open { display: flex; }

.result-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
    width: min(640px, 94vw);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: result-pop 160ms ease-out;
}
@keyframes result-pop {
    from { transform: scale(0.96); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.result-modal > header {
    color: #fff;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.result-modal > header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.2px;
}
.result-modal.result-ok  > header { background: linear-gradient(135deg, #34d399, #059669); }
.result-modal.result-err > header { background: linear-gradient(135deg, #f87171, #dc2626); }

.result-close {
    background: transparent;
    color: #fff;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    padding: 0;
    opacity: 0.85;
    box-shadow: none;
}
.result-close:hover { background: rgba(255,255,255,0.18); opacity: 1; box-shadow: none; }

.result-body {
    padding: 22px 26px;
    overflow-y: auto;
    color: #1e293b;
    line-height: 1.55;
    font-size: 14px;
}
.result-body .result-headline {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #059669;
    text-align: center;
    margin: 8px 0 4px 0;
}
.result-body .result-message {
    margin: 0 0 10px 0;
    white-space: pre-wrap;
}
.result-body .result-details {
    margin-top: 12px;
    background: #0f172a;
    color: #e2e8f0;
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 12.5px;
    padding: 12px 14px;
    border-radius: 8px;
    white-space: pre-wrap;
    overflow: auto;
    max-height: 280px;
}

.result-modal > footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 12px 22px;
    display: flex;
    justify-content: flex-end;
}
