/* =========================================================
   SYSTEM · 12-Wochen-Protokoll — Solo-Leveling-UI
   Dunkles Holo-Interface, bewusst nur Dark Mode.
   ========================================================= */

:root {
  color-scheme: dark;

  /* Flächen & Tinte */
  --paper: #060B16;
  --panel: rgba(11, 22, 41, 0.86);
  --panel-solid: #0B1629;
  --card-2: rgba(20, 38, 66, 0.55);
  --ink: #D9EAFF;
  --ink-2: #8FAECF;
  --ink-3: #55708F;
  --line: #1C3654;
  --hud: #3E6EA8;

  /* Phasenfarben: Cyan → Violett → Gold */
  --p1: #38BDF8;
  --p2: #A78BFA;
  --p3: #FACC15;
  --good: #34D399;
  --danger: #F87171;

  /* Figuren in den Übungsbildern */
  --fig: #C9E6FF;
  --prop: #3A5A80;

  --radius: 4px;
  --radius-s: 3px;

  --font-body: "Rajdhani", "Segoe UI", sans-serif;
  --font-display: "Orbitron", "Segoe UI", sans-serif;
}

/* Aktive Phasenfarbe (am body, damit Overlays sie erben) */
body { --accent: var(--p1); }
body[data-phase="2"] { --accent: var(--p2); }
body[data-phase="3"] { --accent: var(--p3); }

/* Gekaufte Themes überschreiben die Phasenfarbe dauerhaft */
body[data-sltheme="monarch"] { --accent: #A78BFA; }
body[data-sltheme="srank"] { --accent: #FACC15; }

body {
  --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 55%, transparent);
}

/* Gold braucht dunklen Button-Text */
body[data-phase="3"] .btn:not(.btn-ghost),
body[data-sltheme="srank"] .btn:not(.btn-ghost) { color: #1A1508; }

/* ---------- Basis ---------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(1100px 500px at 50% -180px, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    var(--paper);
  color: var(--ink);
  font-size: 16.5px;
  line-height: 1.45;
  font-weight: 500;
  min-height: 100vh;
}

/* Scanlines über allem – das Herz des Holo-Looks */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(180, 220, 255, 0.022) 0 1px,
    transparent 1px 3px
  );
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection { background: var(--accent-soft); }

@keyframes flicker-in {
  0% { opacity: 0; transform: translateY(6px) scaleY(0.92); }
  35% { opacity: 0.7; }
  45% { opacity: 0.25; }
  60% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px var(--accent-glow), inset 0 0 12px color-mix(in srgb, var(--accent) 12%, transparent); }
  50% { box-shadow: 0 0 22px var(--accent-glow), inset 0 0 18px color-mix(in srgb, var(--accent) 20%, transparent); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- App-Gerüst ---------- */

.app {
  max-width: 660px;
  margin: 0 auto;
  padding: 0 16px calc(86px + env(safe-area-inset-bottom));
}

.tab { display: none; }
.tab.is-active { display: block; animation: flicker-in 0.3s ease; }

/* ---------- System-Fenster (Karten) ---------- */

.card {
  position: relative;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, var(--panel)), var(--panel));
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--radius);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 10%, transparent), 0 8px 24px rgba(0, 0, 0, 0.45);
  padding: 18px 16px 16px;
  margin-bottom: 16px;
  backdrop-filter: blur(6px);
}

/* Eck-Klammern */
.card::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background:
    linear-gradient(var(--accent) 0 0) top left / 16px 2px,
    linear-gradient(var(--accent) 0 0) top left / 2px 16px,
    linear-gradient(var(--accent) 0 0) top right / 16px 2px,
    linear-gradient(var(--accent) 0 0) top right / 2px 16px,
    linear-gradient(var(--accent) 0 0) bottom left / 16px 2px,
    linear-gradient(var(--accent) 0 0) bottom left / 2px 16px,
    linear-gradient(var(--accent) 0 0) bottom right / 16px 2px,
    linear-gradient(var(--accent) 0 0) bottom right / 2px 16px;
  background-repeat: no-repeat;
  opacity: 0.9;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--accent);
  margin-bottom: 12px;
}
.card h2::before { content: "◆ "; font-size: 9px; vertical-align: 2px; }

.jp {
  font-size: 0.72em;
  letter-spacing: 0.28em;
  color: var(--ink-3);
  font-weight: 500;
}

/* ---------- Typo-Bausteine ---------- */

.eyebrow {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
}

.big-title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 900;
  font-size: clamp(26px, 6.5vw, 36px);
  letter-spacing: 0.06em;
  line-height: 1.1;
  margin: 4px 0 4px;
  text-shadow: 0 0 24px var(--accent-glow);
}

