/* =========================================================================
   Michalův wishlist – vzhled
   ========================================================================= */

:root {
    --bg: #0a0c13;
    --bg-soft: #10131d;
    --surface: rgba(255, 255, 255, .035);
    --surface-2: rgba(255, 255, 255, .06);
    --line: rgba(255, 255, 255, .09);
    --line-strong: rgba(255, 255, 255, .16);

    --text: #eef1f8;
    --muted: #9aa3b8;
    --faint: #6b7488;

    --accent: #7c6cff;
    --accent-2: #29c5ff;
    --accent-soft: rgba(124, 108, 255, .18);
    --good: #35d07f;
    --good-soft: rgba(53, 208, 127, .14);
    --warn: #ffb545;
    --warn-soft: rgba(255, 181, 69, .14);
    --danger: #ff6b6b;

    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 18px 40px -22px rgba(0, 0, 0, .9);
    --wrap: 1240px;
    --header-h: 58px;

    color-scheme: dark;
}

* { box-sizing: border-box; }

/* Atribut hidden musí přebít i prvky s vlastním display (třeba .btn). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Rozmazané světlo v pozadí, ať stránka nepůsobí ploše. */
.aurora {
    position: fixed;
    inset: -30vh -10vw auto;
    height: 90vh;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(38vw 38vw at 18% 12%, rgba(124, 108, 255, .28), transparent 62%),
        radial-gradient(34vw 34vw at 82% 8%, rgba(41, 197, 255, .20), transparent 60%),
        radial-gradient(30vw 30vw at 55% 40%, rgba(255, 96, 173, .12), transparent 65%);
    filter: blur(18px);
    opacity: .85;
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: clamp(14px, 3vw, 28px);
    position: relative;
    z-index: 1;
}

/* ------------------------------------------------------------ admin bar */

.adminbar {
    position: relative;
    z-index: 30;
    background: linear-gradient(90deg, rgba(124, 108, 255, .22), rgba(41, 197, 255, .14));
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.adminbar-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    flex-wrap: wrap;
    padding-block: 6px;
}

.adminbar-spacer { flex: 1; }

.adminbar-tag {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: #cfc9ff;
    padding: 3px 9px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
}

.abtn {
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    background: rgba(255, 255, 255, .1);
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    padding: 6px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: background .15s, transform .15s, border-color .15s;
}

.abtn:hover { background: rgba(255, 255, 255, .18); transform: translateY(-1px); }
.abtn.ghost { background: transparent; color: var(--muted); }
.abtn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, .08); }

.pill {
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--warn);
    color: #241a00;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.pill[data-empty="1"] { background: rgba(255, 255, 255, .18); color: var(--muted); }

/* -------------------------------------------------------------- hlavička */

.site-header { padding: clamp(28px, 6vw, 60px) 0 clamp(20px, 3vw, 30px); }

.site-header .wrap {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 16px; }

.brand-mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: 15px;
    background: linear-gradient(140deg, var(--accent), var(--accent-2));
    color: #0a0c13;
    box-shadow: 0 12px 30px -12px rgba(124, 108, 255, .9);
}

.brand-text h1 {
    margin: 0;
    font-size: clamp(26px, 4.6vw, 42px);
    line-height: 1.08;
    letter-spacing: -.02em;
    font-weight: 800;
    background: linear-gradient(120deg, #fff 20%, #b9b2ff 60%, #8fe0ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.brand-text p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14.5px;
    max-width: 46ch;
}

.stats { display: flex; gap: 10px; flex-wrap: wrap; }

.stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 16px;
    min-width: 92px;
    backdrop-filter: blur(6px);
}

.stat b {
    display: block;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.stat span {
    font-size: 11.5px;
    color: var(--faint);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.stat.is-done b { color: var(--good); }
.stat.is-pending b { color: var(--warn); }

/* --------------------------------------------------------------- toolbar */

.toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(10, 12, 19, .82);
    backdrop-filter: blur(14px) saturate(1.2);
    border-block: 1px solid var(--line);
}

.toolbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: var(--header-h);
    flex-wrap: wrap;
    padding-block: 9px;
}

.tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.tab {
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 9px;
    padding: 7px 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: color .15s, background .15s;
}

.tab:hover { color: var(--text); }

.tab.is-active {
    color: #fff;
    background: linear-gradient(140deg, rgba(124, 108, 255, .95), rgba(41, 197, 255, .7));
    box-shadow: 0 8px 20px -12px rgba(124, 108, 255, 1);
}

.tab-count {
    font-size: 12px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
}

.tab.is-active .tab-count { background: rgba(0, 0, 0, .25); }

.controls { display: flex; gap: 10px; align-items: center; flex: 1 1 260px; justify-content: flex-end; }

.search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 220px;
    max-width: 340px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 0 10px;
    color: var(--faint);
    transition: border-color .15s, background .15s;
}

