/* ==================================================================
   FUNKELFELD — "Midnight Felt" Design System (2026)
   8×8-Puzzle mit Gem-Blöcken, Combos und globaler Bestenliste.
   ================================================================== */

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

:root {
  --bg0: #0a0e0b;
  --felt: #0e1410;
  --card: rgba(255, 252, 240, 0.045);
  --card-hi: rgba(255, 252, 240, 0.09);
  --edge: rgba(232, 193, 90, 0.14);
  --edge-soft: rgba(255, 252, 240, 0.08);
  --ink: #f4efe2;
  --muted: #93a396;
  --gold: #e8c15a;
  --gold-glow: rgba(232, 193, 90, 0.35);
  --foil: linear-gradient(115deg, #8a6a1c 0%, #e8c15a 25%, #fff3c4 50%, #e8c15a 75%, #8a6a1c 100%);
  --red: #e2685a;
  --radius: 16px;
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Outfit", system-ui, -apple-system, sans-serif;
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);

  /* Gem-Farben (Basis / hell / dunkel) */
  --c1: #ff6b5e; --c1l: #ffa89e; --c1d: #c23b30;
  --c2: #ff9f4d; --c2l: #ffc894; --c2d: #cc6f1e;
  --c3: #ffd257; --c3l: #ffe9a8; --c3d: #cc9a1f;
  --c4: #5ad07f; --c4l: #9fe8b6; --c4d: #2f9c55;
  --c5: #45cfd6; --c5l: #96e8ec; --c5d: #23989e;
  --c6: #5b9cff; --c6l: #a3c8ff; --c6d: #2f6cc9;
  --c7: #b678ff; --c7l: #d7b5ff; --c7d: #8447d1;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-ui);
  background: radial-gradient(120% 90% at 50% -10%, #1a2a1d 0%, var(--felt) 45%, var(--bg0) 100%);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  overscroll-behavior: none;
}

/* ---------- Ambiente ---------- */
.ambience { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora {
  position: absolute;
  width: 70vmax; height: 70vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  mix-blend-mode: screen;
}
.aurora-a {
  top: -35vmax; left: -20vmax;
  background: radial-gradient(circle, rgba(232,193,90,0.28), transparent 65%);
  animation: drift-a 26s ease-in-out infinite alternate;
}
.aurora-b {
  bottom: -40vmax; right: -25vmax;
  background: radial-gradient(circle, rgba(52,120,80,0.35), transparent 65%);
  animation: drift-b 32s ease-in-out infinite alternate;
}
@keyframes drift-a { to { transform: translate(10vmax, 8vmax) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-8vmax, -10vmax) scale(1.1); } }
.grain {
  position: absolute; inset: -50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  opacity: 0.05;
  animation: grain-shift 0.9s steps(3) infinite;
}
@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-2%, 1%); }
  66% { transform: translate(1%, -2%); }
  100% { transform: translate(0, 0); }
}

#app {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 14px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.topbar h1 {
  flex: 1;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1.1;
}
.foil {
  background: var(--foil);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: foil-sheen 5.5s ease-in-out infinite;
}
@keyframes foil-sheen {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.btn-back {
  display: grid; place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 1.15rem;
  box-shadow: 0 0 0 1px var(--edge-soft) inset;
  flex-shrink: 0;
}
button {
  font-family: inherit;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.15s var(--ease-spring);
}
button:active { transform: scale(0.94); }
.btn-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-size: 1.05rem;
  box-shadow: 0 0 0 1px var(--edge-soft) inset;
  flex-shrink: 0;
}

/* ---------- HUD ---------- */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  background: linear-gradient(175deg, var(--card-hi), var(--card));
  border-radius: var(--radius);
  padding: 10px 16px;
  box-shadow: 0 0 0 1px var(--edge-soft) inset, 0 8px 24px -12px rgba(0,0,0,0.6);
}
.hud-score { display: flex; flex-direction: column; }
.hud-score span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.1rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: var(--foil);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: foil-sheen 5.5s ease-in-out infinite;
}
.hud-score label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-top: 3px;
}
.hud-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.hud-best {
  color: var(--muted);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.hud-best span { color: var(--ink); font-weight: 700; }
.hud-rank {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}
.hud-combo {
  background: rgba(232, 193, 90, 0.14);
  color: var(--gold);
  font-weight: 800;
  font-size: 0.92rem;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(232,193,90,0.3) inset;
  animation: combo-pulse 0.9s ease-in-out infinite;
}
/* Reserviert seinen Platz auch unsichtbar → Layout springt nicht */
.hud-combo.off { visibility: hidden; animation: none; }
@keyframes combo-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

/* ---------- Board ---------- */
.board-wrap { position: relative; }
.board-wrap.shake { animation: shake 0.35s ease; }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(2px, 2px); }
}
#board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  aspect-ratio: 1;
  background: rgba(8, 12, 9, 0.6);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: 0 0 0 1px var(--edge) inset, 0 14px 40px -18px rgba(0,0,0,0.8);
  touch-action: none;
}
.cell {
  border-radius: 6px;
  background: rgba(255, 252, 240, 0.04);
  box-shadow: 0 1px 2px rgba(0,0,0,0.35) inset;
  position: relative;
}

