/* Raffle-Modul (/raffle) - Dashboard-Styles */

#rafflePage .form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  max-width: 420px;
}
#rafflePage .form-row label {
  font-size: 13px;
  opacity: 0.8;
}
#rafflePage .hint {
  font-size: 13px;
  opacity: 0.7;
  margin: 4px 0 14px;
}
#rafflePage .error-text {
  color: #ff6b6b;
  font-size: 13px;
  margin-top: 8px;
  min-height: 1em;
}
#rafflePage .success-text {
  color: #4ade80;
  font-size: 13px;
  margin-top: 8px;
  min-height: 1em;
}
#rafflePage .raffle-actions {
  display: flex;
  gap: 10px;
  margin: 14px 0;
  flex-wrap: wrap;
}
#rafflePage .raffle-entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#rafflePage .raffle-entries li {
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 13px;
}
.raffle-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.raffle-history-table th,
.raffle-history-table td {
  text-align: left;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.raffle-history-table .rf-history-del {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 15px;
}
.raffle-history-table .rf-history-del:hover { color: #ff6b6b; }

/* ===== Echtes Dashboard (module/raffle/index.php) ===== */

#rafflePage .rf-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
#rafflePage .rf-topbar-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
#rafflePage .rf-obslink { flex: 1; min-width: 240px; }
#rafflePage .rf-url-row { display: flex; gap: 8px; align-items: center; }
#rafflePage .rf-url-row input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-muted);
}
#rafflePage .rf-statusbadge {
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 3px;
  white-space: nowrap;
}
#rafflePage .rf-statusbadge--draft {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
#rafflePage .rf-statusbadge--open {
  background: rgba(80, 220, 120, 0.15);
  color: #4ade80;
}
#rafflePage .rf-statusbadge--closed {
  background: rgba(255, 190, 80, 0.15);
  color: #ffbe50;
}
#rafflePage .rf-statusbadge--drawn {
  background: rgba(145, 70, 255, 0.15);
  color: var(--accent);
}

#rafflePage .rf-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}
#rafflePage .rf-panel {
  flex: 1.25;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#rafflePage .rf-side {
  flex: 0.95;
}
#rafflePage .rf-sidehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#rafflePage .rf-sidetitle {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
/* Basis-Optik (gestrichelte Box, ausgeblendeter Scrollbar) kommt jetzt
   global aus .cu-stage (style/basis.css, gleiche Optik wie die
   Chatbox-Vorschau) - hier nur noch Raffle-spezifische Abweichungen:
   Inhalt der Zieh-Animation wird mittig statt unten verankert
   dargestellt. */
#rafflePage .rf-stage {
  align-items: center;
  justify-content: center;
  text-align: center;
}
#rafflePage .rf-stage .stage-hint {
  font-size: 13px;
  color: var(--text-muted);
}
#rafflePage .rf-stage--overlaybox {
  min-height: auto;
  padding: 10px;
}

/* Teilnehmer-Overlay-Box-Vorschau - bewusst inline gestylt (JS setzt die
   Werte live aus den Style-Feldern), Rahmen kommt von .rf-stage--overlaybox
   drumherum, damit man den "transparenten OBS-Hintergrund" simuliert. */
#rafflePage .rf-ovboxpreview {
  border-radius: 6px;
  padding: 12px 16px;
  max-width: 100%;
  text-align: left;
}
/* Kopfbereich (Titel+Beschreibung) hat eine EIGENE Ausrichtung
   (header_align), unabhaengig von der Ausrichtung der Namen-Boxen
   (name_align) darunter. */
#rafflePage .rf-ovboxpreview-header { text-align: left; margin-bottom: 8px; }
#rafflePage .rf-ovboxpreview-header.align-right { text-align: right; }
#rafflePage .rf-ovboxpreview-header.align-center { text-align: center; }
#rafflePage .rf-ovboxpreview-title { font-weight: 700; margin-bottom: 2px; }
#rafflePage .rf-ovboxpreview-countdown { opacity: 0.85; margin-bottom: 2px; }
#rafflePage .rf-ovboxpreview-meta { opacity: 0.75; }
#rafflePage .rf-ovboxpreview-desc { opacity: 0.85; margin-top: 2px; }
/* Jede Namens-Box ist genau so breit wie der Username selbst (kein festes
   Spaltenraster) und wandert in die naechste Reihe, sobald die Browser-
   quelle zu schmal wird; justify-content steuert links-/rechtsbuendig. */
