/* Droplight – gleiche Farbwelt wie Marklight und clyve.dev */

:root {
  --bg: #fbf9ff; --bg-soft: #f4effc; --surface: #fff; --surface-2: #f6f1fe;
  --border: #e6ddf6; --border-strong: #d2c4ee;
  --text: #1b1430; --text-soft: #4c4166; --text-muted: #6f6290; --heading: #120d22;
  --accent: #7c3aed; --accent-strong: #6d28d9; --accent-soft: #f1e8fe;
  --danger: #c0392b;
  --grad: linear-gradient(120deg, #a855f7, #7c3aed 50%, #6d28d9);
  --btn-bg: linear-gradient(180deg, #7c3aed, #6d28d9); --btn-text: #fff;
  --glow: rgba(168, 85, 247, .22);
  --page-bg: radial-gradient(1100px 600px at 25% -10%, #efe4ff, transparent 60%);
  --shadow: 0 6px 24px rgba(27, 20, 48, .07);
  --radius: 14px; --radius-sm: 9px; --header-h: 62px;
  --font-ui: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d0b14; --bg-soft: #110e1b; --surface: #171226; --surface-2: #1b1430;
  --border: #2a2142; --border-strong: #3a2e5c;
  --text: #e9d5ff; --text-soft: #c4b5fd; --text-muted: #9b8dba; --heading: #f7f3ff;
  --accent: #a855f7; --accent-strong: #c084fc; --accent-soft: #241838;
  --danger: #ff7b8a;
  --grad: linear-gradient(120deg, #a855f7, #e9d5ff 50%, #6d28d9);
  --btn-bg: linear-gradient(180deg, #1b1430, #0e0a1a); --btn-text: #e9d5ff;
  --glow: rgba(168, 85, 247, .28);
  --page-bg:
    radial-gradient(1200px 700px at 30% -10%, #2a1a4a, transparent 60%),
    radial-gradient(900px 600px at 100% 40%, rgba(109, 40, 217, .12), transparent 60%),
    linear-gradient(180deg, #0d0b14, #060510);
  --shadow: 0 6px 24px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

/* ── Grundlagen ── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--page-bg) fixed var(--bg);
  color: var(--text); font: 15px/1.55 var(--font-ui);
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg .fill { fill: currentColor; stroke: none; }
h1, h2 { color: var(--heading); letter-spacing: -.02em; line-height: 1.2; margin: 0; }
h1 { font-size: clamp(28px, 5vw, 40px); font-weight: 800; }
h2 { font-size: 20px; }
.hl { background: linear-gradient(120deg, #c084fc, #7c3aed); background-clip: text; -webkit-background-clip: text; color: transparent; }
.lead { color: var(--text-soft); margin: 10px 0 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { width: 100%; max-width: 860px; margin: 0 auto; padding: 44px 20px 64px; flex: 1; }
.wrap.narrow { max-width: 460px; }
.wrap.wide { max-width: 1100px; padding-top: 28px; }

/* ── Kopf und Fuß ── */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  display: flex; align-items: center; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 18px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; }
.brand b { color: var(--accent); }
.header-actions { margin-left: auto; display: flex; gap: 6px; }
.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px;
  padding: 20px; border-top: 1px solid var(--border);
  background: var(--bg-soft); color: var(--text-muted); font-size: 13.5px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: inherit; text-decoration: none; }
.footer-links a:hover { color: var(--text-soft); }
.by { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.by:hover { color: var(--text-soft); }
.by strong { color: var(--text); }
.by em { font-style: normal; color: var(--accent); }

/* ── Buttons und Felder ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 14px; white-space: nowrap;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { border-color: transparent; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon svg { width: 18px; height: 18px; }
.btn-lg { min-height: 46px; padding: 0 22px; font-size: 16px; border-radius: 10px; }
.btn-primary, .btn-primary:hover {
  border: 1.5px solid transparent; color: var(--btn-text);
  background: var(--btn-bg) padding-box, var(--grad) border-box;
  box-shadow: 0 0 18px var(--glow);
}
.btn-primary:hover { box-shadow: 0 0 30px var(--glow); }
.btn.danger { color: var(--danger); border-color: currentColor; }

.input {
  min-height: 38px; padding: 7px 11px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text);
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }

/* ── Anmeldung ── */
.card { padding: 32px 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.login { display: grid; }
.login h1 { font-size: 28px; margin-top: 18px; }
.btn-discord, .btn-discord:hover { border-color: transparent; background: #5865f2; color: #fff; }
.btn-discord:hover { background: #4752c4; }
.hint { color: var(--text-muted); font-size: 13px; margin: 18px 0 0; }
.hint a, .legal a { color: var(--accent-strong); }
.user { align-self: center; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft); }

/* ── Hochladen ── */
.drop {
  display: grid; justify-items: center; gap: 6px;
  margin: 26px 0 16px; padding: 52px 20px; text-align: center;
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--text-muted); cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.drop svg { width: 40px; height: 40px; margin-bottom: 8px; color: var(--accent); }
.drop strong { color: var(--heading); font-size: 18px; }
.drop:hover, .drop.over, .drop:focus-within { border-color: var(--accent); background: var(--accent-soft); }
.drop.over { box-shadow: 0 0 40px var(--glow); }
.options { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--text-soft); }

.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 40px 0 12px; }
.rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
#queue:not(:empty) { margin-top: 20px; }
.row {
  display: flex; align-items: center; gap: 12px 16px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.row-main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--heading); font-weight: 600; text-decoration: none; }
a.name:hover { color: var(--accent-strong); text-decoration: underline; }
.meta { color: var(--text-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.row.failed { border-color: var(--danger); }
.row.failed .meta { color: var(--danger); }
.empty { color: var(--text-muted); margin: 8px 0; }

progress { appearance: none; width: 100%; height: 6px; border: 0; border-radius: 3px; overflow: hidden; background: var(--border); }
progress::-webkit-progress-bar { background: var(--border); }
progress::-webkit-progress-value { background: linear-gradient(90deg, #6d28d9, #c084fc); }
progress::-moz-progress-bar { background: linear-gradient(90deg, #6d28d9, #c084fc); }

.usage { margin-left: auto; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.account { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--border); }
.report-text { margin: 4px 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ── Textseiten ── */
.legal h2 { margin: 32px 0 8px; }
.legal p, .legal li { color: var(--text-soft); max-width: 70ch; }
.legal strong { color: var(--text); }

/* ── Melden ── */
.report { margin-top: 28px; color: var(--text-soft); }
.report summary { width: max-content; cursor: pointer; }
.report form { display: grid; gap: 6px; max-width: 520px; margin-top: 14px; }
.report label { margin-top: 8px; }
.report .btn { justify-self: start; margin-top: 10px; }
textarea { font: inherit; resize: vertical; }

/* ── Dateiseite ── */
.file-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 18px 28px; margin-top: 22px; }
.file-title { flex: 1 1 320px; min-width: 0; }
.file-title h1 { font-size: clamp(20px, 3vw, 26px); font-weight: 700; overflow-wrap: anywhere; }
.details { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 8px 0 0; color: var(--text-muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.image-view, .text-view, .no-preview { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.image-view { display: grid; place-items: center; overflow: hidden; }
.image-view img { display: block; max-width: 100%; max-height: 72vh; }
.text-view { margin: 0; padding: 20px; max-height: 68vh; overflow: auto; font: 13.5px/1.6 var(--font-mono); tab-size: 2; }
.no-preview { display: grid; place-items: center; gap: 12px; padding: 64px 20px; color: var(--text-muted); }
.no-preview p { margin: 0; }
.ext { padding: 10px 18px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-strong); font: 600 22px var(--font-mono); }

/* ── Player (immer dunkel, egal welches Design) ── */
.player {
  position: relative; overflow: hidden; color: #f7f3ff;
  border: 1px solid #3a2e5c; border-radius: var(--radius); background: #060510;
  box-shadow: 0 0 60px var(--glow);
}
.player video { display: block; width: 100%; height: min(72vh, 620px); object-fit: contain; }
.player:fullscreen { border: 0; border-radius: 0; }
.player:fullscreen video { height: 100vh; }
.player.idle { cursor: none; }

.controls { position: relative; padding: 14px 16px 10px; }
.player.video .controls {
  position: absolute; inset: auto 0 0; padding-top: 48px;
  background: linear-gradient(transparent, rgba(6, 5, 16, .88));
  transition: opacity .25s; pointer-events: none;
}
.player.video .controls > * { pointer-events: auto; }
.player.idle .controls { opacity: 0; }
.player.idle .controls > * { pointer-events: none; }
.player.audio { background: linear-gradient(160deg, #241838, #0d0b14); padding-top: 24px; overflow: visible; }

.bar { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.bar button, .speed {
  height: 38px; border: 0; border-radius: 8px; background: transparent; color: inherit; cursor: pointer;
}
.bar button { width: 38px; padding: 8px; flex: none; }
.bar button:hover, .speed:hover { background: rgba(196, 181, 253, .18); }
.bar svg { display: block; width: 22px; height: 22px; }
.time { margin: 0 auto 0 8px; font-size: 13.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.speed { padding: 0 4px; font-size: 14px; }
.speed option { background: #171226; color: #f7f3ff; }

.seek, .vol {
  --pos: 0%; --buf: 0%;
  appearance: none; height: 18px; margin: 0; background: transparent; cursor: pointer;
}
.seek { display: block; width: 100%; }
.vol { width: 84px; }
.seek::-webkit-slider-runnable-track, .vol::-webkit-slider-runnable-track {
  height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, #a855f7 var(--pos), rgba(233, 213, 255, .45) var(--pos) max(var(--pos), var(--buf)), rgba(233, 213, 255, .2) 0);
}
.seek::-moz-range-track, .vol::-moz-range-track {
  height: 5px; border-radius: 3px;
  background: linear-gradient(90deg, #a855f7 var(--pos), rgba(233, 213, 255, .45) var(--pos) max(var(--pos), var(--buf)), rgba(233, 213, 255, .2) 0);
}
.seek::-webkit-slider-thumb, .vol::-webkit-slider-thumb {
  appearance: none; width: 14px; height: 14px; margin-top: -4.5px; border-radius: 50%; background: #f7f3ff;
}
.seek::-moz-range-thumb, .vol::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: #f7f3ff; }

.tip {
  position: absolute; transform: translate(-50%, -100%); top: 44px; padding: 2px 8px;
  border-radius: 6px; background: #1b1430; font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.player.video .controls .tip, .player.audio .tip { pointer-events: none; }
.player.audio .tip { top: 8px; }

.big-play {
  display: none; position: absolute; top: 50%; left: 50%; z-index: 1;
  width: 76px; height: 76px; margin: -38px 0 0 -38px; padding: 20px;
  border: 1.5px solid transparent; border-radius: 50%; color: #f7f3ff; cursor: pointer;
  background: linear-gradient(180deg, #7c3aed, #6d28d9) padding-box, linear-gradient(120deg, #a855f7, #e9d5ff 50%, #6d28d9) border-box;
  box-shadow: 0 0 40px rgba(168, 85, 247, .5);
}
.player.video.paused .big-play { display: block; }
.player.video.loading::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  border: 4px solid rgba(233, 213, 255, .25); border-top-color: #a855f7; border-radius: 50%;
  animation: spin 1s linear infinite; pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.player-msg { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; margin: 0; padding: 24px; text-align: center; background: #0d0b14; border-radius: inherit; }
.player.failed .controls, .player.failed .big-play { visibility: hidden; }

/* ── Meldung ── */
.toast {
  position: fixed; bottom: 22px; left: 50%; z-index: 200; margin: 0; padding: 10px 16px;
  max-width: 90vw; overflow-wrap: anywhere; border-radius: 10px;
  background: var(--text); color: var(--bg); font-size: 14px;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 680px) {
  .user { display: none; }
  .site-header { padding: 0 10px; }
  .header-actions { gap: 0; }
  .header-actions .btn:not(.btn-icon) { padding: 0 8px; }
  .usage { margin-left: 0; width: 100%; }
  .wrap { padding-top: 28px; }
  .row { flex-direction: column; align-items: stretch; }
  .row-actions .btn { flex: 1; }
  .actions, .actions .btn { width: 100%; }
  .player video { height: auto; min-height: 210px; max-height: 70vh; }
  .vol { display: none; } /* Lautstärke regelt das Handy selbst */
  .controls { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
