:root {
  --bg-morning: linear-gradient(135deg, #fff8e7 0%, #ffe4b8 100%);
  --bg-evening: linear-gradient(135deg, #ffe0d0 0%, #e8c8e0 100%);
  --bg-quiet: #15161a;
  --card-bg: #ffffff;
  --text: #2d2d2d;
  --text-light: #6b6b6b;
  --text-mute: #9b9b9b;
  --accent-morning: #ff8a3d;
  --accent-evening: #b864c0;
  --departure: #e53e3e;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Hiragino Maru Gothic ProN', 'Hiragino Sans', 'Yu Gothic', system-ui, sans-serif;
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body.mode-morning { background: var(--bg-morning); }
body.mode-evening { background: var(--bg-evening); }
body.mode-quiet { background: var(--bg-quiet); color: #fff; }

#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

#loading {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-light);
}

/* ===== PASSWORD GATE ===== */
.gate {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #fff8e7 0%, #ffe4b8 100%);
  z-index: 9999;
}
.gate-inner {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 28px;
  padding: 48px 56px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  min-width: 360px;
}
.gate-emoji { font-size: 64px; line-height: 1; }
.gate-title {
  font-size: 32px;
  font-weight: 700;
  margin-top: 12px;
  color: var(--accent-morning);
}
.gate-lead {
  font-size: 18px;
  color: var(--text-light);
  margin-top: 18px;
}
.gate-form {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  justify-content: center;
}
.gate-input {
  font-size: 22px;
  padding: 12px 16px;
  border: 2px solid #e6d4b8;
  border-radius: 12px;
  width: 180px;
  text-align: center;
  background: #fff;
  font-family: inherit;
  letter-spacing: 4px;
}
.gate-input:focus { outline: none; border-color: var(--accent-morning); }
.gate-btn {
  font-size: 20px;
  padding: 12px 24px;
  background: var(--accent-morning);
  color: #fff;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 700;
}
.gate-error { color: #e53e3e; margin-top: 14px; font-size: 16px; }

/* ===== HEADER ===== */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 36px 8px;
  flex-shrink: 0;
}

header .day {
  display: flex;
  align-items: baseline;
  gap: 18px;
}

header .prefix {
  font-size: 30px;
  color: var(--text-light);
}

header .dayname {
  font-size: 56px;
  font-weight: 700;
}

body.mode-morning header .dayname { color: var(--accent-morning); }
body.mode-evening header .dayname { color: var(--accent-evening); }

header .date {
  font-size: 26px;
  color: var(--text-light);
}

.weather {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 20px;
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.55);
  padding: 10px 18px;
  border-radius: 999px;
}

.weather .w-icon { font-size: 30px; line-height: 1; }
.weather .w-temp { font-weight: 700; color: var(--text); }
.weather .w-hint { font-size: 18px; }

/* ===== MAIN ===== */
main {
  flex: 1;
  display: flex;
  gap: 24px;
  padding: 12px 36px 28px;
  overflow: hidden;
  min-height: 0;
}

.kids-section {
  flex: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.kids-section h1 {
  font-size: 34px;
  margin-bottom: 14px;
  font-weight: 700;
}

.kids-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.kids-card {
  background: var(--card-bg);
  border-radius: 22px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  min-height: 0;
}

.kids-card .icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kids-card .icon svg { width: 100%; height: 100%; }

.kids-card .text {
  font-size: 22px;
  margin-top: 10px;
  text-align: center;
  font-weight: 600;
}

.kids-card.big {
  grid-column: span 3;
  background: linear-gradient(135deg, #fff3c4 0%, #ffd29a 100%);
}

.kids-card.big .icon { width: 110px; height: 110px; }
.kids-card.big .text { font-size: 38px; font-weight: 700; }

.empty-kids {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 32px;
  text-align: center;
  color: var(--text-light);
  background: rgba(255, 255, 255, 0.5);
  border-radius: 22px;
  padding: 40px;
}

/* ===== INFO ===== */
.info-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.parent-tasks, .events {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  padding: 16px 22px;
}

.parent-tasks h2, .events h2 {
  font-size: 18px;
  color: var(--text-light);
  margin-bottom: 10px;
  font-weight: 600;
}

.parent-tasks ul, .events ul {
  list-style: none;
}

.parent-tasks li, .events li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  padding: 5px 0;
}

.parent-tasks .mini-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}
.parent-tasks .mini-icon svg { width: 100%; height: 100%; }

.events {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.events ul {
  overflow-y: auto;
  flex: 1;
}

.events .time {
  font-weight: 700;
  min-width: 90px;
}

body.mode-morning .events .time { color: var(--accent-morning); }
body.mode-evening .events .time { color: var(--accent-evening); }

.events .summary { flex: 1; }

.empty {
  font-size: 18px;
  color: var(--text-mute);
}

/* ===== MORNING CLOCK PANEL ===== */
.morning-clock-panel {
  background: rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.morning-clock-panel .panel-label {
  font-size: 14px;
  color: var(--text-light);
  letter-spacing: 1px;
}
.morning-clock-panel svg { width: 180px; height: 180px; }
.morning-clock-panel .departure-note {
  text-align: center;
  font-size: 16px;
  color: var(--departure);
  font-weight: 700;
  line-height: 1.4;
}
.morning-clock-panel .departure-note .big-num {
  font-size: 28px;
}

/* ===== QUIET MODE ===== */
.quiet {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
}

.quiet svg.analog-big {
  width: 460px;
  height: 460px;
}

.quiet-date {
  font-size: 32px;
  color: #aaa;
}

.next-event {
  margin-top: 24px;
  text-align: center;
}

.next-label {
  font-size: 18px;
  color: #888;
  letter-spacing: 2px;
}

.next-time {
  font-size: 32px;
  margin-top: 8px;
  color: #fff;
}

.next-summary {
  font-size: 24px;
  color: #ccc;
  margin-top: 4px;
}

/* error banner */
.error-banner {
  position: fixed;
  bottom: 8px;
  right: 8px;
  background: rgba(220, 50, 50, 0.85);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
}
