/* Boulekampen: gemensam formgivning för admin, live och storbild.
   Samma designsystem som startsidan: off-white, orange och svart, rubriker
   i Bonbance och allt annat i Inter. Orange är för det som ska synas först:
   ledaren, pågående match och huvudknappen. */

@font-face { font-family: 'Bonbance'; src: url('../assets/fonts/Bonbance-BoldCondensed.woff2') format('woff2'); font-weight: 700; font-display: swap; }
:root {
  --bg: #0e0e0e;
  --hi: #e5492b;
  --ink: #fbf5ea;
  --muted: rgba(251, 245, 234, 0.62);
  --faint: rgba(251, 245, 234, 0.38);
  --line: rgba(251, 245, 234, 0.14);
  --raise: rgba(251, 245, 234, 0.055);
  --raise-2: rgba(251, 245, 234, 0.1);
  --hi-soft: rgba(229, 73, 43, 0.12);
  --hi-text: var(--hi);
  --on-hi: var(--bg);
  --line-2: rgba(251, 245, 234, 0.3);
  --line-strong: var(--ink);
  --field-bg: rgba(0, 0, 0, 0.14);
  --field-bg-focus: rgba(0, 0, 0, 0.22);
  --backdrop: rgba(12, 11, 10, 0.72);
  --focus: var(--hi);
  --r: 16px;
  --r-sm: 10px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.5, 1);
  --display: 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --heading: 'Bonbance', var(--display);
  --pad: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Typografi ─────────────────────────────────────────────────────── */

.display, h1, h2, h3 {
  font-family: var(--display);
  
  line-height: 1.02;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(28px, 6vw, 64px); font-weight: 700; color: var(--hi-text); overflow-wrap: break-word; hyphens: auto; }
/* Rubriker med långa ord krymper så att ordet ryms på en rad i stället för
   att brytas mitt i. --chars sätts av fitTitle() i ui.js. Space Grotesk:
   ungefär 0,63 em per versal. */
h1.fit { font-size: min(var(--max, 64px), calc((100vw - 2 * var(--pad) - var(--less, 0px)) / (var(--chars) * 0.66))); }
h2 { font-size: clamp(18px, 2.6vw, 26px); font-weight: 700; }
h3 { font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.num { font-family: var(--display); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Logga ──
   Originalfilen används som mask så att loggan alltid får exakt
   varumärkets rosa, utan att SVG:n behöver ändras. */
.mark {
  display: block;
  aspect-ratio: 1;
  background: var(--hi);
  -webkit-mask: url('../assets/images/klot-mark.svg') center / contain no-repeat;
          mask: url('../assets/images/klot-mark.svg') center / contain no-repeat;
}
.logo {
  display: block;
  aspect-ratio: 1;
  background: var(--hi);
  -webkit-mask: url('../assets/images/logga.svg') center / contain no-repeat;
          mask: url('../assets/images/logga.svg') center / contain no-repeat;
}

/* ── Knappar ───────────────────────────────────────────────────────── */

.btn {
  --b: var(--hi);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--b);
  color: var(--on-hi);
  font-family: var(--display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), background 0.2s, color 0.2s, box-shadow 0.25s var(--ease);
}
.btn:hover { box-shadow: 0 0 0 4px var(--hi-soft); }
.btn:active { transform: scale(0.96); }
.btn[disabled] { opacity: 0.4; pointer-events: none; }
.btn.ghost {
  background: var(--raise-2);
  color: var(--ink);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--line-2); box-shadow: none; }
.btn.quiet { background: var(--raise); color: var(--ink); }
.btn.quiet:hover { background: var(--raise-2); box-shadow: none; }
.btn.danger { background: var(--raise-2); color: var(--ink); box-shadow: none; }
.btn.danger:hover { background: var(--ink); color: var(--bg); }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 11px; }
.btn.lg { min-height: 58px; padding: 14px 28px; font-size: 16px; }
.btn.block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  color: var(--ink);
  transition: background 0.2s;
}
.icon-btn:hover { background: var(--raise-2); }

/* ── Segmenterade flikar ──
   En rosa "boll" glider till den valda fliken. Positionen sätts i JS. */
.seg {
  position: relative;
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--raise);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  position: relative;
  z-index: 1;
  padding: 9px 16px;
  border-radius: 999px;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  
  white-space: nowrap;
  color: var(--muted);
  transition: color 0.3s var(--ease);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"] { color: var(--on-hi); }
