/* Hringa – lys profil. Fjord (blå), Nordlys (turkis), Glød (oransje), Natt (tekst), Snø (bakgrunn). */
:root {
  --bg: #f5f7fc;
  --surface: #ffffff;
  --surface-2: #f0f3fa;
  --surface-3: #e6ebf6;
  --text: #13213c;
  --muted: #5b6784;
  --border: #e3e8f3;
  --fjord: #2f6bff;
  --fjord-hover: #1f56e0;
  --fjord-soft: #e8efff;
  --nordlys: #16b5a8;
  --glod: #ff7a3d;
  --glod-hover: #f2652a;
  --glod-soft: #fff1e9;
  --good: #0ca678;
  --good-soft: #e6f8f1;
  --warn: #c76a00;
  --warn-soft: #fff6e0;
  --danger: #e03131;
  --gold: #f5b700;
  --silver: #a7b1c2;
  --bronze: #d9894a;
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgba(19, 33, 60, .05);
  --shadow: 0 1px 2px rgba(19, 33, 60, .04), 0 8px 24px rgba(19, 33, 60, .06);
  --shadow-lg: 0 18px 50px rgba(47, 107, 255, .18);
  --grad: linear-gradient(135deg, #2f6bff 0%, #16b5a8 100%);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
body.has-nav { padding-bottom: 84px; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; justify-content: center; }
.spacer, .grow { flex: 1; }
.hidden { display: none !important; }

/* ---------- Merkevare ---------- */
.brand { display: flex; align-items: center; gap: 6px; color: var(--text); }
.mark { width: 40px; height: 40px; flex-shrink: 0; color: var(--text); }
.wordmark { height: 27px; width: auto; color: var(--text); display: block; }
.brand-btn { border: 0; background: transparent; padding: 4px; border-radius: 12px; cursor: pointer; }
.brand-btn:hover { background: var(--surface-2); }

/* ---------- Topp ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.top-inner {
  max-width: 1120px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 12px; min-height: 64px;
}
.top-title { flex: 1; min-width: 0; }
.top-name { font-weight: 700; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-sub { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress { height: 4px; background: var(--surface-3); }
.progress-bar { height: 100%; background: var(--grad); transition: width .4s; border-radius: 0 4px 4px 0; }

.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 14px; }
.tab {
  border: 0; background: transparent; padding: 8px 18px; border-radius: 10px; cursor: pointer;
  font-weight: 600; color: var(--muted); transition: background .15s, color .15s;
}
.tab:hover:not(:disabled) { color: var(--text); }
.tab.active { background: var(--surface); color: var(--fjord); box-shadow: var(--shadow-sm); }
.tab:disabled { opacity: .4; cursor: not-allowed; }
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; gap: 6px; background: rgba(255, 255, 255, .95); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
}
.bottom-nav .tab { flex: 1; padding: 12px 0; font-size: 1rem; }
.bottom-nav .tab.active { background: var(--fjord-soft); box-shadow: none; }
@media (min-width: 761px) { .mobile-only { display: none !important; } body.has-nav { padding-bottom: 0; } }
@media (max-width: 760px) { .desktop-only { display: none !important; } }

.main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 56px; }

/* ---------- Knapper og felter ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 10px 18px; border-radius: 12px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; min-height: 44px;
}
.btn:hover { border-color: var(--fjord); color: var(--fjord); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--fjord); border-color: var(--fjord); color: #fff; box-shadow: 0 4px 14px rgba(47, 107, 255, .3); }
.btn.primary:hover { background: var(--fjord-hover); color: #fff; }
.btn.accent { background: var(--glod); border-color: var(--glod); color: #fff; box-shadow: 0 6px 20px rgba(255, 122, 61, .4); }
.btn.accent:hover { background: var(--glod-hover); color: #fff; }
.btn.glass { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .4); color: #fff; }
.btn.glass:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.btn.ghost { background: var(--surface); }
.btn.sm { padding: 6px 12px; min-height: 36px; font-size: .9rem; border-radius: 10px; }
.btn.lg { padding: 14px 24px; font-size: 1.05rem; border-radius: 14px; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn {
  border: 0; background: transparent; width: 40px; height: 40px; border-radius: 10px;
  cursor: pointer; font-size: 1.05rem; color: var(--muted); flex-shrink: 0;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
:focus-visible { outline: 2px solid var(--fjord); outline-offset: 2px; }

input[type="text"], input[type="number"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface); min-height: 44px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--fjord); outline: none; box-shadow: 0 0 0 4px var(--fjord-soft); }
textarea { resize: vertical; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px;
  font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted);
}
.badge-live { background: var(--glod-soft); color: var(--glod-hover); }
.badge-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--glod); animation: blink 1.4s infinite; }
.badge-done { background: var(--good-soft); color: var(--good); }
@keyframes blink { 50% { opacity: .3; } }
.warn-text { color: var(--warn); font-size: .9rem; }
.section-title { margin: 36px 0 14px; font-size: 1.2rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* ---------- Avatarer ---------- */
.av {
  --av: var(--fjord);
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: inline-grid; place-items: center;
  background: color-mix(in srgb, var(--av) 16%, white); color: var(--av);
  font-weight: 800; font-size: .78rem; letter-spacing: .02em;
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--av) 30%, white);
}
.av.xs { width: 22px; height: 22px; font-size: .6rem; }
.av.sm { width: 28px; height: 28px; font-size: .68rem; }
.av.lg { width: 56px; height: 56px; font-size: 1.1rem; }
.av.more { --av: #5b6784; }
.av-stack { display: flex; }
.av-stack .av { margin-right: -6px; box-shadow: 0 0 0 2px var(--surface), inset 0 0 0 2px color-mix(in srgb, var(--av) 30%, white); }
.pl { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.pl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Hjem ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 28px;
  background: var(--grad); color: #fff; padding: 52px 44px; box-shadow: var(--shadow-lg);
}
.hero-rings { position: absolute; right: -10px; top: -20px; width: 460px; height: 460px; pointer-events: none; }
.hero-text { position: relative; max-width: 600px; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(255, 255, 255, .18); padding: 5px 12px; border-radius: 99px; margin-bottom: 16px;
}
.hero h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); letter-spacing: -.03em; font-weight: 800; }
.hero p { font-size: 1.1rem; opacity: .92; margin: 14px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.file-btn { cursor: pointer; }
@media (max-width: 600px) {
  .hero { padding: 36px 22px; border-radius: 22px; }
  .hero-rings { width: 300px; height: 300px; right: -110px; top: -70px; opacity: .8; }
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.t-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; border-top: 4px solid var(--sport, var(--fjord)); transition: transform .15s, box-shadow .15s; }
.t-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.t-open {
  border: 0; background: transparent; text-align: left; padding: 18px 20px 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 10px; flex: 1;
}
.t-open h3 { font-size: 1.15rem; }
.t-open:hover h3 { color: var(--fjord); }
.t-row { display: flex; justify-content: space-between; align-items: center; }
.t-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.t-meta span { font-size: .8rem; background: var(--surface-2); padding: 2px 10px; border-radius: 99px; color: var(--muted); font-weight: 600; }
.t-foot { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); font-weight: 600; }
.t-actions { display: flex; align-items: center; gap: 6px; padding: 10px 14px 14px 20px; border-top: 1px solid var(--border); }
.mini-progress { height: 8px; background: var(--surface-2); border-radius: 9px; overflow: hidden; }
.mini-progress div { height: 100%; background: var(--grad); border-radius: 9px; }
.sport-pill {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .85rem;
  color: var(--sport, var(--fjord));
}

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.step { display: flex; flex-direction: column; gap: 6px; }
.step-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem;
  background: color-mix(in srgb, var(--c) 14%, white); margin-bottom: 6px;
}
.sports-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.sport-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px;
  display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-sm);
}
.sport-card span:last-child { font-size: .8rem; color: var(--sport); font-weight: 700; }
.sport-card.soon { opacity: .6; }
.sport-card.soon span:last-child { color: var(--muted); }
.footnote { margin-top: 40px; }

