/* ============================================================
   KJEKKAS OPEN — MAIN STYLESHEET
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  --green-900: #1a0a00;
  --green-800: #c45000;
  --green-700: #d96000;
  --green-600: #e87722;
  --green-400: #f5a55a;
  --green-200: #fdd9b5;
  --gold:       #c5a028;
  --gold-light: #e8c95a;
  --gold-pale:  #fdf3d0;

  --bg:         #fdf6f0;
  --bg-card:    #ffffff;
  --bg-alt:     #faeee4;
  --border:     #f0d8c5;
  --text-1:     #1a0d00;
  --text-2:     #6b3d1a;
  --text-3:     #8a5028;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.14);
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  22px;
  --transition: .22s ease;
  --nav-h:      68px;
}

[data-theme="dark"] {
  --bg:       #150800;
  --bg-card:  #261200;
  --bg-alt:   #1e0e00;
  --border:   #4a2200;
  --text-1:   #f5e6d8;
  --text-2:   #c89470;
  --text-3:   #c08560;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.25);
  --shadow-md: 0 4px 16px rgba(0,0,0,.35);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.45);
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--transition), color var(--transition);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ---------- TYPOGRAPHY ---------- */
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; line-height: 1.2; }
h3 { font-size: 1.25rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 600; }
p  { line-height: 1.7; color: var(--text-2); }

/* ---------- LAYOUT ---------- */
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.section { padding: 72px 0; }
.section-sm { padding: 40px 0; }
main { flex: 1; padding-top: var(--nav-h); }