.search:focus-within { border-color: var(--accent); background: rgba(124, 108, 255, .1); }

.search input {
    font: inherit;
    font-size: 14px;
    background: transparent;
    border: 0;
    outline: 0;
    color: var(--text);
    padding: 9px 0;
    width: 100%;
    min-width: 0;
}

.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { display: none; }

.search-clear {
    font: inherit;
    font-size: 19px;
    line-height: 1;
    background: none;
    border: 0;
    color: var(--faint);
    cursor: pointer;
    padding: 0 2px;
}

.search-clear:hover { color: var(--text); }

#sort {
    font: inherit;
    font-size: 13.5px;
    color: var(--text);
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 9px 10px;
    cursor: pointer;
    outline: 0;
}

#sort:focus-visible { border-color: var(--accent); }
#sort option { background: var(--bg-soft); }

/* ------------------------------------------------------------------ grid */

/* Pozor: jen padding-block – boční odsazení dodává .wrap, ať mřížka lícuje s hlavičkou. */
.main { padding-block: 26px 70px; min-height: 60vh; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
    gap: clamp(12px, 1.6vw, 20px);
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .022));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    animation: cardIn .32s ease both;
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

.card:hover {
    transform: translateY(-3px);
    border-color: var(--line-strong);
    box-shadow: 0 24px 44px -24px rgba(0, 0, 0, 1), 0 0 0 1px var(--accent-soft);
}

