/* ============================================================
   Sudoku · Noir — Styles
   ============================================================ */
:root {
  --bg: #1c0c0f;
  --bg2: #2a1216;
  --wine: #4a1922;
  --panel: rgba(255, 238, 222, 0.05);
  --panel-brd: rgba(230, 200, 170, 0.13);
  --text: #f4e8d2;
  --muted: #b49a86;
  --accent: #d9a84e;
  --accent2: #a8202b;
  --gold: #ecc76a;
  --danger: #e0556a;
  --radius: 18px;
  --shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.75);
  /* Einheitliche Bedien-Oberfläche (Tasten, Werkzeuge, HUD, Pause) */
  --ctrl: linear-gradient(180deg, rgba(86, 58, 50, 0.85), rgba(42, 27, 27, 0.88));
  --ctrl-hover: linear-gradient(180deg, rgba(120, 84, 66, 0.9), rgba(60, 38, 36, 0.9));
  --ctrl-brd: color-mix(in srgb, var(--accent) 26%, rgba(255, 240, 220, 0.08));
  --ctrl-sh: inset 0 1px 0 rgba(255, 240, 220, 0.08), 0 3px 12px -6px rgba(0, 0, 0, 0.65);
  --ctrl-sh-hover: inset 0 1px 0 rgba(255, 240, 220, 0.14), 0 10px 24px -10px color-mix(in srgb, var(--accent) 55%, transparent);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  font-family: "Sora", system-ui, sans-serif;
  background: radial-gradient(1200px 800px at 20% -10%, #4a1922 0%, transparent 55%),
    radial-gradient(1000px 700px at 100% 10%, #3a2416 0%, transparent 50%),
    linear-gradient(160deg, var(--bg), var(--bg2));
  color: var(--text);
  min-height: 100%;
  overflow-x: hidden;
  position: relative;
}

/* Ambient orbs */
.bg-orbs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  animation: float 18s ease-in-out infinite;
}
.orb.o1 {
  width: 420px;
  height: 420px;
  background: #7a2230;
  top: -120px;
  left: -80px;
}
.orb.o2 {
  width: 380px;
  height: 380px;
  background: #b5863f;
  bottom: -140px;
  right: -60px;
  animation-delay: -6s;
}
.orb.o3 {
  width: 320px;
  height: 320px;
  background: #5a1620;
  top: 40%;
  left: 55%;
  animation-delay: -11s;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -40px) scale(1.1); }
}

.glass {
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  box-shadow: var(--shadow);
}

/* ---- Screens ---- */
.screen {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  animation: fade 0.4s ease;
}
.screen.active {
  display: block;
}
@keyframes fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.app-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-top: 34px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.4px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2px 4px;
}
.help-link,
.legal-link {
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 7px;
  letter-spacing: 0.4px;
}
.help-link:hover,
.legal-link:hover { text-decoration: underline; }
.help-link:focus-visible,
.legal-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.footer-copy { opacity: 0.7; }

/* Auszufüllende Platzhalter in den Rechtstexten sichtbar markieren. */
.legal-fill {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 4px;
  padding: 0 4px;
  font-style: normal;
  font-weight: 600;
}
.legal-note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

/* Hilfe-Button in der Spiel-Kopfzeile */
.topbar-end { width: 70px; display: flex; justify-content: flex-end; }
.game-help {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--panel-brd);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.game-help:hover { color: var(--text); border-color: var(--accent); background: rgba(255, 255, 255, 0.09); }
.game-help:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Hilfe-Overlay-Inhalt */
.help-body { display: flex; flex-direction: column; }
.help-sec { padding: 13px 0; border-bottom: 1px solid var(--panel-brd); }
.help-sec:last-child { border-bottom: none; }
.help-sec h4 { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--text); }
.help-sec p { margin: 0; font-size: 13.5px; line-height: 1.55; color: #d9cbb6; }
.help-sec p + p { margin-top: 6px; }
.help-sec ul { margin: 7px 0 0; padding-left: 18px; }
.help-sec li { margin: 4px 0; font-size: 13.5px; line-height: 1.5; color: #d9cbb6; }
.help-sec b { color: var(--text); font-weight: 700; }
.help-sec a { color: var(--accent); text-decoration: underline; word-break: break-word; }
.help-sec a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.help-sec code { font-size: 12.5px; background: rgba(255, 255, 255, 0.07); padding: 0 4px; border-radius: 4px; }

/* ---- Buttons ---- */
.btn {
  font-family: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 12px 20px;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s;
  font-size: 15px;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent2), #7d1824);
  color: #fbefdc;
  box-shadow: 0 10px 30px -8px color-mix(in srgb, var(--accent2) 75%, transparent);
}
.btn-primary:hover { box-shadow: 0 14px 36px -8px color-mix(in srgb, var(--accent2) 85%, transparent); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--panel-brd);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ============================================================
   AUTH
   ============================================================ */
#screen-auth {
  display: none;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}
