/* Rammen rundt siden: toppmeny, innloggingsvindu og felles knapper.
 * Lastes sist, så den overstyrer eldre regler i style.css/accounts.css/enhancements.css.
 */

/* ------------------------------------------------------------------ skrift */
/* Inter, hostet lokalt (SIL OFL). Ikke Google Fonts: det sender brukerens IP til Google. */
@font-face {
  font-family: 'PB Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
    U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'PB Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
    U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0,
    U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --page-zoom: .9;   /* ma folge html{zoom} i style.css */
  --shell-bg: rgba(19, 23, 26, .72);
  --shell-line: rgba(255, 255, 255, .07);
  --accent: #479feb;
  --accent-hi: #6cb6f5;
  /* Fjærende overgang: litt overskyting, så markøren "lander" på neste menyvalg. */
  --spring: cubic-bezier(.34, 1.28, .5, 1);
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, .009, .035 2.1%, .141 4.4%, .723 12.9%, .938 16.7%, 1.017 19.4%,
      1.067, 1.099 24.3%, 1.108 26%, 1.105, 1.088 30.3%, 1.019 38.6%, .997 42.7%,
      .989 46.9%, .999 59.1%, 1.001 66.6%, 1);
  }
}

body {
  font-family: 'PB Inter', Inter, 'Segoe UI', system-ui, sans-serif;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* ---------------------------------------------------------------- toppmeny */
/* Blur-laget ligger på ::before, ikke på header: backdrop-filter på header ville
   gjort den til referanse for position:fixed, og Games-menyen bruker det på mobil. */
body > header {
  position: sticky; top: 0; z-index: 100;
  height: 64px; padding: 0 28px; gap: 18px;
  background: transparent;
  border-bottom: 1px solid var(--shell-line);
  isolation: isolate;
}
body > header::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: var(--shell-bg);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  body > header::before { background: rgba(19, 23, 26, .97); }
}

/* Logoen: gjennomsiktig og tett beskåret (packsbro-logo-alpha.png), så den ikke
   trenger forskyvningene den gamle bildefilen med mørk bakgrunn krevde. */
body > header > .brand-logo {
  position: static; flex: 0 0 auto; width: auto; height: 34px; overflow: visible;
  display: flex; align-items: center; background: none;
}
body > header > .brand-logo img {
  position: static; width: auto; height: 100%; max-width: none;
  left: auto; top: auto; mix-blend-mode: normal; object-fit: contain;
}

/* Keep the menu between the logo and wallet on one row when space allows. */
body > header nav {
  position: relative; left: auto; top: auto; transform: none;
  flex: 0 0 auto; width: auto; margin-left: auto;
  height: auto; gap: 2px; align-items: center;
}
body > header nav > button,
body > header .nav-games-toggle {
  position: relative; z-index: 1;
  height: 38px; padding: 0 14px; border-radius: 10px;
  background: none; border: 0;
  color: #a4aeb7; font: inherit; font-size: 14.5px; font-weight: 600; letter-spacing: -.005em;
  transition: color .2s ease;
}
body > header nav > button:hover,
body > header .nav-games-toggle:hover,
body > header nav > button.active,
body > header .nav-games-toggle.active { color: #fff; }
body > header nav > button:focus-visible,
body > header .nav-games-toggle:focus-visible { outline: none; }
/* Den gamle understreken erstattes av markøren. */
body > header nav > button.active::after,
body > header .nav-games-toggle.active::after { display: none; }
body > header .nav-games { height: auto; align-items: center; }

.nav-marker {
  position: absolute; left: 0; top: 0; z-index: 0;
  border-radius: 10px; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, rgba(120, 190, 255, .13), rgba(71, 159, 235, .05));
  box-shadow:
    inset 0 0 0 1px rgba(120, 190, 255, .28),
    0 0 14px -3px rgba(71, 159, 235, .45);
  transition:
    transform .5s var(--spring), width .5s var(--spring), height .3s ease,
    opacity .2s ease, box-shadow .3s ease, background .3s ease;
  will-change: transform, width;
}
.nav-marker.show { opacity: 1; }
.nav-marker.is-active {
  background: linear-gradient(180deg, rgba(120, 190, 255, .22), rgba(71, 159, 235, .08));
  box-shadow:
    inset 0 0 0 1px rgba(140, 200, 255, .5),
    0 0 18px -2px rgba(71, 159, 235, .6),
    0 0 44px -14px rgba(71, 159, 235, .7);
}
.nav-marker.instant { transition: none; }