.card-media {
    position: relative;
    aspect-ratio: 460 / 215;
    background: linear-gradient(135deg, #1b2030, #131722);
    overflow: hidden;
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease, filter .25s ease;
}

.card:hover .card-media img { transform: scale(1.045); }

/* Náhrada, když hra nemá obrázek */
.card-media .fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: .04em;
    color: rgba(255, 255, 255, .34);
    background: linear-gradient(135deg, #1d2233, #141827);
}

.card-body {
    padding: 11px 13px 13px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    flex: 1;
}

.card-title {
    margin: 0;
    font-size: 14.5px;
    font-weight: 650;
    line-height: 1.32;
    letter-spacing: -.005em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-title a { color: inherit; text-decoration: none; }
.card-title a:hover { color: #cfc8ff; }

.card-meta {
    font-size: 12px;
    color: var(--faint);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: -3px;
}

.card-note {
    font-size: 12.5px;
    color: var(--muted);
    background: rgba(255, 255, 255, .05);
    border-left: 2px solid var(--accent);
    border-radius: 0 6px 6px 0;
    padding: 5px 8px;
}

.card-foot { margin-top: auto; display: flex; gap: 7px; }

.badge {
    position: absolute;
    top: 9px;
    left: 9px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 999px;
    backdrop-filter: blur(8px);
    border: 1px solid transparent;
}

.badge.pending {
    background: rgba(60, 44, 6, .85);
    color: var(--warn);
    border-color: rgba(255, 181, 69, .4);
}

.badge.done {
    background: rgba(9, 48, 30, .85);
    color: var(--good);
    border-color: rgba(53, 208, 127, .4);
}

.badge .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

/* Pořízené hry vizuálně ustoupí do pozadí */
.card.is-acquired { border-color: rgba(53, 208, 127, .22); }
.card.is-acquired .card-media img { filter: grayscale(.55) brightness(.72); }
.card.is-acquired:hover .card-media img { filter: grayscale(0) brightness(.92); }
.card.is-pending { border-color: rgba(255, 181, 69, .3); }

/* -------------------------------------------------------------- tlačítka */

.btn {
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 8px 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    transition: background .15s, border-color .15s, transform .12s, color .15s;
}

.btn:hover { background: rgba(255, 255, 255, .12); border-color: var(--line-strong); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn.primary {
    background: linear-gradient(140deg, var(--accent), #6b5cf0);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 10px 24px -14px rgba(124, 108, 255, 1);
}

.btn.primary:hover { filter: brightness(1.1); }

.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { color: var(--text); background: rgba(255, 255, 255, .07); }

.btn.danger { color: var(--danger); border-color: rgba(255, 107, 107, .35); }
.btn.danger:hover { background: rgba(255, 107, 107, .12); }

.btn.small { padding: 6px 10px; font-size: 12.5px; }
.btn.block { width: 100%; }

.btn-claim {
    background: rgba(124, 108, 255, .12);
    border-color: rgba(124, 108, 255, .3);
    color: #cfc8ff;
}

.btn-claim:hover { background: rgba(124, 108, 255, .26); color: #fff; }

.card-admin {
    display: flex;
    gap: 6px;
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 3;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .16s, transform .16s;
}

.card:hover .card-admin,
.card:focus-within .card-admin { opacity: 1; transform: none; }

.icon-btn {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(12, 14, 22, .78);
    color: var(--text);
    cursor: pointer;
    backdrop-filter: blur(6px);
    padding: 0;
    transition: background .15s, color .15s;
}

.icon-btn:hover { background: rgba(124, 108, 255, .8); }
.icon-btn.danger:hover { background: rgba(255, 107, 107, .85); }

.linklike {
    font: inherit;
    font-size: 13px;
    background: none;
    border: 0;
    color: var(--faint);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}

.linklike:hover { color: var(--accent-2); }

/* --------------------------------------------------------------- ostatní */

.sentinel { height: 1px; }

.empty {
    text-align: center;
    color: var(--muted);
    padding: 60px 20px;
    font-size: 15px;
}

.notice {
    background: var(--warn-soft);
    border: 1px solid rgba(255, 181, 69, .35);
    border-radius: 10px;
    padding: 12px 16px;
    color: #ffd79b;
}

.site-footer {
    border-top: 1px solid var(--line);
    padding: 18px 0 26px;
    color: var(--faint);
    font-size: 13px;
}

.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

/* --------------------------------------------------------------- dialogy */

.modal {
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--text);
    max-width: min(560px, calc(100vw - 24px));
    width: 100%;
    max-height: calc(100dvh - 40px);
    overflow: visible;
}

.modal::backdrop {
    background: rgba(5, 6, 11, .72);
    backdrop-filter: blur(4px);
}

.modal-card {
    background: linear-gradient(180deg, #171b28, #12151f);
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 1);
    display: flex;
    flex-direction: column;
    gap: 13px;
    max-height: calc(100dvh - 60px);
    overflow-y: auto;
    animation: modalIn .2s ease both;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(10px) scale(.985); }
    to { opacity: 1; transform: none; }
}

.modal-card.narrow { max-width: 400px; }
.modal[open] { display: block; }

.modal-title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.modal-sub { margin: -6px 0 0; font-size: 15px; font-weight: 600; color: #cfc8ff; }
.modal-hint { margin: -4px 0 4px; font-size: 13px; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.field > span { color: var(--muted); font-weight: 600; }
.field em { font-style: normal; color: var(--faint); font-weight: 400; }

.field input,
.field textarea {
    font: inherit;
    font-size: 14px;
    color: var(--text);
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    outline: 0;
    width: 100%;
    transition: border-color .15s, background .15s;
    resize: vertical;
}

.field input:focus,
.field textarea:focus { border-color: var(--accent); background: rgba(124, 108, 255, .09); }

.input-row { display: flex; gap: 7px; }
.input-row input { flex: 1; min-width: 0; }

.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }
.modal-actions-spacer { flex: 1; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* žádosti ke schválení */

.pending-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; }

.pending-row {
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
}

.pending-row img {
    width: 92px;
    aspect-ratio: 460 / 215;
    object-fit: cover;
    border-radius: 7px;
    flex: none;
    background: #1b2030;
}

.pending-row .pending-info { flex: 1; min-width: 0; }
.pending-row .pending-name { font-weight: 650; font-size: 14px; }

.pending-row .pending-who {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.pending-row .pending-actions { display: flex; gap: 6px; flex: none; }

.btn.approve {
    background: var(--good-soft);
    border-color: rgba(53, 208, 127, .38);
    color: var(--good);
}

.btn.approve:hover { background: rgba(53, 208, 127, .28); color: #eafff4; }

/* ---------------------------------------------------------------- toasty */

.toasts {
    position: fixed;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    z-index: 90;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
    width: min(440px, calc(100vw - 24px));
}

.toast {
    background: #1a1f2e;
    border: 1px solid var(--line-strong);
    border-left: 3px solid var(--accent);
    border-radius: 11px;
    padding: 11px 15px;
    font-size: 14px;
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 1);
    animation: toastIn .22s ease both;
    max-width: 100%;
}

.toast.ok { border-left-color: var(--good); }
.toast.err { border-left-color: var(--danger); }
.toast.out { animation: toastOut .25s ease both; }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateY(8px); }
}

/* ------------------------------------------------------------ responzivní */

@media (max-width: 720px) {
    .site-header { padding-top: 22px; }
    .site-header .wrap { align-items: flex-start; }
    .stats { width: 100%; }
    .stat { flex: 1; min-width: 0; padding: 9px 12px; }
    .stat b { font-size: 20px; }
    .toolbar-inner { gap: 9px; }
    .tabs { width: 100%; }
    .tab { flex: 1; justify-content: center; }
    .controls { width: 100%; }
    .search { max-width: none; }
    .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .card-admin { opacity: 1; transform: none; }
    .pending-row img { width: 64px; }
    .pending-row { flex-wrap: wrap; }
    .pending-row .pending-actions { width: 100%; }
    .pending-row .pending-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
