@font-face {
  font-family: 'Pixelify Sans';
  src: url('/fonts/pixelify-sans-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Pixelify Sans';
  src: url('/fonts/pixelify-sans-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Pixelify Sans';
  src: url('/fonts/pixelify-sans-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Jersey 10';
  src: url('/fonts/jersey-10-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('/fonts/nunito-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('/fonts/nunito-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('/fonts/nunito-latin-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Nunito';
  src: url('/fonts/nunito-latin-800-normal.woff2') format('woff2');
  font-weight: 800;
  font-display: swap;
}

:root {
  --bg: #0e0b17;
  --panel: rgba(20, 16, 32, 0.82);
  --panel-strong: rgba(20, 16, 32, 0.94);
  --panel-solid: #17131f;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f3eeff;
  --muted: #cbc4e0;
  --dim: #a29bbd;
  --accent: #ffb86b;
  --accent-ink: #2a1a08;
  --blue: #8fb8ff;
  --pink: #ff8fb4;
  --green: #7bd88f;
  --red: #ff6b7a;
  --gold: #ffd35c;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(5, 3, 12, 0.45);
  /* Eigene Schriften liegen als WOFF2 auf dem Server (keine externen Dienste). Falls eine nicht lädt
     oder ein Zeichen fehlt (z. B. Pfeile, Symbole, Emoji), greifen die Systemschriften von
     macOS/iOS, Windows, Android, ChromeOS und Linux. */
  --system: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Ubuntu, Cantarell,
    'Noto Sans', 'DejaVu Sans', 'Liberation Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
    'Segoe UI Symbol', 'Noto Color Emoji', 'Noto Sans Symbols 2';
  --mono: ui-monospace, 'SF Mono', Menlo, 'Cascadia Mono', Consolas, 'Roboto Mono', 'DejaVu Sans Mono', 'Liberation Mono',
    'Courier New', monospace;
  --font: 'Nunito', var(--system);
  --pixel: 'Pixelify Sans', var(--system);
  --digits: 'Jersey 10', 'Pixelify Sans', var(--mono);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

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

#scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  image-rendering: pixelated;
  z-index: 1;
}

#bg-video {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: 0;
  filter: saturate(0.9) brightness(0.8);
}

.app {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.app > * {
  pointer-events: auto;
}

.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  line-height: 0;
}

.pixel {
  font-family: var(--pixel);
}

.digits {
  font-family: var(--digits);
  font-weight: 400;
  line-height: 1;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-weight: 700;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--surface-2);
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: 0 6px 20px rgba(255, 184, 107, 0.25);
}
.btn-primary:hover {
  background: #ffc687;
}
.btn-danger {
  background: rgba(255, 107, 122, 0.14);
  border-color: rgba(255, 107, 122, 0.45);
  color: #ffc1c8;
}
.btn-danger:hover {
  background: rgba(255, 107, 122, 0.24);
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
}
.btn-sm {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 9px;
}
.btn-lg {
  padding: 14px 22px;
  font-size: 17px;
}
.btn-block {
  width: 100%;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  position: relative;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover,
.icon-btn.active {
  background: var(--surface-2);
  color: var(--text);
}
.icon-btn .badge {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--pink);
  color: #2a0f18;
  font-size: 12px;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
}

/* ---------------------------------------------------------------- Formulare */
input[type='text'],
input[type='password'],
input[type='number'],
input[type='email'],
input[type='search'],
input[type='time'],
input[type='datetime-local'],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: rgba(8, 6, 14, 0.45);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: rgba(8, 6, 14, 0.65);
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 32px;
}
select option {
  background: var(--panel-solid);
}
input::placeholder {
  color: var(--dim);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.field-hint {
  color: var(--dim);
  font-size: 12px;
}
input[type='range'] {
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: var(--surface-2);
  outline: none;
}
input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #1a1422;
}
input[type='range']::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #1a1422;
}

.switch {
  /* Bezugspunkt für das unsichtbare Kästchen: sonst hängt es am Rahmen von Drawer oder Dialog,
     und beim Anklicken scrollt der Browser den ganzen Rahmen weg, um es sichtbar zu machen */
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.switch input {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.switch-track {
  width: 40px;
  height: 22px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  position: relative;
  transition: background 0.2s;
  flex: none;
}
.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.2s, background 0.2s;
}
.switch input:checked + .switch-track {
  background: rgba(255, 184, 107, 0.35);
  border-color: var(--accent);
}
.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(18px);
  background: var(--accent);
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(8, 6, 14, 0.4);
  border: 1px solid var(--border);
}
.segmented button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.segmented button.active {
  background: var(--surface-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.pbar {
  height: 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.pbar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--pink));
  border-radius: 6px;
  transition: width 0.4s ease;
}
.pbar.blue .pbar-fill {
  background: linear-gradient(90deg, var(--blue), #b9a6ff);
}
.pbar.green .pbar-fill {
  background: linear-gradient(90deg, #5cc88a, var(--green));
}

/* ---------------------------------------------------------------- Topbar */
.topbar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}
.topbar > * {
  pointer-events: auto;
}
.stats-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px 6px 14px;
}
.brand {
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.5px;
  margin-right: 10px;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
/* „Beta“ neben dem Logo (App und öffentliche Seiten) */
.beta-tag {
  display: inline-flex;
  align-items: center;
  align-self: center;
  margin: 0 8px 0 -4px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font: 700 10px/1.4 var(--font, inherit);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: help;
}
button.beta-tag {
  cursor: pointer;
}
button.beta-tag:hover {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
}
/* Abzeichen „Beta-User“ neben dem Namen, Popup daneben beim Drüberfahren */
.beta-user-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex: none;
  padding: 1px 7px 1px 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, #a98bff 30%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--text);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
  white-space: nowrap;
  cursor: help;
  vertical-align: middle;
}
.beta-user-badge .icon {
  color: var(--accent);
}
.beta-user-badge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.badge-tip {
  position: fixed;
  z-index: 1000;
  max-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  box-shadow: var(--shadow);
}
.badge-tip b {
  font-size: 12px;
  color: var(--accent);
}
.name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.beta-own {
  gap: 8px;
  align-items: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
}
.level-chip {
  gap: 10px;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}
.level-chip:hover {
  background: var(--surface-2);
}
.level-badge {
  font-family: var(--digits);
  font-size: 19px;
  color: var(--gold);
}
.xp-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 110px;
}
.xp-wrap .pbar {
  height: 6px;
}
.xp-text {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.records-chip .count {
  font-family: var(--digits);
  font-size: 21px;
  line-height: 1;
}
.streak-chip {
  color: #ffcf8a;
}
.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px;
}