.seg .seg-ind {
  position: absolute;
  top: 4px; bottom: 4px;
  left: 0; width: 0;
  border-radius: 999px;
  background: var(--hi);
  transition: transform 0.45s var(--ease), width 0.45s var(--ease);
}

/* ── Formulär ──────────────────────────────────────────────────────── */

.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 13px; color: var(--muted); }
.input, .field input, .field select, .field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  border: 0;
  background: var(--raise-2);
  color: var(--ink);
  transition: border-color 0.2s, background 0.2s;
}
.field textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:hover, .field input:hover, .field select:hover, .field textarea:hover { background: var(--line); }
/* Fokus är en ring, inte en kant: 2 px i textfärgen (off-white på mörkt) */
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  background: var(--raise-2);
  box-shadow: 0 0 0 2px var(--ink);
}
.field select, select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
select option { background: var(--bg); }
.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check .box {
  width: 22px; height: 22px;
  border-radius: 7px;
  border: 0;
  background: var(--raise-2);
  display: grid;
  place-items: center;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.check .box::after {
  content: '';
  width: 10px; height: 6px;
  border-left: 2.5px solid var(--on-hi);
  border-bottom: 2.5px solid var(--on-hi);
  transform: rotate(-45deg) scale(0);
  margin-top: -3px;
  transition: transform 0.3s var(--spring);
}
.check input:checked + .box { background: var(--hi); border-color: var(--hi); }
.check input:checked + .box::after { transform: rotate(-45deg) scale(1); }
.check input:focus-visible + .box { outline: 3px solid var(--focus); outline-offset: 2px; }

/* Växlare */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  width: 46px; height: 28px;
  border-radius: 999px;
  background: var(--raise-2);
  position: relative;
  transition: background 0.25s var(--ease);
  flex-shrink: 0;
}
.switch .track::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.35s var(--spring), background 0.25s;
}
.switch input:checked + .track { background: var(--hi); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--on-hi); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ── Ytor ──────────────────────────────────────────────────────────── */

.panel {
  background: var(--raise);
  border-radius: var(--r);
  padding: clamp(16px, 2.4vw, 26px);
}
.panel + .panel { margin-top: 14px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.rule { height: 1px; background: var(--line); border: 0; margin: 18px 0; }
.stack { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.row > .input { flex: 1 1 140px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--raise);
  border-radius: var(--r);
}
.empty strong { display: block; color: var(--ink); font-family: var(--display);  font-size: 14px; margin-bottom: 6px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--raise-2);
  color: var(--ink);
  white-space: nowrap;
}
.pill.hi { background: var(--hi); color: var(--on-hi); }
.pill.line { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }

/* Pulserande prick för pågående */
.live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--hi);
  position: relative;
  flex-shrink: 0;
}
.live-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--hi);
  animation: pulse 1.6s var(--ease) infinite;
}
.pill.hi .live-dot { background: var(--on-hi); }
.pill.hi .live-dot::after { border-color: var(--on-hi); }
@keyframes pulse {
  from { transform: scale(0.6); opacity: 1; }
  to   { transform: scale(1.8); opacity: 0; }
}

/* ── Tabell ────────────────────────────────────────────────────────── */

.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th {
  white-space: nowrap;
  font-weight: normal;
  font-size: 12px;
  color: var(--faint);
  text-align: center;
  padding: 0 6px 8px;
}
.table th:nth-child(2) { text-align: left; }
.table td {
  padding: 10px 6px;
  text-align: center;
  border-top: 1px solid var(--line);
}
.table td.team { text-align: left; width: 100%; }
.table td.team .tname { font-size: 15px; }
.table td.rank { font-family: var(--display); font-weight: 700; font-size: 12px; color: var(--faint); width: 28px; }
.table td.pts { font-family: var(--display); font-weight: 700; font-size: 16px; }
.table tr.lead td.rank, .table tr.lead td.pts { color: var(--hi-text); }
.table tr.q td.rank { color: var(--ink); }
.table tr.mine td { background: var(--hi-soft); }
.table tr.cut td { border-top: 1.5px dashed var(--line-2); }
.table .diff { color: var(--muted); }

/* ── Match ─────────────────────────────────────────────────────────── */

