:root {
    --thl-display-font: "Oxanium", "Arial Black", Arial, sans-serif;
    --thl-ink: #111820;
    --thl-ink-soft: #283545;
    --thl-slate: #667281;
    --thl-line: rgba(17, 24, 32, 0.11);
    --thl-surface: rgba(255, 255, 255, 0.92);
    --thl-surface-solid: #ffffff;
    --thl-blue: #2476ad;
    --thl-blue-deep: #15527e;
    --thl-blue-soft: #e9f4fb;
    --thl-orange: #f26445;
    --thl-green: #258b66;
    --thl-red: #b94848;
    --thl-gold: #c89d38;
    --thl-radius-sm: 10px;
    --thl-radius: 16px;
    --thl-radius-lg: 22px;
    --thl-shadow-sm: 0 3px 12px rgba(20, 32, 44, 0.07);
    --thl-shadow: 0 14px 34px rgba(20, 32, 44, 0.13);
    --thl-shadow-lg: 0 22px 60px rgba(20, 32, 44, 0.18);
    --thl-content: 1200px;
    --thl-ease: 180ms ease;

    /* Publik typskala (rollbaserad, clamp = skalar mot storbild/mobil) */
    --fs-score: clamp(48px, 5.4vw, 72px);      /* klocka, resultat */
    --fs-display: clamp(34px, 4vw, 54px);      /* sidrubrik, "ingen match" */
    --fs-secondary: clamp(24px, 2.2vw, 32px);  /* h2h-total, skott, nasta tid */
    --fs-team: clamp(20px, 1.9vw, 28px);       /* lagnamn */
    --fs-title: clamp(19px, 1.4vw, 23px);      /* kort- och panelrubriker */
    --fs-subtitle: clamp(16px, 1.1vw, 18px);   /* interna underrubriker */
    --fs-body: clamp(15px, 1vw, 17px);         /* tabellceller, brodtext */
    --fs-label: clamp(13px, 0.85vw, 14px);     /* tabellhuvud, pills, status */
    --fs-meta: clamp(12px, 0.8vw, 13px);       /* finstilt, muted, assist */

    /* Chrome-skala for topbar/meny: FASTA px sa menyn aldrig svaller */
    --fs-nav-strong: 15px;   /* ordmarke THL */
    --fs-nav-sm: 13px;       /* dropdown-lankar */
    --fs-nav: 12px;          /* menylankar */
    --fs-nav-meta: 11px;     /* anvandare, sessionslank */
    --fs-nav-label: 10px;    /* dropdown-etikett, brand-subtitel, live-badge */
}

*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; color-scheme: light; scroll-behavior: smooth; }
body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--thl-ink);
    background: #edf2f6;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    color: #fff;
    background: rgba(13, 20, 28, 0.96);
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    box-shadow: 0 10px 30px rgba(7, 12, 18, 0.18);
    backdrop-filter: blur(16px) saturate(125%);
}
.app-header__inner { width: min(1480px, 100%); min-height: 72px; margin: 0 auto; padding: 8px 22px; display: flex; align-items: center; gap: 22px; }
.app-brand { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.app-brand__mark { display: grid; place-items: center; width: 76px; height: 48px; padding: 6px 8px; overflow: hidden; border-radius: 11px; background: rgba(255, 255, 255, 0.96); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55); }
.app-brand__mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.app-brand__copy { display: flex; flex-direction: column; gap: 1px; }
.app-brand__copy strong { font-family: var(--thl-display-font); font-size: var(--fs-nav-strong); line-height: 1; letter-spacing: 1.4px; }
.app-brand__copy small { color: rgba(255, 255, 255, 0.58); font-size: var(--fs-nav-label); letter-spacing: 0.65px; white-space: nowrap; }

