@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --navy-900: #0f1b33; --navy-800: #16213e; --navy-950: #0a1224;
  --orange-500: #f5a623; --orange-600: #d98d0f; --orange-tint: #fff4e0;
  --blue-accent: #2f6fed; --blue-tint: #eaf1ff;
  --green-accent: #1d9e75; --green-tint: #e1f5ee;
  --red-accent: #d64545; --red-tint: #fbeaea;
  --gray-50: #f7f7f5; --gray-100: #eeeeec; --gray-300: #d3d1c7;
  --gray-500: #8a8980; --gray-700: #444441; --gray-900: #201f1c;
  --radius-sm: 8px; --radius-md: 12px; --radius-lg: 16px;
  --app-max-width: 1100px;
  --app-max-width-detail: 640px;
  --topbar-h: 44px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', -apple-system, sans-serif; background: var(--gray-50); color: var(--gray-900); }

.app-shell { max-width: var(--app-max-width); margin: 0 auto; min-height: 100vh; background: #fff; display: flex; flex-direction: column; }

/* Slim, always-visible identity bar. Sits above .hero, which keeps scrolling away as before. */
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: var(--topbar-h);
  background: var(--navy-950);
  color: #eef1f8;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  font-size: 13px; font-weight: 600;
}
.topbar-identity { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-logo { width: 20px; height: 20px; flex-shrink: 0; border-radius: 5px; display: none; }
.topbar-nav { display: none; gap: 4px; flex-shrink: 0; }

@media (min-width: 900px) {
  .topbar-logo { display: block; }
  .topbar-nav { display: flex; }
  .topbar-nav .nav-item {
    flex-direction: row; gap: 6px; padding: 0 12px; height: var(--topbar-h);
    color: #b7c3e0; font-size: 13px; font-weight: 600;
    border-bottom: 2px solid transparent;
  }
  .topbar-nav .nav-item .nav-dot { display: none; }
  .topbar-nav .nav-item.active { color: #fff; border-bottom-color: var(--orange-500); }
}

/* Hero — decorative header, unchanged visually. Scrolls away below the topbar. */
.hero { background: linear-gradient(135deg, #1a2a52 0%, var(--navy-800) 55%, var(--navy-950) 100%); color: #fff; padding: 20px 24px 24px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; top: -30px; right: -30px; width: 120px; height: 120px; border-radius: 50%; background: var(--orange-500); opacity: 0.18; }
.hero::before { content: ""; position: absolute; bottom: -40px; left: -30px; width: 100px; height: 100px; border-radius: 50%; background: var(--orange-500); opacity: 0.08; }
.hero-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #9fb0d9; margin: 0 0 4px; }
.hero-title { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
.hero-subtitle { font-size: 14px; color: #b7c3e0; margin: 4px 0 0; }
.hero-profile-link { position: absolute; top: 20px; right: 24px; font-size: 12px; font-weight: 600; color: #b7c3e0; text-decoration: none; z-index: 2; }
.back { font-size: 13px; color: #9fb0d9; text-decoration: none; }

/* Bottom tab nav (mobile) — unchanged behavior */
.bottom-nav { display: flex; border-top: 1px solid var(--gray-100); background: #fff; position: sticky; bottom: 0; margin-top: auto; z-index: 10; }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px max(12px, env(safe-area-inset-bottom)); text-decoration: none; color: var(--gray-500); font-size: 11px; font-weight: 600; background: none; border: none; cursor: pointer; font-family: inherit; }
.nav-item .nav-dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.nav-item.active { color: var(--navy-800); }
.nav-item.active .nav-dot { background: var(--orange-500); }

@media (min-width: 900px) {
  .bottom-nav { display: none; }
}

.section-label { font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 10px; }

/* Status badges — shared between sasongsoversikt.html and match-detalj.html */
.cell-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700;
}
.cell-icon.played  { background: var(--navy-800);     color: #fff; }
.cell-icon.picked  { background: var(--orange-500);   color: #fff; }
.cell-icon.avail   { background: var(--green-accent); color: #fff; }
.cell-icon.unavail { background: var(--red-accent);   color: #fff; }
.cell-icon.no      { background: var(--gray-100);     color: var(--gray-500); }

.avail-badge { font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: var(--radius-sm); }
.avail-badge.yes     { background: var(--green-accent); color: #fff; }
.avail-badge.unavail { background: var(--red-accent);   color: #fff; }
.avail-badge.no      { background: var(--gray-100);     color: var(--gray-500); }

.pick-check {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: none; background: var(--gray-100); color: var(--gray-300);
  display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0;
}
.player-pick-row.picked .pick-check { background: var(--orange-500); color: #fff; }

/* Card-list pages reflow into a 2-column grid at desktop widths. */
@media (min-width: 900px) {
  .grid-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 24px; align-items: start; }
  .grid-list .match-group-label { grid-column: 1 / -1; }
}

/* Detail/single-task pages: shell/topbar widen with everything else, but the
   actual content stays a comfortably narrow, centered column. */
.detail-content { max-width: var(--app-max-width-detail); margin: 0 auto; width: 100%; }