/* Gem-Block (Board, Tray und Ghost gemeinsam).
   Jeder Block trägt seine Farbtöne als Variablen (--b/--bl/--bd),
   die Skins (body.skin-…) stylen darauf aufbauend um. */
.blk.c1 { --b: var(--c1); --bl: var(--c1l); --bd: var(--c1d); }
.blk.c2 { --b: var(--c2); --bl: var(--c2l); --bd: var(--c2d); }
.blk.c3 { --b: var(--c3); --bl: var(--c3l); --bd: var(--c3d); }
.blk.c4 { --b: var(--c4); --bl: var(--c4l); --bd: var(--c4d); }
.blk.c5 { --b: var(--c5); --bl: var(--c5l); --bd: var(--c5d); }
.blk.c6 { --b: var(--c6); --bl: var(--c6l); --bd: var(--c6d); }
.blk.c7 { --b: var(--c7); --bl: var(--c7l); --bd: var(--c7d); }

/* ---- Skin 1 "Candy" (Standard): glossy Gems mit 3D-Bevel ---- */
.blk {
  border-radius: 24%;
  position: relative;
  background: radial-gradient(130% 130% at 28% 22%, var(--bl), var(--b) 52%, var(--bd));
  box-shadow:
    inset 0 2px 2px rgba(255, 255, 255, 0.5),
    inset 0 -3px 4px rgba(0, 0, 0, 0.38),
    0 2px 4px rgba(0, 0, 0, 0.4);
}
.blk::after {
  content: "";
  position: absolute;
  left: 14%; top: 9%;
  width: 42%; height: 24%;
  border-radius: 999px;
  background: linear-gradient(rgba(255,255,255,0.75), rgba(255,255,255,0.08));
  transform: rotate(-8deg);
  pointer-events: none;
}

/* ---- Skin 2 "Neon": dunkle Kerne mit leuchtenden Kanten ---- */
body.skin-neon .blk {
  border-radius: 18%;
  background: color-mix(in srgb, var(--b) 20%, #0b0f0c);
  box-shadow: inset 0 0 0 2px var(--b), inset 0 0 10px color-mix(in srgb, var(--b) 60%, transparent), 0 0 10px -2px var(--b);
}
body.skin-neon .blk::after { display: none; }

/* ---- Skin 3 "Glas": transluzente Eiswürfel-Optik ---- */
body.skin-glas .blk {
  border-radius: 22%;
  background: linear-gradient(160deg, color-mix(in srgb, var(--bl) 70%, transparent), color-mix(in srgb, var(--b) 45%, transparent));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35), inset 0 -4px 8px rgba(0,0,0,0.25), 0 2px 5px rgba(0,0,0,0.3);
}
body.skin-glas .blk::after {
  left: 10%; top: 8%; width: 34%; height: 34%;
  background: linear-gradient(rgba(255,255,255,0.6), rgba(255,255,255,0));
  transform: rotate(0deg);
}

/* ---- Skin 4 "Pixel": Retro-8-Bit, harte Kanten ---- */
body.skin-pixel .blk {
  border-radius: 0;
  background: var(--b);
  box-shadow: inset -4px -4px 0 var(--bd), inset 4px 4px 0 var(--bl);
}
body.skin-pixel .blk::after { display: none; }
body.skin-pixel .cell { border-radius: 2px; }

/* ---- Skin 5 "Holz": eingefärbte Holzklötze mit Maserung ---- */
body.skin-holz .blk {
  border-radius: 12%;
  background:
    repeating-linear-gradient(100deg, rgba(0,0,0,0.14) 0 2px, transparent 2px 7px),
    linear-gradient(100deg, var(--bd), var(--b) 35%, var(--bd) 60%, var(--b) 85%);
  box-shadow: inset 0 2px 2px rgba(255,255,255,0.25), inset 0 -2px 3px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.4);
}
body.skin-holz .blk::after { display: none; }

/* ---- Skin 6 "Metall": gebürstetes Edelmetall mit Lichtstreifen ---- */
body.skin-metall .blk {
  border-radius: 16%;
  background: linear-gradient(135deg, var(--bd) 0%, var(--bl) 38%, var(--b) 52%, var(--bd) 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.55), inset 0 -2px 3px rgba(0,0,0,0.45), 0 2px 4px rgba(0,0,0,0.4);
}
body.skin-metall .blk::after {
  left: 8%; top: 0; width: 22%; height: 100%;
  border-radius: 0;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,0.5), transparent);
  transform: skewX(-18deg);
}

