* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, sans-serif;
  color: #fff; background: #0b3d6b; overflow: hidden; user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
body.light { color: #222; overflow: auto; }
#app { position: fixed; inset: 0; }
body.light #app { position: static; }

.stage { position: absolute; inset: 0; }
.stage canvas { display: block; width: 100%; height: 100%; }

/* HUD über der 3D-Szene */
.hud { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center;
       padding: max(12px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom)); }
.hud .top { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.kid { background: var(--kid); color: #fff; font-weight: 800; font-size: 20px; padding: 6px 14px; border-radius: 999px;
       box-shadow: 0 3px 0 rgba(0,0,0,.25); display: inline-block; }
.theme { font-weight: 700; font-size: 16px; opacity: .9; text-shadow: 0 2px 4px rgba(0,0,0,.4); }
.counter { margin-top: 3vh; display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,.25);
           padding: 4px 22px 4px 14px; border-radius: 999px; backdrop-filter: blur(4px); }
.counter .cemoji { font-size: 44px; }
.counter .num { font-size: 64px; font-weight: 900; min-width: 1.2ch; text-align: center; text-shadow: 0 3px 0 rgba(0,0,0,.3); }
.num.bump { animation: bump .5s cubic-bezier(.3,1.8,.5,1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.7); color: #ffe066; } 100% { transform: scale(1); } }

.bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.hint { margin-bottom: 2vh; font-size: 30px; font-weight: 800; animation: pulse 1.1s ease-in-out infinite;
        text-shadow: 0 3px 8px rgba(0,0,0,.5); }
@keyframes pulse { 50% { transform: scale(1.12); } }
.msg { font-size: 30px; font-weight: 900; text-align: center; text-shadow: 0 3px 8px rgba(0,0,0,.5);
       animation: popin .5s cubic-bezier(.3,1.6,.5,1); }
.msg small { font-size: 18px; font-weight: 700; opacity: .9; }
@keyframes popin { from { transform: scale(.3); opacity: 0; } }
.hidden { display: none !important; }
.row { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 420px; font-size: 32px; min-height: 8px; }
.row .new { animation: popin .5s cubic-bezier(.3,1.8,.5,1); }
.actions { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-top: 14px; pointer-events: auto; }

.btn { display: inline-block; border: 0; cursor: pointer; text-decoration: none; font: inherit; font-weight: 800; font-size: 20px;
       padding: 12px 22px; border-radius: 16px; background: #fff; color: #333; box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.btn.small { font-size: 16px; padding: 8px 16px; background: rgba(255,255,255,.85); }
.btn.moon { background: #3b3f9e; color: #fff; }
.btn.gold { background: #ffc53d; color: #4a3000; }
.btn.huge { font-size: 28px; padding: 20px 34px; border-radius: 24px; animation: pulse 1.4s ease-in-out infinite; }
.btn.dim { opacity: .55; }

.center-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 24px; text-align: center; }
.center-msg .big { font-size: 110px; }
.center-msg p { font-size: 20px; }

/* Bonus-Auswahl */
.picker { position: absolute; inset: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 16px; color: #3a2400; }
.picker h2 { margin: 6px 0; }
.picker .grid { display: grid; grid-template-columns: repeat(2, minmax(0, 170px)); gap: 12px; }
.picker button { border: 0; border-radius: 18px; background: #fff8e0; padding: 14px 8px; font: inherit; font-weight: 800; font-size: 16px;
                 color: #3a2400; box-shadow: 0 4px 0 rgba(0,0,0,.2); display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.picker button span { font-size: 40px; }

/* Übersicht */
.overview { max-width: 900px; margin: 0 auto; padding: 20px 14px 40px; }
.overview header h1 { margin: 0 0 6px; font-size: 30px; }
.overview .today { font-size: 17px; margin-bottom: 16px; }
.overview .kids { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.kidcard { background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.08); border-top: 8px solid var(--kid); }
.kidcard .kh { font-size: 22px; font-weight: 900; padding: 12px 16px 4px; }
.kidcard .score { display: flex; gap: 14px; padding: 0 16px 8px; font-size: 22px; font-weight: 800; flex-wrap: wrap; align-items: center; }
.kidcard .score .all { font-size: 15px; background: #fff3bf; padding: 3px 10px; border-radius: 999px; }
.tasks { list-style: none; margin: 0; padding: 0 10px; }
.tasks li { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid #f0ece2; color: #888; }
.tasks li.done { color: #222; }
.tasks li .e { font-size: 24px; width: 1.4em; text-align: center; filter: grayscale(1); opacity: .5; }
.tasks li.done .e { filter: none; opacity: 1; }
.tasks li .l { flex: 1; font-weight: 700; }
.tasks li small { font-weight: 700; color: #999; }
.tasks li .ck { width: 26px; height: 26px; border-radius: 50%; background: #eee; color: #fff; display: grid; place-items: center; font-weight: 900; }
.tasks li.done .ck { background: #3ab54a; }
.kbtns { display: flex; gap: 8px; padding: 12px; flex-wrap: wrap; }
.kbtns .btn { font-size: 15px; padding: 9px 14px; box-shadow: 0 3px 0 rgba(0,0,0,.15); background: #eee; }
.kbtns .btn.moon { background: #3b3f9e; } .kbtns .btn.gold { background: #ffc53d; }
.kbtns .undo.confirm { background: #e63946; color: #fff; }
.preview { margin-top: 26px; background: #fff; border-radius: 16px; padding: 4px 16px 12px; }
.preview p { margin: 8px 0 6px; color: #666; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { text-decoration: none; color: #222; background: #f0ece2; padding: 7px 12px; border-radius: 999px; font-weight: 700; font-size: 15px; }
.overview footer { margin-top: 20px; }
.overview footer a { color: #3b3f9e; font-weight: 800; }