.match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.match .ta { text-align: right; }
.match .tb { text-align: left; }
.match .t { font-size: 15px; line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
.match .t.win { color: var(--hi-text); }
.match .t.ph { color: var(--faint); font-style: normal; }
.match .score {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  min-width: 86px;
  text-align: center;
  display: flex;
  justify-content: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}
.match .score .sep { color: var(--faint); }
.match.live .score { color: var(--hi-text); }
.match .meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 10px;
  font-size: 12px;
  color: var(--faint);
  margin-top: -4px;
}
.match.mine { background: linear-gradient(90deg, transparent, var(--hi-soft), transparent); }

/* ── Siffror som rullar ──
   När ett värde ändras glider den nya siffran upp underifrån, som en
   mekanisk poängtavla. Klassen sätts av rollNumbers() i ui.js. */
.roll { display: inline-block; overflow: hidden; vertical-align: bottom; }
.roll > i { display: inline-block; font-style: normal; }
.roll.bump > i { animation: roll-in 0.55s var(--ease); }
@keyframes roll-in {
  0%   { transform: translateY(90%); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: translateY(0); }
}

/* ── Slutspelsträd ─────────────────────────────────────────────────── */

/* Bracket: kolumner per omgång, varje match centrerad mellan de två som
   matar den. Linjerna ritas med ::before/::after på omslagen. */
.bracket { display: flex; gap: 0; overflow-x: auto; padding-bottom: 6px; --bw: 1.5px; --bc: rgba(128, 124, 116, .45); }
.bracket .col { display: flex; flex-direction: column; flex: 1 1 0; min-width: 210px; }
.bracket .col-title { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 22px 10px; }
.bracket .slots { display: flex; flex-direction: column; flex: 1; }
.bracket .bslot { flex: 1 1 0; display: flex; align-items: center; position: relative; padding: 6px 22px; }
.bracket .col:first-child .bslot { padding-left: 0; }
.bracket .col:last-child .bslot { padding-right: 0; }
/* ut från matchen åt höger */
.bracket .col:not(:last-child) .bslot::after { content: ''; position: absolute; right: 0; width: 22px; top: 50%; border-top: var(--bw) solid var(--bc); }
/* lodrätt mellan paren */
.bracket .col:not(:last-child) .bslot:nth-child(odd)::before { content: ''; position: absolute; right: 0; top: 50%; bottom: 0; border-right: var(--bw) solid var(--bc); }
.bracket .col:not(:last-child) .bslot:nth-child(even)::before { content: ''; position: absolute; right: 0; top: 0; bottom: 50%; border-right: var(--bw) solid var(--bc); }
/* in i matchen från vänster */
.bracket .col + .col .bslot .bm::before { content: ''; position: absolute; left: -22px; width: 22px; top: 50%; border-top: var(--bw) solid var(--bc); }
.bracket .col.single .bslot::before { display: none; }
.bm { position: relative; width: 100%; background: var(--surface, var(--raise)); border-radius: 10px; overflow: visible; }
.bm .side { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; font-size: 14px; }
.bm .side + .side { border-top: 1px solid var(--line); }
.bm .side span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bm .side .s { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 1.4em; text-align: right; }
.bm .side.win { font-weight: 600; }
.bm .side.win .s { color: var(--hi); }
.bm .side.ph { color: var(--faint); }
.bm .side.lose { color: var(--muted); }
.bm .when { font-size: 12px; color: var(--muted); padding: 0 12px 9px; }
.bm.live { box-shadow: 0 0 0 2px var(--hi); }
.bm.final { box-shadow: 0 0 0 2px var(--ink); }
.bm.final.done { background: var(--hi); color: var(--on-hi); box-shadow: none; }
.bm.final.done .side, .bm.final.done .side.win .s, .bm.final.done .when { color: var(--on-hi); }
.bracket .col { position: relative; }
.bracket-extra { position: absolute; left: 22px; right: 0; bottom: 0; }
.bracket-below { display: flex; justify-content: flex-end; margin-top: 12px; }
.bracket-below .bracket-extra { position: static; width: min(320px, 100%); }
.bracket-extra .col-title { padding: 0 0 8px; }

/* ── Reveal ────────────────────────────────────────────────────────── */

.rv { opacity: 0; transform: translateY(18px); }
.rv.in { opacity: 1; transform: none; transition: opacity 0.6s var(--ease), transform 0.7s var(--ease); transition-delay: var(--d, 0s); }