/* Knappene til høyre */
body > header #account-header .signin-link,
body > header #account-header .register-link {
  height: 36px; display: inline-flex; align-items: center;
  padding: 0 16px; border-radius: 9px; font-size: 14px; font-weight: 650;
  transition: background .18s ease, box-shadow .18s ease, transform .12s ease;
}
body > header #account-header .signin-link { background: rgba(255, 255, 255, .07); color: #e6ebef; }
body > header #account-header .signin-link:hover { background: rgba(255, 255, 255, .12); }
body > header #account-header .register-link {
  background: linear-gradient(180deg, #5aaaf0, #3a8fdc); color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 6px 18px -8px rgba(71, 159, 235, .9);
}
body > header #account-header .register-link:hover { filter: brightness(1.06); }
body > header #account-header a:active { transform: translateY(1px); }

/* Smalere skjermer: menyen på egen rad, fortsatt midtstilt. .nav-stacked settes av
   site-shell.js når menyen ellers ville truffet saldo/konto til høyre (innlogget bruker
   har bredere høyreside enn en gjest, så en fast bruddgrense holder ikke). */
@media (max-width: 1300px) {
  body > header { height: auto; flex-wrap: wrap; padding: 10px 20px 8px; row-gap: 6px; }
  body > header nav {
    position: relative; left: auto; top: auto; transform: none;
    order: 3; width: 100%; justify-content: center; height: auto;
  }
}
body > header.nav-stacked { height: auto; flex-wrap: wrap; padding: 10px 20px 8px; row-gap: 6px; }
body > header.nav-stacked nav {
  position: relative; left: auto; top: auto; transform: none;
  order: 3; width: 100%; justify-content: center; height: auto;
}
/* Games-menyen er position:fixed på mobil. Lukket skal den ikke finnes i layouten:
   ellers utvider mobilnettleseren viewporten til den usynlige menyen, menyen vokser
   med viewporten, og siden får horisontal scroll. Den legges under den faktiske
   headerhøyden (--header-h, satt av app.js) i stedet for en fast 118px. */
@media (max-width: 650px) {
  .nav-games:not(.open) .nav-games-menu { display: none; }
  .nav-games-menu { top: calc(var(--header-h, 118px) + 6px); }
}
@media (max-width: 600px) {
  body > header { padding: 8px 12px 6px; column-gap: 8px; flex-wrap: wrap; }
  body > header > .brand-logo { height: 26px; }
  body > header #account-header { margin-left: auto; gap: 6px; }
  body > header #account-header .signin-link,
  body > header #account-header .register-link { height: 32px; padding: 0 11px; font-size: 13px; }
  body > header .language-select { width: auto; min-width: 0; height: 32px; padding: 0 6px; font-size: 12px; }
  /* Får alltid plass: krympes, og kan i verste fall scrolles sidelengs i stedet for
     å gjøre hele siden bredere. */
  body > header nav {
    justify-content: space-between; gap: 0;
    overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  }
  body > header nav::-webkit-scrollbar { display: none; }
  body > header nav > button, body > header .nav-games-toggle { flex: 0 0 auto; height: 34px; padding: 0 7px; font-size: 12.5px; }
}

/* ------------------------------------------------------------ pakkerutenett */
/* Glidende ramme bak kortet under pekeren (site-shell.js). Den ligger bak kortene,
   så bare kanten og gløden synes; kortene løftes ikke selv, så rammen og kortet
   aldri beveger seg i utakt. Bildet inni kortet beholder en liten reaksjon. */
.glide-host { position: relative; isolation: isolate; }
.glide-host > :not(.glide-marker) { position: relative; z-index: 1; }
.glide-marker {
  --tone: 71, 159, 235; --tone-hi: 140, 200, 255;
  position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; opacity: 0;
  outline: 1.5px solid rgba(var(--tone-hi), .55); outline-offset: 3px;
  background: rgba(var(--tone), .07);
  box-shadow: 0 0 0 3px rgba(var(--tone), .10), 0 0 28px 2px rgba(var(--tone), .38), 0 18px 40px -18px rgba(var(--tone), .7);
  transition: transform .5s var(--spring), width .5s var(--spring), height .5s var(--spring), opacity .22s ease;
  will-change: transform, width, height;
}
.glide-host[data-glide=gold] > .glide-marker { --tone: 243, 190, 70; --tone-hi: 255, 222, 140; }
.glide-marker.show { opacity: 1; }
.glide-marker.instant { transition: opacity .22s ease; }

