/* ════════════════════════════════════════════════════════════
   KontorTipset — playful edition
   Tema: kontor + fotball + festival.
   ════════════════════════════════════════════════════════════ */

:root {
  /* Bakgrunn & papir */
  --bg: #FAF5E8;
  --bg-soft: #F2EBD7;
  --card: #FFFDF8;
  --ink: #1B1410;
  --ink-soft: #6B5C4A;
  --ink-faded: #A89880;
  --line: rgba(27, 20, 16, 0.10);
  --line-soft: rgba(27, 20, 16, 0.05);

  /* Stadiongrønn */
  --green: #10804F;
  --green-dark: #0A5A37;
  --green-deep: #074026;
  --green-soft: #5BB084;
  --green-tint: rgba(16, 128, 79, 0.10);
  --green-glow: rgba(16, 128, 79, 0.32);

  /* Gull */
  --gold: #E8AE36;
  --gold-warm: #F4C661;
  --gold-soft: #FBE3AB;
  --gold-tint: rgba(232, 174, 54, 0.18);

  /* Coral / energi-pop */
  --coral: #EE6B3D;
  --coral-soft: #F8A37D;
  --coral-tint: rgba(238, 107, 61, 0.14);

  /* Cool accents */
  --sky: #5CA0CC;
  --sky-tint: rgba(92, 160, 204, 0.16);
  --pink: #E89AB5;
  --pink-tint: rgba(232, 154, 181, 0.18);

  /* Bronze for podium */
  --bronze: #C58A4A;
  --silver: #B8B5A8;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(27, 20, 16, 0.04);
  --shadow-sm: 0 4px 12px -6px rgba(27, 20, 16, 0.12);
  --shadow-md: 0 12px 28px -16px rgba(27, 20, 16, 0.22);
  --shadow-lg: 0 28px 56px -24px rgba(27, 20, 16, 0.28);
  --shadow-pop: 0 8px 0 -2px rgba(10, 90, 55, 0.16);

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-xl: 36px;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

/* Sørg for at hidden alltid overstyrer display */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Subtilt gress-prikk-mønster i bakgrunnen, fester atmosfære */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(16, 128, 79, 0.07) 1px, transparent 1.6px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at top, black 0%, transparent 70%);
}

h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); font-weight: 800; letter-spacing: -0.035em; }
h2 { font-size: 1.45rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }

/* ───────── Tilbake-knapp ───────── */
.back-to-portfolio {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 10px 14px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 253, 248, 0.92);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(.2, .7, .2, 1);
}
.back-to-portfolio svg {
  width: 14px; height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.3s cubic-bezier(.2, .7, .2, 1);
}
.back-to-portfolio:hover {
  background: var(--ink);
  color: var(--bg);
  transform: translateY(-2px);
}
.back-to-portfolio:hover svg { transform: translateX(-3px); }

/* ───────── App-layout ───────── */
.app {
  position: relative;
  z-index: 1;
  max-width: 1140px;
  margin: 0 auto;
  padding: 88px 24px 80px;
}

@media (max-width: 640px) {
  .app { padding: 76px 14px 60px; }
}

/* ════════════════════════════════════════════════════════════
   HERO — stadiumkjensle
   ════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(232, 174, 54, 0.22), transparent 55%),
    radial-gradient(ellipse at 0% 100%, rgba(92, 160, 204, 0.12), transparent 50%),
    linear-gradient(135deg, var(--green) 0%, var(--green-dark) 50%, var(--green-deep) 100%);
  color: #FBE3AB;
  border-radius: var(--radius-xl);
  padding: 42px 44px 0;
  margin-bottom: 32px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Banelinjer i bakgrunnen */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg,
      transparent 0,
      transparent 80px,
      rgba(255, 255, 255, 0.03) 80px,
      rgba(255, 255, 255, 0.03) 81px),
    radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.06) 0%, transparent 28%);
  pointer-events: none;
}

/* Konfetti-prikker i hjørner */
.hero::after {
  content: '';
  position: absolute;
  top: 30px;
  right: 40px;
  width: 140px;
  height: 140px;
  background:
    radial-gradient(circle 3px at 20% 30%, var(--gold) 99%, transparent 100%),
    radial-gradient(circle 4px at 70% 50%, var(--coral) 99%, transparent 100%),
    radial-gradient(circle 3px at 40% 80%, var(--pink) 99%, transparent 100%),
    radial-gradient(circle 2.5px at 90% 20%, #fff 99%, transparent 100%),
    radial-gradient(circle 3px at 10% 70%, var(--sky) 99%, transparent 100%);
  opacity: 0.7;
  pointer-events: none;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 36px;
  align-items: end;
  margin-bottom: 32px;
  position: relative;
  z-index: 1;
}

.hero__brand {
  display: flex;
  align-items: center;
  gap: 22px;
}

.hero__mark {
  font-size: 64px;
  line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,0.30));
  animation: bobble 4s ease-in-out infinite;
  transform-origin: center bottom;
  display: inline-block;
}

@keyframes bobble {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-6px) rotate(4deg); }
}

.hero__kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.14);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  color: var(--gold-soft);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.hero__title {
  color: #FBF8F0;
  font-weight: 900;
  letter-spacing: -0.04em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}
.hero__title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--gold-warm) 0%, var(--gold) 60%, var(--coral-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__stats {
  display: flex;
  gap: 28px;
}

.stat {
  text-align: right;
  position: relative;
}

.stat__label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0.70;
  margin-bottom: 6px;
}

.stat__value {
  display: block;
  font-size: 36px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #FBF8F0 0%, var(--gold-warm) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

@media (max-width: 720px) {
  .hero { padding: 28px 22px 0; border-radius: var(--radius-lg); }
  .hero__inner { grid-template-columns: 1fr; gap: 22px; align-items: start; margin-bottom: 22px; }
  .hero__stats { gap: 18px; justify-content: space-between; }
  .stat { text-align: left; }
  .stat__value { font-size: 26px; }
  .hero__mark { font-size: 46px; }
  .hero::after { width: 90px; height: 90px; top: 18px; right: 18px; }
}

/* ───────── Tabs ───────── */
.hero__nav {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.22);
  border-radius: var(--radius) var(--radius) 0 0;
  margin: 0 -44px 0;
  padding-left: 44px;
  padding-right: 44px;
  position: relative;
  z-index: 1;
  overflow-x: auto;
  scrollbar-width: none;
  backdrop-filter: blur(8px);
}
.hero__nav::-webkit-scrollbar { display: none; }

@media (max-width: 720px) {
  .hero__nav { margin: 0 -22px; padding-left: 22px; padding-right: 22px; }
}

.tab {
  background: transparent;
  border: 0;
  color: rgba(251, 248, 240, 0.72);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(.2, .7, .2, 1);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.tab:hover {
  color: #FBF8F0;
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

.tab.is-active {
  background: #FBF8F0;
  color: var(--green-dark);
  font-weight: 700;
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.30);
}

/* ════════════════════════════════════════════════════════════
   MAIN / VIEWS
   ════════════════════════════════════════════════════════════ */
.main { display: block; position: relative; z-index: 1; }

.view {
  display: none;
  flex-direction: column;
  gap: 26px;
  animation: fadeUp 0.4s cubic-bezier(.2, .7, .2, 1);
}

.view.is-active { display: flex; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ───────── Cards ───────── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s;
}

.card:hover { box-shadow: var(--shadow-md); }

@media (max-width: 640px) {
  .card { padding: 22px; border-radius: var(--radius); }
}

.card__head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  margin-bottom: 22px;
}

.card__head > div:first-child h2 { font-size: 1.55rem; }

.card__note {
  font-size: 13px;
  color: var(--ink-soft);
  max-width: 340px;
  text-align: right;
}