#screen-auth.active { display: grid; }
.auth-card {
  width: 100%;
  max-width: 400px;
  border-radius: 24px;
  padding: 40px 34px;
  text-align: center;
}
.brand { margin-bottom: 24px; }
.brand-logo {
  width: 100%;
  max-width: 340px;
  display: block;
  margin: 0 auto;
  border-radius: 18px;
  border: 1px solid var(--panel-brd);
  box-shadow: 0 16px 46px -12px rgba(0, 0, 0, 0.75);
}
.brand-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 40px;
  letter-spacing: 8px;
  margin: 0;
  font-weight: 700;
}
.brand-sub {
  color: var(--accent);
  letter-spacing: 4px;
  font-size: 12px;
  text-transform: uppercase;
  margin: 4px 0 0;
}
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s;
}
.auth-tab.active {
  background: linear-gradient(135deg, var(--accent2), #7d1824);
  color: #fbefdc;
}
.user-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.user-quick:empty { display: none; }
.user-quick-btn {
  flex: 1 1 auto;
  min-width: 90px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--panel-brd);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border 0.2s, background 0.2s, transform 0.1s;
}
.user-quick-btn:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.07);
}
.user-quick-btn:active {
  transform: scale(0.97);
}
.auth-form { text-align: left; }
.field { display: block; margin-bottom: 16px; }
.field span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 7px;
  letter-spacing: 0.5px;
}
.field input {
  width: 100%;
  padding: 13px 15px;
  border-radius: 12px;
  border: 1px solid var(--panel-brd);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border 0.2s, box-shadow 0.2s;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.auth-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-bottom: 8px;
}
.auth-hint {
  color: var(--muted);
  font-size: 12px;
  margin: 18px 0 0;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--panel-brd);
  background: rgba(10, 10, 15, 0.55);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-brand {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  letter-spacing: 3px;
  font-weight: 700;
}
.topbar-brand span { color: var(--accent); font-size: 14px; letter-spacing: 2px; }
/* Marken-Lockup: runder Fuchs + Schriftzug */
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-fox {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.6);
}
.brand-word-wrap { display: flex; flex-direction: column; line-height: 1.05; }
.brand-word {
  font-family: "Cormorant Garamond", serif;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 5px;
  color: var(--text);
}
.brand-tag {
  font-family: "Cormorant Garamond", serif;
  font-size: 15px;
  letter-spacing: 7px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-top: -1px;
}
@media (max-width: 560px) {
  .brand-word { font-size: 22px; letter-spacing: 3px; }
  .brand-tag { font-size: 12px; letter-spacing: 5px; }
  .brand-fox { width: 42px; height: 42px; }
}
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip {
  font-size: 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 7px 12px;
  border-radius: 20px;
}
.user-chip b { color: var(--text); }