/* ---------- NAV ---------- */
#main-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--green-800);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  height: var(--nav-h);
  box-shadow: 0 2px 20px rgba(0,0,0,.25);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  height: 100%; display: flex; align-items: center; gap: 32px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.15rem; color: #fff; white-space: nowrap;
  flex-shrink: 0;
}
.nav-logo-icon { font-size: 1.4rem; }
.nav-logo-text { font-weight: 400; }
.nav-logo-text strong { font-weight: 800; }
.nav-links {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto;
}
.nav-links a {
  color: rgba(255,255,255,.8); padding: 8px 14px;
  border-radius: var(--radius-sm); font-size: .9rem; font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(255,255,255,.12); color: #fff;
}
.nav-links a.active { color: var(--gold-light); }
.nav-theme button {
  background: rgba(255,255,255,.1); border-radius: 50%;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; transition: background var(--transition);
}
.nav-theme button:hover { background: rgba(255,255,255,.2); }
.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  padding: 8px; margin-left: auto;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- HERO ---------- */
.hero {
  color: #fff; padding: 100px 0 80px; text-align: center; position: relative; overflow: hidden;
  background-color: var(--green-900);
  background-image:
    linear-gradient(135deg, rgba(26,10,0,.90) 0%, rgba(196,80,0,.87) 60%, rgba(232,119,34,.85) 100%),
    url("../images/lagbilder/lagbilde_2022.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block; background: var(--gold); color: var(--green-900);
  font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 16px; border-radius: 100px; margin-bottom: 24px;
}
.hero h1 { color: #fff; margin-bottom: 16px; }
.hero p { color: rgba(255,255,255,.75); font-size: 1.15rem; max-width: 560px; margin: 0 auto 40px; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 100px; font-weight: 600;
  font-size: .95rem; transition: all var(--transition); cursor: pointer;
}
.btn-primary {
  background: var(--gold); color: var(--green-900);
  box-shadow: 0 4px 14px rgba(197,160,40,.35);
}
.btn-primary:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(197,160,40,.45); }
.btn-outline {
  border: 2px solid rgba(255,255,255,.4); color: #fff;
}
.btn-outline:hover { border-color: #fff; background: rgba(255,255,255,.1); }
.btn-sm { padding: 8px 18px; font-size: .85rem; }
.btn-green {
  background: var(--green-800); color: #fff;
  box-shadow: 0 4px 14px rgba(26,71,42,.3);
}
.btn-green:hover { background: var(--green-700); transform: translateY(-2px); }

/* ---------- STATS BAR ---------- */
.stats-bar {
  background: var(--bg-card); border-bottom: 1px solid var(--border);
  padding: 32px 0;
}
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center;
}
.stat-number {
  font-size: 2.5rem; font-weight: 800; color: var(--green-800); line-height: 1;
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .stat-number { color: var(--green-400); }
.stat-label { font-size: .85rem; color: var(--text-3); margin-top: 4px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- CARDS ---------- */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 24px;
  box-shadow: var(--shadow-sm); transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card-link { display: block; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

/* ---------- PLAYER CARD ---------- */
.player-card { text-align: center; }
.player-avatar {
  width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--green-700), var(--green-600));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 800; color: #fff;
  border: 3px solid var(--border);
  position: relative; overflow: hidden;
}
.player-avatar.gold { border-color: var(--gold); box-shadow: 0 0 0 4px var(--gold-pale), 0 0 20px rgba(197,160,40,.25); }
.player-avatar-lg { width: 90px; height: 90px; font-size: 1.6rem; }
/* Crown-badge på #1-legenden henger utenfor avatar-sirkelen */
.player-avatar.has-crown { overflow: visible; }
.crown-badge { position: absolute; top: -4px; right: -4px; font-size: 1rem; z-index: 2; }
[data-theme="dark"] .player-avatar.gold { box-shadow: 0 0 0 4px rgba(197,160,40,.2), 0 0 24px rgba(197,160,40,.35); }
/* Bilder fader inn over initialer/emoji-placeholder ved load */
.avatar-img, .logo-img { opacity: 0; transition: opacity .25s ease; }
.avatar-img.loaded, .logo-img.loaded { opacity: 1; }
.player-name { font-size: 1.05rem; font-weight: 700; margin-bottom: 4px; }
.player-years { font-size: .82rem; color: var(--text-3); margin-bottom: 10px; }
.player-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.badge {
  font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 100px;
  background: var(--bg-alt); color: var(--text-2); border: 1px solid var(--border);
}
.badge-gold { background: var(--gold-pale); color: #7a5a00; border-color: var(--gold); }
[data-theme="dark"] .badge-gold { background: rgba(197,160,40,.15); color: var(--gold-light); border-color: rgba(197,160,40,.4); }

/* ---------- TEAM CARD ---------- */
.team-card {}
.team-logo-placeholder {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--green-800), var(--green-600));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.team-name { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.team-members { font-size: .83rem; color: var(--text-3); margin-bottom: 8px; }
.team-years-tag {
  display: inline-block; font-size: .78rem; font-weight: 600;
  background: var(--bg-alt); color: var(--text-2); border: 1px solid var(--border);
  padding: 2px 10px; border-radius: 100px;
}

/* ---------- CHAMPIONSHIP CARD ---------- */
.champ-card { display: flex; flex-direction: column; gap: 12px; }
.champ-year {
  font-size: 2.2rem; font-weight: 800; color: var(--green-800); line-height: 1;
}
[data-theme="dark"] .champ-year { color: var(--green-400); }
.champ-location { font-size: 1rem; font-weight: 600; margin-bottom: 2px; }
.champ-meta { font-size: .82rem; color: var(--text-3); }
.champ-winners { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.champ-winner-row { display: flex; align-items: center; gap: 6px; font-size: .82rem; }
.champ-winner-label { color: var(--text-3); min-width: 56px; }
.champ-winner-name { font-weight: 600; }

/* ---------- HOF TABLE ---------- */
.hof-table-wrap { overflow-x: auto; }
.hof-table {
  width: 100%; border-collapse: collapse; font-size: .9rem;
}
.hof-table th {
  background: var(--green-800); color: #fff; padding: 12px 16px;
  text-align: left; font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  white-space: nowrap;
}
.hof-table th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.hof-table th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.hof-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
.hof-table tr:last-child td { border-bottom: none; }
.hof-table tr:hover td { background: var(--bg-alt); }
.hof-table tr:nth-child(even) td { background: rgba(0,0,0,.015); }
[data-theme="dark"] .hof-table tr:nth-child(even) td { background: rgba(255,255,255,.015); }
.hof-winner { font-weight: 600; }
.hof-empty { color: var(--text-3); font-style: italic; font-size: .8rem; }

/* ---------- PAGE HEADER ---------- */
.page-header {
  background: linear-gradient(135deg, var(--green-900), var(--green-700));
  color: #fff; padding: 60px 0 48px;
}
.page-header h1 { color: #fff; }
.page-header p { color: rgba(255,255,255,.7); margin-top: 10px; font-size: 1.05rem; }
.page-header .breadcrumb { font-size: .82rem; color: rgba(255,255,255,.5); margin-bottom: 12px; }
.page-header .breadcrumb a { color: rgba(255,255,255,.7); }
.page-header .breadcrumb a:hover { color: var(--gold-light); }

/* ---------- DETAIL HERO ---------- */
.detail-hero {
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 100%);
  padding: 64px 0 48px; color: #fff;
}
.detail-hero-inner { display: flex; align-items: flex-start; gap: 32px; }
.detail-avatar-lg {
  width: 120px; height: 120px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,.12); display: flex; align-items: center;
  justify-content: center; font-size: 2.5rem; font-weight: 800;
  border: 4px solid rgba(255,255,255,.2);
  position: relative; overflow: hidden;
}
.detail-avatar-lg.gold { border-color: var(--gold); }
.detail-hero-info { flex: 1; }
.detail-hero-info h1 { color: #fff; margin-bottom: 8px; }
.detail-hero-sub { color: rgba(255,255,255,.7); font-size: 1rem; margin-bottom: 16px; }
.detail-stats-row { display: flex; gap: 24px; flex-wrap: wrap; }
.detail-stat { text-align: center; }
.detail-stat-num { font-size: 1.8rem; font-weight: 800; color: var(--gold-light); line-height: 1; }
.detail-stat-lbl { font-size: .75rem; color: rgba(255,255,255,.6); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

/* ---------- SECTION TITLE ---------- */
.section-title { margin-bottom: 32px; }
.section-title h2 { margin-bottom: 6px; }
.section-title p { color: var(--text-3); }
.section-title .line {
  width: 48px; height: 4px; background: var(--gold); border-radius: 2px; margin-top: 12px;
}

/* ---------- ACHIEVEMENTS LIST ---------- */
.achievements-list { display: flex; flex-direction: column; gap: 10px; }
.achievement-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; background: var(--bg-alt); border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.achievement-icon { font-size: 1.4rem; flex-shrink: 0; }
.achievement-title { font-weight: 600; font-size: .95rem; }
.achievement-year { font-size: .82rem; color: var(--text-3); margin-top: 1px; }

/* ---------- ROUND TABLE ---------- */
.round-section { margin-bottom: 40px; }
.round-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; background: var(--green-800); border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: #fff;
}
.round-type-badge {
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 100px;
  background: rgba(255,255,255,.15);
}
.round-type-badge.team { background: var(--gold); color: var(--green-900); }
.round-link { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; text-decoration-color: rgba(255,255,255,.45); }
.round-link:hover { text-decoration-color: #fff; }
.results-table { width: 100%; border-collapse: collapse; }
.results-table th {
  background: var(--bg-alt); padding: 10px 16px; text-align: left;
  font-size: .78rem; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--border);
}
.results-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: .9rem; }
.results-table tr:last-child td { border-bottom: none; }
.results-table tr:hover td { background: var(--bg-alt); }
.results-table a, .hof-table a, .result-table a { text-decoration: none; border-bottom: 1px solid transparent; transition: border-color var(--transition); }
.results-table a:hover, .hof-table a:hover, .result-table a:hover { border-bottom-color: currentColor; }
/* Spillerprofil: konsistente kolonnebredder pa alle mesterskap-tabellene */
.results-table-player { table-layout: fixed; }
.results-table-player th:nth-child(1), .results-table-player td:nth-child(1) { width: 44%; }
.results-table-player th:nth-child(2), .results-table-player td:nth-child(2) { width: 12%; }
.results-table-player th:nth-child(3), .results-table-player td:nth-child(3) { width: 14%; }
.results-table-player th:nth-child(4), .results-table-player td:nth-child(4) { width: 14%; }
.results-table-player th:nth-child(5), .results-table-player td:nth-child(5) { width: 16%; }
.rank-1 td { font-weight: 700; }
.rank-medal { font-size: 1rem; }

/* ---------- SEARCH ---------- */
.search-bar {
  display: flex; gap: 12px; margin-bottom: 28px; flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-wrap::before {
  content: '🔍';
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 1rem; opacity: .55;
  pointer-events: none;
}
.search-input {
  width: 100%; padding: 12px 18px 12px 44px;
  border: 1px solid var(--border); border-radius: 100px;
  background: var(--bg-card); color: var(--text-1); font-size: .95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.search-input:focus { border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(196,80,0,.15); }
.search-input::placeholder { color: var(--text-3); }

/* ---------- TAGS ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tag {
  padding: 6px 16px; border-radius: 100px; font-size: .82rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-2);
  cursor: pointer; transition: all var(--transition);
}
.tag:hover, .tag.active { background: var(--green-800); color: #fff; border-color: var(--green-800); }

/* ---------- SPONSOR ---------- */
.sponsor-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; padding: 40px 24px;
}
.sponsor-logo-placeholder {
  position: relative;
  width: 120px; height: 80px; border-radius: var(--radius-sm);
  background: var(--bg-alt); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}
/* Hvit bakgrunn bak innlastet logo — så mørke logoer også synes i mørk modus */
.sponsor-logo-placeholder .logo-img { background: #fff; }
.sponsor-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.sponsor-card-sm { padding: 22px 34px; gap: 10px; }
.sponsor-name { font-size: 1.1rem; font-weight: 700; }
.sponsor-desc { font-size: .9rem; color: var(--text-3); }

/* ---------- EMPTY STATE ---------- */
.empty-state {
  text-align: center; padding: 80px 20px; color: var(--text-3);
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 { color: var(--text-2); margin-bottom: 8px; }

/* ---------- FOCUS STATES (keyboard accessibility) ---------- */
.btn:focus-visible,
.tag:focus-visible,
.card-link:focus-visible,
.nav-links a:focus-visible,
.nav-theme button:focus-visible,
.nav-hamburger:focus-visible,
.admin-tab:focus-visible,
.footer-links a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
.search-input:focus-visible { outline: none; }

/* ---------- LOADING SPINNER ---------- */
.loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; color: var(--text-3); gap: 16px;
}
.loading::before {
  content: '';
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--green-700);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .loading::before { animation: none; border-top-color: var(--border); }
}

/* ---------- TABLE WRAPPER (mobile overflow) ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- VISUALLY HIDDEN (screen reader only) ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- UTILITY KLASSER ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--text-3); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.col-full { grid-column: 1 / -1; }
.avatar-img-wrap { position: relative; overflow: hidden; }
.avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.logo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
.logo-img-padded { padding: 6px; box-sizing: border-box; }
.logo-img-padded-lg { padding: 8px; box-sizing: border-box; }
.muted-small { font-size: .8rem; color: var(--text-3); }
.section-label {
  font-size: .8rem; font-weight: 600; color: var(--text-3);
  text-transform: uppercase; letter-spacing: .06em; margin-bottom: 12px;
}
.winner-stat-num { font-size: 2rem; font-weight: 800; color: var(--green-800); }
[data-theme="dark"] .winner-stat-num { color: var(--green-400); }
.winner-stat-sub { font-size: .85rem; color: var(--text-3); margin-top: 4px; }
.detail-link { color: var(--green-700); font-weight: 600; }
.breadcrumb-hero {
  font-size: .82rem; color: rgba(255,255,255,.5); margin-bottom: 16px;
}
.breadcrumb-hero a { color: rgba(255,255,255,.7); }
.breadcrumb-hero a:hover { color: var(--gold-light); }
.empty-card { text-align: center; padding: 32px; color: var(--text-3); }
.empty-card-icon { font-size: 2rem; margin-bottom: 8px; }

/* ---------- ANIMATIONS ---------- */
.fade-in { opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .5s ease; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position:  200% 0; }
}

/* ---------- FOOTER ---------- */
#main-footer {
  background: var(--green-900); color: rgba(255,255,255,.7);
  padding: 48px 0 32px; margin-top: auto;
}
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; text-align: center; }
.footer-logo { font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: 4px; }
.footer-sub { font-size: .85rem; color: rgba(255,255,255,.4); margin-bottom: 24px; }
.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 24px; padding: 20px 0; margin-bottom: 24px; border-top: 1px solid rgba(255,255,255,.08); border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-links a { font-size: .85rem; color: rgba(255,255,255,.6); transition: color var(--transition); }
.footer-links a:hover { color: var(--gold-light); }
.footer-copy { font-size: .78rem; color: rgba(255,255,255,.3); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .nav-links { display: none; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--green-800); padding: 16px 20px 24px; gap: 4px; }
  .nav-links.open { display: flex; }
  .nav-hamburger { display: flex; }
  .nav-inner { position: relative; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-hero-inner { flex-direction: column; align-items: center; text-align: center; }
  .hero { padding: 64px 0 56px; }
  h1 { font-size: 2rem; }
  .section { padding: 48px 0; }
}

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

/* ── Utvikling-graf (spillerprofil) ─────────────────────── */
.evo-card { padding: 18px 18px 14px; }
.evo-sub { font-size: .78rem; color: var(--text-3); margin-bottom: 10px; }
.evo-wrap { position: relative; }
.evo-wrap svg { display: block; width: 100%; height: auto; }
.evo-grid { stroke: var(--border); stroke-width: 1; }
.evo-line { stroke: var(--green-800); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.evo-area { fill: var(--green-800); opacity: .08; }
.evo-dot { fill: var(--green-800); stroke: var(--bg-card); stroke-width: 2; }
[data-theme="dark"] .evo-line { stroke: var(--green-400); }
[data-theme="dark"] .evo-area { fill: var(--green-400); }
[data-theme="dark"] .evo-dot { fill: var(--green-400); }
.evo-tick { font-size: 11px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.evo-endlabel { font-size: 12px; font-weight: 600; fill: var(--text-2); }
.evo-crosshair { stroke: var(--text-3); stroke-width: 1; opacity: 0; }
.evo-note { font-size: .72rem; color: var(--text-3); margin-top: 8px; }
.evo-tooltip {
  position: absolute; display: none; pointer-events: none; z-index: 5;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; box-shadow: 0 4px 14px rgba(0,0,0,.14);
  font-size: .76rem; color: var(--text-2); white-space: nowrap;
}
.evo-tooltip strong { display: block; font-size: .92rem; color: var(--text-1); }

/* Klikkbare navn i HoF-tabeller og vinnerkort — arver utseendet 100 %, avslører seg ved hover.
   Bruker border-bottom (ikke text-decoration) så den deler mekanisme med .hof-table a-regelen
   og aldri gir dobbel strek. */
.hof-link { color: inherit; text-decoration: none; border-bottom: 1px solid transparent; transition: border-color var(--transition); }
.hof-link:hover { border-bottom-color: currentColor; }

/* ── Galleri ─────────────────────────────────────────────── */
.upload-bar { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
/* Tilbake-lenken skyves til venstre; opplastingsknappen blir staaende til hoeyre */
.upload-back { margin-right: auto; }
.upload-panel { max-width: 480px; margin: 0 0 24px auto; padding: 20px; }
.upload-field { margin-bottom: 14px; }
.upload-field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 5px; color: var(--text-2); }
.g-input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-main); color: var(--text-1);
  font-size: .92rem; font-family: inherit;
}
.upload-status { margin: 10px 0 0; font-size: .85rem; color: var(--text-2); min-height: 1.2em; }
.upload-status-err { color: #c0392b; font-weight: 600; }

.album-card { padding: 0; overflow: hidden; }
.album-cover { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-card); }
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--transition); }
.album-card:hover .album-cover img { transform: scale(1.04); }
.album-info { padding: 14px 18px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo-thumb {
  position: relative; aspect-ratio: 1; padding: 0; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; background: var(--bg-card);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--transition); }
