/* =====================================================================
   HvaSkjer – ekstra temaer / extra themes (themes-extra.css)
   Lastes etter revamp.css. Her ligger bare temavelgeren (valgene i Innstillinger og hjørnekontrollen).
   Selve temaene ligger i hver sin fil, lastet i denne rekkefølgen:
     theme-crazy-beta.css → theme-matrix.css → theme-myk-beta.css
   Mørk og lys er uendret.

   - crazy-beta → html[data-theme=light][data-skin=crazy-beta]
   - soft-beta  → html[data-theme=light][data-skin=soft-beta]  (Myk Beta: Crazy beta med dempede farger)
   - matrix     → html[data-theme=dark][data-skin=matrix]  (+ matrix.js for det digitale regnet)
   Valgt tema lagres som før i localStorage «hsa-settings».theme.
   ===================================================================== */

/* ---------------------------------------------------------------------
   1) Temavelgeren / the picker (synlig i alle temaer)
   --------------------------------------------------------------------- */
html:root body .seg3.seg-themes{grid-template-columns:repeat(6,1fr)!important;row-gap:8px}
html:root body .seg3.seg-themes > button{grid-column:span 2;min-height:56px}
html:root body .seg3.seg-themes > .theme-opt-crazy{grid-column:1 / -1;margin:4px 6px 8px}