/* Omsortering av rader (FLIP) */
.flip-move { transition: transform 0.6s var(--ease); }

/* ── Toast ─────────────────────────────────────────────────────────── */

.toasts {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
  width: min(92vw, 420px);
}
.toast {
  background: var(--ink);
  color: var(--bg);
  padding: 12px 18px;
  border-radius: 14px;
  font-size: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.45s var(--spring);
  pointer-events: auto;
}
.toast.hi { background: var(--hi); color: var(--on-hi); }
.toast.out { animation: toast-out 0.3s var(--ease) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* ── Dialog ────────────────────────────────────────────────────────── */

dialog.dlg {
  margin: auto;
  border: 0;
  border-radius: 20px;
  background: var(--bg);
  color: var(--ink);
  padding: 24px;
  width: min(calc(100vw - 32px), 520px);
  max-width: none;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: inset 0 0 0 1.5px var(--line), 0 30px 80px rgba(0, 0, 0, 0.5);
}
dialog.dlg.wide { width: min(calc(100vw - 32px), 760px); }
@media (max-width: 560px) { dialog.dlg { padding: 20px 16px; } }
dialog.dlg::backdrop { background: var(--backdrop); backdrop-filter: blur(3px); }
dialog.dlg[open] { animation: dlg-in 0.4s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(20px) scale(0.98); } }
.dlg h2 { margin-bottom: 14px; }
.dlg .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.dlg .actions .btn { flex: 0 1 auto; }
@media (max-width: 420px) { .dlg .actions .btn { flex: 1 1 auto; } }

/* Siffror skrivs in, inga spinnpilar — de tar plats och ser ut som skräp i smala fält */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field, .grid-2 > * { min-width: 0; }

/* ── Demoläge ──────────────────────────────────────────────────────── */

.demo-bar {
  font-size: 13px;
  text-align: center;
  padding: 8px 16px;
  background: var(--raise);
  color: var(--muted);
}
.demo-bar strong { color: var(--ink); font-weight: normal; }
.bm { --surface: rgba(251, 245, 234, .07); }
[data-theme="light"] .bm { --surface: #ffffff; }

/* ── Ljust tema ──
   Arrangörsvyn: off-white bakgrund, vita rundade kakel, inga
   linjer. Knappar som pills i svart, orange för det viktigaste. */

:root[data-theme="light"] {
  --bg: #fbf5ea;
  --surface: #ffffff;
  --hi: #e5492b;
  --hi-text: #e5492b;
  --on-hi: #111111;
  --ink: #34232f;
  --muted: rgba(52, 35, 47, 0.62);
  --faint: rgba(52, 35, 47, 0.4);
  --line: #ebe9e3;
  --line-2: #dfdcd4;
  --line-strong: #dfdcd4;
  --raise: #efede7;
  --raise-2: #e9e6df;
  --hi-soft: rgba(229, 73, 43, 0.12);
  --field-bg: #efede7;
  --field-bg-focus: #ffffff;
  --backdrop: rgba(52, 35, 47, 0.4);
  --focus: #34232f;
  --r: 12px;
  --r-sm: 8px;
  color-scheme: light;
}
[data-theme="light"] :focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }

[data-theme="light"] h1 { font-size: clamp(40px, 5vw, 64px); line-height: .95; }
[data-theme="light"] h2 { font-family: var(--heading); font-size: 28px; line-height: 1; letter-spacing: 0; text-transform: none; font-weight: 700; }
[data-theme="light"] h3 { font-family: var(--body); font-size: 15px; font-weight: 600; letter-spacing: 0; text-transform: none; }
[data-theme="light"] .dlg h2 { font-size: 32px; }
[data-theme="light"] .logo {
  background: url('../assets/images/logga3.svg') center / contain no-repeat;
  -webkit-mask: none;
          mask: none;
  -webkit-print-color-adjust: exact;
          print-color-adjust: exact;
}

