/* ═══════════════════════════════════════════════
   SINNSUCHE – Scoped Game Styles
   All styles scoped under .sinnsuche-game to
   avoid conflicts with Schulcast main CSS.
   ═══════════════════════════════════════════════ */

.sinnsuche-game {
  --sg-bg-primary: #0a0e1a;
  --sg-bg-secondary: #111827;
  --sg-bg-card: #1a1f35;
  --sg-bg-input: #151a2e;
  --sg-border: #2a3050;
  --sg-border-light: #3a4070;
  --sg-text-primary: #e8ecf4;
  --sg-text-secondary: #8892b0;
  --sg-text-muted: #5a6380;
  --sg-accent-blue: #6c8cff;
  --sg-accent-purple: #a78bfa;
  --sg-accent-pink: #f472b6;
  --sg-accent-green: #34d399;
  --sg-accent-yellow: #fbbf24;
  --sg-accent-orange: #fb923c;
  --sg-accent-red: #f87171;
  --sg-glow-blue: rgba(108,140,255,0.15);
  --sg-glow-green: rgba(52,211,153,0.15);

  position: relative;
  background: var(--sg-bg-primary);
  color: var(--sg-text-primary);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  border-radius: 24px;
  overflow: hidden;
  max-width: 700px;
  margin: 0 auto;
}

/* Light mode: keep game dark regardless */
[data-theme="light"] .sinnsuche-game {
  background: var(--sg-bg-primary);
  color: var(--sg-text-primary);
}

/* Animated background orbs */
.sinnsuche-game .bg-orbs {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.sinnsuche-game .bg-orbs .orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.08;
  animation: sgFloatOrb 20s ease-in-out infinite;
}
.sinnsuche-game .bg-orbs .orb:nth-child(1) { width: 500px; height: 500px; background: var(--sg-accent-blue); top: -100px; left: -100px; }
.sinnsuche-game .bg-orbs .orb:nth-child(2) { width: 400px; height: 400px; background: var(--sg-accent-purple); top: 50%; right: -80px; animation-delay: -7s; }
.sinnsuche-game .bg-orbs .orb:nth-child(3) { width: 350px; height: 350px; background: var(--sg-accent-pink); bottom: -50px; left: 30%; animation-delay: -14s; }

@keyframes sgFloatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

.sinnsuche-game .sg-app {
  position: relative; z-index: 1;
  max-width: 640px; margin: 0 auto; padding: 24px 16px 40px;
}

/* ── HEADER ─────────────────────────────────── */
.sinnsuche-game .sg-header {
  text-align: center; margin-bottom: 28px;
  animation: sgFadeSlideDown 0.6s ease;
}
.sinnsuche-game .logo-badge {
  display: inline-flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px; padding: 10px 22px 10px 14px;
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: sgFloatBadge 4s ease-in-out infinite;
}
.sinnsuche-game .logo-badge:hover {
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.06);
}
.sinnsuche-game .daf-logo-svg { flex-shrink: 0; filter: drop-shadow(0 2px 8px rgba(232,114,42,0.3)); }
.sinnsuche-game .logo-badge-text { display: flex; flex-direction: column; text-align: left; }
.sinnsuche-game .logo-badge-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 2px;
  color: var(--sg-text-muted); font-weight: 600;
}
.sinnsuche-game .logo-badge-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px; font-weight: 700; color: var(--sg-text-secondary);
  margin-top: 1px;
}
@keyframes sgFloatBadge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.sinnsuche-game .sg-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 42px; font-weight: 800; letter-spacing: 3px;
  background: linear-gradient(135deg, #6c8cff 0%, #a78bfa 40%, #f472b6 70%, #fb923c 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.sinnsuche-game .sg-subtitle {
  color: var(--sg-text-secondary); font-size: 14px; margin-top: 6px;
  font-weight: 400; letter-spacing: 0.5px;
}
.sinnsuche-game .sg-subtitle strong { color: var(--sg-text-primary); font-weight: 600; }

/* ── STATS ──────────────────────────────────── */
.sinnsuche-game .sg-stats {
  display: flex; justify-content: center; gap: 32px; margin-bottom: 22px;
  animation: sgFadeSlideDown 0.6s ease 0.1s both;
}
.sinnsuche-game .sg-stat { text-align: center; }
.sinnsuche-game .sg-stat-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px; font-weight: 700;
}
.sinnsuche-game .sg-stat-label {
  font-size: 11px; color: var(--sg-text-muted); text-transform: uppercase; letter-spacing: 1px; margin-top: 2px;
}
.sinnsuche-game .sg-stat-value.blue { color: var(--sg-accent-blue); }
.sinnsuche-game .sg-stat-value.dynamic { transition: color 0.3s; }