@media (max-width: 640px) {
  .card__head { flex-direction: column; align-items: start; }
  .card__note { text-align: left; }
}

.kicker {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 6px;
  font-weight: 600;
}

.muted { color: var(--ink-soft); }
.muted.small { font-size: 13px; }

/* ════════════════════════════════════════════════════════════
   HJEM — Bli med + Ditt tipp
   ════════════════════════════════════════════════════════════ */
.card--hero {
  background:
    radial-gradient(circle at 80% 0%, var(--gold-tint), transparent 50%),
    radial-gradient(circle at 0% 100%, var(--green-tint), transparent 55%),
    var(--card);
  border-color: var(--line);
  position: relative;
  overflow: hidden;
}

.card--hero::before {
  content: '⚽';
  position: absolute;
  top: -30px;
  right: -20px;
  font-size: 200px;
  opacity: 0.04;
  transform: rotate(-15deg);
  pointer-events: none;
}

/* Register-skjema */
.register h2 {
  font-size: 1.9rem;
  margin: 8px 0 10px;
  letter-spacing: -0.025em;
}

.register__lead {
  color: var(--ink-soft);
  margin-bottom: 26px;
  max-width: 460px;
  font-size: 15px;
}

.register__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  position: relative;
  z-index: 1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field.full { grid-column: 1 / -1; }

.field > span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

.field em { font-style: normal; opacity: 0.7; font-weight: 500; }

.field input,
.field select,
.field textarea {
  font: inherit;
  font-size: 15px;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  transition: all 0.2s;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--green-soft);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-tint);
}

.register__form button {
  grid-column: 1 / -1;
  margin-top: 6px;
}

@media (max-width: 640px) {
  .register__form { grid-template-columns: 1fr; }
}

/* "Ditt tipp" — som et spillerkort */
.me {
  position: relative;
  background:
    linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #FBF8F0;
  margin: -32px;
  padding: 32px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.me::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(120deg,
      transparent 0,
      transparent 60px,
      rgba(255, 255, 255, 0.04) 60px,
      rgba(255, 255, 255, 0.04) 61px);
  pointer-events: none;
}

.me::after {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--gold-tint), transparent 70%);
  pointer-events: none;
}

.me > * { position: relative; z-index: 1; }

.me .kicker {
  color: var(--gold-soft);
  background: rgba(255, 255, 255, 0.12);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.me__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 4px 0 18px;
}

.me__flag {
  font-size: 72px;
  line-height: 1;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.25));
}

.me__row h2 {
  font-size: 2rem;
  color: #FBF8F0;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.me__sub {
  color: var(--gold-soft);
  font-size: 14px;
  opacity: 0.85;
}

.me__score {
  text-align: right;
  background: linear-gradient(135deg, var(--gold-warm), var(--gold));
  color: var(--green-deep);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: 0 6px 20px -8px rgba(232, 174, 54, 0.6);
}

.me__score strong {
  display: block;
  font-size: 36px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.me__score span {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.85;
}

.me__stage {
  background: rgba(255, 255, 255, 0.14);
  color: #FBF8F0;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.me__stage.is-out {
  background: rgba(238, 107, 61, 0.22);
  color: #FFD9C4;
  border-color: rgba(238, 107, 61, 0.30);
}

.me #resetMeButton {
  margin-top: 14px;
  color: var(--gold-soft);
  font-size: 12px;
  opacity: 0.75;
}
.me #resetMeButton:hover { opacity: 1; }

@media (max-width: 640px) {
  .me__row { grid-template-columns: auto 1fr; }
  .me__flag { font-size: 56px; }
  .me__score { grid-column: 2; text-align: right; }
  .me__row h2 { font-size: 1.5rem; }
}

/* ════════════════════════════════════════════════════════════
   PODIUM — Topp 3 visualisering
   ════════════════════════════════════════════════════════════ */
.podium {
  list-style: none;
  margin: 0;
  padding: 0;
}

.podium--empty-state {
  text-align: center;
  padding: 36px 20px;
}

.podium__empty {
  color: var(--ink-soft);
  font-style: italic;
  font-size: 15px;
}

.podium__stage {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.podium__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.podium__step:empty { display: none; }

.podium__medal {
  font-size: 32px;
  margin-bottom: 6px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
  animation: medalBob 3s ease-in-out infinite;
}
.podium__step--2 .podium__medal { animation-delay: 0.2s; }
.podium__step--3 .podium__medal { animation-delay: 0.4s; }

@keyframes medalBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

.podium__step-flag {
  font-size: 30px;
  line-height: 1;
  margin-bottom: 6px;
}

.podium__step-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin-bottom: 2px;
}

.podium__step-team {
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.podium__step-points {
  display: inline-block;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--green-tint);
  color: var(--green);
}

.podium__pillar {
  width: 100%;
  margin-top: 12px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.92);
  position: relative;
  overflow: hidden;
}

.podium__pillar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 60%);
  pointer-events: none;
}

.podium__step--1 .podium__pillar {
  height: 92px;
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-warm) 100%);
  color: var(--green-deep);
  box-shadow: 0 10px 24px -10px var(--gold-tint);
}

