/* WauDoku – Stylesheet */
@font-face {
  font-family: 'Nunito'; font-style: normal; font-weight: 600 900; font-display: swap;
  src: url(../assets/fonts/nunito-latin.woff2) format('woff2');
}
:root {
  --bg: #f7efe6;
  --bg-top: #fbf6f0;
  --panel: #fffaf5;
  --white: #ffffff;
  --brown: #7a4b40;
  --brown-soft: #a37c70;
  --chip: #f6ece2;
  --chip-text: #8c6458;
  --orange: #f2962a;
  --orange-dark: #d9771a;
  --green: #35b24a;
  --red: #e8473f;
  --pink: #ff6f91;
  --shadow: 0 4px 14px rgba(122, 75, 64, 0.12);
  --shadow-sm: 0 2px 6px rgba(122, 75, 64, 0.12);
  --bars: #e9dccd;
  --bg-bottom: #f3e6d8;
  --edge: #e6d6c7;
  --line: #f0e4d8;
  --toggle-off: #e3d5c8;
  --ghost: rgba(255, 255, 255, .6);
  --ghost-ring: #eadccf;
  --level-done: #fff4e2;
  --level-locked: #efe5da;
  --level-locked-text: #c8b3a5;
  --hint-bg: #fffbe9;
  --hint-border: #ffe08a;
  --flash-bg: #ffe1dc;
  --overlay: rgba(70, 40, 30, .45);
  --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23dccbb8' fill-opacity='.55'%3E%3Cellipse cx='30' cy='38' rx='9' ry='7'/%3E%3Ccircle cx='20' cy='26' r='4'/%3E%3Ccircle cx='27' cy='20' r='4'/%3E%3Ccircle cx='35' cy='20' r='4'/%3E%3Ccircle cx='41' cy='27' r='4'/%3E%3Cellipse cx='88' cy='96' rx='9' ry='7'/%3E%3Ccircle cx='78' cy='84' r='4'/%3E%3Ccircle cx='85' cy='78' r='4'/%3E%3Ccircle cx='93' cy='78' r='4'/%3E%3Ccircle cx='99' cy='85' r='4'/%3E%3C/g%3E%3C/svg%3E");
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}
/* Eigener Dunkelmodus – damit der Browser die Seite nicht selbst einfärbt.
 * Die Kachelfarben bleiben bewusst unverändert. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #251d1a;
    --bg-top: #2c2320;
    --bg-bottom: #201916;
    --panel: #302724;
    --white: #3b302c;
    --brown: #f4e4d8;
    --brown-soft: #c9ac9e;
    --chip: #473934;
    --chip-text: #e6cabc;
    --shadow: 0 4px 14px rgba(0, 0, 0, .35);
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, .3);
    --bars: #171210;
    --edge: #221a17;
    --line: #463833;
    --toggle-off: #5a4a44;
    --ghost: rgba(255, 255, 255, .06);
    --ghost-ring: #4a3c37;
    --level-done: #4a3622;
    --level-locked: #2c2421;
    --level-locked-text: #6e5d56;
    --hint-bg: #3d3420;
    --hint-border: #8a7330;
    --flash-bg: #5a2a26;
    --overlay: rgba(0, 0, 0, .6);
    --pattern: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='%23ffffff' fill-opacity='.04'%3E%3Cellipse cx='30' cy='38' rx='9' ry='7'/%3E%3Ccircle cx='20' cy='26' r='4'/%3E%3Ccircle cx='27' cy='20' r='4'/%3E%3Ccircle cx='35' cy='20' r='4'/%3E%3Ccircle cx='41' cy='27' r='4'/%3E%3Cellipse cx='88' cy='96' rx='9' ry='7'/%3E%3Ccircle cx='78' cy='84' r='4'/%3E%3Ccircle cx='85' cy='78' r='4'/%3E%3Ccircle cx='93' cy='78' r='4'/%3E%3Ccircle cx='99' cy='85' r='4'/%3E%3C/g%3E%3C/svg%3E");
  }
  .round-btn img[src$="back.svg"], .round-btn img[src$="settings.svg"] { filter: brightness(2.6) saturate(.6); }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--brown);
  background-color: var(--bars);
  /* Seitenbalken auf breiten Bildschirmen: dezentes Pfotenmuster */
  background-image: var(--pattern);
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
img { -webkit-user-drag: none; user-select: none; pointer-events: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
button:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg) 55%, var(--bg-bottom) 100%);
}
@media (min-width: 520px) {
  #app { box-shadow: 0 0 0 1px rgba(122, 75, 64, .08), 0 10px 50px rgba(122, 75, 64, .25); }
}
@media (min-width: 520px) and (min-height: 760px) {
  #app { max-height: 940px; top: 50%; transform: translateY(-50%); border-radius: 28px; }
}