/* ---------- Oppsett ---------- */
.setup { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .setup { grid-template-columns: 1fr; } }
.setup .card { display: flex; flex-direction: column; gap: 16px; }
.setup h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.num {
  width: 30px; height: 30px; border-radius: 10px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: .9rem; font-weight: 800;
}
.count { margin-left: auto; font-size: .85rem; color: var(--fjord); background: var(--fjord-soft); padding: 2px 12px; border-radius: 99px; font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field.inline { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.field.inline > span { text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--text); font-weight: 600; }
.field.inline input, .field.inline select { width: 110px; text-align: center; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--fjord); }

.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-choice {
  --sport: var(--fjord);
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 99px;
  border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; font-weight: 600;
}
.chip-choice em, .option em { font-style: normal; font-size: .68rem; color: var(--muted); background: var(--surface-2); padding: 1px 7px; border-radius: 6px; font-weight: 700; }
.chip-choice.active { border-color: var(--sport); background: color-mix(in srgb, var(--sport) 10%, white); color: var(--sport); }
.chip-choice:disabled { opacity: .55; cursor: default; }
.sport-icon {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sport, var(--fjord)); color: #fff; font-size: .72rem; font-weight: 800;
}
.sport-icon.lg { width: 42px; height: 42px; font-size: .95rem; margin-bottom: 6px; }
.chip-choice:not(.active) .sport-icon { background: color-mix(in srgb, var(--sport) 70%, white); }