.podium__step--2 .podium__pillar {
  height: 64px;
  background: linear-gradient(180deg, #DCD9C8 0%, var(--silver) 100%);
  color: var(--ink);
}

.podium__step--3 .podium__pillar {
  height: 44px;
  background: linear-gradient(180deg, #D9A56F 0%, var(--bronze) 100%);
  color: #FBF8F0;
}

.podium__step--1 .podium__step-points {
  background: var(--gold-tint);
  color: var(--gold);
  font-size: 14px;
}

.podium__rest {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.podium__row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.podium__row:hover { background: var(--bg-soft); }

.podium__rank {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink-faded);
  font-size: 13px;
}

.podium__name { font-size: 14px; font-weight: 600; }

.podium__team {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.podium__points {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--green);
  font-size: 14px;
}

@media (max-width: 480px) {
  .podium__step-name { font-size: 12px; }
  .podium__step-team { font-size: 10px; }
  .podium__step-flag { font-size: 24px; }
  .podium__medal { font-size: 26px; }
  .podium__step--1 .podium__pillar { height: 74px; font-size: 20px; }
  .podium__step--2 .podium__pillar { height: 52px; font-size: 18px; }
  .podium__step--3 .podium__pillar { height: 36px; font-size: 16px; }
}

/* ════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(.2, .7, .2, 1);
  background: var(--card);
  color: var(--ink);
  letter-spacing: 0.01em;
}

.button--primary {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #FBF8F0;
  border-color: var(--green-dark);
  font-weight: 700;
  box-shadow: var(--shadow-pop);
  padding: 14px 28px;
}

.button--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 0 -2px rgba(10, 90, 55, 0.18), 0 16px 24px -10px var(--green-glow);
}

.button--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 0 -2px rgba(10, 90, 55, 0.16);
}

.button--ghost {
  background: transparent;
  border-color: var(--line);
}
.button--ghost:hover {
  background: var(--bg-soft);
  border-color: var(--ink-soft);
  transform: translateY(-1px);
}

.button--danger-ghost {
  background: transparent;
  border-color: var(--coral-tint);
  color: var(--coral);
}
.button--danger-ghost:hover {
  background: var(--coral-tint);
  border-color: var(--coral);
}

.button--small {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 8px;
  font-weight: 600;
}

.link-button {
  background: none;
  border: 0;
  color: var(--green);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
  letter-spacing: 0.01em;
}
.link-button:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ════════════════════════════════════════════════════════════
   LEADERBOARD-TABELL
   ════════════════════════════════════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  margin: 0 -8px;
  padding: 0 8px;
}

.leaderboard {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
}

.leaderboard thead th {
  text-align: left;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faded);
  font-weight: 700;
  padding: 14px 14px;
  border-bottom: 2px solid var(--line);
}

.leaderboard tbody td {
  padding: 16px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  background: transparent;
  transition: background 0.2s;
}

.leaderboard tbody tr { transition: background 0.2s; }
.leaderboard tbody tr:hover td { background: var(--bg-soft); }

/* Topp 3 fremhevet */
.leaderboard tbody tr:nth-child(1) td { background: linear-gradient(90deg, var(--gold-tint), transparent 60%); }
.leaderboard tbody tr:nth-child(2) td { background: linear-gradient(90deg, rgba(184, 181, 168, 0.18), transparent 60%); }
.leaderboard tbody tr:nth-child(3) td { background: linear-gradient(90deg, rgba(197, 138, 74, 0.16), transparent 60%); }
.leaderboard tbody tr:nth-child(1):hover td,
.leaderboard tbody tr:nth-child(2):hover td,
.leaderboard tbody tr:nth-child(3):hover td { background: var(--bg-soft); }

.leaderboard tr.is-eliminated td { opacity: 0.55; }

.col-rank {
  width: 48px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--ink-faded);
  font-size: 14px;
}
.leaderboard tr:nth-child(1) .col-rank::before { content: '🏆 '; }
.leaderboard tr:nth-child(2) .col-rank::before { content: '🥈 '; }
.leaderboard tr:nth-child(3) .col-rank::before { content: '🥉 '; }
.leaderboard tr:nth-child(1) .col-rank,
.leaderboard tr:nth-child(2) .col-rank,
.leaderboard tr:nth-child(3) .col-rank { font-size: 0; }
.leaderboard tr:nth-child(1) .col-rank::before,
.leaderboard tr:nth-child(2) .col-rank::before,
.leaderboard tr:nth-child(3) .col-rank::before { font-size: 18px; }

.col-points {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.col-points strong {
  color: var(--green);
  font-size: 17px;
  font-weight: 800;
}

.col-stage { white-space: nowrap; }
.col-dep { color: var(--ink-soft); font-size: 13px; }

.empty-row td {
  text-align: center;
  color: var(--ink-soft);
  padding: 40px !important;
  font-style: italic;
  background: transparent !important;
}

.team-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.team-pill > span:first-child { font-size: 18px; line-height: 1; }

.stage-chip {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--green-tint);
  color: var(--green);
  letter-spacing: 0.02em;
}

.stage-chip--winner { background: var(--gold-tint); color: var(--gold); }
.stage-chip--final  { background: var(--gold-tint); color: var(--gold); }
.stage-chip--sf     { background: var(--coral-tint); color: var(--coral); }
.stage-chip.is-out  { background: var(--coral-tint); color: var(--coral); }

@media (max-width: 640px) {
  .col-dep { display: none; }
  .leaderboard thead th, .leaderboard tbody td { padding: 12px 10px; }
}

/* ───────── Poengstige ───────── */
.points-ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.points-ladder li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.points-ladder li:hover {
  background: var(--green-tint);
  transform: translateY(-2px);
}

.points-ladder li:nth-child(7) {
  background: linear-gradient(135deg, var(--gold-tint), var(--gold-soft));
}

.points-ladder li:nth-child(7)::before {
  content: '🏆';
  position: absolute;
  right: 6px;
  bottom: -10px;
  font-size: 40px;
  opacity: 0.18;
}

.ladder__stage { color: var(--ink-soft); font-weight: 500; }
.ladder__points {
  font-weight: 800;
  color: var(--green);
  font-variant-numeric: tabular-nums;
  font-size: 16px;
}

.points-ladder li:nth-child(7) .ladder__points { color: var(--gold); }

/* ════════════════════════════════════════════════════════════
   LAG-GRID — spillerkort
   ════════════════════════════════════════════════════════════ */
.legend {
  display: flex;
  gap: 20px;
  margin-bottom: 22px;
  font-size: 13px;
  color: var(--ink-soft);
  flex-wrap: wrap;
}
.legend span { display: flex; align-items: center; gap: 8px; }
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green-soft);
}
.dot--active     { background: var(--green); box-shadow: 0 0 0 3px var(--green-tint); }
.dot--eliminated { background: var(--coral); box-shadow: 0 0 0 3px var(--coral-tint); }
.dot--winner     { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }

.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.team-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 16px 18px;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  transition: all 0.25s cubic-bezier(.2, .7, .2, 1);
  overflow: hidden;
}

/* Diagonal stripe = aktiv */
.team-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-soft) 100%);
}

.team-card:hover {
  transform: translateY(-4px) rotate(-0.5deg);
  border-color: var(--green-soft);
  box-shadow: var(--shadow-md);
}

.team-card.is-eliminated {
  opacity: 0.55;
}
.team-card.is-eliminated::before {
  background: linear-gradient(90deg, var(--coral) 0%, var(--coral-soft) 100%);
}
.team-card.is-eliminated:hover {
  transform: none;
  border-color: var(--coral-tint);
}

.team-card.is-winner {
  background: linear-gradient(180deg, var(--gold-soft) 0%, var(--card) 100%);
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-tint), var(--shadow-md);
  animation: winner-glow 2.5s ease-in-out infinite;
}
.team-card.is-winner::before {
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-warm) 100%);
  height: 8px;
}
.team-card.is-winner::after {
  content: '👑';
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 20px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
  animation: medalBob 2s ease-in-out infinite;
}

@keyframes winner-glow {
  0%, 100% { box-shadow: 0 0 0 4px var(--gold-tint), var(--shadow-md); }
  50%      { box-shadow: 0 0 0 6px rgba(232, 174, 54, 0.28), var(--shadow-md); }
}

.team-card__flag {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.10));
}

.team-card__body { width: 100%; }

.team-card__body h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.team-card__stage {
  font-size: 11px;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.team-card__count {
  position: absolute;
  bottom: 12px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--green-tint);
  color: var(--green);
  border-radius: 999px;
  padding: 6px 10px;
  min-width: 38px;
}
.team-card__count span {
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.team-card__count small {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}

.team-card.is-eliminated .team-card__count {
  background: var(--coral-tint);
  color: var(--coral);
}

/* ────── Ukentlig ────── */
.weekly p {
  margin-bottom: 14px;
  line-height: 1.65;
  color: var(--ink);
}
.weekly p:last-child { margin-bottom: 0; }

/* ════════════════════════════════════════════════════════════
   ADMIN
   ════════════════════════════════════════════════════════════ */
.card--login {
  max-width: 440px;
  margin: 40px auto 0;
  position: relative;
}

.card--login::before {
  content: '🔐';
  position: absolute;
  top: -20px;
  right: -10px;
  font-size: 42px;
  opacity: 0.15;
  transform: rotate(12deg);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form .button { width: 100%; }

.card--admin-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, var(--card) 0%, var(--bg-soft) 100%);
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-teams {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-team {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  border-left: 4px solid var(--green);
  transition: all 0.2s;
}

.admin-team:hover {
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.admin-team.is-eliminated {
  opacity: 0.6;
  border-left-color: var(--coral);
}

.admin-team__flag { font-size: 28px; line-height: 1; }
.admin-team__main strong { font-size: 14px; font-weight: 700; }
.admin-team__main small  { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 3px; }

.admin-team__actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .admin-team { grid-template-columns: auto 1fr; }
  .admin-team__actions { grid-column: 1 / -1; justify-content: flex-start; }
}

.admin-users {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-user {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.admin-user:hover { background: var(--card); box-shadow: var(--shadow-sm); }

.admin-user strong { display: block; font-size: 14px; font-weight: 700; }
.admin-user small  { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 3px; }

.add-team {
  margin-top: 18px;
  border-top: 1px dashed var(--line);
  padding-top: 16px;
}

.add-team summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--green);
  padding: 6px 0;
  list-style: none;
  user-select: none;
}
.add-team summary::-webkit-details-marker { display: none; }
.add-team summary::before { content: '+ '; font-weight: 800; }
.add-team[open] summary { margin-bottom: 14px; }
.add-team[open] summary::before { content: '− '; }

.add-team__form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: end;
}

.add-team__form button { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .add-team__form { grid-template-columns: 1fr; }
}

.weekly-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.weekly-form textarea {
  font-family: var(--font);
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.weekly-form button { align-self: start; }

/* ════════════════════════════════════════════════════════════
   FOOTER
   ════════════════════════════════════════════════════════════ */
.footer {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-faded);
}
.footer__hint a { color: var(--green); text-decoration: none; font-weight: 600; }
.footer__hint a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ════════════════════════════════════════════════════════════
   TOAST
   ════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(24px);
  background: var(--ink);
  color: #FBF8F0;
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(.2, .7, .2, 1);
  z-index: 200;
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 40px);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast[data-kind="success"] {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
}
.toast[data-kind="error"] {
  background: linear-gradient(135deg, var(--coral) 0%, #C84A1F 100%);
}

/* ════════════════════════════════════════════════════════════
   KONFETTI
   ════════════════════════════════════════════════════════════ */
.confetti-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 300;
}