/* ---------------------------------------------------------------- Timer */
.timer-card {
  position: absolute;
  right: max(24px, 4vw);
  top: max(88px, calc(50vh - 250px));
  width: 360px;
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.timer-time {
  font-family: var(--digits);
  font-weight: 400;
  font-size: 112px;
  line-height: 0.85;
  text-align: center;
  letter-spacing: 3px;
  text-shadow: 0 4px 30px rgba(255, 184, 107, 0.25);
  font-variant-numeric: tabular-nums;
}
body.timer-left .timer-card {
  right: auto;
  left: max(24px, 4vw);
}
.phase-break .timer-time {
  text-shadow: 0 4px 30px rgba(143, 184, 255, 0.3);
}
.timer-sub {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  min-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.timer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.strict-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 10px;
  border: 1px solid rgba(123, 216, 143, 0.4);
  background: rgba(123, 216, 143, 0.12);
  color: #b6f0c2;
  font-size: 12px;
  font-weight: 800;
}
.strict-badge.off {
  border-color: var(--border);
  background: var(--surface);
  color: var(--muted);
}
.cycle-dots {
  display: flex;
  gap: 5px;
}
.cycle-dots span {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}
.cycle-dots span.done {
  background: var(--accent);
  border-color: var(--accent);
}
.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.chips button {
  padding: 6px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}
.chips button.active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.chips .step {
  width: 32px;
  padding: 6px 0;
}
.reward-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
.reward-preview b {
  color: var(--text);
}
/* Flowtime: Live-Zähler der Belohnung, leuchtet kurz auf, wenn eine Minute dazukommt */
.flow-live.bump b {
  animation: flow-live-bump 0.9s ease-out;
}
@keyframes flow-live-bump {
  0% {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
  }
  100% {
    color: var(--text);
    text-shadow: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .flow-live.bump b {
    animation: none;
  }
}
.timer-actions {
  display: flex;
  gap: 8px;
}
.timer-actions .btn {
  flex: 1;
}
.intention-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.distractions {
  text-align: center;
  font-size: 12px;
  color: var(--dim);
}

/* Mini-Timer in der Topbar (sichtbar, wenn ein Panel den Timer verdeckt) */
.mini-timer {
  font-family: var(--digits);
  font-size: 21px;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.mini-timer.break {
  color: var(--blue);
}

/* ---------------------------------------------------------------- Player */
.player {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  max-width: calc(100vw - 32px);
}
.disc {
  width: 38px;
  height: 38px;
  flex: none;
}
.disc.spin .vinyl svg {
  animation: spin 3.2s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.now {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 170px;
}
.now-title {
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Platte, Titel und Musikquelle: ein Knopf, der das Vibe-Menü öffnet (Hover-Fläche umfasst alles) */
.source-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 4px 10px 4px 4px;
  margin: -4px -6px -4px -4px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.source-btn:hover,
.source-btn.active {
  background: var(--surface-2);
}
.source-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
}
.source-line {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}
.source-btn .source-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.source-line .icon {
  flex: none;
  transition: transform 0.15s;
}
.source-btn:hover .source-line,
.source-btn.active .source-line {
  color: var(--text);
}
.source-btn:not(.active) .source-line .icon {
  transform: rotate(180deg);
}
.atmo-pop.vibe-pop {
  width: min(420px, calc(100vw - 20px));
}
.vibe-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.vibe-body .section-title {
  margin: 4px 0 0;
}
.vibe-grid {
  display: grid;
  gap: 8px;
}
.vibe-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.vibe-card:hover:not(:disabled) {
  border-color: var(--vc);
  transform: translateY(-1px);
}
.vibe-card.active {
  border-color: var(--vc);
  background: color-mix(in srgb, var(--vc) 16%, var(--surface));
}
.vibe-card:disabled {
  opacity: 0.55;
  cursor: default;
}
.vibe-card.locked .vibe-text,
.vibe-card.locked .vibe-disc {
  opacity: 0.6;
}
/* Kleine Schallplatte in der Farbe des Vibes */
.vibe-disc {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--vc) 0 22%, #111 23% 30%, #1d1a26 31% 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.vibe-card.locked .vibe-disc {
  background: radial-gradient(circle, #555 0 22%, #111 23% 30%, #1d1a26 31% 100%);
}
.vibe-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.vibe-text b {
  font-size: 13px;
}
.vibe-desc {
  font-size: 11px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vibe-note {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.vibe-card > .icon {
  flex: none;
  color: var(--vc);
}
@media (prefers-reduced-motion: reduce) {
  .vibe-card,
  .source-btn,
  .source-line .icon {
    transition: none;
  }
}
body.panel-open:not(.timer-left) .player {
  left: calc((100vw - 488px) / 2);
}
.player .controls {
  display: flex;
  gap: 2px;
}
.player .play {
  background: var(--accent);
  color: var(--accent-ink);
}
.player .play:hover {
  background: #ffc687;
  color: var(--accent-ink);
}
.vol {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  width: 128px;
}
.vol input[type='range'] {
  min-width: 0;
  flex: 1;
}
/* Schalter vor den Reglern: Musik an/aus, Regengeräusche an/aus */
.vol-toggle {
  flex: none;
  width: 30px;
  height: 30px;
}
.vol-toggle[aria-pressed='false'] {
  color: var(--dim);
}
.vol.is-off input[type='range'] {
  opacity: 0.4;
}
.vol-toggle.hint {
  color: var(--blue);
  animation: rain-hint 2.4s ease-in-out infinite;
}
@keyframes rain-hint {
  50% {
    box-shadow: 0 0 0 4px rgba(143, 184, 255, 0.22);
  }
}
@media (prefers-reduced-motion: reduce) {
  .vol-toggle.hint {
    animation: none;
    box-shadow: 0 0 0 2px rgba(143, 184, 255, 0.35);
  }
}
.sep {
  width: 1px;
  height: 28px;
  background: var(--border);
}

/* ---------------------------------------------------------------- FAB */
.fab {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fab .icon-btn {
  width: 46px;
  height: 46px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 14px;
}
.thought-pop {
  position: absolute;
  right: 72px;
  bottom: 16px;
  width: 300px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.thought-pop h3 {
  margin: 0;
  font-size: 15px;
}

/* ---------------------------------------------------------------- Drawer */
.drawer {
  position: absolute;
  top: 78px;
  right: 14px;
  bottom: 14px;
  width: min(460px, calc(100vw - 28px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow: clip; /* nur der Inhalt scrollt, der Rahmen mit Kopfzeile nie */
  background: var(--panel-strong);
  transform: translateX(0);
  animation: drawer-in 0.22s ease;
  z-index: 5;
}
@keyframes drawer-in {
  from {
    transform: translateX(30px);
    opacity: 0;
  }
}
.drawer-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px 18px;
  border-bottom: 1px solid var(--border);
}
.drawer-head h2 {
  margin: 0;
  flex: 1;
  font-family: var(--font);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.1px;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 18px 0 10px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}
.drawer-body > .section-title:first-child {
  margin-top: 0;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.row.between {
  justify-content: space-between;
}
.grow {
  flex: 1;
  min-width: 0;
}
.empty {
  text-align: center;
  color: var(--dim);
  padding: 22px 8px;
  font-size: 14px;
}

/* Quests */
.quest {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.quest.done {
  border-color: rgba(123, 216, 143, 0.4);
}
.quest.claimed {
  opacity: 0.55;
}
/* Hinweis, welche Sessions für Quests zählen */
.quest-rule {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 4px;
}
.quest-rule .icon {
  flex: none;
  margin-top: 2px;
}
.quest-title {
  font-weight: 800;
}
.quest-desc {
  font-size: 13px;
  color: var(--muted);
}
.reward {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}
.achievements {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
}
.ach {
  padding: 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ach.locked {
  opacity: 0.45;
}
.ach .ach-name {
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ach.unlocked .ach-name {
  color: var(--gold);
}

/* Shop & Garderobe */
.shop-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  background: radial-gradient(circle at 30% 30%, rgba(255, 184, 107, 0.14), transparent 60%), var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.shop-preview canvas {
  image-rendering: pixelated;
  flex: none;
}
.shop-detail {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.shop-detail h3 {
  margin: 0;
  font-size: 17px;
}
.rarity {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.tabs-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.tabs-scroll::-webkit-scrollbar {
  display: none;
}
.tabs-scroll button {
  flex: none;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}
.tabs-scroll button.active {
  background: var(--text);
  color: #17131f;
}
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  min-height: 118px;
}
.item:hover {
  background: var(--surface-2);
}
.item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.item.equipped::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}
.item canvas {
  image-rendering: pixelated;
  height: 64px;
  width: auto;
  max-width: 100%;
}
.item .item-name {
  line-height: 1.2;
}
.item .price {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.item .price.owned {
  color: var(--green);
}
.item .price.locked {
  color: var(--dim);
}
.item .rarity-bar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
}
.swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.swatch {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.3);
}
.swatch.active {
  border-color: var(--text);
}
.wardrobe-top {
  display: flex;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.wardrobe-top canvas {
  image-rendering: pixelated;
  background: radial-gradient(circle at 50% 70%, rgba(143, 184, 255, 0.16), transparent 65%);
  border-radius: 14px;
}
.room-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto !important;
  border-radius: 8px;
}
.item.wide {
  grid-column: span 2;
}

/* Aufgaben */
.task {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.task.done .task-title {
  text-decoration: line-through;
  color: var(--dim);
}
.task-title {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.check {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 2px solid var(--border-strong);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: var(--accent-ink);
  padding: 0;
}
.check.on {
  background: var(--green);
  border-color: var(--green);
}
.add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.add-row input {
  flex: 1;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  background: var(--surface-2);
  color: var(--muted);
}

/* Statistik */
.tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.tile {
  padding: 12px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.tile-value {
  font-family: var(--digits);
  font-size: 32px;
  line-height: 1;
}
.tile-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 130px;
  padding: 10px 4px 0;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.bar {
  width: 100%;
  max-width: 22px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--accent), #ff9a8a);
  min-height: 2px;
}
.bar.today {
  background: linear-gradient(180deg, var(--pink), #c07bff);
}
.bar-label {
  font-size: 12px;
  color: var(--dim);
  font-weight: 700;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.list-row:last-child {
  border-bottom: 0;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
}
.lb-row.me {
  background: rgba(255, 184, 107, 0.1);
  border: 1px solid rgba(255, 184, 107, 0.3);
}
.lb-rank {
  width: 26px;
  font-family: var(--digits);
  font-size: 24px;
  text-align: center;
  color: var(--muted);
}
.lb-row canvas {
  image-rendering: pixelated;
}

/* Admin */
table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th,
.table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.table th {
  color: var(--muted);
  font-size: 12px;
}
.upload-drop {
  border: 2px dashed var(--border-strong);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
}
.upload-drop.drag {
  border-color: var(--accent);
  background: rgba(255, 184, 107, 0.08);
}

/* ---------------------------------------------------------------- Modals */
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 4, 12, 0.55);
  opacity: 0;
  transition: opacity 0.2s;
}
.modal-wrap.show {
  opacity: 1;
}
.modal {
  width: min(460px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 22px;
  border-radius: 20px;
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.2s;
}
.modal-wrap.show .modal {
  transform: none;
}
.modal-title {
  margin: 0 0 10px;
  font-family: var(--font);
  font-weight: 800;
  font-size: 22px;
}
.modal-body p {
  margin: 0 0 10px;
  line-height: 1.5;
  color: var(--muted);
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.reward-modal {
  text-align: center;
}
.reward-hero {
  display: flex;
  justify-content: center;
  margin: 4px 0 10px;
}
.reward-hero .vinyl svg {
  animation: spin 2.4s linear infinite, pop 0.6s ease;
  filter: drop-shadow(0 8px 24px rgba(255, 143, 180, 0.35));
}
@keyframes pop {
  from {
    transform: scale(0.4);
  }
}
.reward-totals {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-family: var(--digits);
  font-size: 36px;
  margin: 6px 0 14px;
}
.reward-totals .xp {
  color: var(--blue);
}
.reward-totals .rec {
  color: var(--pink);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.reward-lines {
  text-align: left;
  font-size: 13px;
}
.reward-lines .list-row span:last-child {
  margin-left: auto;
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}
.levelup {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 211, 92, 0.18), rgba(255, 143, 180, 0.18));
  border: 1px solid rgba(255, 211, 92, 0.4);
  font-weight: 800;
}

/* ---------------------------------------------------------------- Diverses */
.toasts {
  position: fixed;
  top: 128px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
  font-weight: 700;
  font-size: 14px;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s, transform 0.25s;
  max-width: calc(100vw - 32px);
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast-success {
  border-color: rgba(123, 216, 143, 0.5);
}
.toast-error {
  border-color: rgba(255, 107, 122, 0.55);
}
.toast-reward {
  border-color: rgba(255, 143, 180, 0.55);
}

.blur-warning {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(40, 6, 16, 0.55);
}
.blur-warning[hidden] {
  display: none;
}
.blur-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 24px;
  border-radius: 18px;
  background: var(--panel-solid);
  border: 1px solid rgba(255, 107, 122, 0.6);
  text-align: center;
  font-size: 15px;
}
.blur-card strong {
  font-family: var(--pixel);
  font-size: 26px;
  color: #ffb3bb;
}

.loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pixel);
  font-size: 22px;
  color: var(--muted);
}

.noscript {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Zen-Modus: nur der Timer bleibt */
body.zen .topbar,
body.zen .player,
body.zen .drawer,
body.zen .thought-pop {
  display: none;
}
body.zen .timer-card {
  left: 50%;
  right: auto;
  top: 28px;
  transform: translateX(-50%);
  width: auto;
  padding: 10px 22px;
  gap: 6px;
  background: rgba(20, 16, 32, 0.45);
}
body.zen .timer-card > :not(.timer-time):not(.timer-sub) {
  display: none;
}
body.zen .timer-time {
  font-size: 76px;
}
body.zen .fab {
  opacity: 0.35;
  transition: opacity 0.2s;
}
body.zen .fab:hover {
  opacity: 1;
}

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1100px) {
  .vol {
    width: 100px;
  }
  .now {
    width: 130px;
  }
  .xp-wrap {
    width: 80px;
  }
}

@media (max-width: 860px) {
  .stats-bar .streak-chip,
  .brand span:last-child {
    display: none;
  }
  .player .vol.rain-vol input[type='range'],
  .player .sep {
    display: none;
  }
  .player .vol.rain-vol {
    width: auto;
  }
}

@media (max-width: 760px) {
  html,
  body {
    font-size: 14px;
  }
  .topbar {
    top: 10px;
    left: 10px;
    right: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .stats-bar,
  .nav {
    justify-content: space-between;
  }
  .brand {
    font-size: 18px;
  }
  .nav .icon-btn {
    width: 36px;
    height: 36px;
  }
  .timer-card,
  body.timer-left .timer-card {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 76px;
    transform: none;
    width: auto;
    padding: 14px;
    gap: 10px;
  }
  .timer-time {
    font-size: 80px;
  }
  .timer-card .reward-preview,
  .timer-card .intention-row select {
    display: none;
  }
  .timer-card .reward-preview.flow-live {
    display: flex;
  }
  .timer-card .segmented button {
    padding: 6px 4px;
  }
  .chips button {
    padding: 5px 9px;
  }
  .player,
  body.panel-open:not(.timer-left) .player {
    left: 10px;
    right: 10px;
    bottom: 10px;
    transform: none;
    max-width: none;
    padding: 6px 8px;
    gap: 8px;
  }
  .player .vol input[type='range'] {
    display: none;
  }
  .player .vol {
    width: auto;
  }
  .now {
    flex: 1;
    width: auto;
  }
  /* Handy: zu wenig Platz für Titel und Sender, die Platte allein öffnet das Menü */
  .source-btn .now {
    display: none;
  }
  .source-btn {
    padding: 2px;
    margin: -2px;
  }
  .fab {
    right: 10px;
    bottom: auto;
    top: 116px;
    flex-direction: row;
  }
  .fab .icon-btn {
    width: 40px;
    height: 40px;
  }
  .thought-pop {
    right: 10px;
    left: 10px;
    width: auto;
    top: 164px;
    bottom: auto;
  }
  .drawer {
    top: 10px;
    right: 10px;
    left: 10px;
    bottom: 10px;
    width: auto;
  }
  .toasts {
    top: 164px;
  }
}

@media (max-height: 640px) and (min-width: 761px) {
  .timer-card {
    gap: 10px;
    padding: 14px 16px;
  }
  .timer-time {
    font-size: 88px;
  }
}

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

/* ---------------------------------------------------------------- v2: Hinweise, Welt, Atmosphäre */
.banners {
  flex-basis: 100%;
  min-width: 0;
  max-width: 100%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: none;
}
.banner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  min-width: 0;
  border-radius: 12px;
  padding: 0;
  max-width: min(560px, 100%);
  border-color: color-mix(in srgb, var(--ev, var(--accent)) 45%, transparent);
}
.banner.tone-boost {
  --ev: var(--gold);
}
.banner.tone-world {
  --ev: #8fd0ff;
}
.banner-main {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  padding: 7px 4px 7px 12px;
  background: none;
  border: 0;
  font-weight: 700;
  font-size: 13.5px;
  text-align: left;
  min-width: 0;
}
.banner-main .icon {
  color: var(--ev, var(--accent));
}
.banner-main span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.banner-x {
  background: none;
  border: 0;
  color: var(--muted);
  padding: 7px 10px;
  display: flex;
}
.banner-x:hover {
  color: var(--text);
}
.world-chip {
  color: #bfe4ff;
  cursor: pointer;
}
.world-chip:hover {
  background: var(--surface-2);
}
body.in-world .stats-bar {
  border-color: rgba(143, 208, 255, 0.45);
}
.nav a.icon-btn {
  text-decoration: none;
}
.weather-btn {
  width: auto;
  min-width: 40px;
  padding: 0 8px;
  gap: 4px;
}
.weather-btn .temp {
  font-weight: 800;
  font-size: 13px;
  color: var(--text);
}
.scene-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  max-width: 300px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--panel-solid);
  border: 1px solid var(--border-strong);
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
  box-shadow: var(--shadow);
}
.atmo-pop {
  position: absolute;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%);
  width: min(380px, calc(100vw - 20px));
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding: 14px 16px 16px;
  z-index: 5;
}
.atmo-pop h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}
.atmo {
  gap: 10px;
}
.atmo-label {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 6px;
}
.atmo-now {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.atmo .segmented {
  width: 100%;
}
.weather-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 6px;
}
.weather-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 6px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
.weather-opt:hover {
  background: var(--surface-2);
  color: var(--text);
}
.weather-opt.active {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(255, 184, 107, 0.12);
}
.chips.wrap {
  flex-wrap: wrap;
}
.chips button.active {
  border-color: var(--accent);
}
.loc-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.loc-result {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  font-size: 13px;
}
.loc-result:hover {
  background: var(--surface-2);
}
.warn {
  color: var(--gold);
}
.row.wrap {
  flex-wrap: wrap;
}

/* Tägliche Belohnung */
.daily-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.daily-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 2px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  opacity: 0.8;
}
.daily-day.done {
  opacity: 0.45;
}
.daily-day.today {
  opacity: 1;
  border-color: var(--accent);
  background: rgba(255, 184, 107, 0.14);
  box-shadow: 0 0 0 3px rgba(255, 184, 107, 0.15);
}
.daily-n {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.daily-r {
  font-weight: 800;
}
.daily-xp {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 520px) {
  .daily-cal {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Events */
.event-card {
  border-left: 3px solid var(--ev, var(--accent));
}
.event-card.boost {
  --ev: var(--gold);
}
.event-card.world {
  --ev: #8fd0ff;
}
/* Eigener Booster einer Event-Welt */
.world-boost {
  gap: 6px;
  align-items: center;
}
.world-boost > .icon,
.world-boost > span,
.world-boost > b {
  color: var(--gold);
}
.world-boost select {
  width: auto;
}
.event-card .row .icon {
  color: var(--ev, var(--accent));
}
.card.quest.event-quest {
  border-left: 3px solid var(--ev, var(--accent));
}
.special-icon .icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
}

@media (max-width: 760px) {
  .banners {
    justify-content: stretch;
  }
  .banner {
    max-width: 100%;
    flex: 1 1 100%;
  }
  .atmo-pop {
    left: 10px;
    right: 10px;
    transform: none;
    width: auto;
    bottom: 70px;
    max-height: calc(100vh - 150px);
  }
  .stats-bar .world-chip {
    padding: 6px 8px;
  }
  .world-chip .chip-label {
    display: none;
  }
}

/* Admin v2 */
.tag-danger {
  background: rgba(255, 107, 122, 0.16);
  color: #ffc1c8;
}
.tag-live {
  background: rgba(123, 216, 143, 0.16);
  color: #b9f0c4;
}
.card.is-disabled {
  opacity: 0.7;
  border-style: dashed;
}
.admin-form {
  margin-top: 10px;
}
.admin-form summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}
.admin-form summary::-webkit-details-marker {
  display: none;
}
.admin-form[open] summary {
  margin-bottom: 12px;
}
.admin-form > .btn {
  margin-top: 6px;
}
/* Flow-Erweiterung in den Einstellungen */
.ext-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.ext-status.ok {
  color: var(--green);
}
.install-steps {
  margin: 0 0 8px;
  padding-left: 20px;
  color: var(--muted);
}
.install-steps li + li {
  margin-top: 4px;
}
.block-group {
  display: grid;
  gap: 6px;
}
.domain-chip.locked {
  padding-right: 10px;
  color: var(--muted);
  background: var(--surface);
}
.domain-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.domain-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px 4px 3px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 13px;
}
.chip-x {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.chip-x:hover,
.chip-x:focus-visible {
  background: var(--surface-2);
  color: var(--text);
}
.blocklist-add input {
  flex: 1;
  min-width: 0;
}
.reward-row {
  flex-wrap: wrap;
  gap: 6px;
}
.reward-row input {
  width: 64px;
  padding: 7px 8px;
}
/* Platten und XP eines Platzes */
.reward-row input:nth-of-type(3),
.reward-row input:nth-of-type(4) {
  width: 88px;
}
.prize {
  gap: 10px;
}
.feature-toggle {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}
.feature-toggle + .feature-toggle {
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.feature-toggle .muted {
  padding-left: 52px;
}
.notice-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 12px;
  background: rgba(143, 184, 255, 0.1);
  border: 1px solid rgba(143, 184, 255, 0.3);
}
.code-line {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(8, 6, 14, 0.55);
  border: 1px solid var(--border);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .banners {
    padding-right: 146px;
  }
  .banner:nth-child(n + 2) {
    display: none;
  }
  .banner-main {
    font-size: 12.5px;
  }
}

/* ================================================================ v3 */

/* Timer: Art, eigene Dauer, Vorlagen */
.timer-card {
  gap: 11px;
  top: max(84px, calc(50vh - 320px));
  max-height: calc(100vh - max(84px, calc(50vh - 320px)) - 96px);
  overflow-y: auto;
  scrollbar-width: none;
}
.timer-card::-webkit-scrollbar {
  display: none;
}
.focus-setup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mode-switch {
  flex: 0 0 auto;
}
.mode-switch button {
  flex: 0 0 auto;
  font-size: 12.5px;
  padding: 6px 9px;
}
.flow-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--pink);
  font-weight: 800;
  font-size: 13px;
  padding-right: 4px;
}
.timer-card.mode-flow .timer-time {
  text-shadow: 0 4px 30px rgba(255, 143, 180, 0.3);
}
.timer-card.mode-flow .pbar-fill {
  background: linear-gradient(90deg, var(--pink), var(--accent));
}
.stepper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
}
.stepper .step {
  flex: 0 0 auto;
  width: 32px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}
.stepper .step:hover {
  background: var(--surface-2);
}
.minutes-field {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 0 10px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(8, 6, 14, 0.4);
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}
.minutes-field:focus-within {
  border-color: var(--accent);
}
.minutes-field .minutes-input {
  width: 44px;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--digits);
  font-size: 30px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}
.minutes-field .minutes-input:focus {
  outline: none;
  background: transparent;
}
.minutes-input::-webkit-outer-spin-button,
.minutes-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.preset-chips button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  font-weight: 700;
  font-size: 12px;
}
.preset-chips button b {
  font-weight: 800;
}
.preset-chips button.active b {
  color: var(--accent-ink);
}
.preset-chips .chip-edit {
  padding: 6px 8px;
}
.flow-hint {
  margin: 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
}

/* Tagesziel */
.goal-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.goal-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
}
.goal-line.reached {
  color: var(--green);
}
.goal-wrap .pbar {
  height: 6px;
}
.pbar.gold .pbar-fill {
  background: var(--gold);
}
.pbar.green .pbar-fill {
  background: var(--green);
}

/* Pausen-Übungen */
.exercises {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(143, 184, 255, 0.08);
  border: 1px solid rgba(143, 184, 255, 0.22);
}
.exercise-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
}
.exercise-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
}
.exercise-btn:hover {
  background: var(--surface-2);
  border-color: rgba(143, 184, 255, 0.45);
}
.exercise-run {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(143, 184, 255, 0.1);
  border: 1px solid rgba(143, 184, 255, 0.3);
  text-align: center;
}
.exercise-count {
  font-size: 30px;
  color: var(--blue);
}

/* Belohnung: Tagesziel & Reflexion */
.reward-modal .levelup {
  margin-top: 8px;
  padding: 8px 12px;
}
.reward-details {
  margin-top: 10px;
  text-align: left;
}
.reward-details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  list-style-position: inside;
}
.reward-details .reward-lines {
  margin-top: 8px;
}
.levelup.goal-reached {
  background: linear-gradient(90deg, rgba(123, 216, 143, 0.2), rgba(255, 211, 92, 0.16));
  border-color: rgba(123, 216, 143, 0.45);
}
.reflect {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.stars {
  display: flex;
  justify-content: center;
  gap: 4px;
}
.star {
  padding: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--dim);
  transition: transform 0.12s ease, color 0.12s ease;
}
.star:hover {
  transform: scale(1.12);
  color: var(--gold);
}
.star.on {
  color: var(--gold);
}