.photo-thumb:hover img { transform: scale(1.05); }

.lightbox {
  position: fixed; inset: 0; z-index: 1000; background: rgba(10, 8, 5, .93);
  display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 20px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 80vh; border-radius: 6px; }
.lightbox-caption { color: rgba(255,255,255,.85); font-size: .88rem; margin-top: 12px; text-align: center; }
.lightbox-btn {
  position: absolute; z-index: 1001; width: 44px; height: 44px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background var(--transition);
}
.lightbox-btn:hover { background: rgba(255,255,255,.28); }
.lightbox-close { top: 16px; right: 16px; }
.lightbox-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* ── Video i galleriet ───────────────────────────────────── */
.play-badge {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 42px; height: 42px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; padding-left: 3px; pointer-events: none;
  transition: background var(--transition);
}
.photo-thumb:hover .play-badge { background: rgba(0,0,0,.75); }
.dur-badge {
  position: absolute; right: 6px; bottom: 6px;
  background: rgba(0,0,0,.7); color: #fff;
  font-size: .72rem; font-variant-numeric: tabular-nums;
  padding: 2px 6px; border-radius: 3px; pointer-events: none;
}

/* Klipp som fortsatt konverteres */
.photo-pending {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; cursor: default; background: var(--bg-card);
}
.pending-spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--green-700);
  animation: pending-spin .9s linear infinite;
}
.pending-text { font-size: .72rem; color: var(--text-3); }
@keyframes pending-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .pending-spinner { animation-duration: 2.5s; }
}

.lightbox video { max-width: 94vw; max-height: 80vh; border-radius: 6px; background: #000; }
.lightbox video[hidden], .lightbox img[hidden] { display: none; }

/* Fremdrift under opplasting */
.upload-progress {
  height: 6px; border-radius: 3px; overflow: hidden;
  background: var(--bg-alt); border: 1px solid var(--border);
  margin-top: 12px;
}
.upload-progress[hidden] { display: none; }
.upload-progress-bar {
  height: 100%; width: 0%; border-radius: 3px;
  background: var(--green-700);
  transition: width .18s linear;
}

/* Albumforside når albumet kun har klipp som fortsatt konverteres */
.album-cover-pending {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-alt);
}