.app-nav-shell { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.app-nav { display: flex; align-items: center; gap: 4px; }
.app-nav__link { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 11px; border: 0; border-radius: 10px; color: rgba(255, 255, 255, 0.72); background: transparent; font-size: var(--fs-nav); font-weight: 750; letter-spacing: 0.32px; text-decoration: none; white-space: nowrap; cursor: pointer; transition: color var(--thl-ease), background var(--thl-ease), transform var(--thl-ease); }
.app-nav__link:hover, .app-nav__link:focus-visible, .app-nav__link.is-active { color: #fff; background: rgba(255, 255, 255, 0.09); outline: none; }
.app-nav__link.is-active::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 3px; height: 2px; border-radius: 999px; background: linear-gradient(90deg, var(--thl-blue), var(--thl-orange)); }
.app-nav__group { position: relative; }
.app-nav__group > summary { list-style: none; }
.app-nav__group > summary::-webkit-details-marker { display: none; }
.app-nav__group svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; transition: transform var(--thl-ease); }
.app-nav__group[open] svg { transform: rotate(180deg); }
.app-nav__dropdown { position: absolute; top: calc(100% + 10px); left: 0; width: 240px; padding: 10px; border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 14px; background: rgba(17, 25, 34, 0.98); box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32); }
.app-nav__dropdown-label { display: block; padding: 7px 10px 6px; color: rgba(255, 255, 255, 0.42); font-size: var(--fs-nav-label); font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.app-nav__dropdown a { display: block; padding: 10px; border-radius: 9px; color: rgba(255, 255, 255, 0.76); font-size: var(--fs-nav-sm); font-weight: 650; text-decoration: none; }
.app-nav__dropdown a:hover, .app-nav__dropdown a[aria-current="page"] { color: #fff; background: rgba(255, 255, 255, 0.09); }
.app-nav__dropdown-rule { display: block; height: 1px; margin: 7px 5px; background: rgba(255, 255, 255, 0.09); }

.app-header__actions { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.app-user { display: inline-flex; align-items: center; gap: 7px; max-width: 150px; color: rgba(255, 255, 255, 0.66); font-size: var(--fs-nav-meta); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-user__dot { width: 7px; height: 7px; border-radius: 50%; background: #45c491; box-shadow: 0 0 0 4px rgba(69, 196, 145, 0.13); }
.app-session-link { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 13px; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 10px; color: rgba(255, 255, 255, 0.82); font-size: var(--fs-nav-meta); font-weight: 800; text-decoration: none; transition: background var(--thl-ease), color var(--thl-ease); }
.app-session-link:hover { color: #fff; background: rgba(255, 255, 255, 0.09); }
.app-session-link--primary { color: #fff; background: var(--thl-blue); border-color: var(--thl-blue); }

.menu-livebadge { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 11px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 999px; color: #fff; background: rgba(255, 255, 255, 0.07); font-size: var(--fs-nav-label); font-weight: 850; letter-spacing: 1px; }
.menu-livedot { width: 8px; height: 8px; border-radius: 50%; background: #ed4f4f; box-shadow: 0 0 0 4px rgba(237, 79, 79, 0.13); animation: menu-livepulse 1.4s ease-in-out infinite; }
@keyframes menu-livepulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.32; } }
.app-nav-toggle { display: none; }
.content { width: 100%; min-height: calc(100vh - 72px); }

.blur-overlay { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(8, 14, 20, 0.62); backdrop-filter: blur(10px); }
.modal-box { position: relative; width: min(420px, 100%); padding: 30px; border: 1px solid rgba(255, 255, 255, 0.72); border-radius: var(--thl-radius-lg); color: var(--thl-ink); background: rgba(255, 255, 255, 0.96); box-shadow: var(--thl-shadow-lg); text-align: center; }
.modal-close { position: absolute; top: 11px; right: 14px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--thl-slate); font-size: 24px; cursor: pointer; }
.modal-close:hover { background: rgba(17, 24, 32, 0.06); }
.btn-blue { width: 65%; min-height: 44px; margin-top: 14px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(135deg, var(--thl-blue), var(--thl-blue-deep)); font-weight: 800; cursor: pointer; box-shadow: 0 8px 20px rgba(36, 118, 173, 0.24); }

@media (max-width: 1180px) {
    .app-brand__copy { display: none; }
    .app-header__inner { gap: 14px; }
    .app-nav__link { padding-inline: 9px; }
    .app-user { display: none; }
}

@media (max-width: 900px) {
    .app-header__inner { min-height: 64px; padding: 8px 14px; justify-content: space-between; }
    .app-brand__mark { width: 68px; height: 43px; }
    .app-nav-toggle { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 42px; height: 42px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 10px; color: #fff; background: rgba(255, 255, 255, 0.06); cursor: pointer; }
    .app-nav-toggle > span:not(.sr-only) { display: block; width: 100%; height: 2px; border-radius: 2px; background: currentColor; }
    .app-nav-shell { position: absolute; top: calc(100% + 1px); left: 0; right: 0; display: none; max-height: calc(100vh - 65px); padding: 12px 14px 18px; overflow-y: auto; background: rgba(13, 20, 28, 0.99); border-bottom: 1px solid rgba(255, 255, 255, 0.09); box-shadow: 0 18px 36px rgba(7, 12, 18, 0.28); }
    .app-nav-shell.is-open { display: block; }
    .app-nav { flex-direction: column; align-items: stretch; }
    .app-nav__link { width: 100%; min-height: 46px; padding-inline: 12px; }
    .app-nav__link.is-active::after { top: 10px; bottom: 10px; left: 3px; right: auto; width: 3px; height: auto; }
    .app-nav__group { width: 100%; }
    .app-nav__dropdown { position: static; width: 100%; margin: 3px 0 8px; box-shadow: none; background: rgba(255, 255, 255, 0.04); }
    .app-header__actions { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
    .app-user { display: inline-flex; margin-right: auto; }
    .content { min-height: calc(100vh - 64px); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
.app-session-form {
    margin: 0;
}

.app-session-form .app-session-link {
    font: inherit;
    cursor: pointer;
    appearance: none;
    background: transparent;
}