/* Knappar: pills */
[data-theme="light"] .btn { border-radius: 999px; letter-spacing: 0; text-transform: none; font-family: var(--body); font-weight: 600; background: var(--ink); color: var(--bg); box-shadow: none; }
[data-theme="light"] .btn:hover { background: #4a3542; color: var(--bg); box-shadow: none; transform: translateY(-1px); }
[data-theme="light"] .btn.ghost, [data-theme="light"] .btn.quiet { background: var(--raise-2); color: var(--ink); box-shadow: none; }
[data-theme="light"] .btn.ghost:hover, [data-theme="light"] .btn.quiet:hover { background: var(--line-2); color: var(--ink); }
[data-theme="light"] .btn.danger { background: #fbe3de; color: #c92b00; box-shadow: none; }
[data-theme="light"] .btn.danger:hover { background: #f8d3cb; color: #c92b00; }
[data-theme="light"] .icon-btn { border-radius: 999px; }

/* Flikar: pills, den valda i svart */
[data-theme="light"] .seg { padding: 4px; gap: 2px; border-radius: 999px; background: var(--raise-2); box-shadow: none; }
[data-theme="light"] .seg button { font-size: 14px; border-radius: 999px; padding: 9px 18px; letter-spacing: 0; text-transform: none; font-family: var(--body); font-weight: 500; position: relative; z-index: 1; }
[data-theme="light"] .seg button[aria-selected="true"] { color: var(--bg); }
[data-theme="light"] .seg .seg-ind { top: 4px; bottom: 4px; border-radius: 999px; background: var(--ink); }

/* Fält: fyllda, utan kant */
[data-theme="light"] .field > span, [data-theme="light"] .label {
  color: var(--muted);
  font-family: var(--body);
  font-size: 13px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}
[data-theme="light"] .input, [data-theme="light"] .field input, [data-theme="light"] .field select, [data-theme="light"] .field textarea {
  border: 0;
  border-radius: 8px;
  background: var(--field-bg);
}
[data-theme="light"] .input:focus, [data-theme="light"] .field input:focus, [data-theme="light"] .field select:focus, [data-theme="light"] .field textarea:focus {
  background: var(--field-bg-focus);
  box-shadow: 0 0 0 2px var(--ink);
}
[data-theme="light"] .check .box { border-radius: 6px; border: 0; background: var(--raise-2); }
[data-theme="light"] .check input:checked + .box { background: var(--ink); }
[data-theme="light"] .switch .track { background: var(--line-2); box-shadow: none; }
[data-theme="light"] .switch input:checked + .track { background: var(--hi); }
[data-theme="light"] .switch .track::after { background: #fff; }

/* Ytor: vita kakel */
[data-theme="light"] .panel { background: var(--surface); border: 0; border-radius: var(--r); padding: 24px; }
[data-theme="light"] .panel + .panel { margin-top: 10px; }
[data-theme="light"] .panel-head { margin-bottom: 16px; }
[data-theme="light"] .rule { background: var(--line); }
[data-theme="light"] .empty { border: 0; border-radius: var(--r); background: var(--raise); }
[data-theme="light"] .pill { border-radius: 999px; font-family: var(--body); font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }
[data-theme="light"] .pill.line { box-shadow: none; background: var(--raise-2); color: var(--ink); }
[data-theme="light"] .live-dot { background: var(--hi); }
[data-theme="light"] .live-dot::after { border-color: var(--hi); }

/* Tabeller och matcher */
[data-theme="light"] .table th {
  color: var(--muted);
  font-family: var(--body);
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  border-bottom: 0;
}
[data-theme="light"] .table td { border-color: transparent; }
[data-theme="light"] .table tbody tr:nth-child(odd) td { background: var(--raise); }
[data-theme="light"] .table tr.lead td.rank { background: var(--hi); color: var(--on-hi); }
[data-theme="light"] .match { border-color: transparent !important; }
[data-theme="light"] .match .t.win { font-weight: 600; }
[data-theme="light"] .match.live .score { background: var(--hi); color: var(--on-hi); padding: 2px 8px; border-radius: 6px; }

[data-theme="light"] .toast { border-radius: 999px; box-shadow: 0 12px 30px -12px rgba(0,0,0,.35); }
[data-theme="light"] dialog.dlg { border-radius: 16px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.35); border: 0; }
[data-theme="light"] dialog.dlg::backdrop { backdrop-filter: none; }

/* ── Rörelse av ────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
  }
  .rv { opacity: 1; transform: none; }
}

@media print {
  body { background: #fff; color: #000; }
  .no-print { display: none !important; }
}

/* Rubriker i Bonbance */
h1, .display { font-family: var(--heading); font-weight: 700; text-transform: none; letter-spacing: 0; }
.demo-bar { display: none !important; }

/* Markerad text: orange med vit text, samma som startsidan */
::selection { background: #e5492b; color: #fff; }