.muted { color: var(--ink-2); font-size: 14.5px; }
.small { font-size: 13px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #fff 6%), color-mix(in srgb, var(--accent) 78%, #000 10%));
  color: #04101F;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15.5px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: var(--radius-s);
  padding: 12px 22px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  box-shadow: 0 0 16px var(--accent-glow);
  transition: filter 0.15s ease, transform 0.1s ease, box-shadow 0.2s ease;
}
.btn:hover { filter: brightness(1.12); box-shadow: 0 0 26px var(--accent-glow); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.4; cursor: default; box-shadow: none; }
.btn.full { width: 100%; }

.btn-ghost {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: inset 0 0 12px color-mix(in srgb, var(--accent) 8%, transparent);
}
.btn-ghost:hover { background: var(--accent-soft); filter: none; }

.btn-done { background: linear-gradient(180deg, #3ddfa2, #22b380); color: #032117; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  border-radius: 2px;
  padding: 3px 10px;
}

/* ---------- Kopfbereich ---------- */

.topbar { padding-top: 18px; }

.topbar-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 21px;
  letter-spacing: 0.3em;
  display: block;
  text-shadow: 0 0 18px var(--accent-glow);
}

.brand-jp { margin-left: 10px; }

.brand-sub {
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.phase-legend { display: flex; gap: 12px; flex-wrap: wrap; }

.phase-legend span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.phase-legend i { width: 8px; height: 8px; display: inline-block; transform: rotate(45deg); }
.phase-legend i.c1 { background: var(--p1); box-shadow: 0 0 8px var(--p1); }
.phase-legend i.c2 { background: var(--p2); box-shadow: 0 0 8px var(--p2); }
.phase-legend i.c3 { background: var(--p3); box-shadow: 0 0 8px var(--p3); }

/* ---------- Wochenband ---------- */

.weekband {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 18px;
}

.wk {
  --wc: var(--p1);
  position: relative;
  min-width: 0;
  height: 54px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--wc) 7%, var(--panel-solid));
  border: 1px solid color-mix(in srgb, var(--wc) 35%, var(--line));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.wk[data-p="2"] { --wc: var(--p2); }
.wk[data-p="3"] { --wc: var(--p3); }

.wk:hover { transform: translateY(-2px); box-shadow: 0 0 12px color-mix(in srgb, var(--wc) 35%, transparent); }

.wk-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: color-mix(in srgb, var(--wc) 80%, var(--ink));
  line-height: 1;
}

.wk.is-past { background: color-mix(in srgb, var(--wc) 20%, var(--panel-solid)); }

.wk.is-current {
  background: color-mix(in srgb, var(--wc) 82%, #000 6%);
  border-color: var(--wc);
  box-shadow: 0 0 16px color-mix(in srgb, var(--wc) 55%, transparent);
}
.wk.is-current .wk-num { color: #04101F; }

.wk-dots { display: flex; gap: 3px; height: 5px; }

.wk-dots i {
  width: 4.5px; height: 4.5px;
  transform: rotate(45deg);
  background: color-mix(in srgb, var(--wc) 30%, transparent);
}
.wk-dots i.on { background: var(--wc); box-shadow: 0 0 5px var(--wc); }
.wk.is-current .wk-dots i { background: rgba(4, 16, 31, 0.35); box-shadow: none; }
.wk.is-current .wk-dots i.on { background: #04101F; }

/* ---------- Navigation ---------- */

.mainnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  gap: 4px;
  background: color-mix(in srgb, var(--panel-solid) 88%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}

.navbtn {
  flex: 1;
  max-width: 106px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px;
  border-radius: 2px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.navbtn svg {
  width: 21px; height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.navbtn.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  text-shadow: 0 0 10px var(--accent-glow);
}

/* ---------- Status-Fenster ---------- */

.status-grid {
  display: flex;
  gap: 16px;
  align-items: center;
}

.lv-block {
  flex: none;
  text-align: center;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  background: var(--accent-soft);
  padding: 10px 14px 8px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.lv-label {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--ink-2);
}

.lv-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 40px;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 18px var(--accent-glow);
}

.pl-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.pl-title { color: var(--ink-2); font-size: 13.5px; font-style: italic; margin: 1px 0 6px; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--rank-c, var(--accent));
  border: 1px solid color-mix(in srgb, var(--rank-c, var(--accent)) 55%, transparent);
  padding: 3px 10px;
  text-transform: uppercase;
}
.rank-badge b {
  font-size: 16px;
  text-shadow: 0 0 10px var(--rank-c, var(--accent));
}

.xp-bar {
  height: 9px;
  margin-top: 10px;
  background: var(--card-2);
  border: 1px solid var(--line);
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
  overflow: hidden;
}
.xp-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 60%, transparent), var(--accent));
  box-shadow: 0 0 10px var(--accent-glow);
  transition: width 0.4s ease;
}