.confetti-piece {
  position: absolute;
  top: -24px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
  will-change: transform, opacity;
}

.confetti-piece--circle { border-radius: 50%; width: 9px; height: 9px; }
.confetti-piece--strip  { width: 6px; height: 16px; border-radius: 2px; }

@keyframes confetti-fall {
  0%   { transform: translate3d(0, -30px, 0) rotate(0deg);   opacity: 1; }
  100% { transform: translate3d(var(--dx, 0), 105vh, 0) rotate(var(--rot, 720deg)); opacity: 0.55; }
}

/* ════════════════════════════════════════════════════════════
   SKJERM-STATER (data-mode)
   ════════════════════════════════════════════════════════════ */
.screen { display: none; }
.app[data-mode="loading"]        .screen--loading        { display: block; }
.app[data-mode="config-missing"] .screen--config-missing { display: block; }
.app[data-mode="landing"]        .screen--landing        { display: block; }
.app[data-mode="not-found"]      .screen--not-found      { display: block; }
.app[data-mode="room"]           .screen--room           { display: block; }
.app[data-mode="om-appen"]       .screen--om-appen       { display: block; }

/* Loading-spinner */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 80px 24px;
  color: var(--ink-soft);
}

.spinner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid var(--green-tint);
  border-top-color: var(--green);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Sentrert kort (for config-missing, not-found) */
.card--centered {
  max-width: 540px;
  margin: 60px auto;
  text-align: center;
}

.card--centered h2 {
  margin-top: 6px;
  margin-bottom: 12px;
}

.card--centered .button {
  margin-top: 18px;
}

/* ════════════════════════════════════════════════════════════
   LANDING — opprett tipperunde eller logg inn
   ════════════════════════════════════════════════════════════ */
.landing-hero {
  text-align: center;
  padding: 32px 20px 36px;
  position: relative;
}

/* Ball + brand-label side om side øverst i hero */
.landing-hero__brand-row {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}

.landing-hero__mark {
  font-size: 56px;
  display: inline-block;
  filter: drop-shadow(0 8px 18px rgba(16, 128, 79, 0.22));
  animation: bobble 4s ease-in-out infinite;
  line-height: 1;
}

.landing-hero__brand-label {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1;
}

.landing-hero__title {
  font-size: clamp(2.6rem, 6.5vw, 4.6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  margin: 8px 0 18px;
}

.landing-hero__title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-warm) 50%, var(--coral) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-hero__tagline {
  max-width: 600px;
  margin: 0 auto 14px;
  color: var(--ink, #1f1a14);
  font-size: clamp(15px, 1.6vw, 19px);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.landing-hero__lead {
  max-width: 540px;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.6;
}

.landing-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 32px;
}

@media (max-width: 760px) {
  .landing-cards { grid-template-columns: 1fr; gap: 16px; }
}

.landing-card {
  display: flex;
  flex-direction: column;
}

.landing-card__head {
  margin-bottom: 18px;
}

.landing-card__head h2 {
  font-size: 1.4rem;
  margin: 4px 0 6px;
}

.landing-card__head .muted {
  font-size: 14px;
}

.landing-foot {
  text-align: center;
  font-size: 14px;
  padding: 12px 16px;
}

/* "Glemt passord?"-link i login-form */
.forgot-link {
  align-self: flex-start;
  font-size: 13px;
  margin-top: 4px;
}

/* Dialog for å sette nytt passord */
.password-dialog {
  max-width: 440px;
  width: calc(100% - 32px);
  padding: 28px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  color: var(--ink);
}

.password-dialog::backdrop {
  background: rgba(27, 20, 16, 0.5);
  backdrop-filter: blur(6px);
}

.password-dialog h2 {
  margin: 6px 0 8px;
  font-size: 1.4rem;
}

.password-dialog .stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Form-utils */
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stack .button {
  margin-top: 4px;
}

.field-hint {
  font-size: 12px;
  color: var(--ink-faded);
  margin-top: 4px;
  font-family: var(--font-mono);
  word-break: break-all;
}

/* ════════════════════════════════════════════════════════════
   SHARE-CARD (delbar lenke i rom-mode)
   ════════════════════════════════════════════════════════════ */
.share-card {
  background: linear-gradient(135deg, var(--green-tint), var(--gold-tint));
  border: 1px dashed var(--green-soft);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  position: relative;
}

.share-card .kicker { color: var(--green-dark); }

.share-card h2 {
  font-size: 1.5rem;
  margin: 4px 0 8px;
  color: var(--ink);
}

.share-card p {
  margin: 4px 0 14px;
  font-size: 14px;
  color: var(--ink);
}

/* Tom-tilstand: tipperunden har ingen tippere ennå — gjør invitasjonen fremtredende */
.share-card--invite {
  background:
    radial-gradient(circle at 0% 0%, var(--gold-tint), transparent 55%),
    radial-gradient(circle at 100% 100%, var(--green-tint), transparent 55%),
    var(--card);
  border: 2px solid var(--green);
  padding: 28px 30px;
  box-shadow: 0 0 0 6px var(--green-tint), var(--shadow-md);
}

.share-card--invite h2 { font-size: 1.7rem; }
.share-card--invite p { font-size: 15px; max-width: 520px; }

.share-row {
  display: flex;
  gap: 8px;
}

.share-row--invite {
  margin-top: 10px;
}

.share-row--invite button {
  width: 100%;
}

.share-row input {
  flex: 1;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 253, 248, 0.85);
  color: var(--ink);
}

.share-row input:focus {
  outline: none;
  border-color: var(--green);
}

@media (max-width: 480px) {
  .share-row { flex-direction: column; }
}

/* ════════════════════════════════════════════════════════════
   AVSLUTT TIPPERUNDEN (slett-seksjon, idiotsikret)
   ════════════════════════════════════════════════════════════ */

/* Teaser i admin-panel — leder til den isolerte siden */
.card--end-teaser {
  background:
    radial-gradient(circle at 0% 0%, var(--gold-tint), transparent 55%),
    radial-gradient(circle at 100% 100%, var(--coral-tint), transparent 55%),
    var(--card);
  border: 2px solid var(--gold);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 22px;
  padding: 26px 30px;
  box-shadow: 0 0 0 6px var(--gold-tint), var(--shadow-md);
}

.card--end-teaser .kicker {
  color: var(--coral);
  margin-bottom: 4px;
}

