/* Farbwahl — v1.0.0 — 10.10.2026 */

:root {
  --bg-primary: #0c0a04;
  --bg-secondary: #15130d;
  --bg-surface: rgba(255, 255, 255, 0.04);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.08);
  --accent: #4ade80;
  --accent-dim: rgba(74, 222, 128, 0.15);
  --accent-glow: rgba(74, 222, 128, 0.25);
  --text-primary: #f0f0ed;
  --text-secondary: #a0a09a;
  --text-muted: #6b6b65;
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.15);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
  --transition: 0.2s ease;
}

[data-theme="light"] {
  --bg-primary: #f5f4f0;
  --bg-secondary: #edebe6;
  --bg-surface: rgba(0, 0, 0, 0.03);
  --bg-glass: rgba(255, 255, 255, 0.6);
  --bg-glass-hover: rgba(255, 255, 255, 0.8);
  --border-glass: rgba(0, 0, 0, 0.08);
  --accent: #16a34a;
  --accent-dim: rgba(22, 163, 74, 0.1);
  --accent-glow: rgba(22, 163, 74, 0.2);
  --text-primary: #1c1b17;
  --text-secondary: #5c5b55;
  --text-muted: #8c8b85;
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.08);
}

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

[hidden] { display: none !important; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

/* Dezente Hintergrund-Tiefe */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(600px 400px at 15% 0%, var(--accent-dim), transparent 70%),
    radial-gradient(700px 500px at 90% 100%, rgba(59, 130, 246, 0.10), transparent 70%);
}

.app-shell {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 20px;
  border-bottom: 1px solid var(--border-glass);
  margin-bottom: 28px;
}

.header-content h1 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-content h1 i {
  color: var(--accent);
  filter: drop-shadow(0 0 12px var(--accent-glow));
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}

.btn-icon {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1.1rem;
}

.btn-icon:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

/* ---------- Main ---------- */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
  transition: var(--transition);
}

.glass-card h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.glass-card h2 i { color: var(--accent); }

/* ---------- Farb-Bühne ---------- */
.color-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  padding: 40px 24px 32px;
}

.color-disc {
  --c: rgba(255, 255, 255, 0.06);
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: var(--c);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.4s ease, box-shadow 0.4s ease;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.10),
    0 0 70px -14px var(--c),
    0 22px 50px rgba(0, 0, 0, 0.35);
}

.color-disc.pop { animation: pop 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }

@keyframes pop {
  0%   { transform: scale(0.86); opacity: 0.5; }
  55%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.color-name-pill {
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.color-hex {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  color: var(--text-secondary);
  letter-spacing: 0.06em;
  min-height: 1.4em;
}

.btn-primary {
  background: var(--accent);
  color: #0c0a04;
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-primary:hover {
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-large {
  font-size: 1.05rem;
  padding: 18px 40px;
  border-radius: var(--radius-lg);
}

.draw-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  min-height: 1.2em;
}

/* ---------- Grid ---------- */
.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ---------- Statistik ---------- */
.stats-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
}

.stat-row {
  display: grid;
  grid-template-columns: 14px 64px 44px 1fr;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
}

.stat-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: 0 0 10px -1px currentColor;
}

.stat-name { color: var(--text-secondary); }
.stat-count { color: var(--text-primary); font-weight: 600; text-align: right; }

.stat-bar {
  height: 6px;
  background: var(--bg-surface);
  border-radius: 999px;
  overflow: hidden;
}

.stat-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: currentColor;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.btn-ghost {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 11px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-ghost:hover {
  background: var(--danger-dim);
  border-color: var(--danger);
  color: var(--danger);
}

/* ---------- Verlauf ---------- */
.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  margin-right: -6px;
  padding-right: 6px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.history-item .stat-dot { width: 12px; height: 12px; flex: 0 0 12px; }
.history-item .h-name { color: var(--text-primary); font-weight: 500; }
.history-item .h-time { margin-left: auto; color: var(--text-muted); font-size: 0.78rem; }

.history-empty {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 24px 0;
}

/* Custom Scrollbar */
.history-list::-webkit-scrollbar { width: 6px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 999px;
}

/* ---------- Footer ---------- */
.app-footer {
  padding: 24px 0 28px;
  margin-top: auto;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.app-footer .version {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  opacity: 0.7;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-two { grid-template-columns: 1fr; }
  .app-header { padding: 22px 0 16px; margin-bottom: 22px; }
  .header-content h1 { font-size: 1.3rem; }
}

@media (max-width: 480px) {
  .app-shell { padding: 0 14px; }
  .glass-card { padding: 18px; }
  .color-stage { padding: 28px 16px 24px; }
  .color-disc { width: 180px; height: 180px; }
  .color-name-pill { font-size: 1rem; padding: 8px 18px; }
  .btn-large { width: 100%; justify-content: center; padding: 16px 24px; }
  .subtitle { font-size: 0.85rem; }
  .stat-row { grid-template-columns: 12px 56px 38px 1fr; font-size: 0.82rem; }
}

/* Touch: Scrollbar ausblenden */
@media (hover: none) and (pointer: coarse) {
  .history-list::-webkit-scrollbar { display: none; }
  .history-list { margin-right: 0; padding-right: 0; }
}