/* Zusammengeführter Header-Button: Avatar + Name + Level -> Einstellungen */
.user-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 12px 5px 5px;
  border-radius: 26px;
  border: 1px solid var(--panel-brd);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  max-width: 62vw;
  transition: background 0.2s, border-color 0.2s;
}
.user-btn:hover { background: rgba(255, 255, 255, 0.09); border-color: var(--accent); }
.user-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.user-btn-avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--panel-brd);
}
.user-btn-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.15;
}
.user-btn-name {
  font-weight: 700;
  font-size: 14px;
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-btn-lvl {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-btn-gear { flex: none; color: var(--muted); font-size: 15px; }

/* Einstellungs-Bereiche */
.set-section { margin-bottom: 22px; }
.set-section:last-child { margin-bottom: 0; }
.set-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}
.set-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.set-name-edit { display: flex; gap: 8px; align-items: stretch; }
.set-input {
  flex: 1;
  min-width: 0;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid var(--panel-brd);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}
.set-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.set-name-edit .btn { flex: none; }
.set-msg { font-size: 12px; min-height: 15px; margin-top: 7px; color: var(--accent); }
.set-msg.err { color: var(--danger); }
.set-section .btn-block { margin-top: 9px; }
.btn-danger {
  background: color-mix(in srgb, var(--danger) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  color: var(--danger);
}
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 26%, transparent); }
.set-danger-confirm {
  margin-top: 10px;
  padding: 13px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
  font-size: 13px;
  color: var(--text);
}
.set-danger-actions { display: flex; gap: 8px; margin-top: 11px; }
.set-about { font-size: 12px; color: var(--muted); line-height: 1.7; }

/* Einladungen */
.inv-head { font-size: 12px; color: var(--muted); margin-bottom: 9px; }
.inv-head b { color: var(--accent); }
.inv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--panel-brd);
}
.inv-row.used { opacity: 0.55; }
.inv-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text);
}
.inv-status { font-size: 12px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-copy {
  flex: none;
  border: 1px solid var(--panel-brd);
  background: rgba(255, 255, 255, 0.05);
  color: var(--accent);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.inv-copy:hover { border-color: var(--accent); }
.inv-copy.done { color: #7bd88f; border-color: #7bd88f; }
.user-lvl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: #2a1206;
  background: linear-gradient(135deg, var(--accent), #b5823a);
  padding: 5px 11px;
  border-radius: 20px;
  white-space: nowrap;
}
.user-lvl .ul-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.25);
}
.user-lvl .ul-num { font-weight: 800; }
.user-lvl .ul-name::before { content: "· "; opacity: 0.7; }
@media (max-width: 560px) {
  .user-lvl .ul-name { display: none; }
}

/* ============================================================
   HOME
   ============================================================ */
/* ============================================================
   RANKING
   ============================================================ */
/* ============================================================
   TÄGLICHE CHALLENGE
   ============================================================ */
/* Kompakte Challenge-Karte: Bild · Kurzstatus · Button in einer Reihe */
.daily-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 16px;
  border-left: 3px solid var(--accent);
}
.daily-thumb {
  flex: none;
  width: 62px;
  height: 62px;
  border-radius: 13px;
  object-fit: cover;
  border: 1px solid var(--panel-brd);
}
.daily-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.daily-diff-line {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.daily-status-line { font-size: 13.5px; line-height: 1.3; }
.daily-done { color: var(--accent); font-weight: 600; }
.daily-todo { color: var(--muted); }
.daily-risk { color: #f0a24e; font-weight: 700; }
.daily-date { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.daily-play { flex: none; }

/* Serie dezent als Text neben der Schwierigkeit */
.daily-streak {
  font-size: 12px;
  font-weight: 700;
  color: #f0a24e;
  margin-left: 7px;
  white-space: nowrap;
}

/* Prominenter Zustand, solange heute noch nicht gespielt (fällt mehr auf) */
.daily-card.daily-todo-state {
  padding: 16px;
  gap: 16px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent),
    0 14px 34px -18px var(--accent);
}
.daily-card.daily-todo-state .daily-thumb {
  width: 104px;
  height: 104px;
  border-radius: 16px;
}
.daily-card.daily-todo-state .daily-diff-line { font-size: 17px; }

.profile-streak { font-size: 12px; color: #f0a24e; font-weight: 600; margin-top: 3px; }

/* ============================================================
   FORTSCHRITT (Level-Streifen + Rangliste in einer Karte)
   ============================================================ */
.progress-card {
  border-radius: var(--radius);
  padding: 16px 18px;
}
/* Level-Streifen oben, Trennlinie, darunter die Rangliste */
.level-strip {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 14px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--panel-brd);
}
.level-card {
  display: flex;
  align-items: center;
  gap: 16px;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.lc-badge {
  flex: none;
  width: 60px;
  height: 60px;
  border-radius: 15px;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 8px 22px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.lc-info { flex: 1; min-width: 0; }
.lc-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.lc-name {
  font-family: "Cormorant Garamond", serif;
  font-size: 23px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lc-lvl {
  flex: none;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-weight: 700;
}
.lc-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 7px;
}
.lc-bar span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #fbe6b8));
  transition: width 0.6s;
}
.lc-sub { font-size: 12px; color: var(--muted); }
.lc-sub b { color: var(--text); font-weight: 600; }

.profile-level {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-top: 4px;
}

.ranking {
  border: 1px solid var(--panel-brd);
  background: var(--panel);
  backdrop-filter: blur(16px);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 22px;
}
.ranking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ranking-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
}
.ranking-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 4px 2px 2px;
}
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.rank-row {
  display: grid;
  grid-template-columns: 26px 36px 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 14px;
}
.rank-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--panel-brd);
}
.rank-row.me {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.rank-pos {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.rank-name {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  line-height: 1.2;
}
.rank-nm {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-lvl {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-name em {
  font-style: normal;
  color: var(--accent);
  font-weight: 500;
  font-size: 12px;
}
.rank-stars {
  color: #f6c453;
  font-size: 13px;
  white-space: nowrap;
}
.rank-score {
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 56px;
  text-align: right;
}

.section-title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 30px;
  text-align: center;
  margin: 10px 0 26px;
}
/* Kompaktes Abschnitts-Label mit auslaufender Linie */
.sec-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  font-weight: 700;
  margin: 26px 0 14px;
}
.sec-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--panel-brd);
}

