/* hrajsa.sk — portál */
:root {
    --accent: #e4572e;
    --accent-2: #f3a712;
    --accent-ink: #fff;
    --bg: #fbf8f3;
    --bg-2: #f2ede4;
    --card: #ffffff;
    --line: #e6dfd3;
    --ink: #1f1d1a;
    --muted: #756e63;
    --ok: #2e8b57;
    --err: #c0392b;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(40, 30, 10, .06), 0 6px 20px rgba(40, 30, 10, .06);
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #161513;
        --bg-2: #211f1c;
        --card: #1e1c1a;
        --line: #34302b;
        --ink: #f2eee8;
        --muted: #a69e92;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
        color-scheme: dark;
    }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; min-height: 100vh; display: flex; flex-direction: column;
    background: var(--bg); color: var(--ink);
    font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 4vw, 34px); margin: 0 0 12px; }
h2 { font-size: 20px; margin: 0 0 12px; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; background: var(--bg-2); padding: 1px 5px; border-radius: 5px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Hlavička */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header-in { max-width: 1100px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.logo { font-weight: 800; font-size: 22px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 8px; letter-spacing: -.02em; }
.logo b { color: var(--accent); }
.logo-mark { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 14px; padding-left: 2px; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.site-nav > a:not(.btn) { color: var(--ink); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: 15px; }
.site-nav > a:not(.btn):hover, .site-nav > a.is-active { background: var(--bg-2); }
.nav-user { display: flex; align-items: center; gap: 8px; }
.avatar { --h: 20; width: 28px; height: 28px; border-radius: 50%; background: hsl(var(--h) 60% 45%); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
@media (max-width: 520px) { .nav-nick { display: none; } .logo { font-size: 19px; } }

.admin-nav { background: var(--bg-2); border-bottom: 1px solid var(--line); }
.admin-nav-in { max-width: 1100px; margin: 0 auto; padding: 6px 12px; display: flex; gap: 2px; overflow-x: auto; }
.admin-nav a { color: var(--ink); text-decoration: none; padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.admin-nav a:hover { background: var(--card); }
.admin-nav a.is-active { background: var(--accent); color: #fff; }

/* Obsah */
.page { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 16px 48px; }
.page-narrow { max-width: 560px; }
.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 20px 16px 28px; display: flex; gap: 10px; justify-content: center; align-items: center; }
.env-badge { background: var(--accent-2); color: #000; font-weight: 800; font-size: 11px; padding: 2px 7px; border-radius: 6px; letter-spacing: .05em; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h2:first-child, .card h1:first-child { margin-top: 0; }
.card[id] { scroll-margin-top: 76px; } /* odkaz na #pristup: nadpis nesmie skončiť pod lepkavou hlavičkou */
.auth-card { margin-top: 24px; padding: 28px; }

.flash { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; background: #e7f5ec; color: #1d5e3a; border: 1px solid #bfe3cd; }
.flash-info { background: #eef3fb; color: #23456e; border-color: #c9d8ef; }
.flash-err { background: #fbeceb; color: #8a2a20; border-color: #f0c7c2; }
@media (prefers-color-scheme: dark) {
    .flash { background: #17301f; color: #b9e4c7; border-color: #255a36; }
    .flash-info { background: #172436; color: #bfd3ef; border-color: #2a4466; }
    .flash-err { background: #3a1916; color: #f3c2bc; border-color: #6a2a23; }
}
.form-error { background: #fbeceb; color: #8a2a20; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: 15px; }
@media (prefers-color-scheme: dark) { .form-error { background: #3a1916; color: #f3c2bc; } }
.dev-box { background: #fff4d6; color: #5a4300; border: 1px dashed #d9a400; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.notice { background: var(--card); border-left: 4px solid var(--accent-2); border-radius: 10px; padding: 12px 16px; margin-bottom: 24px; box-shadow: var(--shadow); }

/* Tlačidlá a formuláre */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 0; border-radius: 12px; padding: 10px 18px; background: var(--accent); color: var(--accent-ink);
    font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: filter .12s ease, transform .12s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn-small { padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn-big { padding: 14px 24px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-ghost { background: var(--bg-2); color: var(--ink); }
.btn-danger { background: var(--err); }
.btn-link { background: none; color: var(--accent); padding: 4px 6px; font-weight: 600; }
.btn-disabled { background: var(--bg-2); color: var(--muted); cursor: default; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-inline { flex-direction: row; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.grow { flex: 1; min-width: 180px; }
.field > span { font-weight: 600; font-size: 14px; }
.field small { color: var(--muted); font-size: 13px; }
.field-check { flex-direction: row; align-items: center; gap: 8px; }
input[type=text], input[type=email], input[type=number], input[type=search], input[type=url], select, textarea {
    font: inherit; color: var(--ink); background: var(--card); width: 100%;
    border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
input[readonly] { background: var(--bg-2); }
textarea { resize: vertical; min-height: 80px; }
.code-input { font-size: 24px !important; letter-spacing: .25em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.copy-row { display: flex; gap: 8px; margin-top: 8px; }
.copy-row input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; flex: 1; min-width: 0; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.row-actions form { margin: 0; }

/* Hlavná stránka: dlaždice hier */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.tile {
    --accent: #6c5ce7; display: flex; flex-direction: column; overflow: hidden;
    background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
    color: var(--ink); text-decoration: none; transition: transform .15s ease, box-shadow .15s ease;
}
a.tile:hover, a.tile:focus-visible { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(40, 30, 10, .16); }
a.tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile-img {
    position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden;
    background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--accent) 55%, #fff) 0, var(--accent) 60%, color-mix(in srgb, var(--accent) 70%, #000) 100%);
}
.tile-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
a.tile:hover .tile-img img { transform: scale(1.03); }
.tile-emoji { font-size: 72px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .25)); }
.tile-play {
    position: absolute; display: grid; place-items: center; width: 68px; height: 68px; padding-left: 5px;
    border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 26px;
    opacity: 0; transform: scale(.9); transition: opacity .15s ease, transform .15s ease;
}
a.tile:hover .tile-play, a.tile:focus-visible .tile-play { opacity: 1; transform: none; }
.tile-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 12px 18px; }
.tile-title { font-size: 19px; font-weight: 800; letter-spacing: -.01em; min-width: 0; overflow-wrap: anywhere; }
.tile-btn { background: var(--accent); flex: none; }
.tile-btn.btn-ghost { background: var(--bg-2); color: var(--ink); }
/* Prototyp vo vývoji: bez obrázka a popisu, len názov */
.tile-proto .tile-img { background: repeating-linear-gradient(-45deg, var(--bg-2) 0 14px, var(--card) 14px 28px); border-bottom: 1px dashed var(--line); }
.tile-proto-label { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
    background: var(--card); border: 1px dashed var(--line); border-radius: 999px; padding: 6px 14px; }
.proto-label { margin: 0 0 6px; font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tile-later { color: var(--muted); font-size: 14px; font-weight: 700; flex: none; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; }
.badge-draft { position: absolute; top: 10px; left: 10px; background: rgba(0, 0, 0, .6); color: #fff; z-index: 1; }

/* Tabuľky (účet, admin) */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.table tr:hover td { background: color-mix(in srgb, var(--bg-2) 60%, transparent); }
.table-compact td, .table-compact th { padding: 6px 8px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table form { display: inline; margin: 0; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--bg-2); color: var(--muted); }
.pill-ok { background: #dcf3e4; color: #1d5e3a; }
.pill-warn { background: #fff0c9; color: #6b4e00; }
.pill-err { background: #fbeceb; color: #8a2a20; }
.pill-accent { background: #fde3da; color: #8a2f14; }
@media (prefers-color-scheme: dark) {
    .pill-ok { background: #17301f; color: #b9e4c7; }
    .pill-warn { background: #3a2f10; color: #f2d78a; }
    .pill-err { background: #3a1916; color: #f3c2bc; }
    .pill-accent { background: #4a2216; color: #f6c3b2; }
}
.session-list { list-style: none; padding: 0; margin: 0; }
.session-list li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }

/* Administrácia */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 28px; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.toolbar .field { min-width: 160px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.cover-preview { display: block; width: 100%; max-width: 360px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); }
@media (max-width: 760px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.table td code { overflow-wrap: anywhere; }   /* dlhé adresy (prístupové údaje) sa zalomia */
.secret { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; }
.chat-line { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.chat-line .body { flex: 1; min-width: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-line.is-deleted .body { color: var(--muted); text-decoration: line-through; }
.pre { white-space: pre-wrap; font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--bg-2); padding: 12px; border-radius: 10px; overflow-x: auto; }