.xp-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.stats-hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.stat-hex {
  text-align: center;
  border: 1px solid var(--line);
  background: var(--card-2);
  padding: 9px 4px 7px;
  clip-path: polygon(7px 0, calc(100% - 7px) 0, 100% 50%, calc(100% - 7px) 100%, 7px 100%, 0 50%);
}

.stat-hex .v {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.1;
}
.stat-hex .k {
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--ink-3);
}

.gold-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: #FACC15;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.5);
  font-variant-numeric: tabular-nums;
}
.gold-chip::before { content: "◈"; font-size: 13px; }

/* ---------- Hunter-Lizenz (rotierende 3D-Karte) ---------- */

.lic3d {
  perspective: 1100px;
  display: grid;
  place-items: center;
  padding: 8px 0 14px;
}

.lic-tilt {
  width: min(100%, 360px);
  animation: lic-float 7s ease-in-out infinite;
  transform-style: preserve-3d;
}

@keyframes lic-float {
  0%, 100% { transform: rotateY(-11deg) rotateX(4deg); }
  50% { transform: rotateY(11deg) rotateX(-3deg); }
}

.lic {
  position: relative;
  width: 100%;
  aspect-ratio: 8 / 5;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.3, 0.9, 0.3, 1);
  cursor: pointer;
}
.lic.flipped { transform: rotateY(180deg); }

.lic-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background:
    radial-gradient(300px 140px at 80% -30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%),
    linear-gradient(160deg, #101E38, #0A1426 60%, #0C1830);
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 26px color-mix(in srgb, var(--accent) 22%, transparent), 0 14px 34px rgba(0, 0, 0, 0.5);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}
.lic-back { transform: rotateY(180deg); }

.lic-tag {
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--accent);
  display: flex;
  justify-content: space-between;
}

.lic-mid { display: flex; align-items: center; gap: 14px; flex: 1; }

.lic-rank {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 58px;
  line-height: 1;
  color: var(--rank-c, var(--accent));
  text-shadow: 0 0 26px var(--rank-c, var(--accent));
}

.lic-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.lic-sub { color: var(--ink-2); font-size: 12.5px; font-style: italic; }

.lic-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--ink-3);
}

.lic-lv {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 20px;
  color: var(--ink);
}
.lic-lv small { font-size: 10px; color: var(--ink-3); letter-spacing: 0.2em; }

.lic-barcode {
  height: 26px;
  margin: 8px 0;
  background: repeating-linear-gradient(90deg,
    rgba(215, 235, 255, 0.85) 0 2px, transparent 2px 5px,
    rgba(215, 235, 255, 0.55) 5px 6px, transparent 6px 11px);
  opacity: 0.55;
}

.lic-stats-mini { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.lic-stats-mini div { text-align: center; }
.lic-stats-mini .v { font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.lic-stats-mini .k { font-family: var(--font-display); font-size: 8px; font-weight: 700; letter-spacing: 0.16em; color: var(--ink-3); }

.lic-hint { text-align: center; color: var(--ink-3); font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; }

/* ---------- STATUS-Fenster (Referenz: königsblaues System-Window) ---------- */

.swin {
  /* Manhwa-Blau (früh); .is-purple = Anime-S2-Look (spät) */
  --swA: #1B52D6;
  --swB: #0A2B92;
  --swMid: #0E36AE;
  --swBorder: #6FA0FF;
  --swGlow: rgba(45, 100, 235, 0.45);
  --swOrn: #7FB0FF;
  --swBox: #CBDEFB;
  --swBoxText: #0A2B92;

  position: relative;
  margin-bottom: 16px;
  background: linear-gradient(175deg, var(--swA) 0%, var(--swMid) 55%, var(--swB) 100%);
  border: 1px solid var(--swBorder);
  outline: 1px solid rgba(10, 20, 60, 0.9);
  outline-offset: 3px;
  box-shadow: 0 0 34px var(--swGlow), 0 16px 40px rgba(0, 0, 0, 0.5);
  padding: 20px 20px 22px;
  color: #F2F7FF;
  overflow: hidden;
}

.swin.is-purple {
  --swA: #7A2FD9;
  --swB: #3A0B80;
  --swMid: #571AAE;
  --swBorder: #C79BFF;
  --swGlow: rgba(155, 80, 255, 0.5);
  --swOrn: #D3B4FF;
  --swBox: #E4D4FF;
  --swBoxText: #3A0B80;
}

/* Glas-Schimmer statt Wasserzeichen (wie im Manhwa-Fenster) */
.swin::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.12) 46%, rgba(255, 255, 255, 0.03) 56%, transparent 62%),
    radial-gradient(620px 220px at 50% -80px, rgba(255, 255, 255, 0.16), transparent 70%);
}