.difficulty-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 620px) {
  .difficulty-grid { grid-template-columns: repeat(4, 1fr); }
}
/* Bild-Kachel: Bild dominiert (mit eingebackenem Label), nur Fortschritt darunter */
.diff-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--panel-brd);
  background: var(--panel);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 0;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}
.diff-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 18px 44px -20px var(--accent);
}
.diff-img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-bottom: 1px solid var(--panel-brd);
}
.diff-info {
  padding: 9px 11px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.diff-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
}
.diff-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fbe6b8));
  border-radius: 3px;
  transition: width 0.5s;
}
.diff-meta { color: var(--muted); font-size: 12px; text-align: center; }

/* Resume banner */
.pw-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-radius: 14px;
  padding: 13px 18px;
  margin-bottom: 18px;
  border-left: 3px solid var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  font-size: 14px;
}
.pw-banner b { color: var(--text); }
.pw-banner .btn { flex: 0 0 auto; }
.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 22px;
  border-left: 3px solid var(--accent);
}
.resume-info { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.resume-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
}
.resume-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   LEVEL SELECT
   ============================================================ */
.levels-pager {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}
.pager-btn {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--panel-brd);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.pager-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.levels-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 8px;
}
#levels-ranking { margin-top: 26px; }
.level-cell {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px solid var(--panel-brd);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
  position: relative;
}
.level-cell:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.05);
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}
.level-cell.done {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.level-cell.locked {
  opacity: 0.4;
  cursor: not-allowed;
}
.lvl-num { font-weight: 600; font-size: 15px; }
.lvl-stars { display: flex; gap: 1px; font-size: 7px; }
.lock { font-size: 13px; }
.star { color: rgba(255, 255, 255, 0.2); }
.star.on { color: var(--gold); }

/* ============================================================
   GAME
   ============================================================ */
.game-title { text-align: center; }
.game-diff {
  display: block;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
}
.game-level {
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  font-weight: 600;
}
.game-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.4vw, 30px);
  height: calc(100vh - 66px);
  padding: 16px 20px;
}
.game-left,
.game-right {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}
.game-left {
  gap: 12px;
  width: clamp(150px, 20vw, 200px);
}
.game-right {
  gap: 12px;
  width: clamp(96px, 11vw, 130px);
}
.stat {
  border-radius: 16px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: var(--ctrl);
  border: 1px solid var(--ctrl-brd);
  box-shadow: var(--ctrl-sh);
  backdrop-filter: none;
}
.hud-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-weight: 700;
}
.hud-val {
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

/* Board */
.board {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  flex: 0 0 auto;
  width: min(76vh, 58vw, 620px);
  height: min(76vh, 58vw, 620px);
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8);
}
.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(18px, 5.5vw, 28px);
  font-weight: 400;
  color: var(--accent);
  cursor: pointer;
  position: relative;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  user-select: none;
  transition: background 0.12s;
  aspect-ratio: 1;
}
.cell.bl { border-left: 2px solid rgba(255, 255, 255, 0.22); }
.cell.bt { border-top: 2px solid rgba(255, 255, 255, 0.22); }
.cell.br { border-right: none; }
.cell.bb { border-bottom: none; }
.cell.given {
  color: var(--text);
  font-weight: 600;
}
.cell.filled:not(.given) { color: var(--accent); }
.cell.peer { background: rgba(255, 255, 255, 0.04); }
.cell.same { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.cell.selected {
  background: color-mix(in srgb, var(--accent) 30%, transparent) !important;
  box-shadow: inset 0 0 0 2px var(--accent);
}
.cell.wrong {
  color: var(--danger) !important;
  background: color-mix(in srgb, var(--danger) 16%, transparent);
}
.cell.shake { animation: shake 0.35s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.notes {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 2px;
}
.notes span {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--muted);
  font-weight: 500;
}

/* Keypad */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.key {
  aspect-ratio: 1;
  border: 1px solid var(--ctrl-brd);
  background: var(--ctrl);
  box-shadow: var(--ctrl-sh);
  border-radius: 13px;
  color: var(--text);
  font-family: inherit; /* Spielbrett-Schrift (Sora) */
  cursor: pointer;
  transition: transform 0.1s, background 0.2s, border-color 0.2s, box-shadow 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.key-num { font-size: clamp(21px, 2.6vw, 30px); font-weight: 600; color: var(--accent); }
.key:hover {
  background: var(--ctrl-hover);
  border-color: var(--accent);
  box-shadow: var(--ctrl-sh-hover);
}
.key:hover .key-num { color: #fbe6b8; }
.key:active { transform: scale(0.93); }
.key.used-up { opacity: 0.3; pointer-events: none; }

/* Tools */
.tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.tool {
  border: 1px solid var(--ctrl-brd);
  background: var(--ctrl);
  box-shadow: var(--ctrl-sh);
  border-radius: 13px;
  padding: 11px 4px;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.tool:hover {
  background: var(--ctrl-hover);
  border-color: var(--accent);
  box-shadow: var(--ctrl-sh-hover);
}
.tool-ico { font-size: 18px; }
.tool-lbl { font-size: 10px; letter-spacing: 0.5px; color: var(--muted); }
.tool.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, var(--accent) 14%, transparent));
}
.tool.active .tool-lbl,
.tool.active .tool-ico { color: var(--accent); }

/* Win Overlay */
/* Pause-Button (in der HUD-Spalte) */
.pause-btn {
  border: 1px solid var(--ctrl-brd);
  background: var(--ctrl);
  box-shadow: var(--ctrl-sh);
  color: var(--text);
  border-radius: 16px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.pause-btn:hover {
  background: var(--ctrl-hover);
  border-color: var(--accent);
  box-shadow: var(--ctrl-sh-hover);
}
.pause-ico { font-size: 18px; color: var(--accent); }
.pause-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); }