.card--end-teaser h2 {
  font-size: 1.35rem;
  margin: 0 0 6px;
}

.card--end-teaser p.muted {
  margin: 0;
  font-size: 14px;
}

.end-teaser__trophy {
  font-size: 56px;
  line-height: 1;
  filter: drop-shadow(0 6px 14px rgba(232, 174, 54, 0.45));
  animation: medalBob 2.5s ease-in-out infinite;
}

.end-teaser__body {
  flex: 1;
}

.button--end-cta {
  background: linear-gradient(135deg, var(--gold) 0%, var(--coral) 100%);
  color: #FBF8F0;
  border-color: transparent;
  font-weight: 700;
  font-size: 15px;
  padding: 16px 28px;
  min-width: 220px;
  box-shadow: 0 8px 0 -2px rgba(184, 69, 24, 0.18), 0 12px 24px -10px rgba(232, 174, 54, 0.5);
  transition: all 0.25s cubic-bezier(.2, .7, .2, 1);
}

.button--end-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 0 -2px rgba(184, 69, 24, 0.2), 0 20px 32px -10px rgba(232, 174, 54, 0.6);
}

@media (max-width: 640px) {
  .card--end-teaser {
    grid-template-columns: auto 1fr;
    padding: 20px 22px;
    gap: 16px;
  }
  .button--end-cta {
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
  }
  .end-teaser__trophy { font-size: 44px; }
}

/* Tilbake-knapp på avslutt-siden */
.end-back {
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 14px;
}

.end-back:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.card--end {
  background:
    radial-gradient(circle at 0% 0%, var(--gold-tint), transparent 50%),
    radial-gradient(circle at 100% 100%, var(--coral-tint), transparent 50%),
    var(--card);
  border: 1.5px solid var(--coral-tint);
}

.end-winner__banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--gold-tint), var(--bg-soft));
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.end-winner__trophy {
  font-size: 36px;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(232, 174, 54, 0.45));
  animation: medalBob 2.5s ease-in-out infinite;
}

.end-winner__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.end-winner__main strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.end-winner__main span {
  font-size: 13px;
  color: var(--ink-soft);
}

.end-winner__flag .fi {
  width: 44px;
  height: 33px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.end-tournament > p {
  margin-bottom: 14px;
  line-height: 1.6;
}

.end-tournament strong { color: var(--coral); }

.button--danger {
  background: linear-gradient(135deg, var(--coral) 0%, #C84A1F 100%);
  color: #FBF8F0;
  border-color: #B84518;
  font-weight: 700;
  box-shadow: 0 8px 0 -2px rgba(184, 69, 24, 0.18);
}

.button--danger:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 0 -2px rgba(184, 69, 24, 0.20), 0 16px 24px -10px rgba(184, 69, 24, 0.4);
}

.button--danger:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.end-confirm {
  margin-top: 22px;
  padding: 22px;
  background: rgba(255, 253, 248, 0.75);
  border-radius: var(--radius);
  border: 1.5px dashed var(--coral);
}

.end-confirm > p {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--ink);
}

.end-confirm code {
  font-family: var(--font-mono);
  background: var(--coral-tint);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  color: var(--coral);
  font-size: 13px;
}

.end-confirm input {
  width: 100%;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.end-confirm input:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--coral-tint);
}

.end-confirm__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════
   TOM-TILSTANDER (empty states)
   ════════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 40px 24px;
  max-width: 480px;
  margin: 0 auto;
  color: var(--ink-soft);
}

.empty-state__icon {
  display: block;
  font-size: 44px;
  margin-bottom: 14px;
  line-height: 1;
  opacity: 0.7;
}

.empty-state strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* ════════════════════════════════════════════════════════════
   BRACKET / KAMPER
   ════════════════════════════════════════════════════════════ */

.bracket {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.bracket__stage-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px dashed var(--line);
  display: inline-block;
}

.bracket__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.match-card {
  position: relative;
  background: var(--bg);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: all 0.2s;
}

.match-card.is-live {
  background: linear-gradient(135deg, var(--coral-tint), var(--bg));
  border-color: var(--coral);
  box-shadow: 0 0 0 3px var(--coral-tint);
}

.match-card.is-finished {
  background: var(--card);
}

.match-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.match-card__kickoff {
  font-size: 11px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.match-status {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.match-status--live {
  background: var(--coral);
  color: #FBF8F0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #FBF8F0;
  animation: livePulse 1.4s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(1.3); }
}

.match-status--finished {
  background: var(--green-tint);
  color: var(--green-dark);
}

.match-status--scheduled {
  background: var(--bg-soft);
  color: var(--ink-soft);
}

.match-team {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 4px;
  transition: opacity 0.2s;
}

.match-team__flag {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.match-team__flag .fi {
  width: 28px;
  height: 21px;
  border-radius: 3px;
}

.match-team__name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.match-team__score {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faded);
  min-width: 30px;
  text-align: right;
}

.match-team.is-winner .match-team__score {
  color: var(--green);
}

.match-team.is-winner .match-team__name {
  font-weight: 700;
  color: var(--green-dark);
}

.match-team.is-winner::after {
  content: '✓';
  position: absolute;
  right: -2px;
  color: var(--green);
  font-weight: 700;
  font-size: 14px;
}

.match-team.is-loser {
  opacity: 0.55;
}

.match-team__tippers {
  grid-column: 2 / -1;
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.match-team__tippers li {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--green-tint);
  color: var(--green-dark);
  border-radius: 999px;
  font-weight: 500;
}

.match-team__tippers li.muted {
  background: transparent;
  color: var(--ink-faded);
  padding: 2px 4px;
}

.match-team__no-tippers {
  grid-column: 2 / -1;
  font-size: 11px;
  font-style: italic;
  margin-top: 2px;
}

.match-card__divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px 0;
  position: relative;
}

.match-card__divider::before,
.match-card__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.match-card__divider span {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 0 10px;
  color: var(--ink-faded);
  font-weight: 600;
}

@media (max-width: 480px) {
  .bracket__grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════
   BRACKET TREE (turneringstre — FIFA-stil)
   ════════════════════════════════════════════════════════════ */

.bracket-tree-section {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 32px;
}

.bracket-champion {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(218, 165, 32, 0.18), transparent 70%),
    linear-gradient(135deg, var(--green-dark), var(--green-deep));
  color: #FBF8F0;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(7, 64, 38, 0.25);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.bracket-champion::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle 2px at 20% 30%, rgba(255, 215, 100, 0.6), transparent 50%),
    radial-gradient(circle 1.5px at 80% 40%, rgba(255, 215, 100, 0.5), transparent 50%),
    radial-gradient(circle 1px at 60% 20%, rgba(255, 215, 100, 0.7), transparent 50%),
    radial-gradient(circle 2px at 30% 70%, rgba(255, 215, 100, 0.4), transparent 50%);
  pointer-events: none;
}

.bracket-champion__icon {
  font-size: 36px;
  filter: drop-shadow(0 0 12px rgba(255, 215, 100, 0.6));
}

.bracket-champion__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(251, 248, 240, 0.7);
  font-weight: 600;
}

.bracket-champion__team {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.bracket-champion__flag .fi {
  width: 36px;
  height: 27px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.bracket-tree {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--ink-faded) transparent;
}

.bracket-tree::-webkit-scrollbar {
  height: 8px;
}

.bracket-tree::-webkit-scrollbar-track {
  background: transparent;
}

.bracket-tree::-webkit-scrollbar-thumb {
  background: var(--ink-faded);
  border-radius: 4px;
}

.bracket-tree__column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-around;
  min-height: 100%;
}

.bracket-tree__stage-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-soft);
  text-align: center;
  padding-bottom: 8px;
  border-bottom: 1.5px dashed var(--line);
  margin-bottom: 4px;
}

