/* ============================================================
   design.css – zdieľaný dizajnový systém HobbyTipovačka
   Načítava sa v header.php, platí pre všetky stránky.
   ============================================================ */

/* Schovaj starý header – nové stránky majú vlastný ht-nav */
header.site-header, .topbar { display: none !important; }
.main-content { padding-top: 0 !important; }
body { background: var(--bg, #0d0d14); overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }

:root {
    --bg:       #0d0d14;
    --surface:  #13131f;
    --surface2: #1a1a2e;
    --border:   rgba(255,255,255,0.07);
    --accent:   #6c63ff;
    --accent2:  #a78bfa;
    --gold:     #f59e0b;
    --green:    #22d3a5;
    --red:      #f43f5e;
    --muted:    #5a5a7a;
    --text:     #e2e2f0;
    --subtext:  #8888aa;
}

/* ── NAV ── */
.ht-nav {
    position: sticky; top: 0; z-index: 200;
    background: rgba(13,13,20,0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 16px;
    display: flex; align-items: center; justify-content: space-between;
    height: 52px;
}
@media (min-width: 600px) {
    .ht-nav { padding: 0 24px; height: 56px; }
}
.ht-nav-brand {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700; font-size: 1.05rem; color: var(--text);
    display: flex; align-items: center; gap: 8px; text-decoration: none;
}
.ht-nav-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 10px var(--accent);
}
.ht-nav-links { display: none; gap: 4px; }
@media (min-width: 600px) { .ht-nav-links { display: flex; } }
.ht-nav-link {
    padding: 6px 12px; border-radius: 6px;
    font-size: 0.8rem; font-weight: 500; color: var(--subtext);
    cursor: pointer; border: none; background: none;
    text-decoration: none; transition: all .15s; display: inline-block;
}
.ht-nav-link:hover { color: var(--text); background: var(--surface2); }
.ht-nav-actions { display: flex; align-items: center; gap: 6px; }
.ht-nav-tip-btn { display: none; }
@media (min-width: 600px) { .ht-nav-tip-btn { display: inline-block; } }
.ht-btn-ghost {
    padding: 6px 14px; border-radius: 6px;
    font-size: 0.8rem; font-weight: 500; color: var(--subtext);
    cursor: pointer; border: 1px solid var(--border); background: none;
    text-decoration: none; transition: all .15s; display: inline-block;
}
.ht-btn-ghost:hover { border-color: var(--accent); color: var(--accent2); }
.ht-btn-primary {
    padding: 6px 14px; border-radius: 6px;
    font-size: 0.8rem; font-weight: 600; color: #fff;
    cursor: pointer; border: none;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    text-decoration: none; transition: opacity .15s; display: inline-block;
}
.ht-btn-primary:hover { opacity: .85; color: #fff; }

/* ── HERO ── */
.ht-hero {
    padding: 24px 16px 16px;
    max-width: 1100px; margin: 0 auto;
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 16px;
}
@media (min-width: 600px) {
    .ht-hero { padding: 44px 24px 24px; gap: 20px; }
}
.ht-hero-eyebrow {
    font-size: .7rem; font-weight: 600; letter-spacing: .12em;
    text-transform: uppercase; color: var(--accent2);
    display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
}
.ht-hero-eyebrow::before { content: ''; display: block; width: 20px; height: 1px; background: var(--accent2); }
.ht-hero-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.4rem, 6vw, 2.2rem); font-weight: 700; line-height: 1.1; color: var(--text);
}
.ht-hero-title span {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.ht-hero-sub { color: var(--subtext); font-size: .86rem; margin-top: 8px; }
.ht-hero-right { display: flex; gap: 12px; flex-wrap: wrap; }
.ht-stat-pill {
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 20px; text-align: center; min-width: 86px;
}
.ht-stat-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem; font-weight: 600; line-height: 1; color: var(--text);
}
.ht-stat-val.ac { color: var(--accent2); }
.ht-stat-val.go { color: var(--gold); }
.ht-stat-lbl { font-size: .7rem; color: var(--subtext); margin-top: 4px; }

/* ── LAYOUT ── */
.ht-container { max-width: 1100px; margin: 0 auto; padding: 0 16px 48px; }
@media (min-width: 600px) { .ht-container { padding: 0 24px 48px; } }
.ht-grid2 { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 16px; }
@media (min-width: 700px) { .ht-grid2 { grid-template-columns: 1fr 1fr; } }

/* ── CARD ── */
.ht-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 20px; margin-bottom: 16px;
}
.ht-card-hdr { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.ht-card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600; font-size: .85rem; color: var(--subtext);
    text-transform: uppercase; letter-spacing: .06em;
    display: flex; align-items: center; gap: 8px;
}
.ht-cion {
    width: 28px; height: 28px; border-radius: 7px;
    display: flex; align-items: center; justify-content: center; font-size: .9rem;
}
.ht-cion-p  { background: rgba(108,99,255,.15); }
.ht-cion-g  { background: rgba(245,158,11,.15); }
.ht-cion-gr { background: rgba(34,211,165,.15); }