/* Pause-Overlay (verdeckt das Spielfeld) */
.pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 10, 0.82);
  backdrop-filter: blur(14px);
  padding: 24px;
}
.pause-overlay.show { display: flex; animation: fade 0.3s ease; }
.pause-card {
  width: 100%;
  max-width: 340px;
  border-radius: 24px;
  padding: 34px 30px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 13px;
  animation: pop 0.4s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.pause-mark { font-size: 46px; color: var(--accent); line-height: 1; }
.pause-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 34px;
  font-weight: 700;
}
.pause-sub { color: var(--muted); font-size: 13px; margin-top: -8px; }
.pause-time { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 6px; }

/* Profil-Popup (schnellste Zeiten je Schwierigkeit) */
.rank-row.clickable { cursor: pointer; }
.rank-row.clickable:hover {
  background: color-mix(in srgb, var(--accent) 14%, rgba(255, 255, 255, 0.03));
}
.rank-row.clickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(8, 4, 6, 0.82);
  backdrop-filter: blur(12px);
  padding: 20px;
}
.profile-overlay.show { display: flex; animation: fade 0.25s ease; }
.profile-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 86vh;
  overflow-y: auto;
  border-radius: 24px;
  padding: 26px 24px 22px;
  animation: pop 0.35s cubic-bezier(0.2, 1.2, 0.4, 1);
}
.profile-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--panel-brd);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.profile-close:hover { color: var(--text); border-color: var(--accent); }
.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding-right: 40px;
}
.profile-avatar {
  flex: none;
  width: 66px;
  height: 66px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
}
.profile-head-text { min-width: 0; }
.profile-eyebrow {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.profile-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 30px;
  margin: 2px 0 0;
  font-weight: 700;
}
.profile-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prof-block-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  font-weight: 700;
  margin: 8px 0 2px;
}
.prof-block-title:first-child { margin-top: 0; }
.prof-times-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.prof-ranks {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.prank {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 5px 10px;
  border-radius: 10px;
  font-size: 13.5px;
  opacity: 0.5;
}
.prank.got { opacity: 1; }
.prank.current {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
}
.prank-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--panel-brd);
  filter: grayscale(0.85) brightness(0.8);
}
.prank.got .prank-img {
  filter: none;
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
}
.prank.current .prank-img { border-color: var(--accent); }
.prank-name { font-weight: 600; color: var(--text); }
.prank-lv {
  color: var(--muted);
  font-weight: 700;
  font-size: 11px;
  margin-right: 6px;
}
.prank-mark { font-size: 12px; }
.prank.selectable { cursor: pointer; }
.prank.selectable:hover { background: color-mix(in srgb, var(--accent) 12%, rgba(255, 255, 255, 0.03)); }
.prank.selectable:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.prank.chosen {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border: 1px solid var(--accent);
}
.prank.chosen .prank-img {
  border-color: var(--accent);
  box-shadow: 0 0 10px -2px color-mix(in srgb, var(--accent) 70%, transparent);
}
.prank-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  font-weight: 700;
  margin-left: 6px;
}
.prof-hint { font-size: 12px; color: var(--muted); margin: -2px 0 8px; }

