/* ─────────────────────────────────────────────────────────────────
   Dobyvatelé — global responsive UI (mobile-first).
   Loaded on every page via Page::header().

   Design system:
   - Primary identity: dark navy (#1a3a5c) + red accent (#c0392b) + gold (#d4a94a)
   - Sekundární sladění s hattrick-cz.com: sage/forest jako podpůrné rámečky,
     Georgia pro nadpisy, paper-warm pozadí, box-shadow depth.
   ───────────────────────────────────────────────────────────────── */

:root {
    /* Dobyvatelé core identity */
    --dob-navy:      #1a3a5c;
    --dob-navy-mid:  #255080;
    --dob-navy-dark: #0f2540;
    --dob-red:       #c0392b;
    --dob-gold:      #d4a94a;

    /* Hattrick-cz akcenty (sladí Dobyvatele s hlavním webem) */
    --ht-sage:        #AFC7AD;
    --ht-sage-soft:   #d6e0d0;
    --ht-forest:      #297339;
    --ht-forest-dark: #215A29;
    --ht-paper:       #fdfcf7;
    --ht-paper-warm:  #f6f2e7;
    --ht-muted:       #6b6b5a;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background:
      radial-gradient(circle at 15% 0%, rgba(175,199,173,0.28) 0%, transparent 45%),
      radial-gradient(circle at 85% 100%, rgba(41,115,57,0.10) 0%, transparent 50%),
      var(--ht-paper-warm);
    color: #222;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--dob-navy); }
a:hover { text-decoration: underline; }

/* Nadpisy v Georgia sladěné se stylem hattrick-cz */
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: -0.2px; }
h1 { color: var(--dob-navy); font-size: 1.75rem; margin: 0.5rem 0 1rem; word-wrap: break-word; }
h2 { color: var(--dob-navy); font-size: 1.25rem; margin: 1.2rem 0 0.6rem; }
h3 { color: var(--dob-navy); font-size: 1.05rem; margin: 1rem 0 0.5rem; }

/* ── Top nav ──────────────────────────────────────────────────── */

nav.site-nav {
    background: var(--dob-navy);
    color: #fff;
    display: flex;
    flex-wrap: wrap;
    align-items: center;   /* všechny přímé děti navu se centrují */
    gap: 0 0.6rem;
    padding: 0.35rem 0.9rem;
    min-height: 42px;
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 3px solid var(--dob-gold);
    line-height: 1;
}

nav.site-nav a {
    color: #cde;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0 0.45rem;
    border-radius: 4px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
}
nav.site-nav a:hover { color: #fff; background: rgba(255,255,255,0.08); text-decoration: none; }
nav.site-nav .site-title {
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    margin-right: 0.5rem;
    font-family: Georgia, serif;
    display: inline-flex;
    align-items: center;
}
nav.site-nav .site-title a { color: #fff; padding: 0; }
nav.site-nav .nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    flex: 1 1 auto;
    gap: 0 0.35rem;
    min-width: 0;
}
nav.site-nav .spacer { flex: 1 1 auto; min-width: 0; }
nav.site-nav .nav-user {
    color: #adf;
    font-size: 0.85rem;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    padding: 0 0.4rem;
}
nav.site-nav .nav-user strong { color: #fff; }

/* Ozdobný "podnadpis" pod navem — informuje, že jde o součást hattrick-cz.com */
.site-banner {
    background: #14304d;
    color: rgba(255,255,255,0.75);
    text-align: center;
    padding: 5px 10px;
    font: italic 12px Georgia, serif;
    border-bottom: 1px solid var(--dob-navy-dark);
}
.site-banner a {
    color: var(--dob-gold);
    text-decoration: none;
    border-bottom: 1px dotted var(--dob-gold);
}
.site-banner a:hover {
    color: #fff;
    border-bottom-color: #fff;
    text-decoration: none;
}

/* Hamburger toggle (hidden ≥720px). */
.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    padding: 0;
    margin-left: auto;
}

@media (max-width: 720px) {
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; align-self: center; }
    nav.site-nav { padding: 0.4rem 0.7rem; min-height: 46px; align-items: center; }
    nav.site-nav .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        flex: 0 0 100%;
        margin-top: 0.5rem;
        gap: 0.1rem;
    }
    nav.site-nav .nav-links.open { display: flex; }
    nav.site-nav .nav-links a {
        padding: 0.6rem 0.5rem;
        font-size: 1rem;
        border-top: 1px solid rgba(255,255,255,0.08);
    }
    nav.site-nav .nav-links .nav-user {
        padding: 0.5rem;
        border-top: 1px solid rgba(255,255,255,0.08);
    }
}