#rafflePage .rf-ovboxpreview-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}
#rafflePage .rf-ovboxpreview-list.align-right { justify-content: flex-end; }
#rafflePage .rf-ovboxpreview-list.align-center { justify-content: center; }
#rafflePage .rf-ovboxpreview-list li {
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.9em;
  white-space: nowrap;
}

#rafflePage .entries-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}
#rafflePage .entries-pagination .btn {
  padding: 4px 12px;
  font-size: 13px;
}
#rafflePage .entries-pageinfo {
  font-size: 12.5px;
  color: var(--text-muted);
}

#rafflePage .rf-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 6px 0;
}
#rafflePage .rf-subhead {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Gruppierte Bereiche innerhalb der Style-Tabs (z.B. "Hintergrund",
   "Schrift & Farbe", "Sound") - eigener Rahmen statt nur einer Ueberschrift,
   damit zusammengehoerige Felder auch optisch als Block erkennbar sind. */
#rafflePage .rf-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: rgba(255,255,255,0.015);
  box-shadow: var(--shadow-card);
}
#rafflePage .rf-section-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#rafflePage .entries-head {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
#rafflePage .entries-head code {
  font-family: var(--font-mono);
  color: var(--mono-text);
  background: var(--mono-bg);
  padding: 1px 6px;
  border-radius: 3px;
}
#rafflePage .entries-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}
#rafflePage .entry-chip {
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 4px 6px 4px 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}
#rafflePage .entry-chip button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
#rafflePage .entry-chip button:hover { color: #ff6b6b; }

/* ---------- "!"-Prefix-Feld (identisch zu Currency, umbenannt) ---------- */
#rafflePage .cmd-row {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-input);
}
#rafflePage .cmd-row .cmd-prefix {
  background: var(--bg-raised);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 700;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-right: 1px solid var(--border-strong);
  font-size: 15px;
}
#rafflePage .cmd-row input {
  border: none;
  border-radius: 0;
  background: transparent;
  font-family: var(--font-mono);
  color: var(--mono-text);
}
#rafflePage .cmd-row input:focus { outline: none; border: none; }
#rafflePage .cmd-row:focus-within { border-color: var(--accent); }

/* ---------- Tabs + Card als Einheit ----------
   Tabs und Card werden zusammen in .rf-card-wrapper gepackt (kein gap),
   damit der umschliessende Flex-Gap von .rf-panel NICHT zwischen Tabs und
   Box einsickert (das war die Ursache fuer den sichtbaren Abstand). Analog
   zu #chatPage .cu-card-wrapper im Chatbox-Modul (style/chat.css). */
#rafflePage .rf-card-wrapper { display: flex; flex-direction: column; }

/* Der aktive Tab "sitzt" direkt auf der Card (wie ein echtes Browser-Tab):
   seine untere Kante verschmilzt mit der Card-Oberkante (negativer
   margin-bottom + border-bottom-color = Card-Hintergrund). */
#rafflePage .tabs {
  display: flex;
  gap: 4px;
  padding-left: 2px;
  flex-wrap: wrap;
}
#rafflePage .tabs .tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 3px 3px 0 0;
  transition: all 0.2s ease;
  font-family: var(--font-family);
}
#rafflePage .tabs .tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}
#rafflePage .tabs .tab-btn.active {
  color: var(--text-primary);
  background: var(--bg-card);
  border-color: var(--border);
  border-bottom-color: var(--bg-card);
  margin-bottom: -1px;
  z-index: 2;
}
#rafflePage .tab-panel { display: none; }
#rafflePage .tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#rafflePage .field { display: flex; flex-direction: column; gap: 6px; }
#rafflePage .grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 960px) {
  #rafflePage .rf-layout { flex-direction: column; }
  #rafflePage .rf-side { position: static; }
  #rafflePage .grid2 { grid-template-columns: 1fr; }
}