/* Crazy-beta option: warning-tape badge */
html:root body .theme-opt-crazy{
  position:relative;flex-direction:row!important;gap:8px!important;min-height:56px;padding:6px 10px!important;
  background:repeating-linear-gradient(135deg,#ffd400 0 9px,#111 9px 18px)!important;
  border:3px solid #ff00b4!important;border-radius:10px!important;color:#ffd400!important;
  transform:skew(-6deg) rotate(-1.2deg);box-shadow:4px 4px 0 #00e5ff!important;
  font-family:"Arial Black","Segoe UI Black",Impact,system-ui,sans-serif!important;
}
html:root body .theme-opt-crazy .cb-bolt{width:22px;height:22px;flex:0 0 22px;fill:#ffd400;stroke:#111;stroke-width:1.6;stroke-linejoin:round;filter:drop-shadow(2px 0 0 #ff00b4) drop-shadow(-1px 0 0 #00e5ff);
  background:#111;border-radius:6px;padding:2px;box-sizing:content-box}
html:root body .theme-opt-crazy .cb-text{display:flex;flex-direction:column;align-items:flex-start;gap:3px;background:#111;padding:4px 8px;border-radius:6px;transform:skew(6deg)}
html:root body .theme-opt-crazy .cb-main{
  color:#ffd400;font-weight:900;font-size:15px;line-height:1;letter-spacing:.06em;text-transform:uppercase;
  text-shadow:2px 0 0 #ff00b4,-2px 0 0 #00e5ff
}
html:root body .theme-opt-crazy .cb-tag{
  display:inline-block;background:#ff00b4;color:#fff;font:800 10.5px/1.15 system-ui,sans-serif;letter-spacing:.02em;
  padding:2px 6px;border-radius:3px;transform:rotate(-2deg);text-transform:none;white-space:nowrap
}
html:root body .theme-opt-crazy:hover,html:root body .theme-opt-crazy:focus-visible{animation:hsaCbWiggle .45s ease-in-out 2}
html:root body .theme-opt-crazy:focus-visible{outline:3px solid var(--ink)!important;outline-offset:3px!important}
html:root body .theme-opt-crazy[aria-pressed=true]{border-color:#00e5ff!important;box-shadow:0 0 0 3px var(--ink),5px 5px 0 #ff00b4!important}
html:root body .theme-opt-crazy[aria-pressed=true]::after{
  content:"✓";position:absolute;top:-9px;right:-9px;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;
  background:#00e5ff;color:#111;font:900 12px/1 system-ui,sans-serif;border:2px solid #111;transform:skew(6deg)
}
@keyframes hsaCbWiggle{0%,100%{transform:skew(-6deg) rotate(-1.2deg)}25%{transform:skew(-6deg) rotate(1.5deg) translateX(1px)}75%{transform:skew(-6deg) rotate(-3deg) translateX(-1px)}}

@media (prefers-reduced-motion:reduce){html:root body .theme-opt-crazy{animation:none!important}}
html.reduce-motion:root body .theme-opt-crazy{animation:none!important}

/* ---------------------------------------------------------------------
   1b) Where the ⚠ Beta entry point lives
   ≥1024px (the app puts the tab bar in the header there): the header theme control (top right)
        is always shown as  Lys | Mørk | ⚠ Beta!  – it replaces the old header badge. Not in Utseende there.
   900–1023px: the header control stays Lys | Mørk as before; Beta is in Innstillinger → Utseende.
   <900px: Innstillinger → Utseende only.
   --------------------------------------------------------------------- */
html:root body .desktop-theme-switch > .dts-beta{display:none!important}
html:root body .desktop-theme-switch > button:focus-visible{outline:2px solid var(--ink)!important;outline-offset:2px!important;position:relative;z-index:1}
@media (min-width:1024px){
  /* always visible, also when the right-hand group is squeezed (hdr-c3 only tightens it) */
  html:root body .app-header .header-actions > .desktop-theme-switch{display:inline-flex!important;align-items:center;gap:2px;flex:0 0 auto;order:1}
  html:root body .app-header .header-actions > .desktop-theme-switch > .dts-beta{display:inline-flex!important}
  html:root body .app-header .desktop-theme-switch > button{height:28px;min-height:28px;line-height:1;white-space:nowrap}
  html:root body .app-header.hdr-c3 .desktop-theme-switch > button:not(.dts-beta){padding:0 6px}
  html:root body .seg3.seg-themes > .theme-opt-crazy{display:none!important}
}

/* «⚠ Beta!» – a tiny hazard sign: yellow/black warning tape around a black label, red «!» energy.
   Same height as Lys and Mørk; a little jitter on hover (off with reduced motion / Færre animasjoner). */
html:root body .desktop-theme-switch > .dts-beta{
  align-items:center;justify-content:center;padding:3px!important;border-radius:999px;
  background:repeating-linear-gradient(-45deg,#ffd400 0 5px,#141414 5px 10px)!important;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.35);color:#ffd400!important;cursor:pointer;
}
html:root body .desktop-theme-switch > .dts-beta .dts-beta-in{
  display:inline-flex;align-items:center;gap:3px;height:100%;padding:0 8px 0 6px;border-radius:999px;
  background:#141414;color:#ffd400;font:900 11px/1 "Arial Black","Segoe UI Black",Impact,system-ui,sans-serif;letter-spacing:.04em;
  text-transform:uppercase;text-shadow:1px 0 0 #ff2d55
}
html:root body .desktop-theme-switch > .dts-beta .dts-warn{color:#ff2d55;font-size:12px;text-shadow:none;font-family:system-ui,sans-serif}
html:root body .desktop-theme-switch > .dts-beta:hover{background:repeating-linear-gradient(-45deg,#ff2d55 0 5px,#141414 5px 10px)!important}
html:root body .desktop-theme-switch > .dts-beta:hover .dts-beta-in,
html:root body .desktop-theme-switch > .dts-beta:focus-visible .dts-beta-in{animation:hsaDtsJitter .36s steps(2,jump-none) 2}
html:root body .desktop-theme-switch > .dts-beta[aria-pressed=true]{background:repeating-linear-gradient(-45deg,#ff2d55 0 5px,#141414 5px 10px)!important;box-shadow:0 0 0 2px #ffd400,0 0 0 3px #141414!important}
html:root body .desktop-theme-switch > .dts-beta[aria-pressed=true] .dts-beta-in{background:#ffd400;color:#141414;text-shadow:none}
html:root body .desktop-theme-switch > .dts-beta[aria-pressed=true] .dts-warn{color:#d4001f}
@keyframes hsaDtsJitter{0%,100%{transform:none}25%{transform:translateX(-1px) rotate(-3deg)}50%{transform:translateX(1px) rotate(2deg)}75%{transform:translateY(-1px) rotate(-1deg)}}
@media (prefers-reduced-motion:reduce){html:root body .desktop-theme-switch > .dts-beta .dts-beta-in{animation:none!important}}
html.reduce-motion:root body .desktop-theme-switch > .dts-beta .dts-beta-in{animation:none!important}

/* Matrix-valget i Innstillinger → Utseende: en liten terminal med regn (synlig i alle temaer) */
html:root body .seg3.seg-themes > .theme-opt-matrix{grid-column:1 / -1;margin:2px 6px 0}
html:root body .theme-opt-matrix{
  position:relative;flex-direction:row!important;justify-content:flex-start!important;gap:12px!important;min-height:56px;padding:8px 14px!important;
  background:#000!important;color:#00ff41!important;border:1px solid rgba(0,255,65,.55)!important;border-radius:6px!important;
  box-shadow:0 0 18px -6px rgba(0,255,65,.6)!important;overflow:hidden;font-family:ui-monospace,"SF Mono",Menlo,Consolas,"DejaVu Sans Mono",monospace!important}
html:root body .theme-opt-matrix::before{content:"";position:absolute;inset:0;pointer-events:none;background:repeating-linear-gradient(0deg,rgba(0,0,0,.35) 0 1px,transparent 1px 3px)}
html:root body .theme-opt-matrix .mx-glyph{display:block;width:34px;flex:0 0 34px;font:700 10px/1.05 ui-monospace,Menlo,Consolas,monospace;color:#00ff41;text-align:center;opacity:.85;text-shadow:0 0 6px rgba(0,255,65,.8)}
html:root body .theme-opt-matrix:hover .mx-glyph,html:root body .theme-opt-matrix:focus-visible .mx-glyph{animation:mxPickRain .9s steps(4) infinite}
@keyframes mxPickRain{0%{transform:translateY(-4px);opacity:.5}100%{transform:translateY(4px);opacity:1}}
html:root body .theme-opt-matrix .mx-text{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left}
html:root body .theme-opt-matrix .mx-main{font:700 16px/1.1 ui-monospace,"SF Mono",Menlo,Consolas,monospace;letter-spacing:.12em;text-transform:uppercase;color:#00ff41;text-shadow:0 0 8px rgba(0,255,65,.7)}
html:root body .theme-opt-matrix .mx-main::after{content:"█";margin-left:4px;font-size:.8em;animation:mxPickBlink 1s steps(1) infinite}
@keyframes mxPickBlink{50%{opacity:0}}
html:root body .theme-opt-matrix .mx-tag{font:500 11px/1.2 ui-monospace,Menlo,Consolas,monospace;color:#5fae74}
html:root body .theme-opt-matrix .mx-tag::after{content:" 🐇";filter:grayscale(1) brightness(2)}
html:root body .theme-opt-matrix[aria-pressed=true]{border-color:#00ff41!important;box-shadow:0 0 0 1px #00ff41,0 0 24px -4px rgba(0,255,65,.8)!important}
html:root body .theme-opt-matrix[aria-pressed=true]::after{content:"[✓]";position:absolute;top:50%;right:14px;translate:0 -50%;font:700 13px/1 ui-monospace,Menlo,Consolas,monospace;color:#00ff41}
html:root body .theme-opt-matrix:focus-visible{outline:1px solid #00ff41!important;outline-offset:3px!important}
@media (prefers-reduced-motion:reduce){html:root body .theme-opt-matrix *{animation:none!important}}
html.reduce-motion:root body .theme-opt-matrix *{animation:none!important}

/* Matrix i hjørnekontrollen (≥1024 px) */
html:root body .desktop-theme-switch > .dts-matrix{display:none!important}
@media (min-width:1024px){html:root body .app-header .header-actions > .desktop-theme-switch > .dts-matrix,html:root body .desktop-theme-switch > .dts-matrix{display:inline-flex!important}}
html:root body .desktop-theme-switch > .dts-matrix{align-items:center;font-family:ui-monospace,"SF Mono",Menlo,Consolas,monospace!important;font-weight:700!important;font-size:11px!important;letter-spacing:.06em;
  background:#000!important;color:#00ff41!important;text-shadow:0 0 6px rgba(0,255,65,.7);border-radius:999px}
html:root body .desktop-theme-switch > .dts-matrix:hover{background:#001a07!important}
html:root body .desktop-theme-switch > .dts-matrix[aria-pressed=true]{background:#00ff41!important;color:#000!important;text-shadow:none;box-shadow:0 0 12px rgba(0,255,65,.7)!important}

/* Myk Beta-valget i Innstillinger → Utseende og i hjørnekontrollen: dempet stripete tape i pastell (synlig i alle temaer) */
html:root body .seg3.seg-themes > .theme-opt-soft{grid-column:1 / -1;margin:2px 6px 4px}
html:root body .theme-opt-soft{position:relative;flex-direction:row!important;gap:8px!important;min-height:56px;padding:6px 10px!important;
  background:repeating-linear-gradient(135deg,#f3e6b3 0 9px,#efbccd 9px 18px)!important;border:3px solid #3a3446!important;border-radius:10px!important;color:#3a3446!important;
  transform:skew(-6deg) rotate(-1deg);box-shadow:4px 4px 0 #a9d6dc!important;font-family:"Arial Black","Segoe UI Black",Impact,system-ui,sans-serif!important}
html:root body .theme-opt-soft .sb-text{display:flex;flex-direction:column;align-items:flex-start;gap:3px;background:#fbf8f2;padding:4px 8px;border-radius:6px;transform:skew(6deg);border:2px solid #3a3446}
html:root body .theme-opt-soft .sb-main{color:#3a3446;font-weight:900;font-size:15px;line-height:1;letter-spacing:.06em;text-transform:uppercase;text-shadow:2px 0 0 #e5a3b9,-2px 0 0 #a9d6dc}
html:root body .theme-opt-soft .sb-tag{display:inline-block;background:#a99bd6;color:#fbf8f2;font:800 10.5px/1.15 system-ui,sans-serif;padding:2px 6px;border-radius:3px;transform:rotate(-2deg);white-space:nowrap}
html:root body .theme-opt-soft[aria-pressed=true]{box-shadow:0 0 0 3px var(--ink),5px 5px 0 #e5a3b9!important}
html:root body .theme-opt-soft[aria-pressed=true]::after{content:"✓";position:absolute;top:-9px;right:-9px;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;background:#a9d6dc;color:#3a3446;font:900 12px/1 system-ui,sans-serif;border:2px solid #3a3446;transform:skew(6deg)}
html:root body .theme-opt-soft:focus-visible{outline:3px solid var(--ink)!important;outline-offset:3px!important}
html:root body .desktop-theme-switch > .dts-soft{display:none!important}
@media (min-width:1024px){html:root body .app-header .header-actions > .desktop-theme-switch > .dts-soft,html:root body .desktop-theme-switch > .dts-soft{display:inline-flex!important}}
html:root body .desktop-theme-switch > .dts-soft{align-items:center;padding:3px!important;border-radius:999px;background:repeating-linear-gradient(-45deg,#f3e6b3 0 5px,#efbccd 5px 10px)!important;cursor:pointer}
html:root body .desktop-theme-switch > .dts-soft .dts-soft-in{display:inline-flex;align-items:center;gap:3px;height:100%;padding:0 8px 0 6px;border-radius:999px;background:#fbf8f2;color:#3a3446;font:900 11px/1 "Arial Black","Segoe UI Black",Impact,system-ui,sans-serif;letter-spacing:.04em;text-transform:uppercase}
html:root body .desktop-theme-switch > .dts-soft[aria-pressed=true]{box-shadow:0 0 0 2px #3a3446!important}
html:root body .desktop-theme-switch > .dts-soft[aria-pressed=true] .dts-soft-in{background:#3a3446;color:#f3e6b3}
