:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --bg: #08090d;
  --surface: #111218;
  --surface-2: #171820;
  --line: rgba(255,255,255,.075);
  --text: #f5f5f7;
  --muted: #92949f;
  --accent: #ef2d45;
  --green: #4bd69a;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); font-size: 1rem; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .6; cursor: wait; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #ff8190; outline-offset: 5px; }
.screen { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1.5rem; padding: 3rem 1.5rem; background: radial-gradient(ellipse at 50% 34%, rgba(239,45,69,.13), transparent 48%), var(--bg); }
.card { width: min(590px, 100%); padding: 44px; border: 1px solid rgba(255,255,255,.085); border-radius: 22px; background: rgba(17,18,24,.94); box-shadow: 0 35px 120px rgba(0,0,0,.44); text-align: center; }
.brand-logo { display: block; width: 104px; height: 104px; object-fit: cover; margin: 0 auto 24px; border: 1px solid rgba(255,64,85,.2); border-radius: 50%; box-shadow: 0 0 32px rgba(239,45,69,.17); }
.kicker { display: block; color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .14em; line-height: 1.7; }
h1 { margin: 16px 0; font-size: clamp(2rem, 7vw, 2.875rem); line-height: 1.08; letter-spacing: -.045em; font-weight: 800; }
h1 b { color: var(--accent); font-weight: inherit; }
.intro { max-width: 410px; margin: 0 auto; color: var(--muted); font-size: 1rem; line-height: 1.7; }
.login-form { margin-top: 30px; }
.button { display: flex; align-items: center; justify-content: center; gap: .7rem; width: 100%; min-height: 52px; padding: .9rem 1.2rem; border: 1px solid transparent; border-radius: 10px; color: white; font-weight: 700; font-size: .9375rem; text-decoration: none; transition: background .16s, box-shadow .16s, transform .16s; }
.button svg { width: 23px; height: 23px; flex-shrink: 0; }
.button-arrow { margin-left: auto; font-size: 1.2rem; }
.discord { background: #5865f2; box-shadow: 0 8px 24px rgba(88,101,242,.16); }
.discord:hover { background: #4752c4; }
.primary { background: linear-gradient(135deg, #ef2d45, #b5162c); box-shadow: 0 8px 22px rgba(239,45,69,.16); }
.primary:hover { border-color: rgba(255,255,255,.3); box-shadow: 0 8px 28px rgba(239,45,69,.3); }
.button:active { transform: translateY(1px); }
.footnote { color: var(--muted); font-size: .875rem; line-height: 1.6; margin: 16px 0 0; }
.card-footer { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .65rem; margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); font-size: .8125rem; color: var(--muted); }
.footer-mark { font-size: .75rem; color: #f36b7b; font-weight: 900; }
.footer-separator { color: #61636e; }
.account-bar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin: -12px 0 30px; padding-bottom: 18px; border-bottom: 1px solid var(--line); font-size: .875rem; }
.identity { display: flex; align-items: center; gap: .6rem; min-width: 0; text-align: left; }
.identity > span:last-child { overflow-wrap: anywhere; }
.status-dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(75,214,154,.2); }
.logout { padding: .4rem 0; border: 0; color: var(--muted); background: none; font-size: .875rem; }
.logout:hover { color: var(--text); }
.upload-zone { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 28px; padding: 26px 22px 22px; border: 1px dashed rgba(255,255,255,.16); border-radius: 14px; background: rgba(255,255,255,.015); transition: border-color .18s, background .18s; }
.upload-zone.drag-over { border-color: var(--accent); background: rgba(239,45,69,.075); }
.upload-icon { width: 37px; height: 37px; color: #f26475; margin-bottom: 2px; }
.upload-zone input[type=file] { max-width: 100%; font-size: .875rem; }
.upload-zone.enhanced input[type=file], .upload-zone.enhanced .file-label { display: none; }
.file-label { font-size: .875rem; }
.drop-hint { display: none; margin: -4px 0 0; color: var(--muted); font-size: .875rem; }
.enhanced .drop-hint { display: block; }
.formats { margin: 0; font-size: .8125rem; color: var(--muted); line-height: 1.6; }
.notice { margin: 20px 0 0; padding: 13px 16px; border: 1px solid var(--line); border-radius: 10px; text-align: left; line-height: 1.6; font-size: .875rem; overflow-wrap: anywhere; }
.error { color: #ff95a1; border-color: rgba(239,45,69,.25); background: rgba(239,45,69,.07); }
.success { color: var(--green); border-color: rgba(75,214,154,.2); background: rgba(75,214,154,.05); }
.upload-progress { margin-top: 24px; }
.progress-caption { display: flex; justify-content: space-between; gap: .8rem; margin-bottom: 10px; color: var(--muted); font-size: .875rem; text-align: left; }
progress { width: 100%; height: 6px; display: block; border: 0; border-radius: 6px; overflow: hidden; background: var(--surface-2); accent-color: var(--accent); }
progress::-webkit-progress-bar { background: var(--surface-2); }
progress::-webkit-progress-value { background: var(--accent); border-radius: 6px; }
progress::-moz-progress-bar { background: var(--accent); }
.upload-status { margin: 18px 0 0; text-align: left; line-height: 1.6; font-size: .875rem; color: var(--muted); }
.upload-status:empty { margin: 0; }
.upload-results:empty { display: none; }
.upload-results { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; max-height: 340px; overflow: auto; }
.result { display: flex; gap: 12px; align-items: center; padding: 12px; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.result-icon { flex: 0 0 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--green); background: rgba(75,214,154,.07); }
.result.failed .result-icon { color: #ff95a1; background: rgba(239,45,69,.07); }
.result strong { display: block; font-size: .875rem; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.result small { display: block; margin-top: 3px; font-size: .8125rem; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; font-size: .875rem; }
.legal-links a { color: var(--muted); text-decoration: none; }
.legal-links a:hover { color: var(--text); text-decoration: underline; }
.setup-card { width: min(650px, 100%); }
.setup-card h1 { font-size: clamp(2rem, 6vw, 2.625rem); }
.setup-card .notice { margin-bottom: 20px; }
.setup-steps { margin: 24px 0; padding-left: 1.25rem; text-align: left; color: var(--muted); font-size: .9375rem; line-height: 1.8; }
.setup-steps li + li { margin-top: .6rem; }
.setup-steps strong { color: var(--text); }
.setup-card code { overflow-wrap: anywhere; font-size: .875em; }
.setup-form { display: grid; gap: 10px; margin-top: 26px; text-align: left; }
.setup-form label { color: var(--muted); font-size: .875rem; font-weight: 650; }
.setup-form input:not([type=hidden]) { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid rgba(255,255,255,.13); border-radius: 9px; background: var(--surface-2); color: var(--text); font-size: 1rem; }
.setup-form input + label { margin-top: 8px; }
.setup-form .button { margin-top: 12px; }
.callback-help { display: grid; gap: 9px; margin: 10px 0; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: rgba(239,45,69,.04); font-size: .875rem; line-height: 1.6; }
.callback-help code { color: #ff95a1; user-select: all; }
.callback-help a { color: #ff95a1; text-decoration: underline; text-underline-offset: 3px; }
.callback-help span, .field-help { color: var(--muted); font-size: .875rem; line-height: 1.6; }
.field-help { margin: 0 0 8px; }
.setup-advanced { margin-top: 6px; font-size: .875rem; }
.setup-advanced summary { cursor: pointer; padding: 8px 0; color: var(--muted); }
.setup-advanced label { display: block; margin: 12px 0 8px; }
.setup-advanced .field-help { margin-top: 8px; }
@media (max-width: 520px) {
  .screen { padding: 24px 14px; }
  .card { padding: 32px 22px; }
  .brand-logo { width: 88px; height: 88px; }
  .upload-zone { padding: 22px 14px; }
  .account-bar { margin-top: -8px; }
  .button { padding-inline: .9rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }

/* Upload review modal */
.upload-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .78);
  backdrop-filter: blur(8px);
}

.upload-modal-dialog {
  width: min(720px, 100%);
  max-height: min(88vh, 860px);
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 22px;
  background: #121217;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .55);
}

.upload-modal-header h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.upload-modal-subtitle {
  margin: 10px 0 22px;
  color: #9b9ba8;
  line-height: 1.55;
}

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

.upload-preview-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 16px;
  background: #18181f;
}

.upload-preview-image {
  width: 104px;
  height: 88px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: #0d0d11;
  color: #777783;
}

.upload-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.upload-preview-details {
  min-width: 0;
}

.upload-preview-original {
  display: block;
  margin-bottom: 8px;
  overflow: hidden;
  color: #777783;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-preview-details label {
  display: block;
  color: #d7d7df;
  font-size: 13px;
  font-weight: 600;
}

.upload-name-wrap {
  display: flex;
  align-items: stretch;
  margin-top: 6px;
}

.upload-name-input {
  min-width: 0;
  flex: 1 1 auto;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  outline: none;
  background: #101015;
  color: #f4f4f7;
  font: inherit;
}

.upload-name-input:focus {
  border-color: #ff526b;
  box-shadow: 0 0 0 3px rgba(255, 82, 107, .14);
}

.upload-name-extension {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 0 10px 10px 0;
  background: #1b1b22;
  color: #8e8e9b;
  font: inherit;
  user-select: none;
}
.upload-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.upload-modal-actions .button {
  min-height: 46px;
  padding: 0 18px;
}

.upload-cancel {
  border: 1px solid rgba(255, 255, 255, .12);
  background: #1b1b22;
  color: #d6d6df;
}

.upload-cancel:hover {
  background: #23232b;
}

@media (max-width: 620px) {
  .upload-modal {
    padding: 12px;
  }

  .upload-modal-dialog {
    padding: 20px;
    border-radius: 18px;
  }

  .upload-preview-card {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
  }

  .upload-preview-image {
    width: 76px;
    height: 72px;
  }

  .upload-modal-actions {
    flex-direction: column-reverse;
  }

  .upload-modal-actions .button {
    width: 100%;
  }
}


/* Größeres Upload-Prüffenster und klickbare Bildvorschau */
.upload-modal-dialog {
  width: min(1100px, calc(100vw - 48px));
  max-height: min(900px, calc(100vh - 48px));
}

.upload-preview-list {
  gap: 20px;
}

.upload-preview-card {
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 260px;
}

.upload-preview-button {
  display: block;
  width: 240px;
  height: 240px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  cursor: zoom-in;
  background: #0b0b0f;
}

.upload-preview-button .upload-preview-image {
  width: 100%;
  height: 100%;
}

.upload-preview-button .upload-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .18s ease;
}

.upload-preview-button:hover .upload-preview-image img {
  transform: scale(1.025);
}

/* Vergrößerung auf derselben Seite, ohne Weiterleitung/neues Fenster */
.viewer-open {
  overflow: hidden;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.image-viewer-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, .84);
  cursor: zoom-out;
}

.image-viewer-panel {
  position: relative;
  z-index: 1;
  width: min(1300px, 94vw);
  height: min(900px, 92vh);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 20px;
  background: #101015;
  box-shadow: 0 25px 80px rgba(0,0,0,.6);
}

.image-viewer-panel img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
}

.image-viewer-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  background: #14141a;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
  font-size: 30px;
  font-weight: 400;
  line-height: 48px;
  text-align: center;
  box-sizing: border-box;
  transform: none;
}

.image-viewer-close:hover {
  background: #22222a;
  border-color: rgba(255,255,255,.28);
}

.image-viewer-close:focus-visible {
  outline: 2px solid #ff526b;
  outline-offset: 3px;
}


.image-viewer-close:hover {
  background: rgba(40,40,48,.98);
}

@media (max-width: 700px) {
  .upload-modal-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .upload-preview-card {
    grid-template-columns: 1fr;
  }

  .upload-preview-button {
    width: 100%;
    height: 280px;
  }

  .image-viewer {
    padding: 10px;
  }

  .image-viewer-panel {
    width: 96vw;
    height: 94vh;
    padding: 10px;
  }
}


/* Erfolgreiche Uploads: Link kopieren */
.result-content {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 18px;
}

.result-text {
  min-width: 0;
  flex: 1;
}

.result-success {
  align-items: flex-start;
}

.result-link-row {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
}

.result-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 9px;
  height: 42px;
  min-height: 42px;
  box-sizing: border-box;
  padding: 0 14px;
  background: #202027;
  color: #e8e8ed;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.result-copy:hover {
  background: #292930;
  border-color: rgba(255,255,255,.2);
}

.result-copy:active {
  transform: translateY(1px);
}

.result-copy.copied {
  border-color: rgba(72, 218, 158, .35);
}

@media (max-width: 620px) {
  .result-copy {
    width: auto;
  }
}


/* Link-Aktion rechts im gespeicherten Upload */
.saved-file-link-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 14px;
}

.saved-file-copy {
  margin-left: auto;
}

@media (max-width: 620px) {
  .result-content {
    align-items: flex-start;
    gap: 10px;
  }

  .result-link-row {
    align-self: center;
  }
}


/* Erfolgsabzeichen im gespeicherten Upload vertikal mittig ausrichten */
.saved-file {
  align-items: center;
}


/* Erfolgsbox und Link-Kopieren-Button exakt auf gleicher Höhe */
.saved-file {
  display: flex;
  align-items: center;
}

.saved-file .saved-file-icon {
  align-self: center;
}

.saved-file .saved-file-info {
  align-self: center;
}

.saved-file .saved-file-copy {
  align-self: center;
}

/* Gespeicherter Upload: Haken-Box auf die Höhe des Link-Buttons zentrieren */
.result.result-success {
  display: flex;
  align-items: center;
}

.result.result-success .result-icon {
  flex: 0 0 auto;
  align-self: center;
}

.result.result-success .result-content {
  min-width: 0;
  align-self: center;
}


/* Grünes Erfolgsabzeichen wieder als gut sichtbares Quadrat */
.result.result-success .result-icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  align-self: center;
  font-size: 24px;
  line-height: 1;
}