/* Wochenrückblick */
.review-modal {
  width: min(560px, calc(100vw - 24px));
}
.review-range {
  margin: -6px 0 12px;
}
.review-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.review-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.review-tile .label {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--dim);
}
.review-tile b {
  font-size: 22px;
  font-weight: 800;
}
.review-tile .sub {
  font-size: 12px;
  color: var(--muted);
}
.review-tile.up .sub {
  color: var(--green);
}
.review-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  height: 150px;
  margin: 16px 0 6px;
}
.review-chart .col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.review-chart .val {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  min-height: 14px;
}
.review-chart .track {
  position: relative;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid var(--border-strong);
}
.review-chart .bar {
  width: min(28px, 70%);
  border-radius: 4px 4px 0 0;
  background: #3987e5;
}
.review-chart .bar.best {
  background: #6da7ec;
}
.review-chart .goal-mark {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(255, 211, 92, 0.55);
  pointer-events: none;
}
.review-chart .day {
  font-size: 11.5px;
  color: var(--dim);
  font-weight: 700;
}
.review-intentions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  text-align: left;
}
.review-intentions .list-row {
  display: flex;
  gap: 10px;
  font-size: 13px;
}
.review-intentions .list-row span:last-child {
  margin-left: auto;
  white-space: nowrap;
}
.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.review-facts {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  text-align: left;
  line-height: 1.5;
}