#rafflePage .colorrow {
  display: flex;
  gap: 8px;
  align-items: center;
}
#rafflePage .colorrow input[type="color"] {
  width: 42px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-raised);
  cursor: pointer;
}
#rafflePage .colorrow input[type="text"] { flex: 1; }

#rafflePage .rangerow {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#rafflePage .rangetop {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}
#rafflePage .rangetop .val {
  color: #fff;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}
#rafflePage input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ---------- Zieh-Animationen (geteilt mit js/raffle_draw_animations.js) ----------
   Diese Klassen sind absichtlich identisch zu module/alert/overlay.php, damit
   die Vorschau im Dashboard exakt wie die echte Ziehung im Alert-Overlay aussieht. */
#rafflePage .raffleAnimStage {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6vmin;
  color: var(--text-primary, #fff);
  padding: 16px 10px;
  border-radius: var(--radius-md);
  text-align: center;
  /* --alert-bg wird per JS gesetzt (raffle_draw_animations.js) - die Box
     selbst hat bewusst KEINEN Rahmen (Akzentfarbe faerbt ausschliesslich
     den ausgelosten Usernamen, nicht die Box). */
  background: var(--alert-bg, transparent);
}
#rafflePage .raffleTitle { font-size: var(--raffle-title-size, 16px); font-weight: 700; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.06em; }

/* Slot-Reel: komplett ohne eigenen Hintergrund - auch keine Fade-Gradienten
   mehr oben/unten, damit wirklich nichts hinter den Namen sichtbar ist. */
#rafflePage .raffleReelWindow { width: 100%; max-width: 340px; height: 56px; overflow: hidden; position: relative; }
#rafflePage .raffleReelTrack { display: flex; flex-direction: column; will-change: transform; }
#rafflePage .raffleReelItem { height: 56px; display: flex; align-items: center; justify-content: center; font-size: var(--raffle-user-size, 18px); font-weight: 700; }
#rafflePage .raffleReelItem.is-winner { color: var(--alert-color, var(--accent)); }

#rafflePage .raffleSpotlight { font-size: var(--raffle-user-size, 26px); font-weight: 800; padding: 6px 16px; }
#rafflePage .raffleSpotlight.is-final { color: var(--alert-color, var(--accent)); }

/* Countdown ist neutral (kein Akzent - ist nicht der ausgeloste User);
   die Gewinner-Praesentationen (Reveal/Wheel-Present/Liste) sind es. */
#rafflePage .raffleCountdown { font-size: 54px; font-weight: 800; }
#rafflePage .raffleWinnerReveal { font-size: var(--raffle-user-size, 22px); font-weight: 800; color: var(--alert-color, var(--accent)); }
#rafflePage .raffleWinnerList { display: flex; flex-direction: column; gap: 4px; font-size: var(--raffle-user-size, 14px); }
#rafflePage .raffleWinnerList div { color: var(--alert-color, var(--accent)); }

#rafflePage .raffleWheelRow { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; max-width: 100%; width: 100%; }
/* Zellgroesse skaliert mit der "User"-Schriftgroesse, damit der Hintergrund
   pro Buchstabe mitwaechst statt fest zu bleiben. */
#rafflePage .raffleWheel {
  width: calc(var(--raffle-user-size, 16px) * 1.7);
  height: calc(var(--raffle-user-size, 16px) * 2.2);
  min-width: 26px;
  min-height: 34px;
  border-radius: 4px;
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
}
#rafflePage .raffleWheel.is-final { background: rgba(255,255,255,0.18); }
#rafflePage .raffleWheelInner { font-size: var(--raffle-user-size, 16px); font-weight: 800; }
#rafflePage .raffleWheelPresent { font-size: var(--raffle-user-size, 20px); font-weight: 800; margin-top: 6px; color: var(--alert-color, var(--accent)); }