.bracket-tree__matches {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: space-around;
  flex: 1;
}

.match-mini {
  position: relative;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s;
}

.match-mini:hover {
  border-color: var(--ink-faded);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(27, 20, 16, 0.06);
}

.match-mini.is-live {
  background: linear-gradient(135deg, var(--coral-tint), var(--card));
  border-color: var(--coral);
  box-shadow: 0 0 0 2px var(--coral-tint);
}

.match-mini.is-finished {
  background: var(--bg-soft);
}

.match-mini__live {
  position: absolute;
  top: -8px;
  right: 8px;
  font-size: 8px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  background: var(--coral);
  color: #FBF8F0;
  padding: 2px 6px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.match-mini__row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 4px 2px;
  border-radius: 6px;
  transition: opacity 0.2s;
}

.match-mini__row.is-winner {
  background: var(--green-tint);
}

.match-mini__row.is-winner .match-mini__name {
  font-weight: 700;
  color: var(--green-dark);
}

.match-mini__row.is-winner .match-mini__score {
  color: var(--green);
  font-weight: 800;
}

.match-mini__row.is-loser {
  opacity: 0.45;
}

.match-mini__flag {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.match-mini__flag .fi {
  width: 22px;
  height: 16px;
  border-radius: 2px;
}

.match-mini__name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.match-mini__count {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--green);
  color: #FBF8F0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: help;
  line-height: 1;
}

.match-mini__count[data-count="0"] {
  display: none;
}

.match-mini__score {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faded);
  min-width: 16px;
  text-align: right;
}

.bracket-bronze {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  padding: 16px;
  background: var(--bg-soft);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  max-width: 320px;
  margin: 0 auto;
}

.bracket-bronze__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-soft);
}

.bracket-bronze__match {
  width: 100%;
}

/* Gruppespill som kollapsbar liste */
.bracket-group-section {
  border-top: 2px dashed var(--line);
  padding-top: 22px;
  margin-top: 6px;
}

.bracket-group-section__summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  list-style: none;
  user-select: none;
}

.bracket-group-section__summary::-webkit-details-marker {
  display: none;
}

.bracket-group-section__summary::after {
  content: '▾';
  font-size: 14px;
  color: var(--ink-faded);
  transition: transform 0.2s;
  margin-left: auto;
}

.bracket-group-section[open] .bracket-group-section__summary::after {
  transform: rotate(180deg);
}

.bracket-group-section__count {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  background: var(--bg-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.bracket-group-section__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

@media (max-width: 640px) {
  .bracket-tree {
    grid-auto-columns: minmax(170px, 1fr);
    gap: 10px;
  }
  .match-mini__name { font-size: 11.5px; }
  .match-mini__flag .fi { width: 18px; height: 13px; }
  .bracket-champion__team { font-size: 1.15rem; }
  .bracket-champion__icon { font-size: 28px; }
  .bracket-group-section__grid { grid-template-columns: 1fr; }
}

/* Admin: match list */
.admin-matches {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 18px;
}

.admin-matches__group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-matches__stage {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 4px;
}

.admin-match {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--line);
}

.admin-match__main strong { font-size: 13px; font-weight: 600; }
.admin-match__main small  { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 2px; }

.admin-match__scores {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-match__input {
  width: 44px;
  padding: 5px 6px;
  text-align: center;
  font: inherit;
  font-family: var(--font-mono);
  font-size: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
}

.admin-match__dash {
  color: var(--ink-faded);
  font-weight: 600;
}

.admin-match__actions {
  display: flex;
  gap: 4px;
}

.sync-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
}

/* Auto-sync-status — viser at appen henter data automatisk */
.auto-sync-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(94, 124, 104, 0.10);
  border: 1px solid rgba(63, 89, 73, 0.20);
  border-radius: 10px;
  font-size: 14px;
  color: var(--ink, #1F1A14);
}
.auto-sync-status__pulse {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4ADE80;
  flex-shrink: 0;
}
.auto-sync-status__pulse::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(74, 222, 128, 0.4);
  animation: autoSyncPulse 2.4s cubic-bezier(.2,.7,.2,1) infinite;
}
@keyframes autoSyncPulse {
  0%   { transform: scale(0.6); opacity: 0.8; }
  80%  { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(1.8); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .auto-sync-status__pulse::after { animation: none; }
}
.auto-sync-status__text {
  flex: 1;
  line-height: 1.4;
}
#lastSyncedLabel {
  font-weight: 600;
}

/* Read-only varianter — fjerner hover/cursor på admin team/match */
.admin-team--readonly {
  cursor: default;
}
.admin-match--readonly {
  cursor: default;
}
.admin-match__scores--readonly {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.admin-match__score {
  display: inline-block;
  min-width: 22px;
  text-align: center;
}

.manual-matches-link {
  width: 100%;
  margin-top: 4px;
  justify-content: space-between;
  font-weight: 600;
}

.manual-matches-link::after {
  content: '';
}

.sync-status {
  flex: 1;
  min-width: 200px;
}

.sync-status a { color: var(--green); font-weight: 600; }

.add-match__form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.add-match__form button { grid-column: 1 / -1; }

@media (max-width: 600px) {
  .add-match__form { grid-template-columns: 1fr; }
  .admin-match { grid-template-columns: 1fr; }
  .admin-match__scores, .admin-match__actions { justify-self: start; }
}

/* ════════════════════════════════════════════════════════════
   DEMO-MODUS
   ════════════════════════════════════════════════════════════ */

/* Sticky banner øverst når demo-mode er aktiv */
.demo-stripe {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 24px;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-warm) 100%);
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 600;
  flex-wrap: wrap;
  text-align: center;
}

.demo-stripe__badge {
  background: var(--green-deep);
  color: var(--gold-warm);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.demo-stripe__text { color: rgba(7, 64, 38, 0.85); }

.demo-stripe__link {
  color: var(--green-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 700;
}

.demo-stripe__link:hover { color: #000; }

@media (max-width: 600px) {
  .demo-stripe { font-size: 12px; padding: 8px 14px; gap: 8px; }
}

/* "Slik fungerer det" — 3-stegs intro på landing */
.landing-how {
  margin-bottom: 28px;
  padding: 26px 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.landing-how__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

.landing-how__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.landing-how__steps li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.landing-how__num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--green);
  color: #FBF8F0;
  border-radius: 50%;
  font-weight: 700;
  font-size: 14px;
  font-family: var(--font-mono);
}

.landing-how__steps strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.landing-how__steps p {
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin: 0;
}

@media (max-width: 760px) {
  .landing-how__steps { grid-template-columns: 1fr; gap: 14px; }
}

/* CTA-blokk på landing-siden (hele blokken er klikkbar) */
.landing-demo-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 26px;
  padding: 26px 30px;
  margin-bottom: 28px;
  background:
    radial-gradient(circle at 0% 0%, var(--gold-tint), transparent 60%),
    radial-gradient(circle at 100% 100%, var(--green-tint), transparent 60%),
    var(--card);
  border: 1.5px dashed var(--gold);
  border-radius: var(--radius);
  flex-wrap: wrap;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(.2, .7, .2, 1);
}

.landing-demo-cta:hover {
  transform: translateY(-2px);
  border-color: var(--gold-warm);
  border-style: solid;
  box-shadow: var(--shadow-md);
}

.landing-demo-cta__text strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.landing-demo-cta__text p {
  font-size: 14px;
  color: var(--ink-soft);
  margin: 4px 0 0;
}

.landing-demo-cta__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 44px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
  color: #FBF8F0;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop);
  min-width: 220px;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(.2, .7, .2, 1);
}

.landing-demo-cta:hover .landing-demo-cta__btn {
  transform: translateY(-1px);
  box-shadow: 0 14px 0 -2px rgba(10, 90, 55, 0.18), 0 16px 24px -10px var(--green-glow);
}