/* ---- Skin 7 "Pastell": mattes Soft-Design, fast Squircle ---- */
body.skin-pastell .blk {
  border-radius: 34%;
  background: color-mix(in srgb, var(--b) 62%, #f4efe2);
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--bd) 55%, transparent), 0 3px 6px -2px rgba(0,0,0,0.35);
}
body.skin-pastell .blk::after { display: none; }

/* ---- Skin 8 "Magma": dunkler Fels mit glühendem Kern ---- */
body.skin-magma .blk {
  border-radius: 14%;
  background: radial-gradient(65% 65% at 50% 58%, var(--bl) 0%, var(--b) 45%, #1a120c 100%);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.5), inset 0 0 12px color-mix(in srgb, var(--b) 55%, transparent), 0 2px 5px rgba(0,0,0,0.5);
}
body.skin-magma .blk::after { display: none; }

/* ---- Skin 9 "Eis": frostige Kristalle mit Facette ---- */
body.skin-eis .blk {
  border-radius: 16%;
  background: linear-gradient(160deg, rgba(255,255,255,0.85) 0%, color-mix(in srgb, var(--b) 55%, #dff5ff) 42%, color-mix(in srgb, var(--bd) 80%, #29506b) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4), inset 0 -3px 6px rgba(30,80,120,0.35), 0 2px 4px rgba(0,0,0,0.35);
}
body.skin-eis .blk::after {
  left: 52%; top: 12%; width: 30%; height: 30%;
  border-radius: 2px;
  background: linear-gradient(45deg, rgba(255,255,255,0.7) 0 50%, transparent 50%);
  transform: rotate(20deg);
}

/* ---- Skin 10 "Papier": flaches Origami mit Falz-Diagonale ---- */
body.skin-papier .blk {
  border-radius: 8%;
  background: linear-gradient(135deg, var(--bl) 0% 50%, var(--b) 50% 100%);
  box-shadow: inset -1px -2px 0 color-mix(in srgb, var(--bd) 60%, transparent), 0 2px 3px rgba(0,0,0,0.35);
}
body.skin-papier .blk::after { display: none; }

/* ---------- Funkelstein: glitzernder Stern auf dem Block ---------- */
.blk.gem::before {
  content: "✦";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.85em;
  color: #fff;
  text-shadow: 0 0 6px rgba(255,255,255,0.9), 0 0 14px var(--gold-glow);
  animation: gem-twinkle 1.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 1;
}
@keyframes gem-twinkle {
  0%, 100% { opacity: 0.75; transform: scale(0.9) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(20deg); }
}
.slot .piece .blk.gem::before { font-size: 0.7em; }

/* ---------- Combo-Fieber: ab x3 glüht das Brett ---------- */
.board-wrap.fever #board {
  box-shadow: 0 0 0 2px var(--gold) inset, 0 0 34px -6px var(--gold-glow), 0 14px 40px -18px rgba(0,0,0,0.8);
  animation: fever-pulse 1.2s ease-in-out infinite;
}
@keyframes fever-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--gold) inset, 0 0 26px -8px var(--gold-glow), 0 14px 40px -18px rgba(0,0,0,0.8); }
  50% { box-shadow: 0 0 0 2px var(--gold) inset, 0 0 44px -4px var(--gold-glow), 0 14px 40px -18px rgba(0,0,0,0.8); }
}

.cell.pop { animation: pop-in 0.22s var(--ease-spring); }
@keyframes pop-in {
  from { transform: scale(1.25); }
  to { transform: scale(1); }
}
.cell.blast { animation: blast 0.32s ease forwards; }
@keyframes blast {
  0% { transform: scale(1); filter: brightness(1.8); }
  100% { transform: scale(0); filter: brightness(2.5); opacity: 0; }
}
.cell.preview-ok { box-shadow: 0 0 0 2px var(--gold) inset; }
.cell.preview-ok::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 4px;
  background: rgba(232, 193, 90, 0.25);
}
.cell.will-clear { box-shadow: 0 0 0 2px var(--gold) inset, 0 0 14px -2px var(--gold-glow); }
.cell.will-clear.filled-hint { filter: brightness(1.45); }

