/* Basketball – stilark. Farver styres af variablerne herunder. */
:root {
  --court: #16324f;      /* banens linjeblå */
  --ball: #e06a12;       /* bold-orange, kun til handlinger */
  --ball-ink: #ffffff;
  --surface: #f4f6f9;
  --panel: #ffffff;
  --ink: #1a1e24;
  --muted: #5b6673;
  --line: #d5dce4;
  --shared: #2f7d5b;
  --danger: #b3261e;
  --head: "Roboto Condensed", "Arial Narrow", sans-serif-condensed, system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --court: #9cc2ea; --ball: #f08a3c; --ball-ink: #1a1007;
    --surface: #12161b; --panel: #1b2128; --ink: #e9edf2; --muted: #9aa6b4;
    --line: #2c3540; --shared: #5fc196; --danger: #ff8a80;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--surface); color: var(--ink); font: 16px/1.5 var(--body); }
a { color: var(--court); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--head); font-stretch: condensed; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.1rem; }
:focus-visible { outline: 3px solid var(--ball); outline-offset: 2px; }

/* Topbar: banens midterlinje */
.topbar { background: var(--panel); border-bottom: 3px solid var(--court); position: sticky; top: 0; z-index: 5; }
.topbar-inner { max-width: 1100px; margin: 0 auto; padding: .6rem 1rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.brand { font-family: var(--head); font-weight: 700; font-size: 1.3rem; text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: .5rem; }
.brand-ball { width: 22px; height: 22px; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; flex: 1; }
.nav a { text-decoration: none; color: var(--ink); padding: .35rem .7rem; border-radius: 6px; font-weight: 500; }
.nav a[aria-current="page"] { background: var(--court); color: var(--panel); }
.userbox { display: flex; gap: .5rem; align-items: center; color: var(--muted); font-size: .9rem; }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 4rem; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.lead { color: var(--muted); margin: .25rem 0 0; }

/* Knapper */
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: .5rem .9rem; border-radius: 8px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; min-height: 42px; }
.btn:hover { border-color: var(--court); }
.btn-primary { background: var(--ball); border-color: var(--ball); color: var(--ball-ink); }
.btn-primary:hover { filter: brightness(1.05); border-color: var(--ball); }
.btn-danger { color: var(--danger); }
.btn-small { min-height: 32px; padding: .25rem .6rem; font-size: .875rem; }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; }
form.inline { display: inline; margin: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--court); font: inherit; cursor: pointer; text-decoration: underline; }

/* Faner Mine / Fælles */
.tabs { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .6rem 1rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ball); }

/* Søgning */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input[type=search] { flex: 1 1 220px; }
.chips { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.chip { font-size: .85rem; padding: .2rem .6rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--panel); }
.chip[aria-current="true"] { background: var(--court); border-color: var(--court); color: var(--panel); }
.tag { font-size: .8rem; color: var(--muted); }

/* Lister: hver række er en øvelse/play */
.rows { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.rows li + li { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 64px 1fr auto; gap: .9rem; align-items: center; padding: .75rem 1rem; text-decoration: none; color: inherit; }
.row:hover .row-title { text-decoration: underline; }
.thumb { width: 64px; height: 48px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); object-fit: cover; display: grid; place-items: center; font-size: .7rem; color: var(--muted); overflow: hidden; }
.row-title { font-weight: 600; }
.row-meta { font-size: .85rem; color: var(--muted); }
.badge { font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.badge-shared { color: var(--shared); }

.empty { background: var(--panel); border: 1px dashed var(--line); border-radius: 10px; padding: 2rem; text-align: center; }
.empty p { color: var(--muted); }

/* Forside */
.dash { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.dash section h2 { display: flex; justify-content: space-between; align-items: baseline; }
.dash section h2 a { font-family: var(--body); font-size: .9rem; font-weight: 500; }
.scoreline { display: flex; gap: 2rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.scoreline strong { display: block; font-family: var(--head); font-size: 2.2rem; line-height: 1; color: var(--court); }
.scoreline span { color: var(--muted); font-size: .9rem; }

/* Detaljevisning */
.detail { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: 1.5rem; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1.25rem; }
.prose { white-space: pre-wrap; max-width: 70ch; }
.media-frame { aspect-ratio: 16 / 9; width: 100%; border: 0; border-radius: 8px; }
.file-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.file-list img { border-radius: 8px; border: 1px solid var(--line); }
.pdf-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 8px; }
.side h3 { margin-top: 1.25rem; }
.side h3:first-child { margin-top: 0; }
.owner-note { font-size: .9rem; color: var(--muted); }
.share-state { padding: .75rem; border-radius: 8px; border: 1px solid var(--line); margin-bottom: .75rem; font-size: .9rem; }
.share-state.on { border-color: var(--shared); color: var(--shared); }

/* Formularer */
.form { max-width: 720px; }
.field { margin-bottom: 1.1rem; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=url], input[type=password], input[type=number], input[type=search], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .55rem .7rem; }
textarea { resize: vertical; }
.field ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.field ul label { font-weight: 400; display: inline-flex; gap: .35rem; align-items: center; }
.help { font-size: .85rem; color: var(--muted); margin-top: .2rem; }
.errorlist { color: var(--danger); font-size: .9rem; list-style: none; padding: 0; margin: .25rem 0; }
.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { background: var(--panel); border-left: 4px solid var(--shared); padding: .6rem 1rem; border-radius: 6px; }
.messages li.error { border-left-color: var(--danger); }
.pick-list { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.pick-list label { display: flex; gap: .6rem; align-items: center; padding: .55rem .8rem; border-bottom: 1px solid var(--line); cursor: pointer; }
.pick-list label:last-child { border-bottom: 0; }

/* Playbook-rækkefølge */
.order { counter-reset: play; }
.order li { counter-increment: play; }
.order .row { grid-template-columns: 2.2rem 1fr auto; }
.order .row::before { content: counter(play); font-family: var(--head); font-size: 1.6rem; font-weight: 700; color: var(--court); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--ball); border-radius: 10px; padding: 2rem; }
.login h1 { display: flex; align-items: center; gap: .6rem; }

.copy-box { display: flex; gap: .5rem; }
.copy-box input { font-family: ui-monospace, monospace; font-size: .85rem; }
table.simple { width: 100%; border-collapse: collapse; }
table.simple th, table.simple td { text-align: left; padding: .5rem; border-bottom: 1px solid var(--line); }

@media (max-width: 760px) {
  .detail { grid-template-columns: 1fr; }
  .row { grid-template-columns: 48px 1fr; }
  .row .badge { grid-column: 2; justify-self: start; }
  .thumb { width: 48px; height: 40px; }
  .userbox .who { display: none; }
  .topbar-inner { gap: .4rem 1rem; }
  .userbox { margin-left: auto; }
  .nav { order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -1rem; padding: 0 1rem .2rem; }
  .nav a { white-space: nowrap; }
  .scoreline { gap: 1.25rem; }
}
@media print {
  .topbar, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}