/* ── CHART ── */
.ht-chart-wrap {
    position: relative; height: 300px; cursor: pointer;
    border-radius: 8px; overflow: hidden;
}
.ht-chart-wrap:hover::after {
    content: '⛶ Rozbaliť';
    position: absolute; top: 8px; right: 8px;
    background: rgba(108,99,255,0.85); color: #fff;
    font-family: 'Space Grotesk', sans-serif; font-size: .75rem; font-weight: 700;
    padding: 4px 10px; border-radius: 6px; pointer-events: none;
}

/* ── SEPARATOR ── */
.ht-sep {
    display: flex; align-items: center; gap: 12px;
    margin: 24px 0 14px; color: var(--muted);
    font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em;
}
.ht-sep::before, .ht-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ── LEADERBOARD ── */
.ht-lb { display: flex; flex-direction: column; gap: 2px; }
.ht-lb-row {
    display: grid;
    grid-template-columns: 28px 32px 1fr auto auto;
    align-items: center; gap: 8px;
    padding: 9px 10px; border-radius: 10px;
    border: 1px solid transparent; transition: all .15s; cursor: default;
    opacity: 0; transform: translateX(-24px);
    position: relative; overflow: visible;
}
.ht-lb-row.visible { opacity: 1; transform: translateX(0); transition: opacity .4s ease, transform .4s ease; }
.ht-lb-row:hover { background: var(--surface2); border-color: var(--border); }
.ht-lb-row.first {
    background: linear-gradient(135deg, rgba(245,158,11,.08), rgba(245,158,11,.02));
    border-color: rgba(245,158,11,.18);
}
.ht-lb-rank {
    font-family: 'JetBrains Mono', monospace;
    font-size: .72rem; font-weight: 600; text-align: center; color: var(--muted);
}
.ht-lb-rank.r1 { color: var(--gold); }
.ht-lb-rank.r2 { color: #94a3b8; }
.ht-lb-rank.r3 { color: #b45309; }
.ht-lb-ava {
    width: 30px; height: 30px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; font-weight: 700; flex-shrink: 0; color: #fff;
}
.ht-lb-name {
    font-weight: 600; font-size: .85rem; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.ht-lb-bar-wrap {
    display: none;
}
.ht-lb-pts {
    font-family: 'JetBrains Mono', monospace;
    font-size: .82rem; font-weight: 600; color: var(--text);
    white-space: nowrap; text-align: right;
}
.ht-lb-pts small { font-size: .6rem; color: var(--muted); margin-left: 2px; }
.ht-badge { font-size: .6rem; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.ht-badge-ok { background: rgba(34,211,165,.12); color: var(--green); }
.ht-badge-no { background: rgba(244,63,94,.1); color: var(--red); }
.ht-lb-row.unpaid { opacity: .55 !important; }
.ht-lb-row.unpaid.visible { opacity: .55; }
.ht-lb-row.unpaid .ht-lb-name,
.ht-lb-row.unpaid .ht-lb-pts { color: var(--muted); }
.ht-sep-unpaid { height: 1px; background: rgba(244,63,94,.15); margin: 6px 0; position: relative; }
.ht-sep-unpaid span {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    background: var(--surface); padding: 0 8px;
    font-size: .6rem; color: var(--red); font-weight: 700;
    text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
}

/* Na širších obrazovkách zobraz progress bar a pridaj stĺpec */
@media (min-width: 600px) {
    .ht-lb-row {
        grid-template-columns: 28px 32px 1fr 2fr auto auto;
        padding: 10px 12px; gap: 12px;
    }
    .ht-lb-bar-wrap {
        display: block;
        height: 4px; background: var(--surface2); border-radius: 2px; overflow: hidden;
    }
    .ht-lb-bar { height: 100%; border-radius: 2px; width: 0%; transition: width .8s cubic-bezier(.4,0,.2,1); }
    .ht-lb-pts { font-size: .83rem; }
    .ht-lb-rank { font-size: .75rem; }
    .ht-lb-ava { width: 32px; height: 32px; font-size: .8rem; }
    .ht-lb-name { font-size: .88rem; }
}

/* ── ALERT ── */
.ht-alert {
    padding: 14px 18px; border-radius: 10px;
    background: rgba(108,99,255,.08); border: 1px solid rgba(108,99,255,.2);
    color: var(--subtext); font-size: .86rem; margin-bottom: 16px;
}
.ht-alert a { color: var(--gold); }

/* ── STATS MODAL ── */
#ht-statsModal {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.75);
    z-index: 3000; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
#ht-statsModal.open { display: flex; }
#ht-statsModalInner {
    background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
    padding: 28px; width: 92vw; max-width: 480px; max-height: 88vh; overflow-y: auto;
    position: relative;
}
#ht-statsModalClose {
    position: absolute; top: 16px; right: 16px; background: rgba(255,255,255,.1);
    border: none; color: #fff; font-size: 1.2rem; width: 36px; height: 36px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s;
}
#ht-statsModalClose:hover { background: rgba(244,63,94,.6); }
.ht-stats-title {
    font-family: 'Space Grotesk', sans-serif; font-size: 1.3rem; font-weight: 700;
    text-transform: uppercase; color: #fff; margin-bottom: 4px; padding-right: 40px;
}
.ht-stats-sub { color: var(--muted); font-size: .82rem; margin-bottom: 20px; }
.ht-stats-row {
    display: grid; grid-template-columns: 28px 1fr auto auto; align-items: center;
    gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border);
}
.ht-stats-row:last-child { border-bottom: none; }
.ht-stats-icon { font-size: 1.1rem; text-align: center; }
.ht-stats-label { font-family: 'Space Grotesk', sans-serif; font-weight: 600; text-transform: uppercase; font-size: .88rem; color: var(--text); }
.ht-stats-my { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.3rem; min-width: 36px; text-align: right; }
.ht-stats-avg { color: var(--muted); font-size: .8rem; min-width: 70px; text-align: right; }
.ht-stats-exact   .ht-stats-my { color: var(--gold); }
.ht-stats-winner  .ht-stats-my { color: var(--green); }
.ht-stats-wrong   .ht-stats-my { color: var(--red); }
.ht-stats-missing .ht-stats-my { color: var(--muted); }
.ht-stats-total {
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(108,99,255,.08); border-radius: 8px; padding: 12px 16px; margin-top: 16px;
}
.ht-stats-total-label { font-size: .82rem; color: var(--muted); }
.ht-stats-total-value { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1.1rem; color: var(--text); }

/* ── CHART MODAL ── */
#ht-chartModal {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.88); z-index: 3000;
    align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
#ht-chartModal.open { display: flex; }
#ht-chartModalInner {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 24px;
    width: 92vw; max-width: 1100px; height: 80vh;
    position: relative; display: flex; flex-direction: column;
}
#ht-chartModalTitle {
    font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; font-weight: 700;
    text-transform: uppercase; color: var(--text); margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