.swin > * { position: relative; }

.swin-corner {
  position: absolute;
  width: 74px; height: 74px;
  color: var(--swOrn);
  opacity: 0.9;
}
.swin-corner.c-tl { top: 4px; left: 4px; }
.swin-corner.c-tr { top: 4px; right: 4px; transform: scaleX(-1); }
.swin-corner.c-bl { bottom: 4px; left: 4px; transform: scaleY(-1); }
.swin-corner.c-br { bottom: 4px; right: 4px; transform: scale(-1); }

.swin-emblem {
  display: block;
  width: 150px;
  height: 40px;
  margin: -6px auto 0;
  color: var(--swOrn);
}

.swin-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30px, 7vw, 38px);
  letter-spacing: 0.08em;
  text-align: center;
  margin: 2px 0 6px;
  text-shadow: 0 2px 14px rgba(0, 20, 80, 0.6);
}

.swin-rule {
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(240, 246, 255, 0.85), transparent);
  margin: 0 auto 16px;
  max-width: 420px;
}

.sw-grid2 {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  column-gap: 24px;
  row-gap: 4px;
  max-width: 460px;
  margin: 0 auto;
}

.sw-field {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  min-width: 0;
}

.sw-field > span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.sw-field > b {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1.5px solid rgba(220, 235, 255, 0.55);
  padding: 0 4px 2px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-wide { max-width: 460px; margin: 0 auto; }

.sw-bar {
  flex: 1.6;
  height: 8px;
  align-self: center;
  background: rgba(6, 20, 70, 0.55);
  border: 1px solid rgba(160, 195, 255, 0.5);
  overflow: hidden;
}
.sw-bar u {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #9CC4FF, #E8F1FF);
}

.sw-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 460px;
  margin: 14px auto 12px;
  color: #CFE2FF;
  font-size: 11px;
}
.sw-divider::before, .sw-divider::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(240, 246, 255, 0.7), transparent);
}

.sw-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 26px;
  row-gap: 8px;
  max-width: 460px;
  margin: 0 auto;
}

.sw-stat {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.sw-stat > span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.06em;
}

.sw-box {
  min-width: 44px;
  text-align: center;
  background: var(--swBox, #CBDEFB);
  color: var(--swBoxText, #0A2B92);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  border-radius: 3px;
  padding: 3px 8px;
  box-shadow: inset 0 1px 3px rgba(10, 20, 80, 0.5);
  font-variant-numeric: tabular-nums;
}

.sw-spin { display: flex; flex-direction: column; gap: 2px; }

.sw-spin button {
  width: 17px; height: 13px;
  display: grid;
  place-items: center;
  font-size: 8px;
  line-height: 1;
  color: var(--swBoxText, #0A2B92);
  background: color-mix(in srgb, var(--swBox, #A9C6F5) 82%, #000 6%);
  border-radius: 2px;
}
.sw-spin button:hover { background: #FFFFFF; }
.sw-spin button:disabled { opacity: 0.35; cursor: default; }

.sw-points {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  max-width: 460px;
  margin: 4px auto 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
}

/* ---------- Inventar ---------- */

.inv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 9px;
}

.inv-slot {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 6%, transparent), transparent 60%),
    var(--card-2);
  display: grid;
  place-items: center;
  padding: 4px;
}

.inv-slot.filled { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); cursor: pointer; }
.inv-slot.filled:hover { box-shadow: 0 0 12px var(--accent-soft); }

.inv-slot .ico { font-size: 25px; line-height: 1; filter: drop-shadow(0 0 6px var(--accent-glow)); }

.inv-slot .nm {
  position: absolute;
  left: 3px; right: 3px; bottom: 3px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inv-slot .ct {
  position: absolute;
  top: 3px; right: 4px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: #FACC15;
}

.inv-slot .eq {
  position: absolute;
  top: 3px; left: 4px;
  font-size: 9px;
  color: var(--good);
  text-shadow: 0 0 6px color-mix(in srgb, var(--good) 60%, transparent);
}

.sysmodal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- Daily Quest ---------- */

.quest-list { display: grid; gap: 8px; }

.q-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  background: var(--card-2);
  padding: 10px 12px;
}

.q-check {
  flex: none;
  width: 22px; height: 22px;
  border: 1.5px solid var(--ink-3);
  transform: rotate(45deg);
  display: grid;
  place-items: center;
  font-size: 13px;
  color: transparent;
}
.q-item.is-done .q-check {
  border-color: var(--good);
  background: color-mix(in srgb, var(--good) 22%, transparent);
  color: var(--good);
  box-shadow: 0 0 10px color-mix(in srgb, var(--good) 45%, transparent);
}
.q-check span { transform: rotate(-45deg); }

.q-item .q-text { flex: 1; font-weight: 600; }
.q-item .q-sub { color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.q-item.is-done .q-text { color: var(--ink-2); text-decoration: line-through; }

.q-warn {
  margin-top: 12px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--danger);
  border: 1px dashed color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 7%, transparent);
  padding: 8px 12px;
}
.q-warn::before { content: "⚠ "; }

.q-reward { color: #FACC15; font-family: var(--font-display); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; white-space: nowrap; }

/* ---------- Heute / Status-Seite ---------- */

.today-head { padding: 6px 2px 14px; }

.day-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.day-cell {
  text-align: center;
  padding: 7px 2px 8px;
  border: 1px solid var(--line);
  background: var(--card-2);
}

.day-cell .d-name {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: 0.1em;
}

.day-cell .d-ico { font-size: 14px; line-height: 1.6; color: var(--ink-2); }

.day-cell.is-today { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 12px color-mix(in srgb, var(--accent) 10%, transparent); }
.day-cell.is-done .d-ico { color: var(--good); text-shadow: 0 0 8px color-mix(in srgb, var(--good) 60%, transparent); }

.today-task { display: flex; align-items: center; gap: 14px; }

.today-task-ico {
  flex: none;
  width: 46px; height: 46px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  clip-path: polygon(9px 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%, 0 9px);
}
.today-task-ico svg {
  width: 25px; height: 25px;
  fill: none; stroke: currentColor;
  stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}

.today-task h3 { font-size: 17px; font-weight: 700; letter-spacing: 0.02em; }

.stat-row { display: flex; gap: 14px; }
.stat-tile { flex: 1; }

.stat-tile .stat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.04em;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.stat-tile .stat-label {
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ---------- Gate / Training ---------- */

.phase-head { margin-bottom: 4px; }

.session-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }

.ex-list { display: grid; gap: 14px; grid-template-columns: 1fr; }

.ex-card {
  position: relative;
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  overflow: hidden;
}

.ex-figure {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 6%, var(--panel-solid)), var(--panel-solid));
  border-bottom: 1px solid var(--line);
}