/* Home-Button zum eigenen Profil (Statistik & Erfolge) */
.stats-link {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 11px;
  border: 1px solid var(--panel-brd);
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent);
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  border-radius: 11px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.stats-link:hover { border-color: var(--accent); background: rgba(255, 255, 255, 0.07); }

/* Statistik-Block im Profil */
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.stat-tile {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--panel-brd);
}
.st-num { font-family: "Cormorant Garamond", serif; font-size: 23px; font-weight: 700; color: var(--text); }
.st-lbl { font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stat-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; padding: 4px 6px; }
.stat-table td { padding: 6px; border-top: 1px solid var(--panel-brd); font-variant-numeric: tabular-nums; color: var(--text); }
.stat-table td:first-child { font-weight: 600; }
.stat-table th:not(:first-child), .stat-table td:not(:first-child) { text-align: right; }
.stat-daily { margin-top: 11px; font-size: 12.5px; color: var(--muted); }
.stat-daily b { color: var(--text); }

/* Erfolge */
.ach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.ach {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--panel-brd);
  opacity: 0.45;
}
.ach.got {
  opacity: 1;
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
}
.ach-ico { font-size: 20px; }
.ach-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ach-txt b { font-size: 13px; color: var(--text); }
.ach-desc { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ach-check { color: var(--accent); font-weight: 800; font-size: 15px; }
.ach-prog { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 560px) { .ach-grid { grid-template-columns: 1fr; } }
.prof-section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-brd);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 12px 14px;
}
.prof-diff {
  font-weight: 700;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.prof-time {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.prof-rank {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
.prof-clock { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 15px; }
.prof-lvl { color: var(--muted); font-size: 12px; }
.prof-stars { font-size: 11px; letter-spacing: 1px; white-space: nowrap; }
.prof-empty { color: var(--muted); font-size: 12px; font-style: italic; padding: 2px 0; }

@media (max-width: 560px) {
  .prof-times-grid { grid-template-columns: 1fr; }
}

.win-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 10, 0.72);
  backdrop-filter: blur(8px);
  padding: 24px;
}
.win-overlay.show { display: flex; animation: fade 0.4s ease; }
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.win-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 400px;
  border-radius: 24px;
  padding: 36px 32px;
  text-align: center;
  animation: pop 0.5s cubic-bezier(0.2, 1.3, 0.4, 1);
}
@keyframes pop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.win-rankup {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  margin-bottom: 18px;
  border-radius: 16px;
  text-align: left;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 26%, transparent), color-mix(in srgb, var(--accent2) 22%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
}
.win-rankup.show { display: flex; animation: rankPulse 0.6s cubic-bezier(0.2, 1.3, 0.4, 1); }
.win-rankup-img {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  box-shadow: 0 0 20px -2px color-mix(in srgb, var(--accent) 75%, transparent);
}
.win-rankup-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.win-rankup-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--accent);
  font-weight: 700;
}
.win-rankup-name {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
@keyframes rankPulse {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.win-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, var(--gold), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.win-stars { font-size: 36px; letter-spacing: 6px; margin-bottom: 16px; }
.win-stars .star { color: rgba(255, 255, 255, 0.18); }
.win-stars .star.on {
  color: var(--gold);
  text-shadow: 0 0 18px rgba(255, 210, 63, 0.7);
  animation: starpop 0.5s ease backwards;
}
.win-stars .star.on:nth-child(1) { animation-delay: 0.1s; }
.win-stars .star.on:nth-child(2) { animation-delay: 0.25s; }
.win-stars .star.on:nth-child(3) { animation-delay: 0.4s; }
@keyframes starpop {
  from { transform: scale(0) rotate(-40deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}
.win-score-big {
  font-size: 52px;
  font-weight: 700;
  font-family: "Cormorant Garamond", serif;
  line-height: 1;
}
.win-score-big small {
  display: block;
  font-size: 12px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--muted);
  font-family: "Sora", sans-serif;
  margin-top: 4px;
}
.win-best {
  color: var(--gold);
  font-weight: 600;
  font-size: 13px;
  min-height: 18px;
  margin-top: 8px;
}
.win-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 20px 0 26px;
}
.win-stats > div { display: flex; flex-direction: column; gap: 3px; }
.ws-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.ws-val { font-size: 22px; font-weight: 600; }
.win-actions { display: flex; gap: 10px; justify-content: center; }
.win-actions .btn { flex: 1; padding: 12px 8px; font-size: 14px; }

/* ---- Responsive ---- */
@media (max-width: 760px) {
  /* Spiel-Kopfzeile schlanker und nicht sticky, damit Feld + Buttons
     komplett auf den Bildschirm passen. */
  #screen-game .topbar { position: static; padding: 8px 14px; }
  #screen-game .game-wrap {
    flex-direction: column;
    height: auto;
    min-height: auto;
    gap: 10px;
    padding: 10px 14px 20px;
  }
  .board {
    width: min(90vw, 47vh);
    height: min(90vw, 47vh);
    order: 2;
  }
  /* Kompakte Kopfzeile: Zeit · Fehler · Pause schlank in einer Reihe */
  .game-right {
    order: 1;
    width: 100%;
    max-width: min(90vw, 47vh);
    flex-direction: row;
    gap: 8px;
  }
  .game-right .stat { flex: 1; padding: 6px 10px; gap: 1px; }
  .game-right .hud-label { font-size: 9px; letter-spacing: 1px; }
  .game-right .hud-val { font-size: 18px; }
  .pause-btn { flex: 0 0 auto; padding: 6px 20px; gap: 2px; }
  .pause-ico { font-size: 17px; }
  .pause-lbl { font-size: 9px; }
  .game-left {
    order: 3;
    width: 100%;
    max-width: min(96vw, 56vh);
    gap: 10px;
  }
  /* Zweireihiges Zahlenfeld (5 + 4), breite Tasten, letzte Reihe zentriert */
  .keypad {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
  }
  .key {
    aspect-ratio: auto;
    width: calc(20% - 8px);
    height: clamp(50px, 7vh, 62px);
    border-radius: 12px;
  }
  .key-num { font-size: clamp(24px, 6.5vw, 32px); }
}
@media (max-width: 560px) {
  .levels-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 380px) {
  .levels-grid { grid-template-columns: repeat(5, 1fr); }
}
