/* Apple Academy Preschool Parent App — styles. Mobile-first, big tap targets. */
:root {
  --cream: #fff9f2;
  --ink: #3a2e2a;
  --red: #e63946;
  --red-dark: #b01220;
  --yellow: #ffd166;
  --green: #58cc5e;
  --blue: #4d9de0;
  --purple: #9b5de5;
  --pink: #ff8fab;
  --orange: #ff9f1c;
  --grey: #b9b0a8;
  --white: #ffffff;
  --radius: 18px;
  --font-head: "Gochi Hand", cursive;
  --font-body: "Nunito", system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  padding-bottom: 92px; /* room for bottom nav */
}
h1, h2, h3, .gochi { font-family: var(--font-head); font-weight: 400; line-height: 1.2; }
button { font-family: var(--font-body); }

/* ---------- Class bar (top of every tab) ---------- */
.class-bar {
  position: sticky; top: 0; z-index: 40;
  background: var(--ink); color: var(--cream);
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 15px;
}
.class-bar strong { font-family: var(--font-head); font-size: 19px; letter-spacing: .3px; }
.class-bar button {
  background: transparent; color: var(--yellow);
  border: 2px solid var(--yellow); border-radius: 999px;
  padding: 8px 14px; font-size: 14px; font-weight: 700; cursor: pointer;
  min-height: 44px;
}

/* ---------- Tabs ---------- */
.tab { display: none; padding: 18px 16px 28px; max-width: 560px; margin: 0 auto; }
.tab.active { display: block; }

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; background: var(--white);
  border-top: 3px solid var(--red);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav button {
  flex: 1; border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 4px 8px; min-height: 68px;
  color: var(--ink); font-size: 13px; font-weight: 700;
}
.bottom-nav button .nav-emoji { font-size: 26px; line-height: 1; }
.bottom-nav button.active { color: var(--red); }
.bottom-nav button.active .nav-emoji { transform: scale(1.15); }