/* Ambience-Mixer */
.player .mix-btn.active {
  color: var(--accent);
}
.mixer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.mix-row {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  align-items: center;
  gap: 10px;
}
.mix-row.is-off {
  opacity: 0.45;
}
.mix-row.auto input[type='range'] {
  opacity: 0.55;
}
.mix-name {
  font-size: 13px;
  font-weight: 700;
}
.mix-auto {
  padding: 4px 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 800;
}
.mix-auto.active {
  color: var(--accent-ink);
  background: var(--accent);
  border-color: var(--accent);
}
.mix-foot {
  margin-top: 4px;
  gap: 8px;
}

/* Foto-Modus */
.photo-flash {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #fff;
  pointer-events: none;
  animation: photo-flash 0.6s ease-out forwards;
}
@keyframes photo-flash {
  from {
    opacity: 0.85;
  }
  to {
    opacity: 0;
  }
}
.photo-modal {
  width: min(760px, calc(100vw - 24px));
}
.photo-preview {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  image-rendering: pixelated;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Plattenkisten */
.crate-modal {
  text-align: center;
  width: min(380px, calc(100vw - 24px));
}
.crate-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 170px;
}
.crate-box canvas,
.crate-stage canvas {
  image-rendering: pixelated;
  position: relative;
}
.crate-box.shake {
  animation: crate-shake 0.45s ease-in-out infinite;
}
.crate-box.open {
  animation: crate-pop 0.3s ease-out forwards;
}
@keyframes crate-shake {
  0%,
  100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-6deg) translateY(-2px);
  }
  75% {
    transform: rotate(6deg) translateY(-2px);
  }
}
@keyframes crate-pop {
  to {
    transform: scale(1.25);
    opacity: 0;
  }
}
.crate-glow {
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow, #ffd35c) 0%, transparent 68%);
  opacity: 0;
  pointer-events: none;
}
.crate-glow.show {
  animation: crate-glow 1.2s ease-out forwards;
}
@keyframes crate-glow {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 0.45;
    transform: scale(1);
  }
}
.crate-item {
  animation: pop 0.5s ease;
}
.crate-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 24px;
}
.crate-result h3 {
  margin: 0;
}
.crate-odds {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-weight: 700;
}