/* ── INPUT AREA ─────────────────────────────── */
.sinnsuche-game .input-area {
  display: flex; gap: 10px; margin-bottom: 14px;
  animation: sgFadeSlideDown 0.6s ease 0.2s both;
}
.sinnsuche-game .input-wrap { flex: 1; position: relative; }
.sinnsuche-game .input-wrap input {
  width: 100%; padding: 14px 18px; border-radius: 14px;
  border: 2px solid var(--sg-border);
  background: var(--sg-bg-input); color: var(--sg-text-primary);
  font-family: 'Inter', sans-serif; font-size: 16px; font-weight: 500;
  outline: none; transition: all 0.25s ease;
}
.sinnsuche-game .input-wrap input::placeholder { color: var(--sg-text-muted); font-weight: 400; }
.sinnsuche-game .input-wrap input:focus {
  border-color: var(--sg-accent-blue);
  box-shadow: 0 0 0 4px var(--sg-glow-blue);
}
.sinnsuche-game .btn-guess {
  padding: 14px 28px; border-radius: 14px; border: none;
  background: linear-gradient(135deg, #6c8cff, #8b5cf6);
  color: #fff; font-family: 'Inter', sans-serif;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: all 0.25s ease; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(108,140,255,0.3);
}
.sinnsuche-game .btn-guess:hover { transform: translateY(-1px); box-shadow: 0 6px 24px rgba(108,140,255,0.4); }
.sinnsuche-game .btn-guess:active { transform: translateY(0); }

/* ── ACTION BUTTONS ─────────────────────────── */
.sinnsuche-game .actions {
  display: flex; gap: 8px; justify-content: center; margin-bottom: 20px;
  flex-wrap: wrap;
  animation: sgFadeSlideDown 0.6s ease 0.3s both;
}
.sinnsuche-game .btn-action {
  padding: 8px 16px; border-radius: 10px;
  background: var(--sg-bg-card); border: 1px solid var(--sg-border);
  color: var(--sg-text-secondary); font-family: 'Inter', sans-serif;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.2s ease; display: flex; align-items: center; gap: 6px;
}
.sinnsuche-game .btn-action:hover { border-color: var(--sg-border-light); background: #1e2440; }
.sinnsuche-game .btn-action.hint { color: var(--sg-accent-yellow); }
.sinnsuche-game .btn-action.giveup { color: var(--sg-accent-red); }
.sinnsuche-game .btn-action.newgame { color: var(--sg-accent-blue); }

/* ── HINT BOX ───────────────────────────────── */
.sinnsuche-game .hints-box {
  background: linear-gradient(135deg, rgba(251,191,36,0.08), rgba(251,191,36,0.03));
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 14px; padding: 16px 18px; margin-bottom: 18px;
  animation: sgFadeIn 0.3s ease;
}
.sinnsuche-game .hint-item {
  color: #fde68a; font-size: 14px; padding: 4px 0;
  display: flex; align-items: flex-start; gap: 8px;
}
.sinnsuche-game .hint-item .icon { flex-shrink: 0; }

/* ── BANNER (WIN / LOSE) ────────────────────── */
.sinnsuche-game .banner {
  border-radius: 18px; padding: 28px; text-align: center;
  margin-bottom: 24px; animation: sgPopIn 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
  position: relative; overflow: hidden;
}
.sinnsuche-game .banner::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at top, rgba(255,255,255,0.05), transparent);
}
.sinnsuche-game .banner.win {
  background: linear-gradient(135deg, #064e3b, #065f46);
  border: 2px solid #34d399;
  box-shadow: 0 8px 40px rgba(52,211,153,0.15);
}
.sinnsuche-game .banner.lose {
  background: linear-gradient(135deg, #4c0519, #6b1532);
  border: 2px solid #f87171;
  box-shadow: 0 8px 40px rgba(248,113,113,0.1);
}
.sinnsuche-game .banner-emoji { font-size: 48px; position: relative; }
.sinnsuche-game .banner-title {
  font-family: 'Space Grotesk', sans-serif; font-size: 24px; font-weight: 700; margin-top: 8px; position: relative;
}
.sinnsuche-game .banner.win .banner-title { color: #34d399; }
.sinnsuche-game .banner.lose .banner-title { color: #fca5a5; }
.sinnsuche-game .banner-text { margin-top: 6px; font-size: 15px; position: relative; }
.sinnsuche-game .banner.win .banner-text { color: #a7f3d0; }
.sinnsuche-game .banner.lose .banner-text { color: #fecaca; }
.sinnsuche-game .banner-text strong { color: #fff; }
.sinnsuche-game .banner-word {
  font-family: 'Space Grotesk', sans-serif; font-size: 22px; font-weight: 700; color: #fff;
}
.sinnsuche-game .btn-banner {
  margin-top: 16px; padding: 12px 32px; border-radius: 12px;
  font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 700;
  border: none; cursor: pointer; transition: all 0.25s; position: relative;
}
.sinnsuche-game .banner.win .btn-banner { background: #34d399; color: #064e3b; }
.sinnsuche-game .banner.lose .btn-banner { background: #f87171; color: #4c0519; }
.sinnsuche-game .btn-banner:hover { transform: translateY(-1px); filter: brightness(1.1); }

/* ── SORT TOGGLE ────────────────────────────── */
.sinnsuche-game .sort-bar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.sinnsuche-game .btn-sort {
  padding: 5px 14px; border-radius: 8px; font-size: 12px;
  background: var(--sg-bg-card); border: 1px solid var(--sg-border);
  color: var(--sg-text-muted); cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all 0.2s;
}
.sinnsuche-game .btn-sort:hover { border-color: var(--sg-border-light); color: var(--sg-text-secondary); }

/* ── GUESS LIST ─────────────────────────────── */
.sinnsuche-game .guess-list { display: flex; flex-direction: column; gap: 6px; }
.sinnsuche-game .guess-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 12px;
  background: var(--sg-bg-card); border: 1px solid transparent;
  transition: all 0.3s ease;
  animation: sgSlideInLeft 0.3s ease;
}
.sinnsuche-game .guess-row.hot { background: rgba(52,211,153,0.08); border-color: rgba(52,211,153,0.3); }
.sinnsuche-game .guess-row.warm { background: rgba(74,222,128,0.05); border-color: rgba(74,222,128,0.15); }
.sinnsuche-game .guess-num {
  font-size: 11px; color: var(--sg-text-muted); min-width: 30px;
  text-align: right; font-weight: 500;
  font-family: 'Space Grotesk', sans-serif;
}
.sinnsuche-game .guess-word { flex: 1; font-size: 15px; font-weight: 500; }
.sinnsuche-game .guess-word.found { color: var(--sg-accent-green); font-weight: 700; }
.sinnsuche-game .guess-word.close { color: #86efac; font-weight: 600; }
.sinnsuche-game .bar-wrap {
  width: 110px; height: 6px; background: rgba(255,255,255,0.05);
  border-radius: 3px; overflow: hidden; flex-shrink: 0;
}
.sinnsuche-game .bar-fill {
  height: 100%; border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.22,1,0.36,1);
}
.sinnsuche-game .guess-score {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px; font-weight: 700; min-width: 32px; text-align: right;
}
.sinnsuche-game .guess-emoji { font-size: 16px; min-width: 22px; text-align: center; }

/* ── EMPTY STATE ────────────────────────────── */
.sinnsuche-game .empty-state {
  text-align: center; padding: 48px 20px;
  animation: sgFadeSlideDown 0.6s ease 0.4s both;
}
.sinnsuche-game .empty-icon { font-size: 56px; margin-bottom: 16px; }
.sinnsuche-game .empty-title { font-size: 16px; font-weight: 600; color: var(--sg-text-secondary); }
.sinnsuche-game .empty-desc {
  font-size: 13px; color: var(--sg-text-muted); margin-top: 10px;
  line-height: 1.7; max-width: 360px; margin-left: auto; margin-right: auto;
}

/* ── LEGEND ─────────────────────────────────── */
.sinnsuche-game .sg-legend {
  margin-top: 28px; padding: 18px; background: var(--sg-bg-card);
  border-radius: 14px; border: 1px solid var(--sg-border);
}
.sinnsuche-game .sg-legend-title {
  font-size: 12px; font-weight: 700; color: var(--sg-text-muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 10px;
}
.sinnsuche-game .sg-legend-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px;
}
.sinnsuche-game .sg-legend-item { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.sinnsuche-game .sg-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── FOOTER ─────────────────────────────────── */
.sinnsuche-game .sg-footer {
  text-align: center; margin-top: 24px; padding-top: 20px;
  border-top: 1px solid var(--sg-border);
  color: var(--sg-text-muted); font-size: 12px;
}
.sinnsuche-game .sg-footer-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; color: var(--sg-text-secondary);
}

/* ── CONFETTI ────────────────────────────────── */
.confetti-container {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 999; overflow: hidden;
}
.confetti-piece {
  position: absolute; top: -20px;
  width: 10px; height: 10px; border-radius: 2px;
  animation: sgConfettiFall linear forwards;
}
@keyframes sgConfettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── ANIMATIONS ─────────────────────────────── */
@keyframes sgFadeSlideDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes sgFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sgPopIn {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes sgSlideInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 480px) {
  .sinnsuche-game .sg-title { font-size: 32px; }
  .sinnsuche-game .sg-stats { gap: 20px; }
  .sinnsuche-game .input-area { flex-direction: column; }
  .sinnsuche-game .btn-guess { width: 100%; text-align: center; }
  .sinnsuche-game .bar-wrap { width: 70px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .sinnsuche-game .bg-orbs .orb,
  .sinnsuche-game .logo-badge { animation: none; }
}
