/* ─── Hockey refresh — BETA ──────────────────────────────────────────
   Loaded only while the beta is on (Hockey Admin → Beta features).
   Everything is scoped under .hkb-scope; rink styling applies to
   .hkb-hockey (hockey pages). Delete this file with
   includes/hockey_beta.php and assets/hockey-beta.js to remove the beta. */

.hkb-scope {
    --hkb-ice: #dcecff;
    --hkb-red: #e23b3b;
    --hkb-blue: #2f7fe0;
    --hkb-line-red: rgba(226, 59, 59, 0.85);
    --hkb-line-blue: rgba(47, 127, 224, 0.85);
    --hkb-track: #232a33;
    --hkb-surface: var(--bg-card);
    --hkb-glow: rgba(120, 180, 255, 0.10);
    --hkb-accent: #7cc4ff;
    --hkb-display: 'Oswald', 'Inter', sans-serif;
    --hkb-led: 'Orbitron', 'Oswald', monospace;
}

/* Seasonal themes: swap the accent + glow, add a small motif. */
.hkb-scope[data-hkb-theme="halloween"] { --hkb-accent: #ff8a2a; --hkb-glow: rgba(255, 122, 26, 0.10); --hkb-red: #ff6a1a; }
.hkb-scope[data-hkb-theme="winter"] { --hkb-accent: #a9dcff; --hkb-glow: rgba(190, 225, 255, 0.14); }
.hkb-scope[data-hkb-theme="playoffs"] { --hkb-accent: #f5c542; --hkb-glow: rgba(245, 197, 66, 0.10); }
.hkb-scope[data-hkb-theme="civbowl"] { --hkb-accent: #c084fc; --hkb-glow: rgba(192, 132, 252, 0.10); }

/* ─── Rink backdrop on hockey pages ───────────────────────────────── */

body:has(.hkb-hockey) {
    background:
        radial-gradient(1200px 520px at 50% -120px, var(--hkb-glow, rgba(120,180,255,.1)), transparent 70%),
        linear-gradient(180deg, #0c1117 0%, var(--bg) 480px);
}
body:has(.hkb-hockey[data-hkb-theme="winter"])::before {
    content: '';
    position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35;
    background-image:
        radial-gradient(2px 2px at 20% 30%, #fff, transparent 60%),
        radial-gradient(1.5px 1.5px at 70% 10%, #fff, transparent 60%),
        radial-gradient(2px 2px at 85% 60%, #fff, transparent 60%),
        radial-gradient(1.5px 1.5px at 40% 80%, #fff, transparent 60%),
        radial-gradient(1px 1px at 55% 45%, #fff, transparent 60%);
    background-size: 340px 340px;
    animation: hkb-snow 18s linear infinite;
}
@keyframes hkb-snow { to { background-position: 0 340px; } }
@media (prefers-reduced-motion: reduce) { body:has(.hkb-hockey)::before { animation: none; } }

.hkb-hockey { position: relative; z-index: 1; }
.hkb-hockey h1,
.hkb-hockey .section-head h2,
.hkb-hockey .page-header h1 {
    font-family: var(--hkb-display);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-weight: 600;
}
.hkb-hockey h1 { font-size: 1.9rem; }
.hkb-hockey .section-head h2 {
    font-size: 1.15rem;
    display: flex; align-items: center; gap: .5rem;
}
/* Red goal-line tick before every section heading, blue line under the head. */
.hkb-hockey .section-head h2::before {
    content: '';
    width: 4px; height: 1.05em; border-radius: 2px;
    background: linear-gradient(180deg, var(--hkb-red), color-mix(in srgb, var(--hkb-red) 60%, transparent));
    flex-shrink: 0;
}
.hkb-hockey .section-head:not(.section-head-stack) {
    padding-bottom: .45rem;
    border-bottom: 1px solid color-mix(in srgb, var(--hkb-blue) 35%, var(--border));
}
.hkb-hockey .section-head-stack h2 { margin-bottom: .1rem; }

/* Tabs read like a scoreboard strip. */
.hkb-hockey .tabs {
    background: linear-gradient(180deg, #121820, #0f141a);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 .35rem;
    position: relative;
    scrollbar-width: none;
}
.hkb-hockey .tabs::-webkit-scrollbar { display: none; }
.hkb-hockey .tabs::after {
    content: '';
    position: absolute; left: 12px; right: 12px; bottom: 0; height: 1px; pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--hkb-line-blue) 20%, var(--hkb-line-red) 50%, var(--hkb-line-blue) 80%, transparent);
    opacity: .6;
}
.hkb-hockey .tab {
    font-family: var(--hkb-display);
    text-transform: uppercase;
    letter-spacing: .05em;
    font-size: .82rem;
    font-weight: 500;
}
.hkb-hockey .tab.active { color: var(--hkb-ice); border-bottom-color: var(--hkb-red); }

/* Hero: faceoff circle watermark. */
.hkb-hockey .hero { position: relative; overflow: hidden; }
.hkb-hockey .hero::before {
    content: '';
    position: absolute; right: -60px; top: 50%; width: 260px; height: 260px; transform: translateY(-50%);
    border-radius: 50%;
    border: 3px solid rgba(226, 59, 59, 0.16);
    box-shadow: inset 0 0 0 46px transparent, 0 0 0 0 transparent;
    background:
        radial-gradient(circle at center, rgba(226,59,59,.22) 0 9px, transparent 10px),
        linear-gradient(90deg, transparent calc(50% - 1px), rgba(226,59,59,.12) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px));
    pointer-events: none;
}
.hkb-hockey .hero > * { position: relative; z-index: 1; }
.hkb-hockey .hero-kicker { color: var(--hkb-accent); }
.hkb-hockey .hero.team-hero { border-color: color-mix(in srgb, var(--team-primary, #4a90d9) 45%, var(--border)); }

.hkb-hockey .card { border-color: #222a34; }
.hkb-hockey .stat-tile-num,
.hkb-hockey .pos-num { font-family: var(--hkb-display); }

/* Team colours on directory cards. */
.hkb-hockey .team-directory-card { position: relative; overflow: hidden; }
.hkb-hockey .team-directory-card::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
    background: linear-gradient(180deg, var(--team, var(--hkb-blue)), color-mix(in srgb, var(--team, var(--hkb-blue)) 30%, transparent));
}
.hkb-hockey .team-directory-card:hover { border-color: color-mix(in srgb, var(--team, var(--hkb-blue)) 55%, var(--border)); }

/* ─── Shared bits ─────────────────────────────────────────────────── */

.hkb-muted { color: var(--text-muted); font-size: .8rem; }
.hkb-crest { width: 34px; height: 34px; object-fit: contain; flex-shrink: 0; }
.hkb-crest-fallback {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-elevated); color: var(--text-secondary);
    border-radius: 8px; font-weight: 800; font-size: .72rem; text-transform: uppercase;
}
.hkb-chip {
    display: inline-flex; align-items: center; gap: .3rem;
    padding: .18rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600;
    background: var(--bg-elevated); border: 1px solid var(--border); color: var(--text-secondary);
}
.hkb-chip-gold { border-color: rgba(224,177,58,.45); color: #f1d07a; background: rgba(224,177,58,.08); }
.hkb-key { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.hkb-tip {
    position: fixed; z-index: 1000; pointer-events: none;
    background: #0b0f14; color: var(--text); border: 1px solid var(--border-light);
    border-radius: 8px; padding: .4rem .6rem; font-size: .78rem; font-weight: 600;
    box-shadow: var(--shadow); max-width: 280px; line-height: 1.35;
    opacity: 0; transform: translateY(4px); transition: opacity .1s, transform .1s;
}
.hkb-tip.is-on { opacity: 1; transform: none; }

/* ─── 1. Scores ticker ────────────────────────────────────────────── */

.hkb-ticker {
    display: flex; align-items: stretch;
    background: linear-gradient(180deg, #121821, #0d1218);
    border: 1px solid #222b36;
    border-radius: 14px;
    margin: -.5rem 0 1.25rem;
    overflow: hidden;
    position: relative;
}
.hkb-ticker::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
    background: linear-gradient(90deg, var(--hkb-blue), var(--hkb-red) 50%, var(--hkb-blue));
    opacity: .55;
}
.hkb-ticker-label {
    display: flex; flex-direction: column; justify-content: center; align-items: center; gap: .1rem;
    padding: 0 .9rem;
    font-family: var(--hkb-display); text-transform: uppercase; letter-spacing: .08em; font-size: .78rem;
    color: var(--hkb-ice);
    border-right: 1px solid #222b36;
    background: rgba(255,255,255,.02);
    flex-shrink: 0;
}
.hkb-ticker-label span { font-size: 1.05rem; }
.hkb-ticker-nav {
    flex-shrink: 0; width: 30px; border: 0; background: transparent; color: var(--text-muted);
    font-size: 1.3rem; cursor: pointer;
}
.hkb-ticker-nav:hover { color: var(--text); background: rgba(255,255,255,.04); }
.hkb-ticker-track {
    display: flex; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; flex: 1;
    scroll-snap-type: x proximity;
}
.hkb-ticker-track::-webkit-scrollbar { display: none; }
.hkb-tick {
    flex: 0 0 158px; scroll-snap-align: start;
    padding: .5rem .7rem .55rem;
    border-right: 1px solid #1d242e;
    display: flex; flex-direction: column; gap: .18rem;
    transition: background .15s;
}
.hkb-tick:hover { background: rgba(255,255,255,.035); }
.hkb-tick-head { display: flex; justify-content: space-between; align-items: center; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: .1rem; }
.hkb-tick-comp { color: var(--hkb-accent); }
.hkb-tick-final .hkb-tick-state { color: var(--text-secondary); }
.hkb-tick-live .hkb-tick-state { color: var(--hkb-red); }
.hkb-tick-row { display: flex; align-items: center; gap: .4rem; font-size: .84rem; color: var(--text-secondary); }
.hkb-tick-row::before { content: ''; width: 3px; height: 14px; border-radius: 2px; background: var(--team); opacity: .9; }
.hkb-tick-crest { width: 16px; height: 16px; object-fit: contain; font-size: .5rem; border-radius: 4px; }
.hkb-tick-abbr { font-family: var(--hkb-display); font-weight: 600; letter-spacing: .04em; flex: 1; }
.hkb-tick-score { font-family: var(--hkb-led); font-weight: 700; font-size: .82rem; min-width: 1ch; text-align: right; }
.hkb-tick-row.is-win { color: var(--text); }
.hkb-tick-row.is-win .hkb-tick-score { color: var(--hkb-ice); }
.hkb-tick-star { display: flex; align-items: center; gap: .3rem; margin-top: .15rem; font-size: .68rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; }
.hkb-tick-star > span:first-child { color: #f1c94a; }
.hkb-tick-star img { width: 14px; height: 14px; border-radius: 3px; image-rendering: pixelated; }
.hkb-tick-star span:last-child { overflow: hidden; text-overflow: ellipsis; }
.hkb-tick-preview { color: var(--hkb-accent); font-weight: 600; }
.hkb-tick-upcoming .hkb-tick-state { color: var(--text-secondary); }

@media (max-width: 640px) {
    .hkb-ticker { margin-top: -.75rem; }
    .hkb-ticker-label { padding: 0 .55rem; font-size: .66rem; }
    .hkb-ticker-nav { display: none; }
    .hkb-tick { flex-basis: 140px; }
}

/* ─── 3. Scoreboard header ────────────────────────────────────────── */

.hkb-scoreboard {
    position: relative; overflow: hidden;
    border-radius: 18px;
    border: 1px solid #253040;
    background:
        linear-gradient(90deg, color-mix(in srgb, var(--home) 34%, transparent) 0%, transparent 38%, transparent 62%, color-mix(in srgb, var(--away) 34%, transparent) 100%),
        linear-gradient(180deg, #141b25, #0d1219);
    padding: 1rem 1.25rem 1.1rem;
    margin-bottom: 1.25rem;
}
.hkb-scoreboard::before {
    /* centre red line + faceoff circle */
    content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-50%);
    background: linear-gradient(180deg, transparent, rgba(226,59,59,.35) 20%, rgba(226,59,59,.35) 80%, transparent);
}
.hkb-scoreboard::after {
    content: ''; position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; transform: translate(-50%, -50%);
    border: 2px solid rgba(47,127,224,.16); border-radius: 50%; pointer-events: none;
}
.hkb-scoreboard > * { position: relative; z-index: 1; }
.hkb-sb-top {
    display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: .45rem;
    font-size: .74rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em;
}
.hkb-sb-top img { height: 18px; max-width: 60px; object-fit: contain; }
.hkb-dot { opacity: .5; }
.hkb-rivalry-tag { color: #ffb38a; background: rgba(255,120,60,.12); border: 1px solid rgba(255,120,60,.35); border-radius: 999px; padding: .1rem .5rem; text-transform: none; letter-spacing: 0; }
.hkb-sb-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin-top: .9rem; }
.hkb-sb-team { display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; min-width: 0; }
.hkb-sb-side { font-size: .62rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.hkb-sb-crest { width: 84px; height: 84px; object-fit: contain; filter: drop-shadow(0 6px 18px rgba(0,0,0,.45)); }
.hkb-sb-crest.hkb-crest-fallback { font-size: 1.4rem; border-radius: 16px; border: 2px solid var(--team); }
.hkb-sb-name { font-family: var(--hkb-display); font-size: 1.25rem; font-weight: 600; text-transform: uppercase; line-height: 1.1; letter-spacing: .02em; }
.hkb-sb-record { font-size: .74rem; color: var(--text-muted); font-weight: 600; }
.hkb-sb-team:hover .hkb-sb-name { color: var(--hkb-ice); }
.hkb-sb-center { display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.hkb-sb-state {
    font-family: var(--hkb-display); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600;
    color: var(--text-secondary); padding: .15rem .65rem; border-radius: 6px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.06);
    display: inline-flex; align-items: center; gap: .4rem;
}
.hkb-state-live { color: #ff7a7a; border-color: rgba(226,59,59,.4); background: rgba(226,59,59,.1); }
.hkb-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hkb-red); animation: hkb-pulse 1.4s ease-in-out infinite; }
@keyframes hkb-pulse { 50% { opacity: .3; } }
.hkb-sb-score {
    display: flex; align-items: center; gap: .3rem;
    font-family: var(--hkb-led); font-weight: 900; font-size: 3.4rem; line-height: 1;
    color: #ffd35a;
    background: #07090c; border: 1px solid #1d232c; border-radius: 12px; padding: .45rem .9rem;
    text-shadow: 0 0 14px rgba(255, 196, 64, .45);
    box-shadow: inset 0 0 22px rgba(0,0,0,.8);
}
.hkb-sb-colon { opacity: .55; font-size: .7em; }
.hkb-sb-vs { font-size: 1.8rem; color: var(--text-muted); text-shadow: none; }
.hkb-sb-countdown { font-family: var(--hkb-led); font-size: .78rem; color: var(--hkb-accent); letter-spacing: .06em; min-height: 1em; }
.hkb-linescore-wrap { display: flex; flex-direction: column; align-items: center; margin-top: 1rem; }
.hkb-linescore { width: auto !important; min-width: 0 !important; border-collapse: collapse; font-size: .84rem; background: rgba(0,0,0,.28); border-radius: 10px; overflow: hidden; }
.hkb-linescore th, .hkb-linescore td { padding: .32rem .75rem; text-align: center; border: 0; }
.hkb-linescore thead th { font-size: .66rem; font-weight: 700; color: var(--text-muted); letter-spacing: .08em; background: rgba(255,255,255,.03); }
.hkb-linescore tbody th { text-align: left; font-family: var(--hkb-display); font-weight: 600; letter-spacing: .04em; display: flex; align-items: center; gap: .4rem; }
.hkb-linescore td { font-family: var(--hkb-led); font-weight: 700; color: var(--text-secondary); }
.hkb-linescore tbody tr + tr { border-top: 1px solid rgba(255,255,255,.05); }
.hkb-ls-total { color: var(--text) !important; background: rgba(255,255,255,.04); }
.hkb-ls-swatch { width: 8px; height: 8px; border-radius: 2px; }
.hkb-ls-note { font-size: .7rem; color: var(--text-muted); margin-top: .35rem; }
.hkb-sb-scorers { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 1rem; font-size: .84rem; }
.hkb-sb-scorers-col { display: flex; flex-direction: column; gap: .15rem; }
.hkb-sb-scorers-home { align-items: flex-end; text-align: right; }
.hkb-sb-scorers-col > div { display: flex; align-items: center; gap: .35rem; }
.hkb-sb-scorers-home > div { justify-content: flex-end; }
.hkb-sb-scorers-home .hkb-goal-light { order: 2; }
.hkb-goal-light { width: 7px; height: 7px; border-radius: 50%; background: var(--hkb-red); box-shadow: 0 0 6px var(--hkb-red); }
.hkb-sb-actions { margin-top: 1.1rem; display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }

@media (max-width: 640px) {
    .hkb-scoreboard { padding: .85rem .7rem 1rem; }
    .hkb-sb-main { gap: .5rem; }
    .hkb-sb-crest { width: 54px; height: 54px; }
    .hkb-sb-name { font-size: .9rem; }
    .hkb-sb-score { font-size: 2.1rem; padding: .35rem .55rem; }
    .hkb-sb-scorers { gap: .6rem; font-size: .76rem; }
    .hkb-scoreboard::after { width: 140px; height: 140px; }
}

/* ─── 8 / 9. Preview + head-to-head ───────────────────────────────── */

.hkb-preview-card { padding: 1rem 1.1rem; }
.hkb-preview-teams { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.hkb-preview-team { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.hkb-preview-team strong { display: block; font-family: var(--hkb-display); text-transform: uppercase; font-weight: 600; font-size: 1rem; letter-spacing: .02em; }
.hkb-preview-team-away { text-align: right; }
.hkb-preview-team-away .hkb-form { justify-content: flex-end; }
.hkb-form { display: flex; gap: 3px; margin-top: .25rem; }
.hkb-form-pill {
    min-width: 22px; height: 20px; padding: 0 4px; border-radius: 5px; font-size: .64rem; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent;
}
.hkb-form-w { background: rgba(56,217,122,.16); color: var(--green); border-color: rgba(56,217,122,.3); }
.hkb-form-otw { background: rgba(56,217,122,.08); color: var(--green); border-color: rgba(56,217,122,.45); border-style: dashed; }
.hkb-form-l { background: rgba(240,96,92,.14); color: var(--red); border-color: rgba(240,96,92,.3); }
.hkb-form-otl { background: rgba(224,177,58,.12); color: var(--yellow); border-color: rgba(224,177,58,.35); }
.hkb-form-d { background: var(--bg-elevated); color: var(--text-muted); }
.hkb-preview-h2h { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--border); }
.hkb-preview-h2h-head { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--text-muted); margin-bottom: .45rem; }
.hkb-preview-h2h-head strong { font-family: var(--hkb-led); font-size: 1.2rem; color: var(--text); }
.hkb-preview-last { display: block; text-align: center; margin-top: .55rem; font-size: .8rem; color: var(--text-secondary); }
.hkb-preview-last:hover { color: var(--text); }
.hkb-h2h-split { display: flex; gap: 2px; height: 10px; border-radius: 6px; overflow: hidden; background: var(--hkb-track); }
.hkb-h2h-seg { display: block; height: 100%; }
.hkb-h2h-home { background: var(--hkb-split-left, #3987e5); border-radius: 4px 0 0 4px; }
.hkb-h2h-away { background: var(--hkb-split-right, #e66767); border-radius: 0 4px 4px 0; }
.hkb-h2h-draw { background: #5b6472; }
.hkb-watch { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--border); }
.hkb-watch-title, .hkb-ms-title { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: .5rem; }
.hkb-watch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.hkb-watch-col { display: flex; flex-direction: column; gap: .4rem; }
.hkb-watch-away .hkb-watch-player { flex-direction: row-reverse; text-align: right; }
.hkb-watch-player { display: flex; align-items: center; gap: .55rem; padding: .35rem .45rem; border-radius: 10px; }
.hkb-watch-player:hover { background: var(--bg-hover); }
.hkb-watch-player img { width: 32px; height: 32px; border-radius: 7px; image-rendering: pixelated; }
.hkb-watch-player strong, .hkb-watch-row strong { display: block; font-size: .86rem; }
.hkb-watch-player small, .hkb-watch-row small { display: block; color: var(--text-muted); font-size: .74rem; }

.hkb-h2h-card { padding: 1rem 1.1rem; }
.hkb-h2h-totals { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .75rem; margin-bottom: .7rem; }
.hkb-h2h-totals > div { display: flex; align-items: center; gap: .55rem; font-family: var(--hkb-display); text-transform: uppercase; font-weight: 600; min-width: 0; }
.hkb-h2h-totals .hkb-h2h-totals-away { justify-content: flex-end; text-align: right; }
.hkb-h2h-big { justify-content: center; gap: .65rem !important; }
.hkb-h2h-big span { font-family: var(--hkb-led); font-size: 1.8rem; font-weight: 900; color: var(--text); }
.hkb-h2h-big small { font-size: .62rem; letter-spacing: .1em; color: var(--text-muted); }
.hkb-h2h-sub { display: flex; justify-content: space-between; font-size: .76rem; color: var(--text-muted); margin-top: .45rem; }
.hkb-meetings { display: flex; flex-direction: column; gap: .35rem; margin-top: .6rem; }
.hkb-meeting {
    display: grid; grid-template-columns: 110px 1fr auto 1fr 74px; align-items: center; gap: .6rem;
    padding: .5rem .8rem; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border); font-size: .84rem;
}
.hkb-meeting:hover { border-color: var(--border-light); background: var(--bg-hover); }
.hkb-meeting.is-current { border-color: color-mix(in srgb, var(--hkb-accent) 50%, var(--border)); }
.hkb-meeting-date { font-size: .76rem; color: var(--text-secondary); line-height: 1.2; }
.hkb-meeting-date small { display: block; color: var(--text-muted); font-size: .68rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hkb-meeting-team { color: var(--text-secondary); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hkb-meeting-away { text-align: left; }
.hkb-meeting-team.is-win { color: var(--text); font-weight: 700; }
.hkb-meeting-score { font-family: var(--hkb-led); font-weight: 700; background: #07090c; border-radius: 6px; padding: .12rem .5rem; text-align: center; color: #ffd35a; }
.hkb-meeting-score small { display: block; font-size: .55rem; color: var(--text-muted); font-family: 'Inter', sans-serif; }
.hkb-meeting-tag { font-size: .68rem; color: var(--hkb-accent); text-align: right; font-weight: 700; }
.hkb-meeting-more { display: none; }
.hkb-meetings.is-open .hkb-meeting-more { display: grid; }
.hkb-meetings-toggle { align-self: center; margin-top: .25rem; }
.hkb-meetings.is-open .hkb-meetings-toggle { display: none; }
@media (max-width: 640px) {
    .hkb-meeting { grid-template-columns: 1fr auto 1fr; }
    .hkb-meeting-date, .hkb-meeting-tag { display: none; }
    .hkb-watch-grid { grid-template-columns: 1fr; }
    .hkb-watch-away .hkb-watch-player { flex-direction: row; text-align: left; }
    .hkb-preview-teams { flex-direction: column; }
    .hkb-preview-team-away { flex-direction: row-reverse; justify-content: flex-end; text-align: left; }
    .hkb-preview-team-away .hkb-form { justify-content: flex-start; }
}

/* ─── 10. Player card ─────────────────────────────────────────────── */

.hkb-player-top { display: grid; grid-template-columns: 300px 1fr; gap: 1.25rem; align-items: start; margin-bottom: 1.5rem; }
.hkb-player-top.hkb-player-top-solo { grid-template-columns: minmax(0, 300px); } /* milestone watch off: just the card */
@media (max-width: 760px) { .hkb-player-top { grid-template-columns: 1fr; } .hkb-pcard-wrap { max-width: 320px; margin: 0 auto; } }
.hkb-pcard-wrap { display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.hkb-pcard {
    position: relative; width: 100%; max-width: 300px; aspect-ratio: 5 / 7.4;
    border-radius: 18px; overflow: hidden; isolation: isolate;
    padding: .9rem .95rem .85rem;
    display: flex; flex-direction: column;
    background:
        radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--c1) 85%, #fff 0%) 0%, transparent 70%),
        linear-gradient(160deg, color-mix(in srgb, var(--c1) 90%, #000) 0%, #0d1117 72%);
    border: 2px solid color-mix(in srgb, var(--c2) 55%, transparent);
    box-shadow: 0 18px 40px rgba(0,0,0,.5), inset 0 0 0 4px rgba(0,0,0,.25);
    transition: transform .25s ease;
    transform-style: preserve-3d;
}
.hkb-pcard::before {
    /* rink lines behind the skin */
    content: ''; position: absolute; inset: 0; z-index: -1; opacity: .18;
    background:
        linear-gradient(0deg, transparent 47%, var(--c2) 47% 48.5%, transparent 48.5%),
        radial-gradient(circle at 50% 47.7%, transparent 0 58px, var(--c2) 59px 61px, transparent 62px);
}
.hkb-tier-gold { border-color: #e2b74a; box-shadow: 0 18px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(226,183,74,.4), 0 0 26px rgba(226,183,74,.18); }
.hkb-tier-legend { border-color: #f4d27a; box-shadow: 0 18px 40px rgba(0,0,0,.5), 0 0 30px rgba(244,210,122,.28); }
.hkb-tier-silver { border-color: #b9c3cf; }
.hkb-pcard-shine {
    position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; mix-blend-mode: screen;
    background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.28) 45%, rgba(160,220,255,.25) 52%, transparent 66%);
    background-size: 250% 250%; background-position: var(--shine-x, 50%) 50%;
    transition: opacity .2s;
}
.hkb-pcard:hover .hkb-pcard-shine { opacity: 1; }
.hkb-tier-gold .hkb-pcard-shine, .hkb-tier-legend .hkb-pcard-shine { opacity: .35; }
.hkb-pcard-top { display: flex; align-items: center; gap: .5rem; }
.hkb-pcard-num { font-family: var(--hkb-led); font-weight: 900; font-size: 1.6rem; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.hkb-pcard-pos { flex: 1; font-family: var(--hkb-display); font-weight: 600; letter-spacing: .1em; font-size: .78rem; color: var(--c2); }
.hkb-pcard-crest { width: 36px; height: 36px; object-fit: contain; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
.hkb-pcard-crest.hkb-crest-fallback { background: rgba(0,0,0,.35); color: #fff; }
.hkb-pcard-art { flex: 1; display: flex; align-items: flex-end; justify-content: center; min-height: 0; padding-top: .3rem; }
.hkb-pcard-art img { max-height: 100%; max-width: 72%; image-rendering: pixelated; filter: drop-shadow(0 10px 14px rgba(0,0,0,.55)); }
.hkb-pcard-name {
    margin-top: .45rem; text-align: center;
    font-family: var(--hkb-display); font-weight: 700; text-transform: uppercase; font-size: 1.35rem; letter-spacing: .03em; line-height: 1.05;
    color: #fff; word-break: break-word;
}
.hkb-pcard-team { text-align: center; font-size: .72rem; color: rgba(255,255,255,.7); margin-top: .1rem; }
.hkb-pcard-stats {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; margin-top: .6rem;
    background: rgba(0,0,0,.35); border-radius: 10px; overflow: hidden;
}
.hkb-pcard-stats div { display: flex; flex-direction: column; align-items: center; padding: .35rem 0; background: rgba(255,255,255,.03); }
.hkb-pcard-stats strong { font-family: var(--hkb-led); font-size: 1rem; color: #fff; }
.hkb-pcard-stats span { font-size: .58rem; font-weight: 700; letter-spacing: .08em; color: rgba(255,255,255,.6); }
.hkb-pcard-foot { display: flex; gap: .5rem; justify-content: space-between; align-items: center; margin-top: .5rem; font-size: .64rem; color: rgba(255,255,255,.65); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.hkb-pcard-tier { color: #f1d07a; }
.hkb-pcard-actions { display: flex; align-items: center; gap: .6rem; }

/* ─── 11. Career timeline ─────────────────────────────────────────── */

.hkb-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.hkb-timeline::before { content: ''; position: absolute; left: 21px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(180deg, var(--hkb-line-blue), var(--hkb-line-red)); opacity: .45; }
.hkb-tl-item { display: grid; grid-template-columns: 44px 1fr; gap: .8rem; position: relative; }
.hkb-tl-item + .hkb-tl-item { margin-top: .75rem; }
.hkb-tl-node { display: flex; justify-content: center; padding-top: .55rem; }
.hkb-tl-crest {
    width: 40px; height: 40px; object-fit: contain; background: var(--bg-card); border: 2px solid var(--team); border-radius: 50%; padding: 4px;
    position: relative; z-index: 1;
}
.hkb-tl-crest.hkb-crest-fallback { border-radius: 50%; color: var(--text); }
.hkb-tl-body { padding: .75rem .9rem; border-left: 3px solid var(--team); }
.hkb-tl-season { font-family: var(--hkb-display); text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; color: var(--hkb-accent); margin-bottom: .3rem; }
.hkb-tl-spell { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .6rem; padding: .2rem 0; }
.hkb-tl-team { font-weight: 700; }
.hkb-tl-stats { font-size: .8rem; color: var(--text-secondary); margin-left: auto; }
.hkb-tl-stats b { color: var(--text); font-family: var(--hkb-display); font-weight: 600; }
.hkb-tl-transfer { font-size: .8rem; color: var(--text-secondary); padding: .15rem 0 .3rem; }
.hkb-tl-transfer a { color: var(--text); font-weight: 600; }
.hkb-tl-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .45rem; }
@media (max-width: 640px) { .hkb-tl-stats { margin-left: 0; width: 100%; } }

/* ─── 12. Milestones & streaks ────────────────────────────────────── */

.hkb-ms { display: flex; flex-direction: column; gap: 1rem; }
.hkb-ms > div { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .9rem 1rem; }
.hkb-streak { display: flex; align-items: center; gap: .7rem; }
.hkb-streak strong { display: block; font-family: var(--hkb-display); text-transform: uppercase; letter-spacing: .02em; font-size: 1.05rem; font-weight: 600; }
.hkb-streak small { color: var(--text-muted); font-size: .78rem; }
.hkb-streak-icon { font-size: 1.6rem; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--bg-elevated); }
.hkb-streak-hot .hkb-streak-icon { background: rgba(255,120,40,.14); box-shadow: 0 0 18px rgba(255,120,40,.18); }
.hkb-streak-cold .hkb-streak-icon { background: rgba(120,190,255,.12); }
.hkb-streak-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .8rem; }
.hkb-streak-stats div { text-align: center; padding: .45rem .3rem; border-radius: 10px; background: var(--bg-elevated); }
.hkb-streak-stats strong { display: block; font-family: var(--hkb-led); font-size: 1.1rem; }
.hkb-streak-stats span { font-size: .66rem; color: var(--text-muted); }
.hkb-ms-row { display: flex; align-items: center; gap: .6rem; padding: .3rem 0; }
.hkb-ms-icon { width: 28px; text-align: center; font-size: 1.05rem; flex-shrink: 0; }
.hkb-ms-info { flex: 1; min-width: 0; }
.hkb-ms-label { display: flex; justify-content: space-between; gap: .5rem; font-size: .84rem; font-weight: 600; margin-bottom: .25rem; }
.hkb-meter { height: 7px; border-radius: 4px; background: rgba(57,135,229,.18); overflow: hidden; }
.hkb-meter span { display: block; height: 100%; border-radius: 4px; background: #3987e5; }
.hkb-ms-done-row { display: flex; align-items: center; gap: .6rem; padding: .35rem .25rem; border-radius: 8px; }
.hkb-ms-done-row:hover { background: var(--bg-hover); }
.hkb-ms-done-row strong { display: block; font-size: .84rem; }
.hkb-ms-done-row small { display: block; font-size: .74rem; color: var(--text-muted); }
.hkb-watchlist { padding: .85rem 1rem; }
.hkb-watchlist .hkb-ms-title:not(:first-child) { margin-top: .8rem; }
.hkb-watch-row { display: flex; align-items: center; gap: .55rem; padding: .3rem .25rem; border-radius: 8px; }
.hkb-watch-row:hover { background: var(--bg-hover); }
.hkb-watch-row img { width: 28px; height: 28px; border-radius: 6px; image-rendering: pixelated; }

/* ─── Charts ──────────────────────────────────────────────────────── */

.hkb-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 860px) { .hkb-chart-grid { grid-template-columns: 1fr; } }
.hkb-chart-card { background: var(--bg-card); border: 1px solid #222a34; border-radius: var(--radius-lg); padding: 1rem 1.1rem 1.1rem; min-width: 0; }
.hkb-chart-card.is-wide { grid-column: 1 / -1; }
.hkb-chart-card header { margin-bottom: .75rem; }
.hkb-chart-card h3 { font-family: var(--hkb-display); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; font-size: .98rem; margin: 0; }
.hkb-chart-card header p { margin: .15rem 0 0; font-size: .78rem; color: var(--text-muted); }
.hkb-chart-empty { color: var(--text-muted); font-size: .84rem; padding: 1.2rem 0; text-align: center; }

.hkb-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .76rem; color: var(--text-secondary); margin-bottom: .6rem; }
.hkb-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.hkb-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hkb-legend-split { justify-content: space-between; font-weight: 600; color: var(--text); }

.hkb-bars { display: flex; flex-direction: column; gap: .45rem; }
.hkb-bar-row { display: grid; grid-template-columns: auto auto minmax(90px, 30%) 1fr auto; align-items: center; gap: .55rem; font-size: .82rem; border-radius: 6px; }
.hkb-bar-row:hover { background: rgba(255,255,255,.025); }
.hkb-bar-rank { width: 1.4em; text-align: right; color: var(--text-muted); font-family: var(--hkb-display); font-size: .78rem; }
.hkb-bar-img { width: 22px; height: 22px; border-radius: 5px; image-rendering: pixelated; }
.hkb-bar-row:not(:has(.hkb-bar-rank)) { grid-template-columns: auto minmax(90px, 30%) 1fr auto; }
.hkb-bar-row:not(:has(.hkb-bar-img)) { grid-template-columns: auto minmax(90px, 30%) 1fr auto; }
.hkb-bar-row:not(:has(.hkb-bar-img)):not(:has(.hkb-bar-rank)) { grid-template-columns: minmax(90px, 30%) 1fr auto; }
.hkb-bar-label { min-width: 0; line-height: 1.2; }
.hkb-bar-label, .hkb-bar-label a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; color: var(--text); font-weight: 600; }
.hkb-bar-label small { display: block; color: var(--text-muted); font-weight: 500; font-size: .7rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hkb-bar-track { display: flex; gap: 2px; height: 14px; align-items: stretch; }
.hkb-bar-fill { display: block; height: 100%; min-width: 3px; }
.hkb-bar-fill:first-child { border-radius: 0; }
.hkb-bar-fill:last-child { border-radius: 0 4px 4px 0; }
.hkb-bar-val { font-variant-numeric: tabular-nums; font-size: .8rem; min-width: 2ch; text-align: right; color: var(--text); white-space: nowrap; }

.hkb-line { position: relative; display: grid; grid-template-columns: 34px 1fr; height: var(--h, 200px); }
.hkb-line-yaxis { position: relative; }
.hkb-line-yaxis span { position: absolute; right: 8px; transform: translateY(-50%); font-size: .68rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.hkb-line-plot { position: relative; margin-right: 34px; }
.hkb-line-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hkb-grid { position: absolute; left: 0; right: 0; height: 1px; background: #232a33; }
.hkb-grid-zero { background: #3a4452; }
.hkb-line-dot { position: absolute; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--bg-card); pointer-events: none; }
.hkb-line-end { position: absolute; left: calc(100% + 8px); transform: translateY(-50%); font-size: .72rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.hkb-line-hit { position: absolute; top: 0; bottom: 0; z-index: 2; cursor: crosshair; }
.hkb-line-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.35); pointer-events: none; opacity: 0; }
.hkb-line-plot.is-hover .hkb-line-cross { opacity: 1; }
.hkb-line-xaxis { display: flex; justify-content: space-between; padding: .35rem 34px 0 34px; font-size: .68rem; color: var(--text-muted); }
.hkb-axis-title { text-align: center; font-size: .68rem; color: var(--text-muted); margin-top: .15rem; }

.hkb-cols { display: flex; align-items: flex-end; gap: 2px; height: var(--h, 160px); border-bottom: 1px solid #3a4452; padding: 0 34px 0 34px; }
.hkb-cols.is-diverging { flex-direction: row; align-items: stretch; border-bottom: 0; }
.hkb-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; min-width: 3px; max-width: 24px; height: 100%; margin: 0 auto; border-radius: 4px 4px 0 0; cursor: default; }
.hkb-col:hover { background: rgba(255,255,255,.04); }
.hkb-col-up { display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; height: 100%; }
.hkb-col-up span:first-child { border-radius: 4px 4px 0 0; }
.hkb-cols.is-diverging .hkb-col { justify-content: center; }
.hkb-cols.is-diverging .hkb-col-up, .hkb-cols.is-diverging .hkb-col-down { height: 50%; display: flex; flex-direction: column; }
.hkb-cols.is-diverging .hkb-col-up { justify-content: flex-end; border-bottom: 1px solid #3a4452; }
.hkb-cols.is-diverging .hkb-col-down { justify-content: flex-start; }
.hkb-col-down span:last-child { border-radius: 0 0 4px 4px; }
.hkb-col span { display: block; min-height: 2px; }

.hkb-donut { display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap; }
.hkb-donut-ring { position: relative; width: 140px; height: 140px; flex-shrink: 0; }
.hkb-donut-svg { width: 100%; height: 100%; transform: none; }
.hkb-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hkb-donut-center strong { font-family: var(--hkb-display); font-size: 1.6rem; font-weight: 600; line-height: 1; }
.hkb-donut-center span { font-size: .7rem; color: var(--text-muted); }
.hkb-donut-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: .3rem; }
.hkb-donut-legend li { display: grid; grid-template-columns: 10px 1fr auto 3.2em; align-items: center; gap: .5rem; font-size: .8rem; color: var(--text-secondary); }
.hkb-donut-legend i { width: 10px; height: 10px; border-radius: 3px; }
.hkb-donut-legend strong { color: var(--text); font-variant-numeric: tabular-nums; }
.hkb-donut-legend small { color: var(--text-muted); text-align: right; font-variant-numeric: tabular-nums; }

.hkb-fly { display: flex; flex-direction: column; gap: .35rem; }
.hkb-fly-row { display: grid; grid-template-columns: 3.6em 1fr minmax(84px, 28%) 1fr 3.6em; align-items: center; gap: .45rem; font-size: .8rem; padding: .12rem 0; border-radius: 6px; }
.hkb-fly-row:hover { background: rgba(255,255,255,.025); }
.hkb-fly-label { text-align: center; color: var(--text-secondary); font-size: .76rem; line-height: 1.15; }
.hkb-fly-track { display: flex; height: 12px; background: rgba(255,255,255,.03); border-radius: 4px; }
.hkb-fly-left { justify-content: flex-end; }
.hkb-fly-left span { border-radius: 4px 0 0 4px; }
.hkb-fly-right span { border-radius: 0 4px 4px 0; }
.hkb-fly-track span { display: block; height: 100%; min-width: 0; }
.hkb-fly-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-secondary); font-weight: 600; }
.hkb-fly-val-right { text-align: left; }
.hkb-fly-val.is-lead { color: var(--text); font-weight: 800; }
@media (max-width: 520px) {
    .hkb-fly-row { grid-template-columns: 2.8em 1fr minmax(64px, 30%) 1fr 2.8em; gap: .3rem; font-size: .74rem; }
    .hkb-bar-row, .hkb-bar-row:not(:has(.hkb-bar-rank)), .hkb-bar-row:not(:has(.hkb-bar-img)) { grid-template-columns: auto minmax(70px, 34%) 1fr auto; }
    .hkb-bar-rank { display: none; }
}

.hkb-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.hkb-tile { background: var(--bg-card); border: 1px solid #222a34; border-radius: 12px; padding: .7rem .8rem; display: flex; flex-direction: column; gap: .15rem; }
.hkb-tile strong { font-family: var(--hkb-display); font-size: 1.45rem; font-weight: 600; line-height: 1.1; }
.hkb-tile span { font-size: .72rem; color: var(--text-muted); }

/* ─── Compare ─────────────────────────────────────────────────────── */

.hkb-compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 860px) { .hkb-compare-grid { grid-template-columns: 1fr; } }
.hkb-compare-legend {
    position: sticky; top: calc(var(--nav-h, 58px) + 6px); z-index: 5;
    background: #0d1117;
    border: 1px solid var(--border); border-radius: 10px; padding: .5rem .8rem; margin-bottom: .8rem;
    font-family: var(--hkb-display); text-transform: uppercase; letter-spacing: .03em; font-size: .9rem;
}
.hkb-compare-legend i { width: 12px; height: 12px; }
.hkb-col-val { font-style: normal; font-size: .72rem; font-weight: 700; color: var(--text); text-align: center; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.hkb-col-up span:first-of-type { border-radius: 4px 4px 0 0; }
.hkb-cols:not(.is-diverging) { padding-top: 18px; }
.hkb-col-up { overflow: visible; }
.hkb-watch-team { display: flex; align-items: center; gap: .4rem; font-size: .72rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .04em; }
.hkb-watch-away .hkb-watch-team { flex-direction: row-reverse; }
@media (max-width: 640px) { .hkb-watch-away .hkb-watch-team { flex-direction: row; } }

/* Edge rows (tale of the tape): one bar from the centre toward whichever side is better. */
.hkb-edge { display: flex; flex-direction: column; gap: .5rem; }
.hkb-edge-summary { display: flex; align-items: center; justify-content: center; gap: .5rem; font-size: .8rem; color: var(--text-secondary); margin-bottom: .2rem; }
.hkb-edge-summary span { font-family: var(--hkb-display); text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; color: var(--text-muted); padding: .05rem .45rem; border: 1px solid var(--border); border-radius: 999px; }
.hkb-edge-row { display: grid; grid-template-columns: 4.2em 1fr 4.2em; align-items: center; gap: .7rem; padding: .1rem 0; border-radius: 6px; }
.hkb-edge-row:hover { background: rgba(255,255,255,.025); }
.hkb-edge-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); font-weight: 600; font-size: .9rem; }
.hkb-edge-val-right { text-align: left; }
.hkb-edge-val.is-lead { color: var(--text); font-weight: 800; }
.hkb-edge-mid { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.hkb-edge-label { text-align: center; font-size: .76rem; color: var(--text-secondary); line-height: 1.15; }
.hkb-edge-label small { color: var(--text-muted); font-size: .66rem; }
.hkb-edge-track { position: relative; height: 8px; border-radius: 4px; background: var(--hkb-track); }
.hkb-edge-track::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; transform: translateX(-50%); background: #4a5462; border-radius: 1px; }
.hkb-edge-fill { position: absolute; top: 0; bottom: 0; }
.hkb-edge-left { right: 50%; background: #3987e5; border-radius: 4px 0 0 4px; }
.hkb-edge-right { left: 50%; background: #e66767; border-radius: 0 4px 4px 0; }
.hkb-fly-label small { display: block; font-size: .62rem; color: var(--text-muted); }

.hkb-card-status { min-height: 1em; font-size: .76rem; }

/* ─── Match preview v2: roomy team panels + stat duel cards ─────────── */

.hkb-mp { padding: 0; overflow: hidden; }
.hkb-mp-top {
    display: grid; grid-template-columns: 1fr minmax(200px, 260px) 1fr; align-items: center; gap: 1.25rem;
    padding: 1.4rem 1.5rem;
    background: linear-gradient(90deg, rgba(57,135,229,.10), transparent 38%, transparent 62%, rgba(230,103,103,.10));
    border-bottom: 1px solid var(--border);
}
.hkb-mp-team { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.hkb-mp-away { flex-direction: row-reverse; text-align: right; }
.hkb-mp-crest { width: 64px; height: 64px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.hkb-mp-crest.hkb-crest-fallback { font-size: 1rem; border-radius: 14px; border: 2px solid var(--team); }
.hkb-mp-team-info { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.hkb-mp-away .hkb-mp-team-info { align-items: flex-end; }
.hkb-mp-side { display: flex; align-items: center; gap: .35rem; font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.hkb-mp-away .hkb-mp-side { flex-direction: row-reverse; }
.hkb-mp-name { font-family: var(--hkb-display); font-size: 1.35rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; line-height: 1.1; color: var(--text); }
.hkb-mp-name:hover { color: var(--hkb-ice); }
.hkb-mp-meta { font-size: .8rem; color: var(--text-secondary); }
.hkb-mp-h2h { display: flex; flex-direction: column; align-items: center; gap: .45rem; text-align: center; }
.hkb-mp-h2h .hkb-h2h-split { width: 100%; }
.hkb-mp-h2h-title { font-size: .66rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); }
.hkb-mp-h2h-score { display: flex; align-items: center; gap: .6rem; font-family: var(--hkb-led); font-weight: 900; font-size: 2rem; line-height: 1; }
.hkb-mp-h2h-score small { color: var(--text-muted); font-size: 1.2rem; }
.hkb-mp-h2h-meta { font-size: .76rem; color: var(--text-muted); }
.hkb-mp-last { font-size: .78rem; color: var(--text-secondary); }
.hkb-mp-last:hover { color: var(--text); }
.hkb-mp-body { padding: 1.25rem 1.5rem 1.4rem; }
.hkb-mp-watch { padding: 1.1rem 1.5rem 1.3rem; border-top: 1px solid var(--border); }

.hkb-duels-summary { display: flex; justify-content: center; align-items: center; gap: .55rem; font-size: .85rem; color: var(--text-secondary); margin-bottom: 1rem; }
.hkb-duels-summary span { font-family: var(--hkb-display); text-transform: uppercase; letter-spacing: .1em; font-size: .68rem; color: var(--text-muted); padding: .1rem .5rem; border: 1px solid var(--border); border-radius: 999px; }
.hkb-duels { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .8rem; }
.hkb-duel { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 12px; padding: .8rem .95rem .75rem; display: flex; flex-direction: column; gap: .55rem; }
.hkb-duel-label { font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-muted); text-align: center; }
.hkb-duel-values { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .5rem; }
.hkb-duel-v { font-family: var(--hkb-display); font-size: 1.5rem; font-weight: 600; line-height: 1; padding: .3rem .5rem; border-radius: 8px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.hkb-duel-left { text-align: left; }
.hkb-duel-right { text-align: right; }
.hkb-duel-v.is-lead { color: var(--text); }
.hkb-duel-left.is-lead { background: rgba(57,135,229,.16); box-shadow: inset 3px 0 0 #3987e5; }
.hkb-duel-right.is-lead { background: rgba(230,103,103,.16); box-shadow: inset -3px 0 0 #e66767; }
.hkb-duel-sep { font-size: .68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.hkb-duel-note { font-size: .7rem; color: var(--text-muted); text-align: center; }
@media (max-width: 760px) {
    .hkb-mp-top { grid-template-columns: 1fr; padding: 1.1rem; gap: 1rem; }
    .hkb-mp-away { flex-direction: row; text-align: left; }
    .hkb-mp-away .hkb-mp-team-info { align-items: flex-start; }
    .hkb-mp-away .hkb-mp-side { flex-direction: row; }
    .hkb-mp-h2h { order: 3; }
    .hkb-mp-body, .hkb-mp-watch { padding-left: 1rem; padding-right: 1rem; }
    .hkb-duels { grid-template-columns: 1fr 1fr; gap: .6rem; }
    .hkb-duel-v { font-size: 1.2rem; padding: .25rem .35rem; }
}

/* ─── Compare v2: identity header + one roomy column ───────────────── */

.hkb-cmp-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.hkb-cmp-id { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--border); min-width: 0; }
.hkb-cmp-id:hover { border-color: var(--border-light); }
.hkb-cmp-left { box-shadow: inset 4px 0 0 #3987e5; }
.hkb-cmp-right { flex-direction: row-reverse; text-align: right; box-shadow: inset -4px 0 0 #e66767; }
.hkb-cmp-art img, .hkb-cmp-crest { width: 56px; height: 56px; object-fit: contain; image-rendering: pixelated; border-radius: 10px; display: block; }
.hkb-cmp-crest { image-rendering: auto; }
.hkb-cmp-crest.hkb-crest-fallback { display: flex; font-size: .9rem; }
.hkb-cmp-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.hkb-cmp-right .hkb-cmp-text { align-items: flex-end; }
.hkb-cmp-key { display: flex; align-items: center; gap: .35rem; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.hkb-cmp-right .hkb-cmp-key { flex-direction: row-reverse; }
.hkb-cmp-key i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.hkb-cmp-text strong { font-family: var(--hkb-display); font-size: 1.3rem; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.hkb-cmp-text small { font-size: .78rem; color: var(--text-secondary); }
.hkb-cmp-vs { font-family: var(--hkb-led); font-weight: 900; color: var(--text-muted); font-size: 1.1rem; }
.hkb-compare { display: flex; flex-direction: column; gap: 1rem; }
.hkb-compare-card { padding: 1.1rem 1.4rem 1.25rem; }
.hkb-compare-card .hkb-fly { gap: .55rem; }
.hkb-compare-card .hkb-fly-row { grid-template-columns: 4.5em 1fr minmax(150px, 24%) 1fr 4.5em; gap: .8rem; font-size: .92rem; padding: .2rem 0; }
.hkb-compare-card .hkb-fly-track { height: 14px; }
.hkb-compare-card .hkb-fly-label { font-size: .84rem; }
@media (max-width: 700px) {
    .hkb-cmp-head { grid-template-columns: 1fr; }
    .hkb-cmp-vs { text-align: center; }
    .hkb-cmp-right { flex-direction: row; text-align: left; box-shadow: inset 4px 0 0 #e66767; }
    .hkb-cmp-right .hkb-cmp-text { align-items: flex-start; }
    .hkb-cmp-right .hkb-cmp-key { flex-direction: row; }
    .hkb-compare-card { padding: .9rem .8rem 1rem; }
    .hkb-compare-card .hkb-fly-row { grid-template-columns: 3em 1fr minmax(78px, 30%) 1fr 3em; gap: .35rem; font-size: .8rem; }
}

/* ─── Team deep dive ───────────────────────────────────────────────── */

.hkb-hl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .8rem; margin-bottom: 1.4rem; }
.hkb-hl { background: var(--bg-card); border: 1px solid #222a34; border-radius: 14px; padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .55rem; }
.hkb-hl-head { display: flex; align-items: center; gap: .5rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.hkb-hl-icon { font-size: 1rem; }
.hkb-hl-who { display: flex; flex-wrap: wrap; gap: .35rem; }
.hkb-hl-value { display: flex; align-items: baseline; gap: .45rem; }
.hkb-hl-value strong { font-family: var(--hkb-display); font-size: 1.8rem; font-weight: 600; line-height: 1; }
.hkb-hl-value span { font-size: .76rem; color: var(--text-secondary); }
.hkb-hl-note { font-size: .74rem; color: var(--text-muted); }
.hkb-pchip { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .5rem .18rem .2rem; border-radius: 999px; background: var(--bg-elevated); border: 1px solid var(--border); font-size: .8rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.hkb-pchip:hover { border-color: var(--border-light); }
.hkb-pchip img { width: 20px; height: 20px; border-radius: 50%; image-rendering: pixelated; }
.hkb-pchip em { font-style: normal; font-size: .62rem; font-weight: 800; color: var(--text-muted); letter-spacing: .04em; }
.hkb-deep-block { margin-bottom: 1.4rem; min-width: 0; }
.hkb-deep-block h3 { font-family: var(--hkb-display); text-transform: uppercase; letter-spacing: .03em; font-weight: 600; font-size: 1rem; margin: 0 0 .6rem; }
.hkb-deep table td { vertical-align: middle; }
.hkb-lineup-cell { display: flex; flex-wrap: wrap; gap: .3rem; min-width: 220px; }
.hkb-deep-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 900px) { .hkb-deep-grid { grid-template-columns: 1fr; } }
.hkb-situations { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.hkb-sit { background: var(--bg-card); border: 1px solid #222a34; border-radius: 12px; padding: .75rem .85rem; display: flex; flex-direction: column; gap: .25rem; }
.hkb-sit-label { font-size: .72rem; color: var(--text-muted); font-weight: 600; }
.hkb-sit strong { font-family: var(--hkb-display); font-size: 1.4rem; font-weight: 600; }
.hkb-sit-sub { font-size: .72rem; color: var(--text-secondary); }
.hkb-sit-bar { height: 6px; border-radius: 3px; background: rgba(57,135,229,.18); overflow: hidden; margin-top: .2rem; }
.hkb-sit-bar span { display: block; height: 100%; background: #3987e5; border-radius: 3px; }
.hkb-cols-labels { display: flex; padding: .35rem 34px 0; }
.hkb-cols-labels span { flex: 1; text-align: center; font-size: .7rem; color: var(--text-muted); }
.hkb-deep-tables { display: flex; flex-direction: column; }

/* Butterfly: the side that is behind on a stat keeps its length but is dimmed. */
.hkb-fly-track.is-behind span { opacity: .32; }
.hkb-deep-hint { margin: -.3rem 0 .6rem; font-size: .78rem; color: var(--text-muted); }

/* Deep dive "On the rink": player column stays pinned while the table scrolls sideways. */
.hkb-sticky-first th:first-child, .hkb-sticky-first td:first-child { position: sticky; left: 0; z-index: 2; background: var(--bg-card); box-shadow: 1px 0 0 var(--border), 6px 0 8px -6px rgba(0,0,0,.6); }
.hkb-sticky-first thead th:first-child { z-index: 3; }
.hkb-sticky-first tbody tr:hover td:first-child { background: var(--bg-hover); }

/* ─── Squad page: locker room ─────────────────────────────────────── */

.hkb-squad { --sq1: #4a90d9; --sq2: #ffffff; }
.hkb-sq-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem; margin-bottom: .9rem; }
.hkb-sq-strip > div { padding: .6rem .85rem; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border); border-left: 3px solid var(--sq1); min-width: 0; }
.hkb-sq-strip b { display: block; font-family: var(--hkb-display); font-size: 1.2rem; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hkb-sq-strip span { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }

.hkb-sq-stage {
    position: relative; overflow: hidden; display: grid; grid-template-columns: 44px minmax(200px, 300px) 1fr 44px; align-items: center; gap: 1rem;
    padding: 1.25rem .75rem; border-radius: 16px; border: 1px solid var(--border); min-height: 420px;
    background:
        radial-gradient(ellipse 60% 70% at 28% 55%, color-mix(in srgb, var(--sq1) 38%, transparent), transparent 70%),
        linear-gradient(135deg, color-mix(in srgb, var(--sq1) 18%, var(--bg-card)) 0%, var(--bg-card) 55%, color-mix(in srgb, var(--sq2) 6%, var(--bg-card)) 100%);
}
.hkb-sq-stage::before { /* locker slats */
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .06;
    background: repeating-linear-gradient(90deg, #fff 0 1px, transparent 1px 64px);
}
.hkb-sq-number {
    position: absolute; left: 4%; top: 50%; transform: translateY(-52%); pointer-events: none; z-index: 0;
    font-family: var(--hkb-display); font-weight: 700; font-size: clamp(9rem, 22vw, 17rem); line-height: 1;
    color: transparent; -webkit-text-stroke: 2px color-mix(in srgb, var(--sq2) 22%, transparent); letter-spacing: -.04em;
}
.hkb-sq-model { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; cursor: grab; }
.hkb-sq-model.is-grabbed { cursor: grabbing; }
.hkb-sq-canvas { position: relative; z-index: 1; width: 100%; display: flex; justify-content: center; }
.hkb-sq-canvas canvas { display: block; }
.hkb-sq-floor { width: 70%; height: 22px; margin-top: -26px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.55), transparent); }
.hkb-sq-hint { margin-top: .4rem; font-size: .7rem; color: var(--text-muted); letter-spacing: .08em; text-transform: uppercase; transition: opacity .3s; }
.hkb-sq-model.is-grabbed .hkb-sq-hint { opacity: 0; }
.hkb-sq-fallback { width: 128px; height: 128px; image-rendering: pixelated; border-radius: 14px; margin: 4rem 0; }

.hkb-sq-info { position: relative; z-index: 1; min-width: 0; }
.hkb-sq-tags { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .4rem; }
.hkb-sq-tags span { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; padding: .2rem .55rem; border-radius: 999px; background: rgba(255,255,255,.08); color: var(--text-secondary); }
.hkb-sq-tags .is-c { background: var(--sq1); color: #fff; }
.hkb-sq-name { margin: 0 0 .9rem; font-family: var(--hkb-display); font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1; letter-spacing: .01em; word-break: break-word; }
.hkb-sq-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin-bottom: .9rem; max-width: 460px; }
.hkb-sq-stats > div { text-align: center; padding: .55rem .2rem; border-radius: 10px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.06); }
.hkb-sq-stats b { display: block; font-family: var(--hkb-led); font-size: 1.25rem; color: var(--text-primary); }
.hkb-sq-stats span { font-size: .64rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.hkb-sq-share { max-width: 460px; margin-bottom: .7rem; }
.hkb-sq-share-top { display: flex; justify-content: space-between; font-size: .75rem; color: var(--text-muted); margin-bottom: .25rem; }
.hkb-sq-share-top b { color: var(--text-primary); }
.hkb-sq-share-bar { height: 7px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.hkb-sq-share-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--sq1), color-mix(in srgb, var(--sq1) 50%, var(--sq2))); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.hkb-sq-debut { font-size: .8rem; color: var(--text-muted); margin-bottom: .6rem; }
.hkb-sq-info .sponsor-card { margin: 0 0 .75rem; max-width: 460px; }

.hkb-sq-arrow {
    position: relative; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
    background: rgba(0,0,0,.25); color: var(--text-primary); font-size: 1.5rem; line-height: 1; cursor: pointer; transition: background .15s, transform .15s;
}
.hkb-sq-arrow:hover { background: var(--sq1); transform: scale(1.06); }

.hkb-sq-stage.is-swap-r .hkb-sq-info { animation: hkbSqInR .35s ease-out; }
.hkb-sq-stage.is-swap-l .hkb-sq-info { animation: hkbSqInL .35s ease-out; }
.hkb-sq-stage.is-swap-r .hkb-sq-number, .hkb-sq-stage.is-swap-l .hkb-sq-number { animation: hkbSqNum .45s ease-out; }
@keyframes hkbSqInR { from { opacity: 0; transform: translateX(18px); } }
@keyframes hkbSqInL { from { opacity: 0; transform: translateX(-18px); } }
@keyframes hkbSqNum { from { opacity: 0; transform: translateY(-52%) scale(.9); } }

.hkb-sq-sort { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; margin: 1.1rem 0 .6rem; }
.hkb-sq-sort span { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; margin-right: .2rem; }
.hkb-sq-sort button { font: inherit; font-size: .78rem; padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); cursor: pointer; }
.hkb-sq-sort button.is-on { background: var(--sq1); border-color: var(--sq1); color: #fff; }

.hkb-sq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .55rem; }
.hkb-sq-card {
    position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .6rem; align-items: center; text-align: left;
    padding: .65rem .75rem .6rem 3.4rem; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-card); color: inherit; font: inherit; cursor: pointer;
    transition: transform .15s, border-color .15s, box-shadow .15s; animation: hkbSqCard .4s ease-out both; animation-delay: var(--d);
}
.hkb-sq-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--sq1) 60%, var(--border)); }
.hkb-sq-card.is-on { border-color: var(--sq1); box-shadow: 0 0 0 1px var(--sq1), 0 8px 24px -12px var(--sq1); }
.hkb-sq-card-num {
    position: absolute; left: 0; top: 0; bottom: 0; width: 2.8rem; display: flex; align-items: center; justify-content: center;
    font-family: var(--hkb-display); font-weight: 700; font-size: 1.35rem; color: #fff; background: var(--sq1);
    clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%);
}
.hkb-sq-card img { grid-row: span 2; width: 34px; height: 34px; border-radius: 6px; image-rendering: pixelated; }
.hkb-sq-card-body { display: flex; flex-direction: column; min-width: 0; }
.hkb-sq-card-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hkb-sq-card-pos { font-size: .72rem; color: var(--text-muted); }
.hkb-sq-card-line { grid-column: 2; font-size: .72rem; color: var(--text-muted); }
.hkb-sq-card-line b { color: var(--text-primary); font-weight: 700; margin-left: .25rem; }
.hkb-sq-card-line b:first-child { margin-left: 0; }
.hkb-sq-c { font-style: normal; font-size: .62rem; font-weight: 800; padding: 0 .3rem; border-radius: 4px; background: var(--sq1); color: #fff; vertical-align: 2px; }
@keyframes hkbSqCard { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 760px) {
    .hkb-sq-stage { grid-template-columns: 1fr 1fr; grid-template-areas: "model model" "info info" "prev next"; min-height: 0; padding: 1rem; }
    .hkb-sq-model { grid-area: model; }
    .hkb-sq-info { grid-area: info; text-align: center; }
    .hkb-sq-tags { justify-content: center; }
    .hkb-sq-stats, .hkb-sq-share { margin-left: auto; margin-right: auto; }
    .hkb-sq-arrow.is-prev { grid-area: prev; justify-self: start; }
    .hkb-sq-arrow.is-next { grid-area: next; justify-self: end; }
    .hkb-sq-number { left: 50%; top: 30%; transform: translate(-50%, -50%); font-size: 11rem; }
    @keyframes hkbSqNum { from { opacity: 0; } }
    .hkb-sq-stats { grid-template-columns: repeat(5, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .hkb-sq-card, .hkb-sq-stage .hkb-sq-info, .hkb-sq-stage .hkb-sq-number { animation: none !important; }
}