/* Laden & Garderobe: Raum-Vorschau, Stil, Presets */
.drawer-body > .shop-preview {
  position: sticky;
  top: -16px;
  z-index: 3;
  background: radial-gradient(circle at 30% 30%, rgba(255, 184, 107, 0.14), transparent 60%), var(--panel-solid);
  box-shadow: 0 10px 20px rgba(5, 3, 12, 0.35);
}
.shop-room-preview {
  width: 176px;
  border-radius: 10px;
  image-rendering: pixelated;
}
.item canvas.swatch-icon {
  border-radius: 8px;
}
.sub-tabs {
  margin-top: 10px;
}
.sub-tabs button {
  font-size: 12.5px;
}
.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}
.preset-grid.room {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.preset-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}
.preset-slot.empty {
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 118px;
  border-style: dashed;
  color: var(--dim);
  font-size: 12.5px;
  font-weight: 700;
}
.preset-slot.empty:hover {
  color: var(--text);
  border-color: var(--border-strong);
}
.preset-apply {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 10px;
  border: 0;
  background: transparent;
  color: var(--text);
}
.preset-apply:hover {
  background: var(--surface-2);
}
.preset-thumb {
  width: 100%;
  border-radius: 8px;
  image-rendering: pixelated;
}
.preset-thumb.avatar {
  width: auto;
  height: 84px;
}
.preset-name {
  font-size: 12.5px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.preset-tools {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.preset-slot:hover .preset-tools,
.preset-slot:focus-within .preset-tools {
  opacity: 1;
}
.preset-tools .icon-btn {
  width: 28px;
  height: 28px;
  background: var(--panel-strong);
}

/* Einstellungen: Vorlagen-Editor */
.preset-editor {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.preset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 50px 50px auto;
  align-items: end;
  gap: 6px;
}
.mini-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11px;
  font-weight: 800;
  color: var(--dim);
}
.mini-field input {
  width: 100%;
  padding-left: 6px;
  padding-right: 4px;
}

@media (hover: none) {
  .preset-tools {
    opacity: 1;
  }
}
@media (max-width: 760px) {
  .mix-row {
    grid-template-columns: 92px 1fr auto;
  }
  .timer-card .preset-chips,
  .timer-card .goal-wrap,
  .timer-card .flow-hint {
    display: none;
  }
  .minutes-field .minutes-input {
    font-size: 24px;
    width: 40px;
  }
  .stepper .step {
    width: 30px;
    height: 32px;
  }
  .timer-card {
    top: auto;
    max-height: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .crate-box.shake,
  .crate-glow.show,
  .photo-flash {
    animation: none;
  }
}

/* Rechtliches in der App */
.notice-card.ok {
  background: rgba(123, 216, 143, 0.1);
  border-color: rgba(123, 216, 143, 0.35);
}
.notice-card.warn {
  background: rgba(255, 211, 92, 0.1);
  border-color: rgba(255, 211, 92, 0.4);
}
.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}
.legal-links a,
.terms-modal a {
  color: #ffd2a1;
}
.terms-points {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}
.terms-body p {
  margin: 0;
}
.segmented.admin-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.drawer a.btn {
  color: inherit;
  text-decoration: none;
}
.banner.tone-danger {
  --ev: var(--red);
  background: rgba(255, 107, 122, 0.12);
}
.mail-queue {
  gap: 0;
}
.mail-row {
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.error-text {
  color: var(--red);
}
