/* Skytteform components. Every colour, font and shape comes from the design tokens in themes.css. */

:root { --good: #059669; --bad: #dc2626; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.5; font-feature-settings: "tnum" 1;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-text); }
h1, h2, h3 {
  line-height: 1.15; margin: 0 0 .5rem; font-family: var(--font-display); font-weight: var(--display-weight);
  text-transform: var(--display-case); letter-spacing: var(--display-spacing);
}
h1 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
h2 { font-size: 1.2rem; }
.muted { color: var(--muted); }
.num, .kpi b, .hero .stats b, .pos, td.series, .tag { font-family: var(--font-num); }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 85%, transparent); border-bottom: var(--card-border);
}
.topbar .wrap { display: flex; align-items: center; gap: 18px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: var(--display-weight);
  text-transform: var(--display-case); letter-spacing: var(--display-spacing); font-size: 1.2rem; }
.brand svg { width: 28px; height: 28px; }
.brand .disc { fill: var(--accent); }
.brand .dome { fill: var(--accent-soft); }
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 7px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 550; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--accent); }
.search { position: relative; }
.search input {
  width: 210px; padding: 8px 12px 8px 34px; border-radius: var(--radius-sm); border: var(--card-border);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23888' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m14 14-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center;
  color: var(--text); font: inherit;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-results {
  position: absolute; right: 0; top: 44px; width: 300px; background: var(--surface); border: var(--card-border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: none;
}
.search-results a { display: flex; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--surface-2); }
.search-results a:last-child { border-bottom: 0; }
.search-results a:hover, .search-results a.sel { background: var(--surface-2); }
.icon-btn { background: none; border: var(--card-border); color: var(--muted); border-radius: var(--radius-sm); width: 36px; height: 36px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { color: var(--text); }
.design-pick { font: inherit; font-size: .85rem; color: var(--text); background: var(--surface); border: var(--card-border);
  border-radius: var(--radius-sm); padding: 7px 8px; cursor: pointer; }

/* ---------- layout ---------- */
main { padding: 32px 0 64px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.card { background: var(--surface); border: var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card h2 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card h2 small { font-family: var(--font); font-weight: 500; color: var(--muted); font-size: .8rem; text-transform: none; letter-spacing: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > h2 { padding: 18px 20px 6px; }
a.card:hover { border-color: var(--accent); color: inherit; }
.section { margin-top: 28px; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: calc(var(--radius) * 1.5); padding: 22px 28px; margin-bottom: 24px;
  background: var(--hero-bg); color: var(--hero-text); border: var(--card-border);
}
/* Compact banner: intro text on the left, stats on the right. */
.hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.hero p { color: var(--hero-muted); max-width: 46ch; font-size: 1rem; margin: 0; }
.hero .stats { display: flex; flex-wrap: wrap; gap: 28px; }
.hero .stats b { display: block; font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.hero .stats span { color: var(--hero-muted); font-size: .85rem; }
.hero .stats > div { border-left: 3px solid var(--accent); padding-left: 12px; }
.hero-disc { display: none; position: absolute; right: -60px; bottom: -80px; width: 320px; opacity: .12; pointer-events: none; fill: var(--hero-text); }

/* ---------- controls ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { padding: 5px 12px; border-radius: calc(var(--radius-sm) - 2px); color: var(--muted); font-weight: 550; font-size: .9rem; }
.seg a.active { background: var(--accent); color: var(--on-accent); }
select, .input {
  font: inherit; color: var(--text); background: var(--surface); border: var(--card-border);
  border-radius: var(--radius-sm); padding: 7px 10px;
}
.btn { display: inline-flex; gap: 6px; align-items: center; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--accent); color: var(--on-accent); font-weight: 600; border: 0; cursor: pointer; font-family: inherit; }
.btn:hover { color: var(--on-accent); filter: brightness(1.08); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .06em; padding: 10px 12px; border-bottom: var(--card-border); background: var(--surface); position: sticky; top: 0;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--surface-2); white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .num { text-align: right; }
table.data .center { text-align: center; }
table.data .strong { font-weight: 650; }
table.data td.series { color: var(--muted); text-align: center; width: 36px; }
table.data td.series.perfect { color: var(--accent-text); font-weight: 700; }
tr.incomplete td { opacity: .5; }
.pos { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--radius-sm); font-weight: 700; background: var(--surface-2); font-size: .85rem; }
.pos.p1 { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #451a03; }
.pos.p2 { background: linear-gradient(135deg, #f1f5f9, #94a3b8); color: #0f172a; }
.pos.p3 { background: linear-gradient(135deg, #fed7aa, #b45309); color: #fff; }
.who { display: flex; flex-direction: column; }
.who small { color: var(--muted); }

/* ---------- pills & kpis ---------- */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; color: #fff; background: var(--muted); letter-spacing: .02em; }
.pill.ghost { background: var(--surface-2); color: var(--muted); }
.tag { display: inline-block; padding: 1px 8px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--muted); font-size: .75rem; font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: var(--card-border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.kpi span { color: var(--muted); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.kpi b { display: block; font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; }
.kpi small { color: var(--muted); }

/* ---------- profile header ---------- */
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-bottom: 24px; }
.avatar { width: 76px; height: 76px; border-radius: calc(var(--radius) * 1.6); display: grid; place-items: center; font-family: var(--font-display);
  font-weight: var(--display-weight); font-size: 1.7rem; color: var(--on-accent); background: var(--accent); box-shadow: var(--shadow); }
.profile-head .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; color: var(--muted); }

.chart { width: 100%; height: 340px; }
.chart.tall { height: 400px; }
.chart.short { height: 260px; }
.spark { width: 110px; height: 28px; display: block; }

.list-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--surface-2); gap: 12px; }
.list-row:last-child { border-bottom: 0; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
/* Class distribution card */
.dist-bar { display: flex; gap: 2px; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: 6px 0 14px; }
.dist-bar span { min-width: 4px; }
.dist-rows { display: grid; }
.dist-row { display: grid; grid-template-columns: 44px 58px 1fr 40px 40px; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--surface-2); }
.dist-row:last-child { border-bottom: 0; }
.dist-row b { text-align: right; font-size: 1.05rem; }
.dist-row > .muted { white-space: nowrap; }
.dist-row .num.muted { text-align: right; font-size: .85rem; }
.dist-track { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.dist-track span { display: block; height: 100%; border-radius: 999px; }
.class-badge { display: inline-grid; place-items: center; height: 26px; min-width: 36px; padding: 0 8px; border-radius: var(--radius-sm);
  font-family: var(--font-num); font-weight: 700; font-size: .85rem; color: var(--band);
  background: color-mix(in srgb, var(--band) 14%, transparent); border: 1px solid color-mix(in srgb, var(--band) 40%, transparent); }
.prose { max-width: 70ch; }

footer { border-top: var(--card-border); padding: 24px 0; color: var(--muted); font-size: .85rem; }

/* ---------- design-specific touches ---------- */
[data-design="scoreboard"] table.data th, [data-design="scoreboard"] .kpi span { font-family: var(--font-display); font-size: .8rem; letter-spacing: .08em; }
[data-design="scoreboard"] .card h2 { border-left: 4px solid var(--accent); padding-left: 10px; }
[data-design="scoreboard"] .card.flush > h2 { margin-left: 20px; padding-left: 10px; }
[data-design="scoreboard"] .kpi b { font-size: 2.1rem; }
[data-design="mono"] .hero { border-width: 2px; }
[data-design="mono"] table.data td { border-bottom-color: var(--chart-grid); }
[data-design="mono"] .kpi b { font-weight: 500; }
[data-design="heritage"] .card h2 { border-bottom: 1px solid var(--border); padding-bottom: 8px; }
[data-design="heritage"] .card.flush > h2 { margin: 0 20px; padding: 18px 0 8px; }

@media (max-width: 760px) {
  .topbar .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .nav { order: 3; width: 100%; flex: none; }
  .search { margin-left: auto; }
  .search input { width: 150px; }
  .hero { padding: 18px 20px; }
  .hero .stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; width: 100%; }
  .hero .stats span { font-size: .72rem; }
  .hero .stats b { font-size: 1.3rem; }
  .hero .stats > div { padding-left: 8px; }
  .hide-sm { display: none; }
}
[data-design="ember"] .hero-disc { display: block; }

/* ---------- shooter profile modules ---------- */
.modules { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; grid-auto-flow: row dense; }
.module { min-width: 0; }
.module.w-full { grid-column: span 12; }
.module.w-half { grid-column: span 6; }
.module.w-third { grid-column: span 4; }
@media (max-width: 900px) { .module.w-half, .module.w-third { grid-column: span 12; } }
.small { font-size: .82rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.btn.ghost { background: var(--surface); color: var(--text); border: var(--card-border); }
.btn.ghost:hover { color: var(--accent-text); }
button.link { background: none; border: 0; color: var(--accent-text); cursor: pointer; font: inherit; font-size: .85rem; padding: 0; }

.customize { position: relative; }
.customize-panel { position: absolute; right: 0; top: 46px; z-index: 30; width: min(320px, 90vw); max-height: 70vh; overflow: auto; padding: 16px; }
.customize-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.customize-group { display: grid; gap: 4px; padding: 8px 0; border-top: 1px solid var(--surface-2); }
.customize-group label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.customize-group input { accent-color: var(--accent); }

.standing { display: flex; flex-wrap: wrap; gap: 24px; margin: 6px 0 14px; }
.standing-pos b { display: block; font-size: 2rem; line-height: 1.1; }
.standing-pos span { color: var(--muted); font-size: .82rem; }
.meter { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.form-badge { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); margin: 6px 0 12px; }
.form-badge b { display: block; font-size: 1.15rem; }
.form-arrow { font-size: 1.4rem; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 999px; background: var(--surface); }
.form-hot .form-arrow { color: var(--good); }
.form-cold .form-arrow { color: var(--bad); }
.form-steady .form-arrow { color: var(--muted); }
.form-compare { display: flex; gap: 24px; margin-bottom: 12px; }
.form-compare span { display: block; font-size: .78rem; }
.form-compare b { font-size: 1.3rem; }

.records { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.record { padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); display: grid; gap: 2px; }
.record > span { font-size: .78rem; }
.record b { font-size: 1.4rem; }
.record small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tape { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.tape-cell { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 4px; font-family: var(--font-num);
  font-size: .72rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.tape-cell.s24 { background: color-mix(in srgb, var(--accent) 35%, var(--surface-2)); color: var(--text); }
.tape-cell.s23 { background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); color: var(--text); }
.tape-cell.perfect { background: var(--accent); color: var(--on-accent); }
.tape-gap { width: 10px; }
.tape-legend { display: flex; gap: 6px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.tape-legend .tape-cell { width: 22px; height: 22px; }

/* ---------- tags ---------- */
.tag-pick { display: inline-flex; align-items: center; gap: 8px; }
.tag-pick select { font-weight: 600; }
.tag-chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600;
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.tag-chip.primary { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.seg-count { font-family: var(--font-num); font-size: .75rem; opacity: .65; margin-left: 2px; }

.include-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-sm);
  border: var(--card-border); color: var(--muted); font-size: .88rem; font-weight: 550; background: var(--surface); }
.include-toggle .box { width: 16px; height: 16px; border: 1.5px solid var(--muted); border-radius: 4px; display: inline-grid;
  place-items: center; font-size: .7rem; line-height: 1; }
.include-toggle.on { color: var(--text); border-color: var(--accent); }
.include-toggle.on .box { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.club-history { display: inline-flex; gap: 4px; align-items: baseline; flex-wrap: wrap; }

/* "?" help: page explanations live behind a button instead of on the page. */
.help { position: relative; align-self: start; }
.help > summary { list-style: none; font-weight: 700; font-size: 1rem; }
.help > summary::-webkit-details-marker { display: none; }
.help[open] > summary { color: var(--accent); border-color: var(--accent); }
.help-panel { position: absolute; right: 0; top: 44px; z-index: 40; width: min(420px, calc(100vw - 32px)); max-height: 75vh; overflow: auto; padding: 18px 20px; font-size: .92rem; line-height: 1.55; box-shadow: 0 12px 32px rgba(0, 0, 0, .25); }
.help-panel h3 { margin: 0 0 8px; font-size: 1rem; }
.help-panel h4 { margin: 14px 0 4px; font-size: .92rem; }
.help-panel p, .help-panel ul { margin: 0 0 8px; }
.help-panel ul { padding-left: 18px; }
.help-panel dl { margin: 0; display: grid; gap: 6px; }
.help-panel dt { font-weight: 600; }
.help-panel dd { margin: 0 0 4px; color: var(--muted); }
.page-head .head-actions { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; justify-content: flex-end; }
.hero { position: relative; overflow: visible; }  /* let the help panel out */
.hero > .help { position: absolute; top: 12px; right: 12px; color: var(--hero-text); }
.hero:has(> .help) { padding-right: 64px; }  /* keep the stats clear of the "?" */
.hero > .help .help-panel { color: var(--text); }
.hero > .help > summary { color: var(--hero-muted); border-color: currentColor; }
/* Pin "?" to the top-right corner of the page header, whatever wraps beside it. */
.page-head, .profile-head { position: relative; padding-right: 52px; }
.page-head .help, .profile-head .help { position: absolute; top: 0; right: 0; }

/* Site status badge ("Under udvikling" / "Vedligeholdelse"): small, bottom-left, out of the way. */
.site-banner { position: fixed; left: 14px; bottom: 14px; z-index: 35; max-width: min(320px, calc(100vw - 28px));
  font-size: .74rem; font-weight: 600; letter-spacing: .02em; color: #fff; border-radius: 999px;
  background: var(--banner-bg, #d9822b); opacity: .82; box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  transition: opacity .15s ease; }
.site-banner:hover, .site-banner[open] { opacity: 1; }
.site-banner[open] { border-radius: 12px; }
.site-banner > summary, .site-banner > span { display: block; padding: 5px 12px 5px 26px; list-style: none; cursor: default; position: relative; }
.site-banner > summary { cursor: pointer; }
.site-banner > summary::-webkit-details-marker { display: none; }
.site-banner > summary::before, .site-banner > span::before { content: ""; position: absolute; left: 11px; top: 50%;
  width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: currentColor; opacity: .85; }
.site-banner p { margin: 0; padding: 0 12px 10px; font-weight: 400; font-size: .78rem; line-height: 1.45; }
.site-banner--development { --banner-bg: #d9822b; }
.site-banner--maintenance { --banner-bg: #c8102e; }
.site-banner--info { --banner-bg: #2f6fb0; }
@media print { .site-banner { display: none; } }