/* ---------- Buttons & cards ---------- */
.big-btn {
  display: block; width: 100%;
  background: var(--red); color: #fff; border: 0; border-radius: var(--radius);
  padding: 18px; font-size: 20px; font-weight: 800; cursor: pointer;
  min-height: 60px; margin: 12px 0;
  box-shadow: 0 4px 0 var(--red-dark);
}
.big-btn:active { transform: translateY(3px); box-shadow: none; }
.big-btn.green { background: var(--green); box-shadow: 0 4px 0 #35953a; }
.big-btn.blue { background: var(--blue); box-shadow: 0 4px 0 #2f6fa8; }
.big-btn.orange { background: var(--orange); box-shadow: 0 4px 0 #b96e00; }
.big-btn.ghost { background: var(--white); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.card {
  background: var(--white); border-radius: var(--radius);
  border: 3px solid var(--ink);
  padding: 18px; margin: 14px 0;
  box-shadow: 4px 4px 0 rgba(58,46,42,.12);
}
.card h2, .card h3 { margin: 0 0 8px; }
.hint {
  background: #fff3d6; border: 2px dashed var(--orange); border-radius: 14px;
  padding: 12px 14px; font-weight: 700; text-align: center; margin: 12px 0;
}

/* ---------- Setup overlay ---------- */
#setup-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: var(--cream);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 28px 18px 60px;
}
#setup-overlay[hidden] { display: none; }
#install-landing {
  position: fixed; inset: 0; z-index: 100;
  background: var(--cream);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 28px 18px 60px;
}
#install-landing[hidden] { display: none; }
.tagline { font-size: 18px; font-weight: 600; color: #6b5d55; margin: 6px 0 4px; }
.linklike {
  background: none; border: 0; cursor: pointer; color: var(--blue);
  font-size: 16px; font-weight: 700; text-decoration: underline; margin-top: 10px;
}
.setup-box { max-width: 520px; width: 100%; text-align: center; }
.setup-box .logo { width: 120px; height: 120px; border-radius: 50%; border: 4px solid var(--red); background: #fff; }
.setup-box h1 { font-size: 34px; color: var(--red); margin: 12px 0 4px; }
.class-pick {
  display: block; width: 100%; margin: 12px 0; padding: 20px 14px;
  background: var(--white); border: 4px solid var(--blue); border-radius: var(--radius);
  font-size: 19px; font-weight: 800; color: var(--ink); cursor: pointer; min-height: 72px;
}
.class-pick small { display: block; font-size: 15px; font-weight: 600; color: #6b5d55; }
.class-pick.selected { border-color: var(--red); background: #ffeef0; }
.text-input {
  width: 100%; padding: 16px; font-size: 20px; font-family: var(--font-body);
  border: 3px solid var(--ink); border-radius: 14px; margin: 10px 0;
}
.setup-nav { display: flex; gap: 10px; margin-top: 8px; }
.setup-nav .big-btn { margin: 0; }
.install-note { font-weight: 700; color: #6b5d55; margin: 4px 0 12px; }
.install-app-btn { margin-top: 16px; }

/* ---------- Today tab ---------- */
.greeting { font-size: 38px; margin: 4px 0 0; color: var(--ink); }
.class-big { font-family: var(--font-head); font-size: 30px; color: var(--red); margin: 0 0 6px; }
.section-title { font-size: 28px; margin: 26px 0 6px; color: var(--ink); }

/* Grouping game */
#tree-zone { position: relative; width: 100%; height: 300px; margin: 8px 0 4px; touch-action: none; }
#tree-zone svg.tree { position: absolute; inset: 0; width: 100%; height: 100%; }
.fruit {
  position: absolute; width: 58px; height: 58px; border-radius: 50%;
  touch-action: none; cursor: grab; z-index: 5;
  transition: transform .35s ease;
}
.fruit.apple {
  background: radial-gradient(circle at 32% 28%, #ffb3ab 0%, #f25c5c 28%, var(--red) 58%, var(--red-dark) 100%);
  box-shadow: inset -4px -6px 8px rgba(0,0,0,.18);
}
.fruit.apple::after {
  content: ""; position: absolute; left: 20%; top: 9%;
  width: 34%; height: 22%; background: rgba(255,255,255,.8);
  border-radius: 50%; transform: rotate(-25deg);
}
.fruit.apple::before {
  content: ""; position: absolute; left: 46%; top: -9px;
  width: 6px; height: 14px; background: #6b4a2f; border-radius: 3px;
}
.fruit.orange {
  background: radial-gradient(circle at 32% 28%, #ffe0b0 0%, #ffbf5e 28%, var(--orange) 58%, #d96a00 100%);
  box-shadow: inset -4px -6px 8px rgba(0,0,0,.15);
}
.fruit.orange::after {
  content: ""; position: absolute; left: 20%; top: 9%;
  width: 34%; height: 22%; background: rgba(255,255,255,.75);
  border-radius: 50%; transform: rotate(-25deg);
}
.fruit.dragging { transition: none; cursor: grabbing; z-index: 20; transform-origin: center; }
.fruit.placed { pointer-events: none; }
.barrels { display: flex; justify-content: space-around; gap: 12px; margin: 10px 0 4px; }
.barrel-wrap { text-align: center; flex: 1; }
.barrel {
  position: relative; width: 128px; height: 150px; margin: 0 auto;
  background: linear-gradient(to bottom, #b9834f 0%, #a5713f 40%, #8a5a2e 100%);
  border-radius: 16px 16px 26px 26px; border: 3px solid #6b4423;
  display: flex; align-items: center; justify-content: center;
}
.barrel::before, .barrel::after {
  content: ""; position: absolute; left: 6px; right: 6px; height: 10px;
  background: #5e3c1e; border-radius: 5px;
}
.barrel::before { top: 18px; } .barrel::after { bottom: 18px; }
.barrel .mini { position: static; width: 52px; height: 52px; }
.barrel-label { font-family: var(--font-head); font-size: 20px; margin-top: 6px; }
.barrel .collected { position: absolute; bottom: 6px; left: 0; right: 0; display: flex; justify-content: center; gap: 2px; flex-wrap: wrap; }
.barrel .collected .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); }
.barrel .collected .dot.apple { background: var(--red); }
.barrel .collected .dot.orange { background: var(--orange); }
.game-msg { min-height: 56px; font-weight: 700; text-align: center; margin: 8px 0; font-size: 18px; }
.game-msg.good { color: #2f8f36; }
.game-msg.oops { color: var(--red); }

/* AB pattern game */
#ab-slots { display: flex; gap: 8px; justify-content: center; margin: 14px 0; flex-wrap: wrap; }
.ab-slot {
  width: 52px; height: 52px; border-radius: 50%;
  border: 3px dashed #c9bfae; background: var(--white);
  display: flex; align-items: center; justify-content: center; font-size: 30px;
}
.ab-slot.filled { border-style: solid; border-color: var(--ink); }
.ab-btns { display: flex; gap: 14px; justify-content: center; margin-bottom: 8px; }
.ab-btn {
  border: 3px solid var(--ink); background: var(--white); border-radius: var(--radius);
  padding: 14px 22px; font-size: 20px; font-weight: 800; cursor: pointer; min-height: 64px;
  display: flex; align-items: center; gap: 8px;
}
.ab-btn .mini-fruit { width: 34px; height: 34px; border-radius: 50%; display: inline-block; }
.mini-fruit.apple { background: radial-gradient(circle at 32% 28%, #ffb3ab 0%, #f25c5c 28%, var(--red) 58%, var(--red-dark) 100%); }
.mini-fruit.orange { background: radial-gradient(circle at 32% 28%, #ffe0b0 0%, #ffbf5e 28%, var(--orange) 58%, #d96a00 100%); }

/* Absence form */
#absence-form { display: none; }
#absence-form.open { display: block; }
#absence-form label { display: block; font-weight: 800; margin: 10px 0 4px; }
#absence-form input, #absence-form textarea {
  width: 100%; padding: 14px; font-size: 18px; font-family: var(--font-body);
  border: 3px solid var(--ink); border-radius: 12px;
}
.sms-btn {
  display: block; text-align: center; text-decoration: none;
  background: var(--green); color: #fff; border-radius: var(--radius);
  padding: 18px; font-size: 20px; font-weight: 800; margin: 12px 0;
  box-shadow: 0 4px 0 #35953a; min-height: 60px;
}
.sms-btn:active { transform: translateY(3px); box-shadow: none; }

/* ---------- Calendar tab ---------- */
.goals-box {
  background: var(--yellow); border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 14px 16px; margin: 6px 0 12px;
}
.goals-box h2 { margin: 0 0 6px; font-size: 24px; }
.goals-box ul { margin: 0; padding-left: 22px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-dow { font-family: var(--font-head); text-align: center; font-size: 16px; padding: 4px 0; color: #6b5d55; }
.cal-day {
  min-height: 66px; border: 2px solid #d8cdbd; border-radius: 10px;
  background: var(--white); padding: 3px 4px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  font-size: 10px; font-weight: 700; text-align: center; line-height: 1.25;
  color: var(--ink);
}
.cal-day .num { font-family: var(--font-head); font-size: 19px; font-weight: 400; }
.cal-day.empty { border: 0; background: transparent; cursor: default; }
.cal-day.k-mw   { background: linear-gradient(to bottom, var(--blue) 50%, var(--purple) 50%); color: #fff; border-color: var(--ink); }
.cal-day.k-tth  { background: var(--green); color: #fff; border-color: var(--ink); }
.cal-day.k-tuition   { background: var(--red); color: #fff; border-color: var(--ink); }
.cal-day.k-fieldtrip { background: var(--pink); color: var(--ink); border-color: var(--ink); }
.cal-day.k-party     { background: var(--orange); color: #fff; border-color: var(--ink); }
.cal-day.k-showtell-mw { background: linear-gradient(to bottom, var(--blue) 50%, var(--purple) 50%); color: #fff; border-color: var(--ink); }
.cal-day.k-showtell-tth { background: var(--green); color: #fff; border-color: var(--ink); }
.cal-day.k-blossom-mw { background: linear-gradient(to bottom, var(--blue) 50%, var(--purple) 50%); color: #fff; border-color: var(--ink); }
.cal-day.k-blossom-tth { background: var(--green); color: #fff; border-color: var(--ink); }
.cal-day.k-noschool { background: var(--grey); color: #fff; border-color: var(--ink); }
.cal-day .lbl { font-size: 9.5px; }
.legend { margin: 14px 0; display: grid; gap: 8px; }
.legend .row { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.swatch { width: 30px; height: 22px; border-radius: 6px; border: 2px solid var(--ink); flex-shrink: 0; }
.swatch.mw { background: linear-gradient(to bottom, var(--blue) 50%, var(--purple) 50%); }
.swatch.tth { background: var(--green); }
.swatch.tuition { background: var(--red); }
.swatch.fieldtrip { background: var(--pink); }
.swatch.party { background: var(--orange); }
.swatch.noschool { background: var(--grey); }
.ics-btn {
  display: block; width: 100%; margin: 8px 0; padding: 14px;
  background: var(--white); border: 3px solid var(--blue); border-radius: 14px;
  font-size: 16px; font-weight: 800; color: var(--ink); cursor: pointer; min-height: 56px;
}

/* ---------- Snack tab ---------- */
.snack-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 3px solid var(--ink); border-radius: 14px;
  padding: 12px 14px; margin: 8px 0; font-weight: 700; font-size: 18px;
}
.snack-row .date {
  font-family: var(--font-head); background: var(--yellow);
  border-radius: 10px; padding: 6px 10px; white-space: nowrap; font-size: 18px;
}
.snack-row .cookie { margin-left: auto; font-size: 26px; }

/* ---------- Notices tab ---------- */
.notice-card { border-top: 8px solid var(--red); }
.notice-card h2 { font-size: 25px; }
.notice-card h2 .em { margin-right: 6px; }
.kid-line {
  display: block; background: #fff3d6; border: 2px solid var(--orange);
  border-radius: 10px; padding: 8px 12px; margin: 8px 0;
  font-weight: 800; font-size: 19px;
}
.lessons { list-style: none; margin: 0; padding: 0; }
.lessons li {
  font-size: 17px; line-height: 1.5; padding: 10px 4px;
  border-bottom: 2px dotted #d8cdbd;
}
.lessons li:last-child { border-bottom: 0; }
.vocab {
  display: inline-block; background: var(--purple); color: #fff;
  border-radius: 8px; padding: 2px 10px; margin-left: 6px;
  font-weight: 800;
}

/* ---------- More tab ---------- */
.highlight-row {
  display: flex; gap: 12px; align-items: baseline;
  padding: 10px 4px; border-bottom: 2px dotted #d8cdbd; font-size: 18px;
}
.highlight-row .d { font-family: var(--font-head); color: var(--red); font-size: 21px; white-space: nowrap; min-width: 104px; }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0;
}
.switch { position: relative; width: 62px; height: 34px; flex-shrink: 0; opacity: .55; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: #ccc; border-radius: 999px; transition: .2s; }
.slider::before { content: ""; position: absolute; width: 26px; height: 26px; left: 4px; top: 4px; background: #fff; border-radius: 50%; }
.soon-note { font-weight: 700; color: var(--red); font-size: 15px; }
.absence-item {
  background: var(--cream); border: 2px solid #d8cdbd; border-radius: 10px;
  padding: 10px 12px; margin: 8px 0; font-size: 16px;
}
.pin-row { display: flex; gap: 10px; margin-top: 8px; }
.pin-row input {
  flex: 1; padding: 14px; font-size: 20px; font-family: var(--font-body);
  border: 3px solid var(--ink); border-radius: 12px; text-align: center; letter-spacing: 6px;
}
.pin-row button {
  padding: 0 22px; font-size: 18px; font-weight: 800; border-radius: 12px;
  border: 3px solid var(--ink); background: var(--yellow); cursor: pointer; min-height: 56px;
}
.about { text-align: center; color: #6b5d55; font-weight: 700; margin-top: 22px; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(58,46,42,.55); display: flex; align-items: flex-end; justify-content: center; }
.modal[hidden] { display: none; }
.modal-sheet {
  background: var(--cream); border-radius: 22px 22px 0 0; width: 100%; max-width: 560px;
  max-height: 88vh; overflow-y: auto; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
}
.modal-sheet h2 { margin-top: 0; }
.modal-close {
  display: block; width: 100%; margin-top: 12px; padding: 14px;
  background: var(--white); border: 3px solid var(--ink); border-radius: 14px;
  font-size: 17px; font-weight: 800; cursor: pointer; min-height: 56px;
}