/* ---------- Screens ---------- */
.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: calc(var(--safe-top) + 10px) 16px calc(var(--safe-bottom) + 12px);
  opacity: 0; pointer-events: none;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
}
.screen.active { opacity: 1; pointer-events: auto; transform: none; }

.top-bar { display: flex; align-items: center; justify-content: space-between; height: 52px; flex: none; }
.title { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: .2px; }
.title-block { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.game-score { font-size: 14px; font-weight: 800; color: var(--orange-dark); font-variant-numeric: tabular-nums; }
.game-score.bump { animation: pulse .35s; }
.round-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--white); box-shadow: var(--shadow-sm);
  display: grid; place-items: center; transition: transform .12s;
}
.round-btn img { width: 22px; height: 22px; object-fit: contain; }
.round-btn:active { transform: scale(.9); }
.round-btn.placeholder { visibility: hidden; }

/* ---------- Home ---------- */
.home-top { display: flex; justify-content: flex-end; height: 52px; flex: none; }
.home-hero { text-align: center; margin-top: 2vh; }
.home-icon { width: 96px; height: 96px; border-radius: 26px; box-shadow: var(--shadow); }
.logo { margin: 12px 0 0; font-size: 46px; font-weight: 900; letter-spacing: -.5px; line-height: 1; color: var(--brown); }
.logo .logo-doku { color: var(--orange); }
.tagline { margin: 8px 0 0; color: var(--brown-soft); font-weight: 700; font-size: 15px; }
.home-cat { display: block; width: min(62%, 260px); margin: auto auto 0; filter: drop-shadow(0 8px 12px rgba(122,75,64,.18)); animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-1deg); } }
.home-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.home-row { display: flex; gap: 12px; }
.home-row > * { flex: 1; }
.home-stats { text-align: center; color: var(--brown-soft); font-size: 13px; font-weight: 700; min-height: 18px; margin-top: 12px; }
.home-stats b { color: var(--orange-dark); }
.home-privacy { display: block; margin: 4px auto 0; font-size: 12.5px; font-weight: 700; color: var(--brown-soft); text-decoration: underline; text-underline-offset: 2px; padding: 4px 10px; }

.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; padding: 10px 20px;
  border-radius: 999px; background: linear-gradient(180deg, #ffad42, var(--orange));
  color: #fff; font-size: 20px; font-weight: 900; letter-spacing: .3px;
  box-shadow: 0 5px 0 var(--orange-dark), 0 8px 18px rgba(242, 150, 42, .35);
  transition: transform .1s, box-shadow .1s;
  text-shadow: 0 1px 1px rgba(160, 80, 0, .35);
}
.btn-primary:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--orange-dark), 0 4px 10px rgba(242,150,42,.3); }
.btn-primary img { width: 24px; height: 24px; }
.btn-primary.big { flex-direction: column; gap: 0; min-height: 72px; }
.btn-title { font-size: 26px; line-height: 1.1; }
.btn-sub { font-size: 14px; font-weight: 800; opacity: .92; }
.btn-secondary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px; padding: 8px 18px; border-radius: 999px;
  background: var(--white); color: var(--brown); font-size: 17px; font-weight: 800;
  box-shadow: 0 4px 0 var(--edge), var(--shadow-sm);
  transition: transform .1s, box-shadow .1s;
}
.btn-secondary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.btn-secondary img { width: 26px; height: 26px; }
.daily-check { color: var(--green); font-weight: 900; }
.btn-ghost {
  min-height: 44px; border-radius: 999px; background: var(--ghost);
  font-weight: 800; font-size: 15px; color: var(--brown-soft); box-shadow: inset 0 0 0 2px var(--ghost-ring);
}
.btn-ghost:active { background: var(--white); }
.btn-link { display: block; margin: 12px auto 0; font-weight: 800; color: var(--brown-soft); font-size: 15px; padding: 6px 12px; }
.btn-link.danger { color: var(--red); }