@media (max-width: 600px) {
  .landing-demo-cta {
    flex-direction: column;
    text-align: center;
    padding: 22px 20px;
    gap: 18px;
  }
  .landing-demo-cta__btn {
    width: 100%;
    min-width: 0;
    padding: 15px 28px;
  }
}

/* Demo-intro inni rom-skjermen (erstatter "ditt tipp"-kortet) */
.demo-intro {
  text-align: center;
  padding: 8px 0;
}

.demo-intro h2 {
  font-size: 1.8rem;
  margin: 6px 0 10px;
  letter-spacing: -0.02em;
}

.demo-intro > p {
  color: var(--ink-soft);
  max-width: 480px;
  margin: 0 auto 22px;
  line-height: 1.6;
}

.demo-intro strong { color: var(--green); font-weight: 700; }

.demo-intro__cta {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

/* "Dette er en hobby-tjeneste"-disclaimer */
.hobby-note {
  font-size: 12.5px;
  line-height: 1.55;
  padding: 10px 12px;
  background: var(--gold-tint);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  color: var(--ink);
  margin: 0;
}

.hobby-note strong {
  font-weight: 700;
  color: var(--ink);
}

.hobby-note a {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ════════════════════════════════════════════════════════════
   SAMTYKKE-CHECKBOX (vilkår)
   ════════════════════════════════════════════════════════════ */
.checkbox-field {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s;
}

.checkbox-field.full { grid-column: 1 / -1; }

.checkbox-field:hover {
  background: var(--bg-soft);
}

.checkbox-field input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--green);
}

.checkbox-field span { flex: 1; }

.checkbox-field a {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.checkbox-field a:hover { color: var(--green-dark); }

.checkbox-field strong { color: var(--ink); }

/* ════════════════════════════════════════════════════════════
   LANDSFLAGG (flag-icons)
   ════════════════════════════════════════════════════════════ */

/* Default rendering — alle .fi får en pen rounded look */
.fi {
  display: inline-block;
  vertical-align: middle;
  border-radius: 2px;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08) inset;
}

.flag-fallback {
  display: inline-block;
  line-height: 1;
}

/* "Ditt tipp"-kortet — stort flagg */
.me__flag .fi {
  width: 78px;
  height: 58px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255,255,255,0.15) inset;
}

/* Podium topp 3 */
.podium__step-flag .fi {
  width: 40px;
  height: 30px;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Podium 4–5 (rader) */
.podium__row .podium__team .fi {
  width: 20px;
  height: 15px;
  border-radius: 2px;
  margin-right: 6px;
}

/* Leaderboard team pill */
.team-pill .fi {
  width: 22px;
  height: 16px;
  border-radius: 2px;
}

/* Lag-grid spillerkort */
.team-card__flag .fi {
  width: 60px;
  height: 45px;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Admin lag-rad */
.admin-team__flag .fi {
  width: 34px;
  height: 25px;
  border-radius: 3px;
}

/* Admin tipper-liste */
.admin-user small .fi {
  width: 18px;
  height: 13px;
  border-radius: 2px;
  margin: 0 2px;
}

/* Sørg for at flag-icons har default-fallback if CSS ikke laster */
.fi::before {
  content: '';
  display: block;
}

@media (max-width: 640px) {
  .me__flag .fi { width: 60px; height: 45px; }
  .team-card__flag .fi { width: 50px; height: 38px; }
}

/* ════════════════════════════════════════════════════════════
   BEDRIFTSLOGO
   ════════════════════════════════════════════════════════════ */

/* Logo i hero-banneren */
.hero__logo {
  width: 88px;
  height: 88px;
  border-radius: 18px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.96);
  padding: 8px;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.30);
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .hero__logo { width: 64px; height: 64px; border-radius: 14px; padding: 6px; }
}

/* Firmanavn under "VM 2026" */
.hero__titles {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hero__subtitle {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--gold-soft);
  background: rgba(255, 255, 255, 0.08);
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  align-self: flex-start;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .hero__subtitle { font-size: 11px; padding: 4px 10px; letter-spacing: 0.08em; }
}

/* Om appen — trygghet, gratis-signal, signatur */
.landing-about {
  max-width: 640px;
  margin: 56px auto 0;
  padding: 28px 28px 30px;
  background: var(--bg-soft);
  border: 1px solid rgba(27, 20, 16, 0.07);
  border-radius: 14px;
  text-align: left;
}
.landing-about__title {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.landing-about__lead {
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.landing-about__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.landing-about__list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.landing-about__list strong {
  color: var(--ink);
  font-weight: 600;
}
.landing-about__icon {
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1.35;
}
.landing-about__author {
  color: var(--green-dark);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--green-tint);
  transition: color 0.2s, border-color 0.2s;
}
.landing-about__author:hover {
  color: var(--green);
  border-bottom-color: var(--green);
}
@media (max-width: 480px) {
  .landing-about {
    padding: 22px 20px;
    margin-top: 40px;
  }
}

/* Trygg-app-badge nederst i hero */
.landing-hero__safe-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 20px auto 0;
  padding: 7px 16px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border: 1px solid rgba(27, 20, 16, 0.08);
  border-radius: 999px;
}
.landing-hero__safe-badge span[aria-hidden="true"] {
  font-size: 13px;
  line-height: 1;
}