.ex-svg { display: block; width: 100%; height: auto; max-height: 170px; }

.ex-svg .fig { stroke: var(--fig); stroke-width: 7; fill: none; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(160, 215, 255, 0.35)); }
.ex-svg .head { fill: var(--fig); stroke: none; }
.ex-svg .gho { opacity: 0.22; }
.ex-svg .prop { stroke: var(--prop); stroke-width: 4.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ex-svg .ground { stroke: var(--line); stroke-width: 3; stroke-linecap: round; }
.ex-svg .acc { stroke: var(--accent); stroke-width: 3.5; fill: none; stroke-linecap: round; filter: drop-shadow(0 0 5px var(--accent-glow)); }
.ex-svg .acc.dash { stroke-dasharray: 7 7; stroke-width: 3; }
.ex-svg .accfill { fill: var(--accent); stroke: none; filter: drop-shadow(0 0 5px var(--accent-glow)); }

.ex-body { padding: 12px 14px 14px; display: flex; gap: 12px; align-items: flex-start; }

.ex-text { flex: 1; }

.ex-name { font-size: 17px; font-weight: 700; letter-spacing: 0.02em; }

.ex-reps {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
  margin: 2px 0 5px;
}

.ex-cue { color: var(--ink-2); font-size: 13.5px; line-height: 1.45; }

.ex-extra {
  margin-top: 5px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ---------- Formulare ---------- */

.mform { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field.wide { grid-column: 1 / -1; }

.field label {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.field input, .field select, .photo-actions select {
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  color: var(--ink);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 10px var(--accent-soft); }

/* ---------- Charts ---------- */

.chart-wrap { position: relative; }

.chart-svg { display: block; width: 100%; height: auto; }

.chart-svg text {
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  fill: var(--ink-3);
}
.chart-svg .grid-line { stroke: var(--line); stroke-width: 1; opacity: 0.7; }
.chart-svg .ref-line { stroke: var(--ink-3); stroke-width: 1.3; stroke-dasharray: 5 5; }
.chart-svg .data-line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chart-svg .pt { stroke: var(--panel-solid); stroke-width: 2; }
.chart-svg .pt-hit { fill: transparent; cursor: pointer; }
.chart-svg .direct-label { font-weight: 700; fill: var(--ink); font-size: 11.5px; }

.chart-tip {
  position: fixed;
  z-index: 90;
  pointer-events: none;
  background: var(--panel-solid);
  border: 1px solid var(--accent);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 10px;
  box-shadow: 0 0 14px var(--accent-glow);
  opacity: 0;
  transition: opacity 0.1s ease;
  white-space: nowrap;
}
.chart-tip.show { opacity: 1; }

/* ---------- Tabellen ---------- */

.mtable { width: 100%; border-collapse: collapse; font-size: 14.5px; }

.mtable th {
  text-align: left;
  font-family: var(--font-display);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  font-weight: 700;
  padding: 4px 8px 8px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
}

.mtable td {
  padding: 9px 8px 9px 0;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.mtable .del-btn { color: var(--ink-3); font-size: 16px; line-height: 1; padding: 4px 8px; }
.mtable .del-btn:hover { color: var(--danger); text-shadow: 0 0 8px color-mix(in srgb, var(--danger) 60%, transparent); }

.delta-up { color: var(--danger); }
.delta-down { color: var(--good); }

.hist-meta { color: var(--ink-2); font-size: 13.5px; margin-bottom: 10px; }

/* ---------- Shop ---------- */

.shop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.shop-list { display: grid; gap: 12px; }

.shop-item {
  display: flex;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--card-2);
  padding: 12px 14px;
}

.shop-item .si-text { flex: 1; }
.shop-item .si-name { font-weight: 700; font-size: 16px; letter-spacing: 0.02em; }
.shop-item .si-desc { color: var(--ink-2); font-size: 13px; line-height: 1.4; }

.shop-item .si-action { flex: none; text-align: right; display: grid; gap: 6px; justify-items: end; }

.shop-item.is-owned { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }

.si-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: #FACC15;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.4);
  font-variant-numeric: tabular-nums;
}
.si-price::before { content: "◈ "; font-size: 11px; }

.si-owned {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--good);
}

.btn-sm { padding: 8px 14px; font-size: 12.5px; }

/* ---------- Status-Window-Overlay (Vollbild) ---------- */

.statuswin {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(3, 6, 14, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 16px calc(30px + env(safe-area-inset-bottom));
}
.statuswin.open { display: block; }
.statuswin.open .statuswin-inner { animation: flicker-in 0.35s ease; }

.statuswin-inner {
  position: relative;
  width: min(100%, 560px);
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.sw-close {
  position: sticky;
  top: 0;
  align-self: flex-end;
  z-index: 5;
  width: 40px; height: 40px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  color: var(--ink-2);
  display: grid;
  place-items: center;
  font-size: 16px;
  margin-bottom: 8px;
}
.sw-close:hover { border-color: var(--danger); color: var(--danger); }

/* Lizenz solo im Overlay: größer und mittig */
.statuswin-inner.is-license .lic-tilt { width: min(100%, 450px); }
.statuswin-inner.is-license .lic3d { padding: 20px 0 18px; }

/* ---------- System-Modal (LEVEL UP etc.) ---------- */

.sysmodal {
  position: fixed;
  inset: 0;
  z-index: 96;
  background: rgba(3, 7, 14, 0.78);
  display: none;
  place-items: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.sysmodal.open { display: grid; }

.sysmodal-card {
  /* System-Fenster sind früh Manhwa-blau, spät Anime-purple */
  --accent: #4D8DFF;
  --accent-glow: color-mix(in srgb, var(--accent) 55%, transparent);
  width: min(100%, 410px);
  text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--panel-solid)), var(--panel-solid));
  border: 1px solid var(--accent);
  box-shadow: 0 0 44px var(--accent-glow), inset 0 0 30px color-mix(in srgb, var(--accent) 8%, transparent);
  padding: 22px 22px 22px;
  animation: flicker-in 0.4s ease;
  position: relative;
}

.sysmodal-card.is-purple { --accent: #B685FF; }
.sysmodal-card.is-gold { --accent: #FACC15; }

/* "(!) NOTIFICATION"-Kopf wie im Anime */
.sysmodal-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.sysmodal-alert {
  flex: none;
  width: 34px; height: 34px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
  box-shadow: 0 0 14px var(--accent-glow), inset 0 0 8px color-mix(in srgb, var(--accent) 15%, transparent);
}

.sysmodal-tag {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.26em;
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  padding: 6px 16px;
  text-shadow: 0 0 12px var(--accent-glow);
}

.sysmodal-title {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: 30px;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-shadow: 0 0 26px var(--accent-glow);
  margin-bottom: 6px;
}

.sysmodal-body { color: var(--ink-2); font-size: 14.5px; margin-bottom: 18px; }
.sysmodal-body b { color: var(--ink); }

/* ---------- Toast als System-Meldung ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(94px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  background: var(--panel-solid);
  border: 1px solid var(--accent);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  box-shadow: 0 0 18px var(--accent-glow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  max-width: min(90vw, 430px);
  text-align: center;
}
.toast::before {
  content: "[SYSTEM] ";
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); animation: flicker-in 0.25s ease; }

/* ---------- Gate-Player ---------- */

.player {
  position: fixed;
  inset: 0;
  z-index: 80;
  background:
    radial-gradient(900px 420px at 50% -140px, color-mix(in srgb, var(--accent) 11%, transparent), transparent 70%),
    var(--paper);
  display: none;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.player.open { display: block; }

.player-inner {
  max-width: 620px;
  margin: 0 auto;
  padding: 16px 18px calc(28px + env(safe-area-inset-bottom));
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.p-top { display: flex; align-items: center; gap: 12px; }

.p-progress {
  flex: 1;
  height: 8px;
  background: var(--card-2);
  border: 1px solid var(--line);
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
  overflow: hidden;
}
.p-progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent));
  box-shadow: 0 0 10px var(--accent-glow);
  transition: width 0.3s ease;
}

.p-close {
  flex: none;
  width: 40px; height: 40px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  font-size: 16px;
  color: var(--ink-2);
  display: grid;
  place-items: center;
}
.p-close:hover { border-color: var(--danger); color: var(--danger); }

.p-meta {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent);
  white-space: nowrap;
  text-shadow: 0 0 10px var(--accent-glow);
}

.p-stage {
  position: relative;
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent) 12%, transparent);
  overflow: hidden;
}

