:root {
  --bg: #0b0e14;
  --card: #111827;
  --card-glass: rgba(17, 24, 39, 0.9);
  --bdr: #1f2937;
  --bdr-strong: #374151;
  --bdr-box: #6b7280;
  --txt: #f3f4f6;
  --muted: #9ca3af;
  --rose: #ec4899;
  --rose-bright: #f472b6;
  --rose-glow: rgba(236, 72, 153, 0.55);
  --blue: #3b82f6;
  --green: #10b981;
  --red: #ef4444;
  --cell-bg: #111827;
  --cell-selected: rgba(236, 72, 153, 0.25);
  --cell-highlight: rgba(255, 255, 255, 0.04);
  --cell-same-num: rgba(236, 72, 153, 0.15);
  --cell-conflict: rgba(239, 68, 68, 0.25);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--txt); min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 1.5rem 1rem; -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none;
}

.back-link {
  display: inline-flex; align-items: center; gap: 0.5rem;
  color: var(--muted); font-size: 0.85rem; font-weight: 600; text-decoration: none;
  padding: 0.5rem 0.85rem; border: 1px solid var(--bdr); border-radius: 8px;
  background: var(--card-glass); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: all 0.2s ease; position: fixed; top: 1rem; left: 1rem; z-index: 100;
}
.back-link:hover { color: #fff; border-color: var(--rose); box-shadow: 0 0 24px rgba(236, 72, 153, 0.7), 0 0 8px rgba(236, 72, 153, 0.45); }

.game-container { width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; gap: 1rem; margin-top: 2.5rem; }
.page-header { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.title-wrap { display: flex; align-items: center; gap: 0.6rem; }
.title-wrap h1 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.title-wrap h1 span.accent { color: var(--rose-bright); }
.metallic-mn {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted);
  background: linear-gradient(135deg, #e5e7eb, #9ca3af); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.difficulty-bar, .mode-bar { display: flex; gap: 0.45rem; width: 100%; }
.mode-btn, .diff-btn {
  flex: 1; padding: 0.45rem 0.6rem; border-radius: 8px; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all 0.2s ease; border: 1px solid var(--bdr);
  background: var(--card); color: var(--muted); text-align: center;
}
.mode-btn:hover, .diff-btn:hover { color: var(--txt); }
.mode-btn.active, .diff-btn.active { background: rgba(236, 72, 153, 0.15); border-color: var(--rose); color: var(--rose-bright); }

.killer-helper-bar {
  width: 100%; background: var(--card); border: 1px solid var(--bdr); border-radius: 10px;
  padding: 0.55rem 0.85rem; display: flex; flex-direction: column; gap: 0.45rem;
}
.killer-helper-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.killer-helper-title { font-size: 0.76rem; font-weight: 700; color: var(--txt); }
.killer-helper-toggle {
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--bdr-strong); color: var(--muted);
  border-radius: 6px; padding: 0.2rem 0.55rem; font-size: 0.7rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all 0.15s ease;
}
.killer-helper-toggle:hover { color: var(--txt); border-color: var(--rose); }
.killer-helper-combos { display: flex; flex-wrap: wrap; gap: 0.35rem; min-height: 1.4rem; align-items: center; }
.killer-helper-bar.collapsed .killer-helper-combos { display: none; }
.killer-combo-chip {
  font-size: 0.72rem; font-family: monospace; font-weight: 700; color: #e2e8f0;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--bdr-strong);
  border-radius: 5px; padding: 0.15rem 0.4rem;
}
.killer-helper-empty { font-size: 0.74rem; color: var(--muted); }

.status-bar {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  background: var(--card); border: 1px solid var(--bdr); border-radius: 10px; padding: 0.6rem 1rem;
}
.status-item { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.status-item span.val { color: var(--txt); font-family: monospace; font-size: 1rem; font-weight: 700; }
.pause-btn { background: transparent; border: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; padding: 0.2rem; border-radius: 4px; }
.pause-btn:hover { color: var(--rose-bright); }

.board-wrapper {
  position: relative; width: 100%; aspect-ratio: 1 / 1; background: #1f2937;
  border: 2px solid var(--bdr-box); border-radius: 12px; overflow: hidden; box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}
.sudoku-grid { display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(9, 1fr); width: 100%; height: 100%; background: #111827; gap: 1px; }
.cell {
  position: relative; display: flex; align-items: center; justify-content: center;
  background: var(--cell-bg); font-size: 1.5rem; font-weight: 700; color: var(--txt);
  cursor: pointer; transition: background-color 0.15s ease; -webkit-user-select: none; user-select: none;
}
.cell[data-col="2"], .cell[data-col="5"] { border-right: 2px solid var(--bdr-box); }
.cell[data-row="2"], .cell[data-row="5"] { border-bottom: 2px solid var(--bdr-box); }
.cell.cage-tint-0 { background: #141c2f; }
.cell.cage-tint-1 { background: #13212c; }
.cell.cage-tint-2 { background: #1c182c; }
.cell.cage-tint-3 { background: #132324; }
.cell.given { color: #38bdf8; font-weight: 800; }
.cell.hinted { color: #a78bfa; font-weight: 800; }
.cell.highlight-axis { background: var(--cell-highlight); }
.cell.cage-tint-0.highlight-axis, .cell.cage-tint-1.highlight-axis,
.cell.cage-tint-2.highlight-axis, .cell.cage-tint-3.highlight-axis { filter: brightness(1.14); }
.cell.same-number { background: var(--cell-same-num); }
.cell.selected { background: var(--cell-selected) !important; outline: 2px solid var(--rose); outline-offset: -2px; z-index: 2; }
.cell.conflict { background: var(--cell-conflict) !important; color: var(--red) !important; }
.cell.complete-glow { animation: unitCompleteGlow 300ms ease-out forwards; }
@keyframes unitCompleteGlow {
  0% { box-shadow: inset 0 0 0 0 rgba(16, 185, 129, 0), inset 0 0 18px rgba(16, 185, 129, 0.55); background-color: rgba(16, 185, 129, 0.22); }
  100% { box-shadow: inset 0 0 0 0 rgba(16, 185, 129, 0); }
}

.cage-sum {
  position: absolute; top: 2px; left: 3px; z-index: 4; display: none;
  font-size: 0.62rem; font-weight: 800; line-height: 1; padding: 1px 3px; border-radius: 3px;
  color: #f8fafc; background: rgba(11, 14, 20, 0.88); pointer-events: none; letter-spacing: -0.02em;
}
.mode-killer .cage-sum.visible { display: block; }
.mode-killer .cell { font-size: 1.38rem; padding-top: 8px; }
.cell-val { line-height: 1; }

.notes-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); width: 100%; height: 100%; padding: 2px; pointer-events: none; }
.mode-killer .notes-grid { padding: 13px 3px 3px 3px; }
.note-digit { display: flex; align-items: center; justify-content: center; font-size: 0.62rem; font-weight: 600; color: var(--muted); line-height: 1; }

.killer-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 3; display: none;
}
.mode-killer .killer-overlay { display: block; }
.cage-path {
  fill: none; stroke: rgba(203, 213, 225, 0.45); stroke-width: 2;
  stroke-dasharray: 5 4; stroke-linejoin: round; transition: stroke 0.15s ease, stroke-width 0.15s ease;
}
.cage-path.active-cage { stroke: rgba(244, 114, 182, 0.9); stroke-width: 2.6; }
.cage-path.cage-error { stroke: rgba(239, 68, 68, 0.92); stroke-width: 2.6; }

.pause-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(11, 14, 20, 0.95); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; z-index: 10;
}
.pause-overlay.active { display: flex; }
.resume-btn { padding: 0.75rem 1.6rem; border-radius: 10px; font-size: 0.95rem; font-weight: 700; cursor: pointer; background: var(--rose); color: #fff; border: none; transition: all 0.2s ease; }
.resume-btn:hover { background: var(--rose-bright); box-shadow: 0 0 20px var(--rose-glow); }

.action-bar { display: flex; justify-content: space-between; width: 100%; gap: 0.5rem; }
.action-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.3rem;
  padding: 0.6rem 0.4rem; background: var(--card); border: 1px solid var(--bdr); border-radius: 10px;
  color: var(--muted); font-family: inherit; font-size: 0.72rem; font-weight: 700; cursor: pointer; transition: all 0.2s ease;
}
.action-btn:hover { color: var(--txt); border-color: var(--bdr-strong); }
.action-btn.active { background: rgba(236, 72, 153, 0.18); border-color: var(--rose); color: var(--rose-bright); }
.action-badge { font-size: 0.6rem; padding: 0.1rem 0.35rem; border-radius: 4px; background: rgba(236, 72, 153, 0.2); color: var(--rose-bright); }

.numpad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 0.45rem; width: 100%; }
.num-btn {
  position: relative; aspect-ratio: 1 / 1.1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--bdr); border-radius: 10px; color: var(--txt);
  font-size: 1.35rem; font-weight: 700; cursor: pointer; font-family: inherit; transition: all 0.2s ease; gap: 1px;
}
.num-val { line-height: 1; }
.num-rem { font-size: 0.6rem; font-weight: 700; color: var(--muted); line-height: 1; font-family: monospace; }
.num-btn.completed .num-rem { opacity: 0; }
.num-btn:hover { border-color: var(--rose); color: var(--rose-bright); transform: translateY(-2px); background: rgba(236, 72, 153, 0.1); }
.num-btn:active { transform: translateY(0); }
.num-btn:disabled, .num-btn.completed {
  cursor: not-allowed; pointer-events: none; background: rgba(17, 24, 39, 0.35); border-color: rgba(255, 255, 255, 0.05);
  color: rgba(156, 163, 175, 0.22); transform: none !important; box-shadow: none !important;
}
.num-btn.completed::after {
  content: '✓'; position: absolute; top: 3px; right: 5px; font-size: 0.65rem; font-weight: 800;
  color: var(--green); line-height: 1; animation: checkPop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes checkPop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.75);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: none;
  align-items: center; justify-content: center; z-index: 100; padding: 1.5rem;
}
.modal-overlay.active { display: flex; }
.victory-card {
  background: var(--card); border: 1px solid var(--rose); border-radius: 16px; padding: 2rem;
  max-width: 420px; width: 100%; text-align: center; box-shadow: 0 0 50px var(--rose-glow);
  animation: popIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes popIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.victory-icon { font-size: 3.5rem; margin-bottom: 0.5rem; }
.victory-title { font-size: 1.6rem; font-weight: 800; color: #fff; margin-bottom: 0.5rem; }
.victory-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin: 1.25rem 0; padding: 1rem;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--bdr); border-radius: 10px;
}
.stat-box { display: flex; flex-direction: column; }
.stat-title { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; }
.stat-num { font-size: 1.2rem; font-weight: 700; color: var(--rose-bright); font-family: monospace; }
.victory-btn { width: 100%; padding: 0.8rem; border-radius: 10px; background: var(--rose); color: #fff; font-weight: 700; font-size: 0.95rem; border: none; cursor: pointer; transition: all 0.2s ease; }
.victory-btn:hover { background: var(--rose-bright); box-shadow: 0 0 20px var(--rose-glow); }

.confirm-card {
  background: var(--card); border: 1px solid var(--bdr-strong); border-radius: 16px; padding: 1.5rem;
  max-width: 380px; width: 100%; text-align: center; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
  animation: popIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.confirm-title { font-size: 1.15rem; font-weight: 800; color: #fff; margin-bottom: 0.45rem; }
.confirm-desc { font-size: 0.86rem; color: var(--muted); margin-bottom: 1.2rem; line-height: 1.45; }
.confirm-actions { display: flex; gap: 0.65rem; }
.confirm-btn-cancel, .confirm-btn-ok {
  flex: 1; padding: 0.68rem 0.9rem; border-radius: 10px; font-size: 0.88rem; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: all 0.15s ease;
}
.confirm-btn-cancel { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--bdr-strong); color: var(--txt); }
.confirm-btn-cancel:hover { background: rgba(255, 255, 255, 0.1); }
.confirm-btn-ok { background: var(--rose); border: 1px solid var(--rose); color: #fff; }
.confirm-btn-ok:hover { background: var(--rose-bright); box-shadow: 0 0 18px var(--rose-glow); }

.keyboard-hints { font-size: 0.75rem; color: var(--muted); display: flex; gap: 1rem; justify-content: center; margin-top: 0.5rem; }
.keyboard-hints kbd { background: var(--card); border: 1px solid var(--bdr); padding: 0.15rem 0.4rem; border-radius: 4px; font-family: monospace; color: var(--txt); }

@media (prefers-reduced-motion: reduce) {
  .cell.complete-glow { animation: none; }
}

/* SEO / Info-Text unter dem Spiel */
.seo-info {
  width: 100%; margin-top: 1.5rem; padding: 1.25rem 1.5rem;
  border: 1px solid var(--bdr); border-radius: 12px; background: var(--card);
  color: var(--muted); font-size: 0.9rem; line-height: 1.6;
  -webkit-user-select: text; user-select: text;
}
.seo-info h2 { font-size: 1.05rem; font-weight: 700; color: var(--txt); margin-bottom: 0.6rem; }
.seo-info p + ul, .seo-info ul + p { margin-top: 0.75rem; }
.seo-info ul { padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.3rem; }
.seo-info strong { color: var(--txt); font-weight: 600; }
.seo-info a { color: var(--rose-bright); text-decoration: none; }
.seo-info a:hover { text-decoration: underline; }
.seo-info-note { font-size: 0.8rem; }

@media (max-width: 480px) {
  body { padding: 1rem 0.5rem; }
  .cell { font-size: 1.25rem; }
  .mode-killer .cell { font-size: 1.15rem; padding-top: 6px; }
  .mode-killer .notes-grid { padding: 11px 2px 2px 2px; }
  .cage-sum { font-size: 0.52rem; top: 1px; left: 2px; padding: 1px 2px; }
  .note-digit { font-size: 0.52rem; }
  .num-btn { font-size: 1.1rem; }
  .num-rem { font-size: 0.52rem; }
  .num-btn.completed::after { top: 2px; right: 3px; font-size: 0.55rem; }
  .keyboard-hints { display: none; }
  .seo-info { padding: 1rem; font-size: 0.85rem; }
}