/* ---------- Level-Auswahl ---------- */
.level-grid {
  flex: 1; overflow-y: auto; margin: 10px -16px 0; padding: 6px 16px 24px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-content: start;
}
.level-btn {
  aspect-ratio: 1; border-radius: 16px; background: var(--white); box-shadow: 0 3px 0 var(--edge);
  display: grid; place-items: center; font-weight: 900; font-size: 18px; position: relative;
}
.level-btn.done { background: var(--level-done); color: var(--orange-dark); }
.level-btn.done::after { content: '★'; position: absolute; top: 2px; right: 6px; font-size: 12px; color: #f6b928; }
.level-btn.current { background: var(--orange); color: #fff; box-shadow: 0 3px 0 var(--orange-dark); animation: pulse 1.6s ease-in-out infinite; }
.level-btn.locked { background: var(--level-locked); color: var(--level-locked-text); box-shadow: none; pointer-events: none; }
.level-btn.hard::before { content: ''; position: absolute; bottom: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* ---------- Spiel ---------- */
.status-row { display: flex; justify-content: center; gap: 10px; margin-top: 6px; flex: none; }
.pill {
  display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px;
  background: var(--white); border-radius: 999px; box-shadow: var(--shadow-sm);
  font-weight: 900; font-size: 18px;
}
.pill img { width: 24px; height: 24px; object-fit: contain; }
#cat-counter b { color: var(--green); margin-left: 2px; }
#cat-counter span { color: var(--brown-soft); }
#cat-counter i { font-style: normal; }
.hearts { gap: 2px; padding: 0 10px; }
.hearts .heart { width: 22px; height: 22px; transition: transform .3s, filter .3s, opacity .3s; }
.hearts .heart.lost { filter: grayscale(1) brightness(1.6); opacity: .35; transform: scale(.85); }
.hearts .heart.breaking { animation: heartbreak .6s ease; }
@keyframes heartbreak { 0% { transform: scale(1); } 30% { transform: scale(1.5) rotate(-12deg); } 100% { transform: scale(.85); } }
.timer { font-size: 15px; color: var(--brown-soft); }
.timer img { width: 20px; height: 20px; }
.timer.hidden { display: none; }

.rules-card {
  display: flex; gap: 6px; margin-top: 12px; padding: 6px;
  background: var(--white); border-radius: 14px; box-shadow: var(--shadow-sm); flex: none;
}
.rule-chip {
  flex: 1; display: grid; place-items: center; text-align: center;
  min-height: 46px; padding: 4px 6px; border-radius: 10px;
  background: var(--chip); color: var(--chip-text);
  font-size: 12.5px; font-weight: 700; line-height: 1.2; transition: background .25s, color .25s, box-shadow .25s;
}
.rule-chip.flash { background: var(--flash-bg); color: var(--red); box-shadow: inset 0 0 0 2px var(--red); animation: shake .4s; }

.board-area { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.board-wrap { position: relative; }
.board {
  --n: 5; --gap: 4px;
  display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: var(--gap);
  padding: 6px; background: var(--white); border-radius: 14px; box-shadow: var(--shadow);
  touch-action: none;
}
.board.enter .cell { animation: cellIn .4s backwards; animation-delay: calc(var(--d) * 18ms); }
@keyframes cellIn { from { transform: scale(.4); opacity: 0; } }
.board.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.cell {
  position: relative; aspect-ratio: 1; border-radius: var(--r, 5px);
  background: var(--c); cursor: pointer; overflow: hidden;
  transition: filter .2s, opacity .2s;
}
.cell::before { /* leichte 3D-Kante wie im Original */
  content: ''; position: absolute; inset: 0; border-radius: inherit;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.08), inset 0 1px 0 rgba(255,255,255,.18);
  pointer-events: none;
}
.cell.x::after, .cell.err::after {
  content: ''; position: absolute; inset: 18%;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M8 8L32 32M32 8L8 32' stroke='%23fff' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E");
  animation: pop .18s ease-out;
}
.cell.err::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M8 8L32 32M32 8L8 32' stroke='%23f2582a' stroke-width='7' stroke-linecap='round'/%3E%3C/svg%3E");
}
.cell.err { animation: shake .35s; }
.cell.cat { background: color-mix(in srgb, var(--c) 78%, #ffffff); }
.cell.cat img {
  position: absolute; inset: 6%; width: 88%; height: 88%; object-fit: contain;
  animation: catIn .35s cubic-bezier(.3, 1.6, .5, 1);
}
@keyframes catIn { from { transform: scale(0) rotate(-20deg); } }
@keyframes pop { from { transform: scale(.3); opacity: .2; } }
.cell.located { box-shadow: 0 0 0 3px #ffd84a inset; }

.board.hinting .cell:not(.focus) { filter: saturate(.5) brightness(.78); opacity: .7; }
.cell.focus { z-index: 1; }
.cell.target { animation: targetPulse 1s ease-in-out infinite; z-index: 2; }
.cell.target::before { box-shadow: inset 0 0 0 3px #fff, 0 0 10px 2px #ffe266; }
@keyframes targetPulse { 50% { filter: brightness(1.15); } }

.rules-wrap { position: relative; flex: none; }
.hint-banner[hidden] { display: none; }
.hint-banner {
  position: absolute; top: 9px; bottom: -3px; left: -3px; right: -3px; z-index: 5;
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--hint-bg); border-radius: 14px; box-shadow: var(--shadow); border: 2px solid var(--hint-border);
  animation: slideDown .25s ease-out;
}
.hint-banner img { width: 24px; height: 38px; object-fit: contain; flex: none; }
.hint-banner p { margin: 0; font-size: 13.5px; font-weight: 700; line-height: 1.3; }
@keyframes slideDown { from { transform: translateY(-12px); opacity: 0; } }

.difficulty-tag {
  margin-top: 10px; padding: 3px 14px; border-radius: 999px; background: var(--red); color: #fff;
  font-weight: 900; font-size: 13px; letter-spacing: .5px; text-transform: uppercase;
}

.combo { position: absolute; inset: 0; pointer-events: none; display: grid; place-items: center; }
.combo-word {
  position: absolute; padding: 6px 18px; border-radius: 999px; background: var(--white);
  font-weight: 900; font-size: 26px; box-shadow: 0 4px 14px rgba(0,0,0,.15);
  animation: comboUp 1.1s ease-out forwards; white-space: nowrap;
}
.combo-word.w1 { color: #3bb34b; } .combo-word.w2 { color: #3b8fd1; } .combo-word.w3 { color: var(--orange); }
.combo-word.w4 { color: #ef3d4a; } .combo-word.w5 { color: #d24ad6; }
.combo-word.w6 { background-image: linear-gradient(90deg, #35c4f0, #a066f0, #f04ad1); -webkit-background-clip: text; background-clip: text; color: transparent; box-shadow: none; text-shadow: none; filter: drop-shadow(0 0 3px #fff) drop-shadow(0 2px 5px rgba(0,0,0,.2)); }
@keyframes comboUp {
  0% { transform: translateY(10px) scale(.5); opacity: 0; }
  20% { transform: translateY(0) scale(1.1); opacity: 1; }
  30% { transform: scale(1); }
  80% { opacity: 1; }
  100% { transform: translateY(-40px); opacity: 0; }
}

.toolbar { display: flex; justify-content: space-around; align-items: flex-end; flex: none; padding-top: 8px; }
.tool { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 72px; }
.tool-icon {
  width: 58px; height: 58px; border-radius: 50%; background: var(--white); box-shadow: 0 4px 0 var(--edge), var(--shadow-sm);
  display: grid; place-items: center; transition: transform .1s, box-shadow .1s;
}
.tool-icon img { width: 36px; height: 36px; object-fit: contain; }
.tool-icon.broom svg { width: 34px; height: 34px; }
.tool:active .tool-icon { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge); }
.tool-label { font-size: 12px; font-weight: 800; color: var(--brown-soft); }
.badge {
  position: absolute; top: -4px; right: 2px; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: #e0403a; color: #fff; font-weight: 900; font-size: 13px;
  display: grid; place-items: center; border: 2px solid var(--white);
}
.badge.empty { background: #c9b6a9; }
.tool.disabled { opacity: .45; }
.tool.bump .tool-icon { animation: pulse .3s; }

/* ---------- Dialoge ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 20px;
  background: var(--overlay); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fadeIn .2s ease-out;
}
.overlay[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.dialog {
  position: relative; width: 100%; max-width: 360px; max-height: 100%; overflow-y: auto;
  background: var(--panel); border-radius: 26px; padding: 24px 20px 18px;
  text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,.25);
  animation: dlgIn .35s cubic-bezier(.3, 1.5, .5, 1);
}
@keyframes dlgIn { from { transform: scale(.7); opacity: 0; } }
.dialog h3 { margin: 0 0 14px; font-size: 24px; font-weight: 900; }
.dialog p { margin: 0 0 16px; color: var(--brown-soft); font-weight: 700; }
.dialog .btn-primary, .dialog .btn-secondary { margin-top: 10px; }
.dlg-close {
  position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--chip); font-weight: 900; font-size: 16px; color: var(--brown-soft);
}

.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 800; cursor: pointer; }
.setting small { display: block; font-size: 12px; color: var(--brown-soft); font-weight: 700; }
.setting input { position: absolute; opacity: 0; pointer-events: none; }
.setting i { flex: none; width: 52px; height: 30px; border-radius: 999px; background: var(--toggle-off); position: relative; transition: background .2s; }
.setting i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.setting input:checked + i { background: var(--green); }
.setting input:checked + i::after { transform: translateX(22px); }
.setting-actions { margin-top: 10px; }
.privacy { text-align: left; }
.privacy ul { margin: 0 0 14px; padding: 0; list-style: none; }
.privacy li { position: relative; padding: 7px 0 7px 30px; font-weight: 700; font-size: 14.5px; border-bottom: 1px solid var(--line); }
.privacy li::before { content: '✓'; position: absolute; left: 4px; top: 6px; color: var(--green); font-weight: 900; }
.privacy p { font-size: 13.5px; margin-bottom: 10px; }
.privacy a { color: var(--orange-dark); }

.rules .rule { display: flex; align-items: center; gap: 14px; text-align: left; margin-bottom: 12px; }
.rules .rule img { width: 86px; height: 86px; flex: none; border-radius: 12px; background: var(--white); box-shadow: var(--shadow-sm); }
.rules .rule p { margin: 0; font-size: 14.5px; color: var(--brown); font-weight: 700; }
.rules .rule b { display: block; font-weight: 900; }
.controls-help { background: var(--chip); border-radius: 14px; padding: 10px 14px; text-align: left; margin: 4px 0 6px; }
.controls-help p { margin: 3px 0; font-size: 14px; color: var(--chip-text); }
.desktop-only { display: none; }
@media (hover: hover) and (pointer: fine) { .desktop-only { display: block; } }

.win-rays {
  position: absolute; left: 50%; top: 38%; width: 900px; height: 900px; margin: -450px 0 0 -450px;
  background: repeating-conic-gradient(rgba(255, 220, 120, .28) 0 10deg, transparent 10deg 20deg);
  border-radius: 50%; mask-image: radial-gradient(circle, #000 20%, transparent 65%); -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 65%);
  animation: spin 18s linear infinite; pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.dialog.win { overflow: visible; padding-top: 72px; margin-top: 110px; }
.win-cat { position: absolute; left: 50%; top: -106px; width: 170px; transform: translateX(-50%); filter: drop-shadow(0 8px 10px rgba(0,0,0,.2)); animation: catIn .6s cubic-bezier(.3, 1.6, .5, 1); }
.win-word {
  position: absolute; left: 50%; top: -172px; transform: translateX(-50%) rotate(-4deg); z-index: 2; white-space: nowrap;
  font-size: 54px; font-weight: 900; letter-spacing: .5px; color: #ffb03a;
  text-shadow: 0 -3px 0 #8e1f22, 3px 0 0 #8e1f22, 0 3px 0 #8e1f22, -3px 0 0 #8e1f22,
    2px 2px 0 #8e1f22, -2px 2px 0 #8e1f22, 2px -2px 0 #8e1f22, -2px -2px 0 #8e1f22, 0 7px 0 #6d1518, 0 10px 14px rgba(0,0,0,.3);
  animation: wordIn .7s .15s cubic-bezier(.3, 1.6, .5, 1) backwards;
}
@keyframes wordIn { from { transform: translateX(-50%) scale(0) rotate(-30deg); } }
.win-stars { display: flex; justify-content: center; gap: 6px; margin: -4px 0 12px; }
.win-stars img { width: 46px; height: 46px; animation: catIn .5s cubic-bezier(.3, 1.6, .5, 1) backwards; }
.win-stars img:nth-child(2) { width: 58px; height: 58px; margin-top: -10px; }
.win-stars img.dim { filter: grayscale(1) brightness(1.3); opacity: .35; }
.win-stats { display: flex; justify-content: center; gap: 12px; margin-bottom: 10px; }
.win-stats div { display: flex; align-items: center; gap: 6px; background: var(--chip); padding: 6px 14px; border-radius: 999px; font-weight: 900; font-size: 17px; }
.win-stats img { width: 22px; height: 22px; object-fit: contain; }
.win-score { margin: 0 0 6px; font-size: 30px; font-weight: 900; color: var(--orange-dark); font-variant-numeric: tabular-nums; }
.win-score small { display: block; font-size: 13px; font-weight: 800; color: var(--brown-soft); }
.win-score .record { color: var(--green); }
.win-reward { min-height: 20px; font-size: 14px; }
.dialog.fail { padding-top: 10px; }
.fail-cat { width: 150px; margin: 0 auto 6px; display: block; animation: catIn .5s cubic-bezier(.3, 1.6, .5, 1); }

.toast {
  position: absolute; left: 50%; bottom: calc(130px + var(--safe-bottom)); z-index: 60;
  transform: translateX(-50%); max-width: 90%;
  padding: 10px 18px; border-radius: 999px; background: rgba(80, 48, 40, .92); color: #fff;
  font-weight: 800; font-size: 15px; text-align: center; animation: slideDown .25s;
}
.toast[hidden] { display: none; }

.confetti { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; z-index: 49; pointer-events: none; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

@media (max-height: 640px) {
  .rules-card { margin-top: 8px; }
  .rule-chip { min-height: 36px; font-size: 11.5px; }
  .tool-icon { width: 50px; height: 50px; }
  .tool-icon img { width: 30px; height: 30px; }
  .home-icon { width: 72px; height: 72px; }
  .logo { font-size: 38px; }
}
/* Handy quer: wenig Höhe – Regelkarte ausblenden, alles etwas kompakter */
@media (max-height: 500px) {
  .screen { padding-top: calc(var(--safe-top) + 4px); padding-bottom: calc(var(--safe-bottom) + 4px); }
  .top-bar { height: 44px; }
  .round-btn { width: 38px; height: 38px; }
  .title { font-size: 20px; }
  .status-row { margin-top: 2px; }
  .pill { height: 30px; font-size: 16px; }
  .rules-card { display: none; }
  .hint-banner { top: 4px; bottom: auto; }
  .toolbar { padding-top: 4px; }
  .tool-icon { width: 44px; height: 44px; }
  .tool-icon img, .tool-icon.broom svg { width: 26px; height: 26px; }
  .tool-label { font-size: 11px; }
  .home-top { height: 40px; }
  .home-hero { margin-top: 0; }
  .home-icon { width: 52px; height: 52px; border-radius: 14px; }
  .logo { margin-top: 4px; font-size: 32px; }
  .tagline { font-size: 13px; margin-top: 4px; }
  .home-cat { display: none; }
  .home-actions { margin-top: auto; gap: 8px; }
  .btn-primary.big { min-height: 58px; }
  .btn-secondary { min-height: 42px; }
  .home-stats { margin-top: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