.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.option {
  text-align: left; padding: 14px; border-radius: 14px; border: 1.5px solid var(--border);
  background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 3px;
  transition: border-color .15s, background .15s;
}
.option strong { font-size: .98rem; }
.option span { font-size: .8rem; color: var(--muted); }
.option:hover:not(:disabled) { border-color: var(--fjord); }
.option.active { border-color: var(--fjord); background: var(--fjord-soft); }
.option.active strong { color: var(--fjord); }
.option:disabled { opacity: .55; cursor: default; }

.segmented { display: flex; background: var(--surface-2); padding: 4px; border-radius: 14px; gap: 4px; }
.segmented button {
  flex: 1; border: 0; background: transparent; padding: 10px; border-radius: 10px;
  cursor: pointer; font-weight: 600; color: var(--muted);
}
.segmented button small { display: block; font-weight: 400; font-size: .75rem; }
.segmented button.active { background: var(--surface); color: var(--fjord); box-shadow: var(--shadow-sm); }
.segmented.sm button { padding: 6px 14px; font-size: .9rem; }

.add-row { display: flex; gap: 8px; align-items: flex-start; }
.add-row textarea { flex: 1; min-height: 46px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 99px; padding: 3px 3px 3px 3px; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.chip-name { border: 0; background: transparent; cursor: pointer; padding: 4px 4px 4px 4px; }
.chip-name:hover { color: var(--fjord); }
.chip-x {
  border: 0; background: transparent; width: 26px; height: 26px; border-radius: 50%;
  cursor: pointer; color: var(--muted); font-size: 1.05rem; line-height: 1;
}
.chip-x:hover { background: var(--danger); color: #fff; }

.courts { display: flex; flex-direction: column; gap: 8px; }
.court-row { display: flex; align-items: center; gap: 10px; }
.court-dot {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; background: var(--court); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .9rem;
}
.setup .card > .btn.sm { align-self: flex-start; }

.details { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.details:empty { display: none; }
.wdl { display: flex; gap: 10px; }
.wdl label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: .8rem; color: var(--muted); font-weight: 700; }
.wdl input { text-align: center; }

.summary { grid-column: 1 / -1; background: linear-gradient(180deg, #fff 0%, #f7faff 100%); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stats div {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px;
  display: flex; flex-direction: column;
}
.stats b { font-size: 1.8rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats span { font-size: .8rem; color: var(--muted); font-weight: 600; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Kamper ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.toolbar h2 { font-size: 1.5rem; }
.rules {
  display: inline-block; margin: 0 0 18px; background: var(--surface); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 99px;
}
.timer {
  margin-left: auto; display: flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 14px; padding: 3px 5px;
  box-shadow: var(--shadow-sm);
}
.timer-time {
  border: 0; background: transparent; font-variant-numeric: tabular-nums; font-weight: 800;
  font-size: 1.2rem; padding: 4px 8px; cursor: pointer;
}
.timer.running { border-color: var(--fjord); }
.timer.running .timer-time { color: var(--fjord); }
.timer.ended { border-color: var(--glod); animation: pulse 1s infinite; }
.timer.ended .timer-time { color: var(--glod); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--glod-soft); } }

.rounds { display: flex; flex-direction: column; gap: 16px; }
.round { padding: 16px; scroll-margin-top: 96px; }
.round-live { border-color: var(--glod); box-shadow: 0 0 0 2px var(--glod-soft), var(--shadow); }
.round-done { background: #fbfcff; }
.round-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.round-head h3 { font-size: 1.1rem; }
.round-num {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800;
  background: var(--surface-2); color: var(--muted);
}
.round-live .round-num { background: var(--glod); color: #fff; }
.round-done .round-num { background: var(--good); color: #fff; }
.matches { display: flex; flex-direction: column; gap: 10px; }

.match {
  --court: var(--fjord);
  display: grid; grid-template-columns: 96px 1fr auto 1fr 40px; align-items: center; gap: 12px;
  padding: 10px 8px 10px 14px; border-radius: 14px; background: var(--surface);
  border: 1.5px solid var(--border); border-left: 5px solid var(--court);
  transition: border-color .15s, background .15s;
}
.match.is-done { background: #fbfffd; }
.match.has-warn { border-color: var(--warn); border-left-color: var(--court); background: var(--warn-soft); }
.court-tag {
  font-size: .78rem; font-weight: 800; color: var(--court); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-transform: uppercase; letter-spacing: .04em;
}
.side { display: flex; flex-direction: column; gap: 4px; font-weight: 600; min-width: 0; }
.side-a { align-items: flex-end; }
.side-a .pl { flex-direction: row-reverse; }
.side.win .pl-name { color: var(--good); font-weight: 800; }
.side.win .pl-name::after { content: " ✓"; }
.score { display: flex; align-items: center; gap: 6px; }
.score input {
  width: 60px; height: 54px; text-align: center; font-size: 1.45rem; font-weight: 800; padding: 0;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; background: var(--surface-2); border-color: transparent;
}
.score input:focus { background: var(--surface); }
.match.is-done .score input { background: var(--good-soft); color: var(--good); }
.score input::-webkit-outer-spin-button, .score input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dash { color: var(--muted); font-weight: 800; }
.warn { grid-column: 1 / -1; font-size: .8rem; color: var(--warn); font-weight: 600; margin-top: -4px; }
.warn:empty { display: none; }
.byes { margin-top: 12px; font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-weight: 600; }
.bye { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); padding: 3px 10px 3px 3px; border-radius: 99px; color: var(--text); }

@media (max-width: 600px) {
  .match {
    grid-template-columns: 1fr auto 1fr; grid-template-areas: "court court edit" "a score b" "warn warn warn";
    gap: 8px; padding: 10px 10px 12px 12px;
  }
  .court-tag { grid-area: court; }
  .match .edit { grid-area: edit; justify-self: end; width: 34px; height: 30px; }
  .side-a { grid-area: a; }
  .side-b { grid-area: b; }
  .side .pl { flex-direction: column; gap: 4px; text-align: center; max-width: 100%; }
  .side-a, .side-b { align-items: center; }
  .side .pl-name { font-size: .9rem; }
  .score { grid-area: score; }
  .score input { width: 54px; height: 50px; }
  .warn { grid-area: warn; margin: 0; }
  .timer { margin-left: 0; }
}

/* ---------- Tabell ---------- */
.table-wrap { overflow-x: auto; padding: 8px 14px; }
.standings { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.standings th, .standings td { padding: 11px 8px; text-align: center; border-bottom: 1px solid var(--border); }
.standings th { font-size: .75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.standings tbody tr:hover { background: var(--surface-2); }
.standings tr:last-child td { border-bottom: 0; }
.standings .left { text-align: left; }
.standings .name { font-weight: 600; max-width: 220px; }
.standings .rank { font-weight: 800; color: var(--muted); font-size: 1.05rem; }
.standings .val { font-weight: 800; font-size: 1.15rem; color: var(--fjord); }
.standings tr.top1 { background: linear-gradient(90deg, rgba(245, 183, 0, .1), transparent 60%); }
@media (max-width: 560px) { .hide-sm { display: none; } .standings th, .standings td { padding: 10px 5px; } }

.podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin: 10px 0 22px; }
.pod { flex: 1; max-width: 190px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.pod-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.pod-val { font-size: .85rem; color: var(--muted); font-weight: 600; }
.pod-block {
  width: 100%; border-radius: 16px 16px 6px 6px; display: grid; place-items: center; font-size: 2rem;
  font-weight: 800; color: #fff; box-shadow: var(--shadow);
}
.pod-1 .pod-block { height: 120px; background: linear-gradient(180deg, #ffd23f, var(--gold)); }
.pod-2 .pod-block { height: 88px; background: linear-gradient(180deg, #c9d1de, var(--silver)); }
.pod-3 .pod-block { height: 66px; background: linear-gradient(180deg, #f0a86c, var(--bronze)); }

.matrix { border-collapse: separate; border-spacing: 3px; font-size: .85rem; font-variant-numeric: tabular-nums; }
.matrix th, .matrix td { padding: 7px 9px; text-align: center; white-space: nowrap; border-radius: 8px; }
.matrix th { font-weight: 700; color: var(--muted); }
.matrix th.left { text-align: left; color: var(--text); }
.matrix td { background: var(--surface-2); }
.matrix td.self { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 4px, var(--surface-3) 4px, var(--surface-3) 8px); }
.matrix td.w { background: var(--good-soft); color: var(--good); font-weight: 800; }
.matrix td.l { background: #fff0f0; color: #c92a2a; }

/* ---------- Modal ---------- */
dialog {
  border: 0; border-radius: 22px; padding: 0; width: min(540px, calc(100% - 32px));
  background: var(--surface); color: var(--text); box-shadow: 0 30px 80px rgba(19, 33, 60, .3);
}
dialog::backdrop { background: rgba(19, 33, 60, .45); backdrop-filter: blur(3px); }
.modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-body h2 { font-size: 1.2rem; }
.vs-edit { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.vs {
  margin-bottom: 6px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--glod-soft); color: var(--glod-hover); font-weight: 800; font-size: .75rem;
}
@media (max-width: 480px) { .vs-edit { grid-template-columns: 1fr; } .vs { justify-self: center; } }
.modal-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.warn-text:empty { display: none; }

/* ---------- Storskjerm ---------- */
#tv {
  position: fixed; inset: 0; z-index: 100; overflow: auto;
  background: radial-gradient(1200px 600px at 100% 0%, #e3ecff 0%, transparent 60%), var(--bg);
  padding: 3vh 3vw; font-size: clamp(16px, 1.6vw, 30px);
}
#tv[hidden] { display: none; }
.tv-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3vh; }
.tv-head .mark { width: 2.4em; height: 2.4em; }
.tv-head h1 { font-size: 2em; }
.tv-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3vw; }
@media (max-width: 760px) { .tv-grid { grid-template-columns: 1fr; } }
.tv-grid > section { background: var(--surface); border-radius: 24px; padding: 1.2em 1.4em; box-shadow: var(--shadow); }
.tv-grid h2 { font-size: 1.1em; margin-bottom: .6em; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.tv-grid h2.next { margin-top: 1.4em; font-size: .9em; }
.tv-table td { padding: .45em .5em; }
.tv-table .val { font-size: 1.3em; }
.tv-table .av { width: 1.8em; height: 1.8em; font-size: .7em; }
.tv-match {
  --court: var(--fjord);
  display: grid; grid-template-columns: 6em 1fr auto 1fr; gap: .6em; align-items: center;
  background: var(--surface-2); border-left: 6px solid var(--court); border-radius: 14px; padding: .7em 1em; margin-bottom: .5em;
  font-weight: 700;
}
.tv-match .court-tag { font-size: .7em; }
.tv-match > div:nth-child(2) { text-align: right; }
.tv-vs { color: var(--glod); font-weight: 800; font-variant-numeric: tabular-nums; }

/* ---------- Utskrift ---------- */
@media print {
  .top, .bottom-nav, .toolbar, .row-actions, .icon-btn, .btn, .rules, .focus-card, .banner-note, #toast, .lang { display: none !important; }
  body { background: #fff; padding: 0; }
  .card, .match { box-shadow: none; background: #fff !important; break-inside: avoid; }
  .round-live { box-shadow: none; }
  .main { padding: 0; }
}

/* ---------- Språkvalg ---------- */
.lang { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex-shrink: 0; }
.lang button {
  border: 0; background: transparent; padding: 5px 9px; border-radius: 8px; cursor: pointer;
  font-size: .78rem; font-weight: 800; color: var(--muted); letter-spacing: .03em;
}
.lang button.active { background: var(--surface); color: var(--fjord); box-shadow: var(--shadow-sm); }
.tab-ic { display: none; }
.bottom-nav .tab { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 0; font-size: .85rem; }
.bottom-nav .tab-ic { display: block; font-size: 1.15rem; line-height: 1; }

/* ---------- Varselbanner (endret spillerliste) ---------- */
.banner-note {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px;
  background: var(--fjord-soft); border: 1.5px solid color-mix(in srgb, var(--fjord) 30%, white); border-radius: 16px;
}
.banner-note > div { flex: 1; display: flex; flex-direction: column; }
.banner-note span:not(.banner-ic) { font-size: .9rem; color: var(--muted); }
.banner-ic {
  width: 36px; height: 36px; border-radius: 10px; background: var(--fjord); color: #fff;
  display: grid; place-items: center; font-weight: 800; flex-shrink: 0;
}
@media (max-width: 560px) { .banner-note { flex-wrap: wrap; } .banner-note .btn { width: 100%; } }

/* ---------- Finn meg ---------- */
.find {
  display: flex; align-items: center; gap: 6px; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 0 4px 0 10px; box-shadow: var(--shadow-sm);
}
.find select { border: 0; min-height: 36px; padding: 4px 6px; width: auto; max-width: 180px; background: transparent; box-shadow: none; font-weight: 600; }
.focus-card {
  --court: var(--fjord);
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 14px;
  background: var(--surface); border: 1.5px solid var(--border); border-left: 6px solid var(--court);
  border-radius: 16px; box-shadow: var(--shadow);
}
.focus-card > div { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.focus-card strong { font-size: 1.15rem; }
.focus-card span { color: var(--muted); font-size: .9rem; }
.focus-label { font-size: .75rem !important; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--court) !important; }
.focus-count { font-weight: 800; color: var(--text) !important; background: var(--surface-2); padding: 4px 10px; border-radius: 99px; }
@media (max-width: 560px) {
  .focus-card { flex-wrap: wrap; row-gap: 10px; }
  .focus-card .av.lg { width: 44px; height: 44px; }
  .focus-card > div { flex: 1 1 calc(100% - 60px); }
  .focus-card .focus-count { margin-left: auto; }
}
.pl.me .pl-name { color: var(--fjord); font-weight: 800; }
.pl.me .av { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--fjord); }
.bye.me { background: var(--fjord-soft); color: var(--fjord); }
.match.flash { animation: flash 1.4s ease; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--court) 40%, transparent); } 100% { box-shadow: none; } }
.kbd-hint { white-space: nowrap; }
@media (hover: none) { .kbd-hint { display: none; } }

/* ---------- Tabell: vinner og trukne ---------- */
.winner-banner {
  display: flex; align-items: center; gap: 16px; padding: 18px 22px; margin-bottom: 16px; border-radius: 20px;
  background: linear-gradient(120deg, #fff6d6, #fff 70%); border: 1.5px solid #ffe08a; box-shadow: var(--shadow);
}
.winner-banner .trophy { font-size: 2.2rem; }
.winner-banner span { display: block; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #a17400; }
.winner-banner strong { font-size: 1.5rem; }
.tag { font-size: .68rem; font-weight: 700; background: var(--surface-2); color: var(--muted); padding: 1px 7px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.standings tr.withdrawn td { color: var(--muted); }
.chip.withdrawn { opacity: .6; border-style: dashed; }
.chip.withdrawn .chip-name { text-decoration: line-through; }
.chip-x.restore:hover { background: var(--fjord); }

/* ---------- Dialog og toast ---------- */
.modal-body > input { font-size: 1.05rem; }
.btn.danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger-solid:hover { background: #c92a2a; color: #fff; }
#toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; max-width: calc(100% - 32px);
  background: var(--natt, #13213c); color: #fff; padding: 12px 14px 12px 18px; border-radius: 14px;
  box-shadow: 0 12px 40px rgba(19, 33, 60, .35); font-weight: 600; font-size: .95rem;
  transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button {
  border: 0; background: rgba(255, 255, 255, .14); color: #ffb48f; font-weight: 800; padding: 6px 12px;
  border-radius: 9px; cursor: pointer;
}
#toast button:hover { background: rgba(255, 255, 255, .24); }
body.has-nav #toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

@media (max-width: 760px) {
  .top-inner { gap: 8px; }
  .toolbar { gap: 8px; }
  .find { flex: 1; min-width: 150px; }
  .find select { max-width: none; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 600px) {
  .view-matches .toolbar > .segmented { order: 1; flex: 0 0 auto; }
  .view-matches .toolbar > .find { min-width: 0; flex: 1 1 140px; }
  .view-matches .toolbar > #jumpSlot { order: 2; }
  .view-matches .toolbar > .find { order: 3; }
  .view-matches .toolbar > .timer { order: 4; }
  .rules { font-size: .8rem; }
}
.segmented.sm button { white-space: nowrap; }
@media (max-width: 560px) {
  .standings th, .standings td { padding: 10px 4px; }
  .standings th { letter-spacing: 0; }
  .standings .name { max-width: 150px; }
  .standings .av.sm { width: 24px; height: 24px; font-size: .6rem; }
  .view-table .toolbar .btn.sm { padding: 6px 10px; }
  .podium { gap: 8px; }
}

/* ---------- Tilgangskode ---------- */
.gate { display: flex; justify-content: center; padding: 48px 16px; }
.gate-card {
  width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px 24px;
}
.gate-card h1 { font-size: 1.5rem; }
.gate-card p { margin: 0; }
.gate-card input {
  width: 100%; padding: 12px 14px; font-size: 1.05rem; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2);
}
.gate-card input:focus { outline: 2px solid var(--fjord); outline-offset: 1px; background: var(--surface); }
.gate-card .btn { width: 100%; justify-content: center; padding-top: 12px; padding-bottom: 12px; }
.gate-error { color: var(--danger); font-weight: 600; font-size: .9rem; }
