/* ===========================================================
   AniFatherBot Mini App — design tokens
   Palette fixed by spec: bg #0D0E11, accent #6C8EF5
   Type fixed by spec: Inter (text), IBM Plex Mono (code/numbers)

   Signature idea: every video in this app is identified by a plain
   sequential number (the "kod"). That number is the whole product's
   nervous system — nothing plays without it. So instead of hiding it,
   the UI treats codes/episode numbers as a visible mono-type badge
   system everywhere (EP tags, ratings, durations, the admin's video
   code field) — a quiet through-line rather than one flashy moment.
   =========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    --bg: #0D0E11;
    --bg-raised: #15171C;
    --bg-card: #1B1E25;
    --border: #262A33;
    --accent: #6C8EF5;
    --accent-dim: #6C8EF522;
    --text: #F2F3F5;
    --text-dim: #9A9FAC;
    --text-faint: #5C6270;
    --danger: #E5637A;
    --success: #63C08A;

    --font-sans: 'Inter', -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;

    --radius: 14px;
    --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    -webkit-tap-highlight-color: transparent;
}

#app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 76px;
    position: relative;
}

.mono { font-family: var(--font-mono); }

.code-badge {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid #6C8EF544;
    border-radius: 6px;
    padding: 2px 7px;
}

.screen { padding: 16px; animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.topbar {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px 6px;
}
.topbar button.back {
    background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text); width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.topbar h1 { font-size: 17px; font-weight: 600; margin: 0; }

h1, h2, h3 { font-family: var(--font-sans); letter-spacing: -0.01em; }

.section-title {
    font-size: 13px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.06em; color: var(--text-dim); margin: 22px 0 10px;
}

.hrow {
    display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px;
    scrollbar-width: none;
}
.hrow::-webkit-scrollbar { display: none; }

.anime-card { flex: 0 0 128px; cursor: pointer; }
.anime-card img {
    width: 128px; height: 192px; object-fit: cover;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    background: var(--bg-card);
}
.anime-card .title { font-size: 13px; font-weight: 500; margin-top: 6px; line-height: 1.25; }
.anime-card .meta { font-size: 11px; color: var(--text-faint); margin-top: 2px; font-family: var(--font-mono); }

.featured-banner {
    position: relative; width: 100%; height: 200px; border-radius: var(--radius);
    overflow: hidden; border: 1px solid var(--border); flex: 0 0 100%;
}
.featured-banner img { width: 100%; height: 100%; object-fit: cover; }
.featured-banner .overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, transparent 40%, #0D0E11EE 100%);
    display: flex; align-items: flex-end; padding: 16px;
}
.featured-banner .overlay h2 { margin: 0 0 4px; font-size: 20px; }

.btn {
    font-family: var(--font-sans); font-weight: 600; font-size: 15px;
    border: none; border-radius: var(--radius-sm); padding: 13px 18px;
    cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: var(--accent); color: #0D0E11; width: 100%; }
.btn-primary:active { opacity: 0.85; }
.btn-ghost { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }

.bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    max-width: 480px; width: 100%; background: var(--bg-raised);
    border-top: 1px solid var(--border);
    display: flex; padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav button {
    flex: 1; background: none; border: none; color: var(--text-faint);
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    font-size: 11px; font-family: var(--font-sans); cursor: pointer; padding: 6px 0;
}
.bottom-nav button.active { color: var(--accent); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.field input, .field select, .field textarea {
    width: 100%; background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text); border-radius: var(--radius-sm); padding: 11px 12px;
    font-family: var(--font-sans); font-size: 14px;
}
.field input.mono, .field .code-input { font-family: var(--font-mono); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    border: 1px solid var(--border); background: var(--bg-card); color: var(--text-dim);
    border-radius: 20px; padding: 7px 13px; font-size: 13px; cursor: pointer;
}
.chip.selected { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

.list-row {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    margin-bottom: 8px; cursor: pointer;
}
.list-row img { width: 48px; height: 68px; object-fit: cover; border-radius: 6px; }
.list-row .info { flex: 1; }
.list-row .info .name { font-size: 14px; font-weight: 500; }
.list-row .info .sub { font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); margin-top: 2px; }
.list-row .check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); }
.list-row .check.done { background: var(--accent); border-color: var(--accent); }

.toast {
    position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
    background: var(--bg-raised); border: 1px solid var(--accent);
    color: var(--text); padding: 12px 18px; border-radius: 12px;
    font-size: 14px; z-index: 999; box-shadow: 0 8px 24px #000A;
    animation: toastin .25s ease;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.empty { text-align: center; padding: 40px 16px; color: var(--text-faint); }
.empty .code-badge { display: inline-block; margin-bottom: 10px; }

.avatar {
    width: 84px; height: 84px; border-radius: 50%; margin: 8px auto;
    background: var(--bg-card); border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; color: var(--text-faint); object-fit: cover;
}

.menu-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 4px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.menu-item:last-child { border-bottom: none; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 14px;
}
.stat-card .num { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--accent); }
.stat-card .label { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