/* Kortenes egne løft erstattes av rammen. */
.glide-host > .pack-card:hover { transform: none; border-color: #3c4852; }
.glide-host > .rp-tier:hover { translate: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.glide-host > button:hover img { transform: none; }
.home-new-packs > button img { transition: transform .35s cubic-bezier(.2, .9, .3, 1.3); }
.home-new-packs > button:hover img { transform: translateY(-3px) scale(1.02); }
.pack-card img, .daily-card .reward-pack-art { transition: transform .35s cubic-bezier(.2, .9, .3, 1.3); }
.glide-host > .daily-card:hover .reward-pack-art { transform: rotate(-3deg) scale(1.03); }

/* ------------------------------------------------------------ innlogging */
.auth-modal {
  width: min(420px, calc(100vw - 32px)); max-height: calc(100dvh - 40px);
  padding: 30px 28px 24px; margin: auto;
  border: 1px solid rgba(255, 255, 255, .08); border-radius: 18px;
  background: linear-gradient(180deg, #21272c, #191e22);
  color: #eef2f5;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(0, 0, 0, .35);
  overflow: auto;
}
.auth-modal[open] { animation: auth-in .32s cubic-bezier(.2, .9, .3, 1.08); }
.auth-modal::backdrop {
  background: rgba(7, 9, 11, .62);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: auth-fade .25s ease;
}
@keyframes auth-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes auth-fade { from { opacity: 0; } }

/* Én lukkeknapp for alle vinduer. padding:0 og border-box er poenget: den globale
   knappestilen (padding 10px 16px) dyttet ikonet ut av midten, og tekstglyfer (✕, ×)
   sentreres etter skriftens grunnlinje, ikke optisk. SVG-krysset står alltid midt. */
button.dialog-close.dialog-close {
  box-sizing: border-box; flex: 0 0 auto;
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; min-width: 36px; padding: 0; margin: 0;
  border: 0; border-radius: 10px; line-height: 0; font-size: 0;
  background: rgba(255, 255, 255, .06); color: #9aa6b0;
  cursor: pointer; transition: background .15s, color .15s;
}
button.dialog-close.dialog-close:hover { background: rgba(255, 255, 255, .12); color: #fff; }
button.dialog-close.dialog-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dialog-close svg { display: block; }
/* I vinduer uten egen topplinje ligger den fast i hjørnet. */
.auth-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
/* Tynne, mørke rullefelt i alle vinduer, også i elementer som scroller inni dem
   (scrollbar-width arves ikke). */
dialog, dialog * { scrollbar-width: thin; scrollbar-color: #3a454e transparent; }

/* Den globale regelen input{width:205px; padding; border} (style.css) traff også
   avkrysningsbokser og radioknapper: de ble 205px brede usynlige felt med selve
   boksen i venstre kant, langt fra teksten sin (f.eks. Borrow i pakkevinduet). */
input[type=checkbox], input[type=radio] { width: auto; min-width: 0; padding: 0; accent-color: var(--accent); }
.dialog-close svg, .auth-eye svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.auth-head { text-align: center; margin: 4px 0 22px; }
.auth-head h2 { margin: 0 0 6px; font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.auth-head p { margin: 0; color: #93a0aa; font-size: 14px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 7px; }
.auth-field span, label.auth-field { color: #b9c4cc; font-size: 13px; font-weight: 600; }
label.auth-field[for] { margin-bottom: -7px; }
.auth-modal input:not([type=checkbox]) {
  width: 100%; height: 46px; box-sizing: border-box; min-width: 0;
  padding: 0 14px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px;
  background: #121619; color: #f1f4f6; font: inherit; font-size: 15px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.auth-modal input::placeholder { color: #5f6b74; }
.auth-modal input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(71, 159, 235, .2); background: #14191c; }
.auth-password { position: relative; }
.auth-password input { padding-right: 48px; }
.auth-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: none; color: #7f8b95; cursor: pointer;
}
.auth-eye:hover { color: #dfe6eb; background: rgba(255, 255, 255, .05); }
.auth-eye[aria-pressed=true] { color: var(--accent-hi); }
.auth-hint { margin: -6px 0 0; color: #74808a; font-size: 12.5px; }
.auth-check {
  display: flex; align-items: flex-start; gap: 10px;
  color: #aab5bd; font-size: 13px; line-height: 1.45; cursor: pointer;
}
.auth-check input { width: 17px; height: 17px; margin: 1px 0 0; flex: 0 0 auto; accent-color: var(--accent); }
.auth-feedback { margin: 0; min-height: 0; color: #ff7a8f; font-size: 13.5px; }
.auth-feedback:empty { display: none; }
.auth-submit {
  height: 48px; margin-top: 4px; border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(180deg, #5aaaf0, #3288d6); color: #fff;
  font: inherit; font-size: 15.5px; font-weight: 700;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 10px 26px -12px rgba(71, 159, 235, .9);
  transition: filter .15s, transform .08s;
}
.auth-submit:hover:not(:disabled) { filter: brightness(1.07); }
.auth-submit:active:not(:disabled) { transform: translateY(1px); }
.auth-submit:disabled { filter: saturate(.5) brightness(.8); cursor: default; }
.auth-switch { margin: 18px 0 0; text-align: center; color: #93a0aa; font-size: 14px; }
.auth-switch a { color: var(--accent-hi); font-weight: 650; }
.auth-switch a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- knapper fra heroen
 * Selve forsiden for utloggede ligger i home-guest.css. Knappene og trinnlisten brukes
 * også av Rewards-landingssiden (rewards-promo). */
.hero-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.hero-cta, .hero-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  height: 46px; padding: 0 22px; border-radius: 11px;
  font-size: 15px; font-weight: 700; white-space: nowrap;
  transition: filter .15s, transform .1s, background .15s, box-shadow .2s;
}
.hero-cta {
  background: linear-gradient(180deg, #5aaaf0, #3288d6); color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 12px 30px -12px rgba(71, 159, 235, 1);
}
.hero-cta:hover { filter: brightness(1.08); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 14px 36px -10px rgba(71, 159, 235, 1); }
.hero-cta.small { height: 40px; padding: 0 18px; font-size: 14px; }
.hero-ghost { background: rgba(255, 255, 255, .06); color: #e8edf1; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.hero-ghost:hover { background: rgba(255, 255, 255, .1); }
.hero-cta:active, .hero-ghost:active { transform: translateY(1px); }
.hero-trust {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px;
  margin: 24px 0 0; padding: 0; list-style: none; color: #7f8b95; font-size: 13px;
}
.hero-trust li { display: flex; align-items: center; gap: 7px; }
.hero-trust li::before {
  content: ''; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(61, 220, 151, .14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.2 7 10.5l4.5-5' fill='none' stroke='%233ddc97' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat;
}
.hero-trust a { color: inherit; }
.hero-trust a:hover { color: #cfd8de; }
/* Glansstripe, brukt av rewards-promo.css */
@keyframes hero-shine { 0%, 72% { transform: translateX(-130%); } 88%, 100% { transform: translateX(130%); } }

/* ------------------------------------------------------------ trinnliste (rewards-promo) */
.how-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
.how-steps li {
  position: relative; padding: 22px 22px 24px; border-radius: 16px;
  background: linear-gradient(180deg, #1f252a, #1a1f23);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
  transition: transform .25s ease, box-shadow .25s ease;
}
.how-steps li:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(120, 190, 255, .22), 0 18px 40px -24px rgba(71, 159, 235, .7); }
.how-num {
  display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 14px;
  border-radius: 10px; background: rgba(71, 159, 235, .14); color: var(--accent-hi);
  font-weight: 800; font-size: 15px; box-shadow: inset 0 0 0 1px rgba(120, 190, 255, .25);
}
.how-steps h3 { margin: 0 0 6px; font-size: 17px; font-weight: 720; }
.how-steps p { margin: 0; color: #8f9ba5; font-size: 14px; line-height: 1.55; }

/* ---------------------------------------------------------------- mobil */
@media (max-width: 820px) {
  .how-steps { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-cta, .hero-ghost { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-marker, .glide-marker { transition: none; }
  .auth-modal[open], .auth-modal::backdrop { animation: none; }
}