/* ---------- FX (Floating Text) ---------- */
#fx-layer { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 5; }
.float-text {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--gold);
  text-shadow: 0 2px 12px rgba(0,0,0,0.6), 0 0 20px var(--gold-glow);
  animation: float-up 1.3s ease-out forwards;
  white-space: nowrap;
}
.float-text.big {
  font-size: 2rem;
  font-style: italic;
  background: var(--foil);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@keyframes float-up {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1); }
}
/* Zentrale Meldungen (Lob, Combo, Board Clear): länger sichtbar mit Halte-Phase */
.float-text.hold { animation: float-hold 2.4s ease-out forwards; }
@keyframes float-hold {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); }
  7% { opacity: 1; transform: translate(-50%, -50%) scale(1.14); }
  11% { transform: translate(-50%, -50%) scale(1); }
  78% { opacity: 1; transform: translate(-50%, -58%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -110%) scale(1); }
}

/* ---------- Tray ---------- */
.tray {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
  min-height: 96px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.slot {
  display: grid;
  place-items: center;
  background: var(--card);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 0 0 1px var(--edge-soft) inset;
  min-height: 108px;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.slot:active { cursor: grabbing; }
.slot .piece {
  display: grid;
  gap: 3px;
  cursor: grab;
  animation: piece-in 0.35s var(--ease-spring);
}
@keyframes piece-in {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.slot .piece.dragging { opacity: 0.25; }
.slot .piece .blk { width: var(--mini); height: var(--mini); border-radius: 4px; }
.slot .piece .void { width: var(--mini); height: var(--mini); }

/* Drag-Ghost folgt dem Finger */
#ghost {
  position: fixed;
  left: 0; top: 0;
  z-index: 30;
  pointer-events: none;
  display: grid;
  gap: 5px;
  will-change: transform;
}
#ghost .blk { border-radius: 6px; }
#ghost .void { }

/* ---------- Fußzeile ---------- */
.foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
}
.btn-ghost {
  background: transparent;
  color: var(--muted);
  font-size: 0.92rem;
  padding: 10px 12px;
  border-radius: 10px;
}
.btn-ghost:hover { color: var(--ink); }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 6, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 18px;
  animation: overlay-in 0.25s ease;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
.panel {
  background: linear-gradient(180deg, #17201a, #101611);
  border-radius: 22px;
  box-shadow: 0 0 0 1px var(--edge) inset, 0 24px 70px -24px rgba(0,0,0,0.9);
  padding: 26px 20px calc(20px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 420px;
  max-height: 86vh;
  overflow-y: auto;
  animation: panel-up 0.4s var(--ease-spring);
  text-align: center;
}
@keyframes panel-up {
  from { transform: translateY(46px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.panel h2 {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-size: 1.7rem;
  margin-bottom: 6px;
}
.panel .sub { color: var(--muted); font-size: 0.92rem; margin-bottom: 18px; }

.go-score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3.2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: var(--foil);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: foil-sheen 5.5s ease-in-out infinite;
  margin: 6px 0 2px;
}
.go-best-badge {
  display: inline-block;
  background: rgba(232, 193, 90, 0.14);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 5px 14px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(232,193,90,0.3) inset;
  margin-bottom: 10px;
}
.go-rank { color: var(--muted); font-size: 0.95rem; margin-bottom: 16px; min-height: 1.3em; }
.go-rank b { color: var(--gold); }
.go-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 8px 0 6px;
}
.go-karat {
  color: var(--gold);
  font-size: 0.85rem;
  margin-bottom: 10px;
}
.btn-ghost.used { opacity: 0.35; text-decoration: line-through; }

.btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #f0cd6e 0%, var(--gold) 40%, #c39a30 100%);
  color: #1a1508;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 15px;
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 0 0 1px rgba(255, 230, 160, 0.35) inset, 0 10px 30px -10px var(--gold-glow);
  margin-bottom: 10px;
}
.btn-secondary {
  background: var(--card-hi);
  color: var(--ink);
  font-size: 1rem;
  padding: 13px;
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--edge-soft) inset;
}

.panel input[type="text"] {
  font-family: inherit;
  font-size: 1.15rem;
  text-align: center;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--edge-soft);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  margin-bottom: 14px;
}
.panel input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 193, 90, 0.18);
}

/* Bestenliste */
.lb-list { list-style: none; text-align: left; margin: 6px 0 16px; }
.lb-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--edge-soft);
  font-size: 0.98rem;
}
.lb-list li:last-child { border-bottom: 0; }
.lb-rank {
  width: 34px;
  flex-shrink: 0;
  text-align: center;
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.lb-list li:nth-child(1) .lb-rank,
.lb-list li:nth-child(2) .lb-rank,
.lb-list li:nth-child(3) .lb-rank { font-size: 1.15rem; }
.lb-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-list li.me .lb-name { color: var(--gold); font-weight: 700; }
.lb-score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.lb-empty { color: var(--muted); padding: 18px 0; }

/* Konfetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -4vh;
  width: 8px; height: 14px;
  border-radius: 2px;
  opacity: 0.9;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.7; }
}

.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .grain, .aurora { animation: none !important; }
}