/* Logo-input i opprett-skjema */
.logo-input {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Auto-logo forslag basert på e-post-domene */
.logo-suggestions {
  margin-bottom: 12px;
  padding: 10px 12px;
  background: rgba(94, 124, 104, 0.08);
  border: 1px solid rgba(63, 89, 73, 0.18);
  border-radius: 10px;
}
.logo-suggestions__label {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--ink-soft, #3A3128);
}
.logo-suggestions__label strong {
  font-weight: 600;
  color: var(--ink, #1F1A14);
}
.logo-suggestions__list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.logo-suggestions__item {
  position: relative;
  width: 56px;
  height: 56px;
  padding: 4px;
  background: #fff;
  border: 1px solid rgba(31, 26, 20, 0.14);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.logo-suggestions__item:hover {
  border-color: var(--green, #3F5949);
  transform: translateY(-1px);
}
.logo-suggestions__item.is-selected {
  border-color: var(--green, #3F5949);
  box-shadow: 0 0 0 2px rgba(63, 89, 73, 0.20);
}
.logo-suggestions__item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.logo-suggestions__item.is-broken {
  display: none;
}

.logo-input__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  background: var(--bg);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink-soft);
  transition: all 0.2s;
}

.logo-input__btn:hover {
  border-color: var(--green-soft);
  border-style: solid;
  background: var(--green-tint);
  color: var(--green-dark);
}

.logo-input__preview {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--bg);
  border: 1.5px solid var(--line);
  overflow: hidden;
}

.logo-input__preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.logo-input__remove {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: var(--ink);
  color: var(--bg);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.logo-input__remove:hover {
  background: var(--coral);
}

/* Admin-panel: logo-seksjon */
.logo-manage {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.logo-manage__current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 96px;
  padding: 8px;
  background: var(--bg);
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-sm);
}

.logo-manage__img {
  max-width: 120px;
  max-height: 88px;
  object-fit: contain;
}

.logo-manage__actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ════════════════════════════════════════════════════════════
   MØRK LANDING-MODUS — premium og trendy first impression
   Aktiv KUN i landing-modus. Selve appen forblir lys.
   ════════════════════════════════════════════════════════════ */
html:has(.app[data-mode="landing"]),
body:has(.app[data-mode="landing"]),
html:has(.app[data-mode="om-appen"]),
body:has(.app[data-mode="om-appen"]) {
  background: #0A1F14;
}
.app[data-mode="landing"],
.app[data-mode="om-appen"] {
  background: #0A1F14;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(232, 174, 54, 0.10) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 60%, rgba(16, 128, 79, 0.18) 0%, transparent 60%),
    linear-gradient(180deg, #0A1F14 0%, #061812 100%);
  min-height: 100vh;
  color: #F2EAD3;
}

/* Om appen-skjermen layout */
.screen--om-appen {
  padding: 32px 20px 60px;
  max-width: 700px;
  margin: 0 auto;
}
.about-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: rgba(248, 243, 228, 0.85);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.about-back:hover {
  background: rgba(255, 255, 255, 0.10);
  color: #FBE3AB;
}

/* Footer-knapp som ser ut som lenke */
.footer__linkbutton {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.footer__linkbutton:hover {
  color: #FBE3AB;
}

/* Om appen-blokk på om-appen skjermen — bruk samme dark styling */
.app[data-mode="om-appen"] .landing-about {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
  margin-top: 0;
}
.app[data-mode="om-appen"] .landing-about__title { color: #F8F3E4; }
.app[data-mode="om-appen"] .landing-about__lead { color: rgba(248, 243, 228, 0.75); }
.app[data-mode="om-appen"] .landing-about__list li { color: rgba(248, 243, 228, 0.75); }
.app[data-mode="om-appen"] .landing-about__list strong { color: #F8F3E4; }
.app[data-mode="om-appen"] .landing-about__author {
  color: #FBE3AB;
  border-bottom-color: rgba(251, 227, 171, 0.30);
}
.app[data-mode="om-appen"] .landing-about__author:hover {
  color: var(--gold-warm);
  border-bottom-color: var(--gold-warm);
}

.app[data-mode="landing"] .landing-hero__brand-label {
  color: #FBE3AB;
}
.app[data-mode="landing"] .landing-hero__title { color: #F8F3E4; }
.app[data-mode="landing"] .landing-hero__tagline { color: #F8F3E4; }
.app[data-mode="landing"] .landing-hero__lead { color: rgba(248, 243, 228, 0.72); }
.app[data-mode="landing"] .landing-hero__safe-badge {
  color: rgba(248, 243, 228, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

/* "Slik fungerer det"-blokk på mørk */
.app[data-mode="landing"] .landing-how__title {
  color: #FBE3AB;
}
.app[data-mode="landing"] .landing-how__steps li {
  color: rgba(248, 243, 228, 0.82);
}
.app[data-mode="landing"] .landing-how__steps li strong {
  color: #F8F3E4;
}
.app[data-mode="landing"] .landing-how__num {
  background: linear-gradient(135deg, var(--gold) 0%, var(--coral) 100%);
  color: #0A1F14;
}
.app[data-mode="landing"] .landing-how {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Demo-CTA */
.app[data-mode="landing"] .landing-demo-cta {
  background: rgba(232, 174, 54, 0.08);
  border-color: rgba(232, 174, 54, 0.28);
  color: #F8F3E4;
}
.app[data-mode="landing"] .landing-demo-cta__btn {
  background: var(--gold);
  color: #0A1F14;
}
.app[data-mode="landing"] .landing-demo-cta__text strong {
  color: #FBE3AB;
}
.app[data-mode="landing"] .landing-demo-cta__text p {
  color: rgba(248, 243, 228, 0.7);
}

/* Cards (opprett / logg inn / glemt passord) på mørk */
.app[data-mode="landing"] .landing-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #F8F3E4;
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.5);
}
.app[data-mode="landing"] .landing-card h2 { color: #F8F3E4; }
.app[data-mode="landing"] .landing-card .kicker {
  color: #FBE3AB;
}
.app[data-mode="landing"] .landing-card .muted,
.app[data-mode="landing"] .landing-card p.muted {
  color: rgba(248, 243, 228, 0.65);
}
.app[data-mode="landing"] .landing-card label > span:first-child {
  color: rgba(248, 243, 228, 0.85);
}
.app[data-mode="landing"] .landing-card input[type="text"],
.app[data-mode="landing"] .landing-card input[type="email"],
.app[data-mode="landing"] .landing-card input[type="password"],
.app[data-mode="landing"] .landing-card input:not([type="checkbox"]):not([type="file"]) {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  color: #F8F3E4;
}
.app[data-mode="landing"] .landing-card input:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
}
.app[data-mode="landing"] .landing-card .field-hint,
.app[data-mode="landing"] .landing-card .field-hint span,
.app[data-mode="landing"] .landing-card small {
  color: rgba(248, 243, 228, 0.55);
}

/* Logo-suggestion-boks */
.app[data-mode="landing"] .logo-suggestions {
  background: rgba(232, 174, 54, 0.08);
  border-color: rgba(232, 174, 54, 0.25);
}
.app[data-mode="landing"] .logo-suggestions__label {
  color: rgba(248, 243, 228, 0.75);
}
.app[data-mode="landing"] .logo-suggestions__label strong {
  color: #FBE3AB;
}

/* Logo-input-knapp */
.app[data-mode="landing"] .logo-input__btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(248, 243, 228, 0.85);
}
.app[data-mode="landing"] .logo-input__btn:hover {
  background: rgba(255, 255, 255, 0.10);
}

/* Checkbox-tekst (vilkår) — feltet har fortsatt lys cream BG i dark mode,
   så teksten må holdes mørk for kontrast */
.app[data-mode="landing"] .checkbox-field {
  color: var(--ink);
  background: #FBF6E6;
}
.app[data-mode="landing"] .checkbox-field:hover {
  background: #F5EFDB;
}
.app[data-mode="landing"] .checkbox-field strong {
  color: var(--ink);
  font-weight: 700;
}
.app[data-mode="landing"] .checkbox-field a {
  color: var(--green-dark);
  font-weight: 700;
}

/* Om appen-blokken på mørk */
.app[data-mode="landing"] .landing-about {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
}
.app[data-mode="landing"] .landing-about__title { color: #F8F3E4; }
.app[data-mode="landing"] .landing-about__lead { color: rgba(248, 243, 228, 0.75); }
.app[data-mode="landing"] .landing-about__list li { color: rgba(248, 243, 228, 0.75); }
.app[data-mode="landing"] .landing-about__list strong { color: #F8F3E4; }
.app[data-mode="landing"] .landing-about__author {
  color: #FBE3AB;
  border-bottom-color: rgba(251, 227, 171, 0.30);
}
.app[data-mode="landing"] .landing-about__author:hover {
  color: var(--gold-warm);
  border-bottom-color: var(--gold-warm);
}

/* Landing-foot tekst */
.app[data-mode="landing"] .landing-foot.muted {
  color: rgba(248, 243, 228, 0.55);
}

/* Footer på mørk */
.app[data-mode="landing"] .footer {
  color: rgba(248, 243, 228, 0.5);
  border-top-color: rgba(255, 255, 255, 0.08);
}
.app[data-mode="landing"] .footer a {
  color: rgba(248, 243, 228, 0.75);
}
.app[data-mode="landing"] .footer a:hover {
  color: #FBE3AB;
}

/* Tilbake-til-portefølje-pille */
.app[data-mode="landing"] .back-to-portfolio {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(248, 243, 228, 0.85);
}
.app[data-mode="landing"] .back-to-portfolio:hover {
  background: rgba(255, 255, 255, 0.10);
}

/* "Fant ikke"-card på mørk */
.app[data-mode="landing"] .screen--not-found .card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.10);
}

/* Primary-button keeps green but pop more på mørk */
.app[data-mode="landing"] .button--primary {
  box-shadow: 0 8px 22px -10px rgba(16, 128, 79, 0.55);
}

/* ════════════════════════════════════════════════════════════
   REDUCED MOTION
   ════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