.p-stage .ex-svg { max-height: 230px; background: var(--panel-solid); border-bottom: 1px solid var(--line); }

.p-stage-body { padding: 14px 18px 18px; text-align: center; }

.p-ex-name { font-size: 20px; font-weight: 700; letter-spacing: 0.03em; }

.p-ex-reps {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(22px, 5.5vw, 30px);
  letter-spacing: 0.08em;
  color: var(--accent);
  text-shadow: 0 0 18px var(--accent-glow);
  margin: 2px 0 6px;
}

.p-ex-cue { color: var(--ink-2); font-size: 14px; max-width: 440px; margin: 0 auto; }

.p-timerbox { text-align: center; padding: 4px 0; }

.p-timer {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(54px, 15vw, 86px);
  line-height: 1;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 30px var(--accent-glow);
}
.p-timer.is-rest { color: var(--accent); }

.p-timer-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: var(--ink-3);
  margin-top: 4px;
}

.p-actions { display: grid; gap: 10px; margin-top: auto; }
.p-actions .btn { padding: 15px 20px; font-size: 16px; animation: pulse-glow 2.4s ease-in-out infinite; }
.p-actions .btn-ghost { animation: none; }

.p-skip {
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 8px;
  justify-self: center;
}
.p-skip:hover { color: var(--ink-2); }