/* ── Main + cards ─────────────────────────────────────────────── */

main {
    max-width: 1100px;
    margin: 1rem auto;
    padding: 0 0.9rem 2rem;
    flex: 1;
    width: 100%;
}

/* Sladěný "box" ve stylu hattrick-cz: paper background, sage border,
   navy left accent, měkký shadow. Použito pro .adm-card, .panel, .card. */
.adm-card, .panel, .card {
    background: var(--ht-paper);
    border: 1px solid var(--ht-sage);
    border-left: 4px solid var(--dob-navy);
    border-radius: 4px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Interaktivní karty (odkazy) se rozjasní při hoveru */
a.card {
    display: block;
    text-decoration: none;
    color: #222;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
a.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(26,58,92,0.15);
    border-color: var(--dob-navy);
    text-decoration: none;
}

/* Hero blok pro home page (paralela k .hero na hattrick-cz.com) */
.hero {
    display: flex;
    align-items: center;
    gap: 22px;
    background: linear-gradient(135deg, var(--ht-paper) 0%, #f0ede0 100%);
    border: 1px solid var(--ht-sage);
    border-left: 5px solid var(--dob-navy);
    border-radius: 4px;
    padding: 20px 24px;
    margin: 0 0 22px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.hero .hero-icon {
    width: 96px;
    height: 96px;
    flex-shrink: 0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.hero .hero-copy { flex: 1; min-width: 0; }
.hero h1 {
    margin: 0 0 6px;
    font: bold 30px Georgia, serif;
    color: var(--dob-navy);
    letter-spacing: -0.5px;
}
.hero .hero-sub {
    margin: 0 0 8px;
    font-size: 15px;
    color: #333;
    line-height: 1.5;
}
.hero .hero-meta {
    font-size: 12.5px;
    color: var(--ht-muted);
}
.hero .hero-meta a {
    color: var(--ht-forest-dark);
    text-decoration: none;
    border-bottom: 1px dotted var(--ht-forest);
}
.hero .hero-meta a:hover {
    border-bottom-style: solid;
    background: rgba(41,115,57,0.06);
}

@media (max-width: 640px) {
    .hero { flex-direction: column; text-align: center; padding: 18px 18px; }
    .hero h1 { font-size: 24px; }
    .hero .hero-icon { width: 72px; height: 72px; }
}

/* ── Flash ────────────────────────────────────────────────────── */
.flash { padding: 0.6rem 0.9rem; border-radius: 4px; margin: 0 0 0.8rem; word-wrap: break-word; }
.flash--info    { background: #d1ecf1; color: #0c5460; }
.flash--success { background: #d4edda; color: #155724; }
.flash--warning { background: #fff3cd; color: #856404; }
.flash--error   { background: #f8d7da; color: #721c24; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
button {
    display: inline-block;
    padding: 0.55rem 1rem;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    line-height: 1.2;
    min-height: 38px;
}
.btn-primary, button.btn-primary { background: var(--dob-navy); color: #fff; }
.btn-primary:hover { background: var(--dob-navy-mid); color: #fff; }
.btn-secondary, button.btn-secondary { background: #6c757d; color: #fff; }
.btn-secondary:hover { background: #5a6268; color: #fff; }
.btn-danger, button.btn-danger { background: var(--dob-red); color: #fff; }
.btn-danger:hover { background: #962d22; color: #fff; }

/* Bare <button> defaults (used inside admin forms) */
button:not([class*="btn"]) {
    background: var(--dob-navy);
    color: #fff;
}

/* ── Forms ────────────────────────────────────────────────────── */
label { display: block; margin-bottom: 0.25rem; font-weight: 600; }
input[type=text],
input[type=email],
input[type=password],
input[type=number],
select,
textarea {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem;
    margin-bottom: 0.8rem;
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    background: #fff;
    color: #222;
    font-family: inherit;
}
@media (min-width: 600px) {
    input[type=text],
    input[type=email],
    input[type=password] { max-width: 360px; }
    input[type=number] { max-width: 8rem; }
}

/* ── Tables: scroll on mobile instead of overflowing the viewport */
.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -0.3rem 0.8rem;
    padding: 0 0.3rem;
}
table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.95rem;
}
th, td {
    border: 1px solid #ddd;
    padding: 0.45rem 0.65rem;
    text-align: left;
    vertical-align: top;
}
th {
    background: var(--dob-navy);
    color: #fff;
    white-space: nowrap;
}
tr:nth-child(even) { background: #f9f9f9; }

@media (max-width: 600px) {
    table { font-size: 0.85rem; }
    th, td { padding: 0.35rem 0.45rem; }
    /* Auto-wrap any table inside main with a scroll shell if it's wide. */
    main > table,
    main .adm-card > table,
    main .panel > table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }
}

/* ── Utility ──────────────────────────────────────────────────── */
.muted { color: var(--ht-muted); }
.num { font-variant-numeric: tabular-nums; }
code {
    background: #eef;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.9em;
    word-break: break-all;
}
.adm-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.adm-actions form { display: inline; }
img { max-width: 100%; height: auto; }

/* ── Site footer (sladěný s hattrick-cz.com) ─────────────────── */
.site-footer {
    text-align: center;
    padding: 22px 20px 26px;
    font-size: 12.5px;
    color: var(--ht-muted);
    border-top: 1px solid rgba(41,115,57,0.15);
    background: rgba(255,255,255,0.5);
    line-height: 1.7;
    font-family: Georgia, serif;
}
.site-footer .foot-main { color: #444; }
.site-footer .foot-main strong { color: var(--dob-navy); }
.site-footer .foot-family {
    font-style: italic;
    margin-top: 4px;
}
.site-footer .foot-family a {
    color: var(--ht-forest-dark);
    text-decoration: none;
    border-bottom: 1px dotted var(--ht-forest);
    padding: 1px 3px;
}
.site-footer .foot-family a:hover {
    border-bottom-style: solid;
    background: rgba(41,115,57,0.06);
}
.site-footer .foot-meta {
    font-size: 11.5px;
    color: #8c8c78;
    margin-top: 6px;
}
.site-footer .sep {
    color: #b0b0a0;
    margin: 0 6px;
}

/* ── Game switcher (segmented pill group v navu) ─────────────
   Vzhled: pilulky vedle sebe, aktivní hra má zlaté pozadí. */
.nav-game-switch-wrap {
    display: inline-flex;
    align-items: stretch;
    align-self: center;
    gap: 2px;
    background: var(--dob-navy-dark);
    border: 1px solid rgba(212, 169, 74, 0.5);
    border-radius: 999px;
    padding: 2px;
    line-height: 1;
}

nav.site-nav .nav-game-pill {
    /* přebíjí obecné "nav.site-nav a" styly */
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: transparent;
    color: #cde;
    font-size: 0.85rem;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    transition: background-color .15s, color .15s;
}

/* U jednotlivých labelu pillů: pokud je short_name krátký, nech ho jak je;
   dlouhé názvy se elegantně ořínou třemi tečkami. */

nav.site-nav .nav-game-pill:hover {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
}

nav.site-nav .nav-game-pill.is-current {
    background: var(--dob-gold);
    color: var(--dob-navy);
    font-weight: 600;
    cursor: default;
}

nav.site-nav .nav-game-pill.is-current:hover {
    background: var(--dob-gold);
    color: var(--dob-navy);
}

/* Značka statusu (▸/+/✓) ─ lehce potlumená */
.nav-game-mark {
    opacity: 0.75;
    font-size: 0.8em;
}

.nav-game-pill.is-current .nav-game-mark {
    opacity: 1;
}

.nav-game-lbl {
    overflow: hidden;
    text-overflow: ellipsis;
}
