:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Comic Sans MS", system-ui, sans-serif;
  --ink: #3d2a17;
  --brown: #6d421c;
  --gold: #e3a72f;
  --parchment: #f3dfad;
  --parchment-dark: #d0a35e;
  --green: #3f6b44;
}
* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 12%, rgba(151, 89, 38, .24), transparent 20rem),
    radial-gradient(circle at 92% 8%, rgba(227, 167, 47, .28), transparent 18rem),
    linear-gradient(135deg, #b77b3a, #efd08a 40%, #8f5c2f);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: .22;
  background-image: repeating-linear-gradient(35deg, rgba(74,45,20,.25), rgba(74,45,20,.25) 1px, transparent 1px, transparent 16px);
}
.hidden { display: none !important; }
#app { min-height: 100vh; padding: max(22px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left)); }
.login-card, .dashboard {
  width: min(1180px, 100%);
  margin: 0 auto;
}
.login-card {
  margin-top: 9vh;
  padding: 42px;
  text-align: center;
  border: 8px double #7b4b24;
  border-radius: 30px;
  background: var(--parchment);
  box-shadow: 0 24px 80px rgba(45, 25, 5, .38), inset 0 0 80px rgba(109, 66, 28, .20);
}
.map-title { font-size: clamp(34px, 6vw, 68px); font-weight: 900; }
.login-card p { font-size: 24px; }
form { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
input, button {
  font: inherit;
  font-weight: 800;
  font-size: 24px;
  border: 4px solid var(--brown);
  border-radius: 18px;
  padding: 18px 22px;
}
input { width: min(360px, 100%); text-align: center; background: #fff5d1; }
button { background: #ffcf4a; color: #3d2a17; box-shadow: 0 7px 0 #9f681f; }
button:active { transform: translateY(5px); box-shadow: 0 2px 0 #9f681f; }
.error { color: #9d1b1b; font-weight: 900; min-height: 1.5em; }
.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 28px 34px;
  border: 8px double #70461f;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(255,242,197,.95), rgba(225,187,110,.95));
  box-shadow: 0 20px 60px rgba(50, 28, 6, .33);
}
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .14em; color: #7a3f1e; font-weight: 900; }
h1 { margin: 0; font-size: clamp(42px, 7vw, 84px); line-height: .95; }
.subtitle { margin: 10px 0 0; font-size: clamp(19px, 2.5vw, 28px); }
.treasure-total {
  min-width: 190px;
  padding: 20px;
  text-align: center;
  border: 5px solid #754717;
  border-radius: 24px;
  background: #2f1e12;
  color: #ffe9a7;
}
.treasure-total span { display: block; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.treasure-total strong { display: block; font-size: clamp(44px, 7vw, 76px); color: #ffd451; }
.kids-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 24px 0; }
.kid-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 7px solid #76501f;
  border-radius: 34px;
  background:
    radial-gradient(circle at 92% 8%, rgba(227,167,47,.35), transparent 9rem),
    linear-gradient(145deg, #f8e8b8, #e0bb70);
  box-shadow: 0 18px 45px rgba(54, 30, 5, .25), inset 0 0 70px rgba(125, 75, 28, .18);
}
.kid-card::after {
  content: "✕";
  position: absolute; right: 24px; top: 18px;
  color: rgba(134,31,31,.35);
  font-size: 74px; font-weight: 900;
  transform: rotate(12deg);
}
.kid-top { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.kid-name { font-size: clamp(36px, 5vw, 62px); margin: 0; }
.avatar { font-size: 54px; filter: drop-shadow(0 3px 0 rgba(80,44,9,.3)); }
.progress-wrap { margin: 18px 0 16px; }
.progress-label { display: flex; justify-content: space-between; font-size: 22px; font-weight: 900; }
.progress { height: 24px; border: 4px solid #694016; border-radius: 999px; background: #8b5a2b; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, #5e9d55, #ffd451); width: 0%; transition: width .7s cubic-bezier(.2,.8,.2,1); }
.chores { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 12px; }
.chore {
  display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px;
  padding: 14px;
  border: 3px dashed rgba(92,58,25,.55);
  border-radius: 18px;
  font-size: clamp(21px, 2.4vw, 28px);
  font-weight: 900;
  background: rgba(255,246,210,.55);
}
.box {
  width: 38px; height: 38px;
  border: 4px solid #553313;
  border-radius: 10px;
  display: grid; place-items: center;
  background: #f8e8b8;
}
.chore.done .box { background: #5e9d55; color: white; }
.chore.done .title { text-decoration: line-through; opacity: .68; }
.badge { font-size: 15px; padding: 7px 10px; border-radius: 999px; background: rgba(89,54,22,.13); text-transform: uppercase; letter-spacing: .05em; }
.allowance {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-top: 14px;
}
.allowance div { padding: 14px 10px; border-radius: 18px; background: rgba(68,42,18,.15); text-align: center; font-weight: 900; }
.allowance span { display: block; font-size: 15px; text-transform: uppercase; color: #70401c; }
.allowance strong { display: block; font-size: 32px; }
.earned { color: #285f31; }
.locked { color: #8d2424; }
.logbook {
  padding: 24px;
  border: 6px solid #70461f;
  border-radius: 28px;
  background: rgba(255, 237, 179, .9);
}
.log-head { display:flex; justify-content:space-between; gap: 12px; align-items:center; }
.log-head h2 { margin: 0; font-size: 32px; }
#forget { font-size: 16px; padding: 10px 14px; border-width: 3px; border-radius: 14px; }
#events { margin: 16px 0 0; padding-left: 24px; font-weight: 800; font-size: 18px; max-height: 220px; overflow:auto; }
#events li { margin: 8px 0; }
.animation {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  pointer-events: none;
  background: rgba(41, 22, 6, .15);
  z-index: 20;
}
.animation > * { grid-area: 1 / 1; }
.coin { font-size: 150px; animation: coinDrop 1.2s ease-out both; }
.stamp {
  transform: rotate(-10deg);
  padding: 22px 34px;
  border: 9px solid #8c1717;
  border-radius: 18px;
  color: #8c1717;
  background: rgba(255,235,188,.86);
  font-weight: 1000;
  font-size: clamp(44px, 8vw, 96px);
  text-transform: uppercase;
  animation: stamp .9s .22s cubic-bezier(.2,1.4,.25,1) both;
}
.sparkles { font-size: 80px; transform: translateY(120px); animation: sparkle 1.4s .3s both; }
@keyframes coinDrop { from { transform: translateY(-45vh) rotate(-160deg) scale(.3); opacity: 0; } 55% { opacity: 1; } to { transform: translateY(-58px) rotate(12deg) scale(1); opacity: 0; } }
@keyframes stamp { from { opacity: 0; transform: rotate(-10deg) scale(2.3); } 55% { opacity: 1; transform: rotate(-10deg) scale(.9); } to { opacity: 0; transform: rotate(-10deg) scale(1.05); } }
@keyframes sparkle { from { opacity: 0; transform: translateY(70px) scale(.5); } 40% { opacity: 1; } to { opacity: 0; transform: translateY(-80px) scale(1.4); } }
@media (max-width: 850px) {
  #app { padding: 14px; }
  .hero { grid-template-columns: 1fr; }
  .kids-grid { grid-template-columns: 1fr; }
  .allowance { grid-template-columns: 1fr; }
}

.parent-review-button { font-size: 18px; padding: 14px 18px; z-index: 1; }
.balance-badge {
  min-width: 112px; padding: 12px 16px; text-align: center; z-index: 1;
  border: 4px solid #754717; border-radius: 20px; background: #2f1e12; color: #ffe9a7;
}
.balance-badge span, .balance-badge strong { display: block; }
.balance-badge strong { color: #ffd451; font-size: 38px; }
.week-total { margin: 2px 0 0; font-weight: 900; color: #70401c; }
.chore-row {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center;
  padding: 10px; border: 3px dashed rgba(92,58,25,.55); border-radius: 18px;
  background: rgba(255,246,210,.55);
}
.chore-toggle {
  min-width: 0; display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 12px;
  padding: 5px; border: 0; border-radius: 12px; background: transparent; box-shadow: none; text-align: left;
}
.chore-toggle:active { transform: none; box-shadow: none; }
.chore-copy { min-width: 0; display: flex; flex-direction: column; }
.chore-copy .title { font-size: clamp(20px, 2.4vw, 27px); font-weight: 900; }
.chore-copy small { font-size: 14px; color: #70401c; }
.chore-row.done .box { background: #5e9d55; color: white; }
.chore-row.done .title { text-decoration: line-through; opacity: .72; }
.chore-row.status-pending { border-color: #b37b1b; }
.chore-row.status-approved { border-color: #3f6b44; }
.chore-row.status-denied { border-color: #9d1b1b; }
.count-button { font-size: 14px; padding: 9px 10px; border-width: 2px; border-radius: 12px; box-shadow: 0 3px 0 #9f681f; }
.day-details { grid-column: 1 / -1; list-style: none; padding: 8px 10px; margin: 0; border-radius: 12px; background: rgba(68,42,18,.10); }
.day-details li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 14px; }
.status-approved { color: #285f31; }
.status-pending { color: #8a5c05; }
.status-denied { color: #9d1b1b; }
.kid-owed { background: rgba(47,30,18,.92) !important; color: #ffe9a7; }
.kid-owed span { color: #ffe9a7; }
.kid-owed strong { color: #ffd451; }
.parent-panel {
  margin: 24px 0; padding: 24px; border: 6px solid #70461f; border-radius: 28px;
  background: rgba(255, 237, 179, .96); box-shadow: 0 18px 45px rgba(54,30,5,.25);
}
#parent-pin-form { margin: 22px 0; }
#close-parent { font-size: 15px; padding: 9px 12px; border-width: 2px; }
.parent-approval-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; }
.approval-toggle { font-size: 17px; padding: 14px; }
.approval-toggle.approved { background: #7fbd70; }
.review-list { display: grid; gap: 10px; }
.review-item { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: rgba(68,42,18,.12); }
.review-item div:first-child { display: flex; flex-direction: column; }
.review-actions { display: flex; gap: 8px; }
.review-actions button { font-size: 15px; padding: 10px 12px; border-width: 2px; }
.review-actions .deny { background: #dc8b77; }
.all-reviewed { font-size: 20px; font-weight: 900; color: #285f31; }
@media (max-width: 600px) {
  .chore-row { grid-template-columns: 1fr; }
  .count-button { width: 100%; }
  .parent-approval-grid { grid-template-columns: 1fr; }
  .review-item { align-items: stretch; flex-direction: column; }
  .review-actions button { flex: 1; }
}