.p-done-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 10px 0 6px;
}

.p-done-stats .stat-tile {
  text-align: center;
  background: var(--card-2);
  border: 1px solid var(--line);
  padding: 12px 6px;
}

.xp-gain {
  margin: 10px auto 0;
  max-width: 340px;
  text-align: left;
  font-size: 13.5px;
}
.xp-gain div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
  color: var(--ink-2);
}
.xp-gain div:last-child { border-bottom: none; }
.xp-gain b { color: var(--accent); font-variant-numeric: tabular-nums; }
.xp-gain .gold b { color: #FACC15; }

/* ---------- Onboarding ---------- */

.onboard {
  position: fixed;
  inset: 0;
  z-index: 92;
  background:
    radial-gradient(800px 400px at 50% -100px, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--paper);
  display: none;
  overflow-y: auto;
  padding: 24px 18px;
}
.onboard.open { display: grid; place-items: center; }

.ob-card {
  width: min(100%, 470px);
  background: var(--panel);
  border: 1px solid var(--accent);
  box-shadow: 0 0 34px var(--accent-glow);
  padding: 28px 24px 24px;
  animation: flicker-in 0.4s ease;
}

.ob-eyebrow {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.28em;
  color: var(--accent);
}

.ob-title {
  font-family: var(--font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(24px, 7vw, 32px);
  letter-spacing: 0.08em;
  line-height: 1.12;
  margin: 6px 0 8px;
  text-shadow: 0 0 22px var(--accent-glow);
}

.ob-text { color: var(--ink-2); font-size: 15px; margin-bottom: 18px; }

.ob-fields { display: grid; gap: 14px; margin-bottom: 20px; }

.ob-dots { display: flex; gap: 6px; margin-bottom: 18px; }
.ob-dots i {
  width: 28px; height: 4px;
  background: var(--card-2);
  border: 1px solid var(--line);
}
.ob-dots i.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

.ob-actions { display: flex; gap: 10px; }
.ob-actions .btn { flex: 1; }
.ob-actions .btn-ghost { flex: 0 0 auto; }

/* ---------- Foto / Memory Log ---------- */

.photo-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.photo-actions select { width: auto; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 10px;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  cursor: pointer;
  background: var(--panel-solid);
}
.photo-thumb:hover { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-soft); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo-thumb .pw {
  position: absolute;
  left: 5px; bottom: 5px;
  background: rgba(4, 12, 24, 0.8);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(2, 6, 12, 0.92);
  display: none;
  place-items: center;
  padding: 20px;
}
.lightbox.open { display: grid; }

.lb-inner { max-width: min(92vw, 720px); text-align: center; }

.lb-inner img {
  max-width: 100%;
  max-height: 72vh;
  border: 1px solid var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
  display: block;
  margin: 0 auto 12px;
}

.lb-caption {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.lb-actions { display: flex; gap: 10px; justify-content: center; }

.ss-dots { display: flex; gap: 5px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.ss-dots i { width: 7px; height: 7px; transform: rotate(45deg); background: rgba(190, 225, 255, 0.25); }
.ss-dots i.on { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

/* ---------- System-Seite (Plan) ---------- */

.plan-phase { border-left: 3px solid var(--pc, var(--p1)); }

.plan-phase .p-title {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 16px;
  letter-spacing: 0.1em;
  color: var(--pc);
  text-shadow: 0 0 12px color-mix(in srgb, var(--pc) 50%, transparent);
}

.plan-ex-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.plan-ex-row:last-child { border-bottom: none; }
.plan-ex-row .r { color: var(--ink-2); white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }

.week-sched { display: grid; gap: 0; }

.sched-row {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
  align-items: baseline;
}
.sched-row:last-child { border-bottom: none; }

.sched-row .d {
  flex: none;
  width: 36px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.sched-row.is-kraft .d { color: var(--accent); text-shadow: 0 0 8px var(--accent-glow); }

.nut-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.nut-row:last-child { border-bottom: none; }
.nut-row .l { color: var(--ink-2); font-weight: 700; white-space: nowrap; }
.nut-row .v { text-align: right; }

.data-actions { display: flex; gap: 10px; flex-wrap: wrap; }

ul.dotlist { list-style: none; }
ul.dotlist li { padding: 5px 0 5px 22px; position: relative; font-size: 14.5px; }
ul.dotlist li::before {
  content: "";
  position: absolute;
  left: 4px; top: 11px;
  width: 7px; height: 7px;
  transform: rotate(45deg);
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow);
}

/* =========================================================
   Breites Layout — iPad quer & Desktop (≥ 900px)
   ========================================================= */

@media (min-width: 900px) {

  .app {
    max-width: none;
    padding: 0 32px 40px 232px;
  }

  .mainnav {
    top: 0; bottom: 0; right: auto; left: 0;
    width: 200px;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    border-top: none;
    border-right: 1px solid var(--line);
    padding: 112px 14px 20px;
  }

  .navbtn {
    flex: none;
    max-width: none;
    width: 100%;
    flex-direction: row;
    gap: 12px;
    padding: 11px 14px;
    font-size: 13px;
    justify-content: flex-start;
  }

  .topbar { padding-top: 24px; }
  .topbar-inner { max-width: 1060px; }

  .weekband { max-width: 1060px; }
  .wk { height: 58px; }
  .wk-num { font-size: 16px; }

  .content { max-width: 1060px; }

  .ex-list { grid-template-columns: 1fr 1fr; gap: 16px; }
  .ex-svg { max-height: 190px; }

  .grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: start;
    margin-bottom: 16px;
  }
  .grid-2 > .card { margin-bottom: 0; }

  .mform { grid-template-columns: repeat(4, 1fr); }
  .mform .field.wide { grid-column: auto; }
  .mform .btn { grid-column: 3 / 5; }

  .toast { bottom: 32px; }

  .big-title { font-size: 40px; }

  .player-inner {
    max-width: 980px;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    grid-template-rows: auto 1fr;
    align-items: start;
    align-content: start;
    column-gap: 28px;
    padding-top: 26px;
  }
  .p-top { grid-column: 1 / -1; }
  .p-stage { grid-row: 2; }
  .p-side { display: flex; flex-direction: column; gap: 16px; grid-row: 2; min-height: 420px; }
  .p-side .p-actions { margin-top: auto; }
  .p-stage .ex-svg { max-height: 320px; }
}

/* Schmale Screens */
@media (max-width: 600px) {
  .phase-legend { display: none; }
}

@media (max-width: 440px) {
  .weekband { gap: 4px; }
  .wk-num { font-size: 12px; }
  .wk-dots i { width: 3.5px; height: 3.5px; }
  .stats-hud { grid-template-columns: repeat(2, 1fr); }
}