#ht-chartModalTitle::before {
    content: ''; display: inline-block; width: 4px; height: 18px;
    background: var(--accent); border-radius: 2px;
}
#ht-chartModalCanvasWrap { flex: 1; position: relative; }
#ht-closeModal {
    position: absolute; top: 16px; right: 16px;
    background: rgba(255,255,255,.1); border: none; color: #fff;
    font-size: 1.1rem; width: 36px; height: 36px; border-radius: 50%;
    cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .2s;
}
#ht-closeModal:hover { background: rgba(244,63,94,.6); }

/* ── FIREWORKS ── */
.ht-fw-particle {
    position: absolute; top: 50%; left: 50%;
    width: 6px; height: 6px; border-radius: 50%;
    pointer-events: none; opacity: 0;
}
@keyframes htFwBurst {
    0%   { transform: translate(-50%,-50%) scale(0.3); opacity: 1; }
    70%  { opacity: 1; }
    100% { transform: translate(var(--fw-x), var(--fw-y)) scale(0.4); opacity: 0; }
}
.ht-fw-particle.firing { animation: htFwBurst 1.6s ease-out forwards; }

/* ── MATCH CARDS ── */
.ht-match-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 700px) { .ht-match-grid { grid-template-columns: 1fr 1fr; } }
.ht-mcard {
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 12px; padding: 14px 16px; transition: border-color .15s;
}
.ht-mcard:hover { border-color: rgba(108,99,255,.3); }
.ht-mcard.played   { border-left: 3px solid var(--green); }
.ht-mcard.upcoming { border-left: 3px solid var(--accent); }
.ht-mmeta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ht-mdate { font-size: .7rem; color: var(--muted); }
.ht-mpill { font-size: .62rem; font-weight: 700; text-transform: uppercase; padding: 2px 7px; border-radius: 20px; letter-spacing: .06em; }
.ht-mpill.done     { background: rgba(34,211,165,.1); color: var(--green); }
.ht-mpill.upcoming { background: rgba(108,99,255,.1);  color: var(--accent2); }
.ht-mteams { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ht-mteam { display: flex; align-items: center; gap: 6px; font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: .86rem; flex: 1; }
.ht-mteam.r { justify-content: flex-end; }
.ht-mscore { font-family: 'JetBrains Mono', monospace; font-size: 1.15rem; font-weight: 700; color: var(--gold); padding: 0 10px; background: rgba(245,158,11,.08); border-radius: 6px; line-height: 2; }
.ht-mscore.tbd { color: var(--muted); font-size: .85rem; }
.ht-tdiv { height: 1px; background: var(--border); margin: 10px 0 8px; }
.ht-trow { display: flex; align-items: center; justify-content: space-between; padding: 4px 0; font-size: .8rem; }
.ht-tname { color: var(--subtext); font-weight: 500; }
.ht-tscore { font-family: 'JetBrains Mono', monospace; font-weight: 600; font-size: .8rem; }
.ht-t-exact { color: var(--gold); }
.ht-t-win   { color: var(--green); }
.ht-t-wrong { color: var(--red); }
.ht-t-pend  { color: var(--muted); }
.ht-tpts { font-size: .62rem; margin-left: 4px; padding: 1px 4px; border-radius: 3px; }
.ht-p3 { background: rgba(245,158,11,.15); color: var(--gold); }
.ht-p1 { background: rgba(34,211,165,.12); color: var(--green); }
.ht-p0 { background: rgba(244,63,94,.1);   color: var(--red); }

/* ── TAB BAR ── */
.ht-tab-bar {
    display: flex; gap: 3px; background: var(--surface2);
    border-radius: 8px; padding: 3px; border: 1px solid var(--border); width: fit-content;
}
.ht-tab {
    padding: 5px 13px; border-radius: 5px;
    font-size: .75rem; font-weight: 600; cursor: pointer;
    color: var(--muted); border: none; background: none; transition: all .15s;
}
.ht-tab.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.3); }

/* ── BACK LINK ── */
.ht-back {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .82rem; color: var(--muted); text-decoration: none;
    transition: color .15s; margin-bottom: 4px;
}
.ht-back:hover { color: var(--accent2); }