@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;600;700;800&display=swap');

:root {
  color-scheme: light;
  /* 한글 가독성과 일관성을 위해 heading/body를 동일 스택으로 통일 */
  --font-heading: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-size-base: 22px;
  --color-bg: #fafafa;
  --color-bg-accent: #f5f5f5;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-muted: #6b7280;
  --color-primary: #6366f1;
  --color-primary-dark: #4f46e5;
  --color-secondary: #ec4899;
  --color-accent: #10b981;
  --color-warning: #f59e0b;
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-medium: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius-card: 16px;
  --touch-target: 52px;
}

body.dark-mode {
  --color-bg: #121638;
  --color-bg-accent: #1f2553;
  --color-surface: #1c214a;
  --color-text: #f5f7ff;
  --color-muted: #a5b2ff;
  --shadow-soft: 0 18px 42px rgba(17, 24, 68, 0.55);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.auth-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(32px, 8vw, 96px);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(99, 102, 241, 0.18), transparent 60%),
    radial-gradient(100% 120% at 100% 0%, rgba(236, 72, 153, 0.12), transparent 55%),
    var(--color-bg);
}

.auth-gate__card {
  width: min(420px, 100%);
  background: var(--color-surface);
  border-radius: calc(var(--radius-card) + 8px);
  box-shadow: var(--shadow-medium);
  padding: clamp(32px, 4vw, 48px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-gate__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(28px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-gate__subtitle {
  margin: 0;
  color: var(--color-muted);
  font-size: clamp(16px, 2.6vw, 18px);
}

.auth-gate__feedback {
  margin: 0;
  font-size: clamp(15px, 2.4vw, 17px);
  font-weight: 600;
  color: var(--color-primary);
}

.auth-gate__feedback.is-error {
  color: #ef4444;
}

.auth-gate__feedback.is-success {
  color: var(--color-accent);
}

.auth-gate__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-gate__field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-gate__label {
  font-size: clamp(15px, 2.5vw, 17px);
  font-weight: 600;
}

.auth-gate__input {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: 1.5px solid rgba(99, 102, 241, 0.18);
  background: var(--color-bg-accent);
  font-size: clamp(18px, 3vw, 22px);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-gate__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  outline: none;
}

.auth-gate__input::-webkit-outer-spin-button,
.auth-gate__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.auth-gate__input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.auth-gate__submit {
  width: 100%;
  font-size: clamp(18px, 3vw, 22px);
  padding: 16px 18px;
  border-radius: 14px;
  justify-content: center;
}

.auth-gate__hint {
  margin: 0;
  color: var(--color-muted);
  font-size: clamp(14px, 2.2vw, 16px);
  text-align: center;
}

@media (max-width: 520px) {
  .auth-gate {
    padding: 24px;
  }

  .auth-gate__card {
    padding: 28px 24px;
    border-radius: calc(var(--radius-card) + 4px);
  }

  .auth-gate__input {
    padding: 14px;
    letter-spacing: 0.12em;
  }
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.kid-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.kid-shell__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px clamp(12px, 3vw, 24px) 8px;
  flex-shrink: 0;
}

.kid-shell__pokemon-list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding-right: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.kid-shell__pokemon-list::-webkit-scrollbar {
  display: none;
}

.kid-shell__pokemon-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
  border: 2px solid rgba(99, 102, 241, 0.2);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
}

.kid-shell__pokemon-item:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  border-color: rgba(99, 102, 241, 0.4);
}

.kid-shell__pokemon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.kid-shell__controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.kid-shell__tabs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  padding-top: 12px;
}

.kid-shell__tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.kid-shell__tab:hover {
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary);
}

.kid-shell__tab.is-active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.control-button {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  background: rgba(115, 103, 240, 0.12);
  color: var(--color-primary-dark);
  font-weight: 700;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 16px rgba(115, 103, 240, 0.12);
}

.control-button:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
}

.control-button:hover {
  background: rgba(115, 103, 240, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(115, 103, 240, 0.18);
}

.kid-shell__offline {
  text-align: center;
  color: var(--color-warning);
  margin: 4px auto 0;
  font-weight: 700;
}

.kid-shell__main {
  flex: 1;
  display: flex;
}

.screen {
  flex: 1;
  padding: 8px clamp(12px, 3vw, 24px) 12px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

/* Kid tabs in wallet header */
.kid-tabs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.kid-tabs::-webkit-scrollbar { display: none; }
.kid-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 2px solid rgba(99, 102, 241, 0.18);
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(236,72,153,0.06));
  color: var(--color-text);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.kid-tab__name { font-family: var(--font-heading); }
.kid-tab__balance {
  font-size: 14px;
  font-weight: 800;
  color: var(--color-primary-dark);
  background: rgba(99, 102, 241, 0.12);
  padding: 4px 8px;
  border-radius: 999px;
}
.kid-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 6px 14px rgba(99, 102, 241, 0.16);
}
.kid-tab.is-active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(99, 102, 241, 0.28);
}
.kid-tab.is-active .kid-tab__balance {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.screen-title {
  font-size: 36px;
  font-weight: 800;
  margin: 0;
  font-family: var(--font-heading);
}

.subtitle {
  font-size: 18px;
  color: var(--color-muted);
  margin: 8px 0 0;
}

.card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: 20px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(6px);
  margin-bottom: 20px;
}

.card-title {
  font-size: 28px;
  margin: 0 0 12px;
  font-family: var(--font-heading);
}

.kid-dashboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  overflow: hidden;
}

.kid-dashboard__users {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
}

.kid-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: clamp(150px, 32vw, 240px);
  padding: 24px 28px;
  border-radius: 28px;
  border: 4px solid transparent;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.12), rgba(148, 163, 184, 0.12));
  box-shadow: var(--shadow-soft);
  font-weight: 700;
  font-size: 24px;
  color: var(--color-text);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.kid-card__name {
  margin: 0;
}

.kid-card__meta {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--color-muted);
}

.kid-card:hover,
.kid-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(79, 70, 229, 0.4);
}

.kid-card.is-active {
  border-color: var(--kid-accent, var(--color-primary));
  background: linear-gradient(
    135deg,
    rgba(79, 70, 229, 0.24),
    rgba(255, 255, 255, 0.96)
  );
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(79, 70, 229, 0.25);
  color: #0f172a;
}

.kid-card.is-active .kid-card__meta {
  color: rgba(30, 64, 175, 0.9);
}

.kid-dashboard__prompt {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.kid-dashboard__heading {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-heading);
}

.kid-dashboard__subheading {
  margin: 0;
  font-size: 13px;
  color: var(--color-muted);
}

.kid-dashboard__grid {
  display: grid;
  gap: 12px;
  margin-top: 0;
  grid-template-columns: 1fr; /* 한 아이가 화면 전체를 사용 */
  flex: 1;
  min-height: 0;
  overflow: visible;
  align-items: stretch;
}

.kid-panel__done[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.kid-dashboard__tasks {
  display: grid;
  gap: 20px;
}

.parent-dashboard__tiles {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: stretch;
}

.parent-dashboard__tile {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.parent-dashboard__tile--wide {
  grid-column: 1 / -1;
}

.parent-dashboard__tile--action {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(79, 70, 229, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.18);
}

.parent-dashboard__tile--routine {
  border: 1px solid rgba(23, 23, 36, 0.08);
  background: rgba(255, 255, 255, 0.9);
}

.parent-dashboard__tile--empty {
  border: 1px dashed rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.06);
}

.parent-dashboard__tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.parent-dashboard__tile-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.parent-dashboard__tile-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.parent-dashboard__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 14px;
}

.parent-dashboard__tile-text {
  margin: 0;
  font-size: 15px;
  color: var(--color-muted);
  line-height: 1.5;
}

.parent-dashboard__value {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.parent-dashboard__select {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}

.parent-dashboard__select select {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 2px solid rgba(115, 103, 240, 0.18);
  background: rgba(255, 255, 255, 0.85);
  font: inherit;
}

.parent-dashboard__tile--wide .parent-dashboard__tile-text {
  font-size: 14px;
}

.parent-form {
  gap: 16px;
}

.parent-form input,
.parent-form textarea,
.routine-manager select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 2px solid rgba(115, 103, 240, 0.18);
  font: inherit;
  background: rgba(255, 255, 255, 0.85);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.parent-form input:focus-visible,
.parent-form textarea:focus-visible,
.routine-manager select:focus-visible {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(115, 103, 240, 0.18);
}

.parent-form--compact {
  display: grid;
  gap: 16px;
}

.parent-form__full {
  grid-column: 1 / -1;
}

@media (min-width: 720px) {
  .parent-form--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .parent-form--compact label:nth-child(3),
  .parent-form--compact button,
  .parent-form--compact textarea,
  .parent-form--compact .parent-form__full {
    grid-column: 1 / -1;
  }

  .parent-form--compact button {
    justify-self: flex-start;
  }
}

.parent-form--stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.parent-form__inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.parent-buttons--stacked {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.parent-routine__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.parent-routine__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.parent-routine__points {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 13px;
}

.parent-routine__meta {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--color-muted);
  line-height: 1.5;
}

.parent-routine__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.parent-modal-layer {
  z-index: 1000;
}

.parent-modal {
  width: min(90vw, 720px);
}

.parent-modal--narrow {
  max-width: 440px;
}

.parent-modal--wide {
  max-width: 760px;
}

.parent-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.parent-modal__title {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
}

.parent-modal__close {
  appearance: none;
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-muted);
}

.parent-modal__close:hover {
  color: var(--color-text);
}

.parent-modal__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.parent-import-modal {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.parent-import__controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.parent-import__select {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 160px;
}

.parent-import__select select {
  min-width: 160px;
}

.parent-import__select-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.parent-import__list {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.parent-import__item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(79, 70, 229, 0.18);
  background: rgba(255, 255, 255, 0.7);
}

.parent-import__item-body {
  flex: 1;
  min-width: 0;
}

.parent-import__item-title {
  font-weight: 800;
  margin: 0 0 4px;
}

.parent-import__item-meta {
  margin: 0;
  font-size: 14px;
  color: var(--color-muted);
}

.parent-import__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.parent-import__upload {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.parent-guide--modal {
  margin: 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.parent-guide--modal li {
  font-size: 15px;
  color: var(--color-text);
  line-height: 1.6;
}

/* PIN modal keypad */
.pin-input {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 8px 0 12px;
}
.pin-input input {
  width: 44px;
  height: 52px;
  text-align: center;
  font-size: 24px;
  border: 2px solid rgba(0,0,0,0.15);
  border-radius: 10px;
  background: #f9fafb;
}
.pin-keypad {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.pin-keypad .keypad-btn {
  padding: 14px 0;
  font-size: 18px;
  border-radius: 12px;
}
.pin-keypad .keypad-func {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid rgba(0,0,0,0.08);
}

.routine-manager {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.routine-manager__selector {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.routine-manager__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.routine-manager__empty {
  margin: 0;
  color: var(--color-muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-card);
  padding: 18px;
  text-align: center;
}

.routine-manager__form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: calc(var(--radius-card) - 4px);
  padding: 18px;
  box-shadow: 0 12px 32px rgba(29, 27, 78, 0.08);
}

.routine-manager__form h3 {
  margin: 0;
  font-size: 20px;
  font-family: var(--font-heading);
  font-weight: 700;
}

.routine-manager__fields {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.routine-manager__fields label,
.routine-manager__fields fieldset {
  flex: 1 1 min(220px, 100%);
}

.routine-manager__daypart {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.routine-manager__daypart label {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(115, 103, 240, 0.12);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
}

.routine-manager__days {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.day-chip {
  border: none;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 16px;
  font-weight: 700;
  background: rgba(115, 103, 240, 0.12);
  color: var(--color-primary-dark);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.day-chip.is-active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #fff;
  box-shadow: 0 12px 24px rgba(115, 103, 240, 0.3);
  transform: translateY(-1px);
}

.routine-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border-radius: calc(var(--radius-card) - 6px);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 28px rgba(29, 27, 78, 0.1);
}

.routine-card__title {
  margin: 0;
  font-size: 20px;
  font-family: var(--font-heading);
}

.routine-card__meta {
  margin: 6px 0 0;
  color: var(--color-muted);
  font-weight: 600;
}

.parent-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.parent-import {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.parent-guide {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-weight: 600;
}

.praise-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, rgba(115, 103, 240, 0.78), rgba(45, 9, 94, 0.92));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 4000;
  animation: overlayFade 0.2s ease-out;
}

.praise-overlay__content {
  text-align: center;
  color: #fff;
  max-width: 720px;
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 36px;
  padding: clamp(32px, 6vw, 56px);
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: overlayPop 0.35s ease-out;
}

.praise-overlay__message {
  margin: 0;
  font-size: clamp(60px, 12vw, 108px);
  line-height: 1.1;
  font-family: var(--font-heading);
  font-weight: 800;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.praise-overlay__sub {
  margin: 0;
  font-size: clamp(28px, 5.5vw, 36px);
  font-weight: 700;
  opacity: 0.9;
}

.praise-overlay__hint {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  opacity: 0.85;
}
@media (min-width: 900px) {
  .kid-dashboard__tasks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.kid-panel {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: 10px;
  padding-bottom: 12px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.kid-panel__header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.kid-panel__emoji {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(0,0,0,0.1);
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.kid-panel__header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 12px;
  flex-wrap: wrap;
}

.kid-panel__name {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40%;
}

.kid-panel__coins-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

.kid-panel__earned {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.18);
  padding: 4px 10px;
  border-radius: 8px;
  white-space: nowrap;
}
.kid-panel__earned-label {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 800;
  opacity: 0.95;
}
.kid-panel__earned-today {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--color-primary-dark);
  line-height: 1;
}
.kid-panel__earned-total {
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--color-accent);
  line-height: 1;
}
.kid-panel__earned-sep {
  color: #9ca3af;
  font-weight: 700;
}
.kid-panel__coin-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-text);
}

.kid-panel__coin-badge.is-today {
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary);
}

.kid-panel__coin-badge.is-total {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-accent);
}

.kid-panel__coin-badge-label {
  font-size: 11px;
  opacity: 0.7;
  font-weight: 600;
}

.kid-panel__coin-badge-value {
  font-weight: 700;
  font-family: var(--font-heading);
}

.kid-panel__tasks {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 4px;
  padding-bottom: 8px; /* ensure content not hidden behind footer */
}

.kid-panel__task-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Daypart theming: morning vs evening */
.kid-panel__task-section[data-task-list="morning"] {
  background: linear-gradient(180deg, rgba(99,102,241,0.06), rgba(99,102,241,0.03));
  border: 2px solid rgba(99,102,241,0.12);
  border-radius: 12px;
  padding: 8px;
}
.kid-panel__task-section[data-task-list="evening"] {
  background: linear-gradient(180deg, rgba(236,72,153,0.06), rgba(236,72,153,0.03));
  border: 2px solid rgba(236,72,153,0.12);
  border-radius: 12px;
  padding: 8px;
}
.kid-panel__task-section[data-task-list="morning"] .kid-panel__task-section-title {
  color: #4f46e5;
}
.kid-panel__task-section[data-task-list="evening"] .kid-panel__task-section-title {
  color: #ec4899;
}

.kid-panel__task-section[data-task-list="morning"] .task-chip.is-selected {
  border-color: #6366f1;
  background: rgba(99,102,241,0.14);
}
.kid-panel__task-section[data-task-list="evening"] .task-chip.is-selected {
  border-color: #ec4899;
  background: rgba(236,72,153,0.14);
}

.kid-panel__task-section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kid-panel__task-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.kid-panel__footer {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
  padding-top: 6px;
  padding-bottom: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
  min-height: fit-content;
  z-index: 1; /* keep buttons above scrolling content */
  background: var(--color-surface);
}

.kid-panel__no-task {
  margin: 0;
  color: var(--color-muted);
  font-weight: 600;
  font-size: 14px;
  padding: 12px;
  text-align: center;
}

.kid-panel__button-row {
  display: flex;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
  align-items: stretch;
}

.kid-panel__verse-btn {
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-body);
  padding: 12px 16px;
  justify-content: center;
  align-items: center;
  display: flex;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  box-shadow: var(--shadow-soft);
  border-radius: 8px;
  height: 50px;
  margin-bottom: 0;
}

.kid-panel__verse-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.kid-panel__verse-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

/* chore button style */
.kid-panel__chore-btn {
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-body);
  padding: 12px 16px;
  justify-content: center;
  align-items: center;
  display: flex;
  /* 심부름 버튼은 말씀 버튼과 확실히 다른 컬러 (오렌지→노랑 톤) */
  background: linear-gradient(135deg, #f59e0b 0%, #eab308 100%);
  color: #fff;
  box-shadow: var(--shadow-soft);
  border-radius: 8px;
  height: 50px;
  margin-bottom: 0;
}
.kid-panel__chore-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.kid-panel__done {
  width: 100%;
  font-size: 13px;
  padding: 8px 12px;
  font-weight: 700;
  justify-content: center;
  background: var(--color-primary);
  box-shadow: var(--shadow-medium);
  border-radius: 8px;
  min-height: 36px;
}

.kid-panel__praise {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-secondary);
  background: rgba(236, 72, 153, 0.1);
  border-radius: 8px;
  padding: 10px 16px;
  font-family: var(--font-heading);
}

.kid-dashboard__group {
  background: var(--color-surface);
  padding: 20px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

.kid-dashboard__group-title {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 700;
}

.kid-dashboard__task-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.kid-dashboard__no-task {
  margin: 0;
  color: var(--color-muted);
  font-weight: 600;
}

.task-chip {
  min-height: 72px;
  border-radius: 12px;
  border: 2px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  text-align: left;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.task-chip__title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--color-text);
  font-weight: 800;
  line-height: 1.2;
}

.task-chip__meta {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-muted);
  opacity: 0.9;
}

.task-chip:hover,
.task-chip:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.5);
  background: linear-gradient(180deg, #ffffff, rgba(99, 102, 241, 0.06));
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.task-chip.is-selected {
  border-color: var(--color-primary);
  background: linear-gradient(180deg, rgba(99,102,241,0.12), rgba(99,102,241,0.06));
  box-shadow: 0 10px 24px rgba(99, 102, 241, 0.25);
  transform: translateY(-2px);
}

.task-chip.is-complete {
  background: linear-gradient(180deg, rgba(16,185,129,0.16), rgba(16,185,129,0.08));
  border-color: var(--color-accent);
  color: var(--color-accent);
  cursor: default;
  opacity: 1;
  pointer-events: none; /* 재클릭 방지 */
  position: relative;
}

.task-chip.is-complete .task-chip__meta {
  color: var(--color-accent);
}

/* 완료 배지 표시 */
.task-chip.is-complete::after {
  content: '✓ 완료';
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--color-accent);
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.35);
  border-radius: 999px;
  padding: 2px 8px;
}

.task-chip[disabled] {
  opacity: 0.4;
  cursor: default;
}

.task-chip-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-chip-checkbox {
  width: 24px;
  height: 24px;
  min-width: 24px;
  cursor: pointer;
  accent-color: var(--color-primary);
  flex-shrink: 0;
}

.task-chip.is-batch-selected {
  border-color: var(--color-primary);
  background: linear-gradient(180deg, rgba(99,102,241,0.16), rgba(99,102,241,0.08));
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.15);
}


.kid-dashboard__verse {
  margin-top: 0;
  margin-bottom: 6px;
  flex-shrink: 0;
  height: fit-content;
  max-height: 20vh;
}


.kid-dashboard__side-panel {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: 12px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: calc(60vh - 100px);
  overflow: hidden;
}

.side-panel__tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.side-panel__tab {
  flex: 1;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.side-panel__tab:hover {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.02);
}

.side-panel__tab.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.side-panel__content {
  flex: 1;
  position: relative;
  overflow-y: auto;
  min-height: 0;
}

.side-panel__panel {
  display: none;
}

.side-panel__panel.is-active {
  display: block;
}

/* 음악 플레이어 */
.music-player {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.music-player__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-heading);
}

.music-player__input-group {
  display: flex;
  gap: 8px;
}

.music-player__input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  font-size: 14px;
}

.music-player__load-btn {
  padding: 10px 20px;
  font-size: 14px;
}

.music-player__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.music-player__placeholder {
  color: var(--color-muted);
  font-size: 14px;
  text-align: center;
}

.music-player__presets {
  margin-top: 8px;
}

.music-player__presets-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-muted);
}

.music-player__preset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.music-player__preset-btn {
  padding: 8px 14px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.02);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.music-player__preset-btn:hover {
  border-color: var(--color-primary);
  background: rgba(99, 102, 241, 0.08);
}

/* 식단 플래너 */
.meal-planner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.meal-planner__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-heading);
}

.meal-planner__date {
  font-size: 13px;
  color: var(--color-muted);
  margin-bottom: 8px;
}

.meal-planner__section {
  padding: 12px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 12px;
}

.meal-planner__section-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
}

.meal-planner__input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.meal-planner__input {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  font-size: 13px;
}

.meal-planner__add-btn {
  padding: 8px 16px;
  font-size: 13px;
}

.meal-planner__food-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meal-planner__food-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--color-surface);
  border-radius: 8px;
  gap: 8px;
}

.meal-planner__food-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.meal-planner__food-name {
  font-weight: 600;
  font-size: 14px;
}

.meal-planner__food-serving {
  font-size: 11px;
  color: var(--color-muted);
}

.meal-planner__food-nutrition {
  display: flex;
  gap: 8px;
  font-size: 11px;
  color: var(--color-muted);
}

.meal-planner__remove-btn {
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-muted);
  transition: all 0.2s ease;
}

.meal-planner__remove-btn:hover {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}

.meal-planner__summary {
  margin-top: 8px;
  padding: 12px;
  background: rgba(99, 102, 241, 0.05);
  border-radius: 12px;
}

.meal-planner__summary-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
}

.meal-planner__summary-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.meal-planner__nutrition-item {
  display: flex;
  gap: 12px;
}

/* 일정 플래너 */
.schedule-planner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.schedule-planner__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-heading);
}

.schedule-planner__week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}

.schedule-planner__day {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  min-height: 120px;
}

.schedule-planner__day.is-today {
  background: rgba(99, 102, 241, 0.08);
  border: 2px solid var(--color-primary);
}

.schedule-planner__day-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.schedule-planner__day-label {
  font-size: 11px;
  color: var(--color-muted);
  font-weight: 600;
}

.schedule-planner__day-number {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.schedule-planner__schedule-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.schedule-planner__schedule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--color-surface);
  border-radius: 6px;
  font-size: 11px;
  gap: 4px;
}

.schedule-planner__schedule-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.schedule-planner__schedule-time {
  font-size: 10px;
  color: var(--color-muted);
}

.schedule-planner__schedule-title {
  font-weight: 600;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schedule-planner__remove-btn {
  width: 18px;
  height: 18px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-muted);
  flex-shrink: 0;
}

.schedule-planner__add-btn {
  width: 100%;
  margin-top: 8px;
}

.schedule-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.schedule-form__buttons {
  display: flex;
  gap: 8px;
}

.schedule-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
}

.schedule-form input,
.schedule-form select {
  padding: 10px 14px;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  font-size: 14px;
}

.verse-card {
  background: var(--color-surface);
  border-radius: var(--radius-card);
  padding: 8px;
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  max-height: 20vh;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.verse-card__header {
  margin-bottom: 6px;
  flex-shrink: 0;
}

.verse-card__title {
  margin: 0 0 2px;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-heading);
}

.verse-card__date {
  margin: 0;
  font-size: 11px;
  color: var(--color-muted);
}

.verse-card__content {
  flex: 1;
  min-width: 0;
}

.verse-card__text {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.5;
  color: var(--color-text);
  font-style: italic;
}

.verse-card__reference {
  margin: 0;
  font-weight: 600;
  font-size: 18px;
  color: var(--color-muted);
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: var(--shadow-soft);
  }
  50% {
    transform: scale(1.02);
    box-shadow: var(--shadow-medium);
  }
}

.kid-dashboard__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.kid-dashboard__empty-title {
  margin: 0;
  font-size: 26px;
}

.kid-dashboard__empty-text {
  margin: 0;
  color: var(--color-muted);
  font-weight: 600;
}

.progress-circle {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: conic-gradient(
    var(--color-primary) calc(var(--progress) * 1%),
    rgba(148, 163, 184, 0.3) 0
  );
  display: grid;
  place-items: center;
  color: var(--color-text);
  font-weight: 700;
  font-size: 24px;
  margin: 0 auto 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  touch-action: manipulation;
  font-family: var(--font-heading);
  box-shadow: var(--shadow-soft);
}

.button:hover {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-medium);
}

.button:focus-visible {
  outline: 3px solid var(--color-secondary);
  outline-offset: 2px;
}

.button:active {
  transform: translateY(1px);
}

.button.secondary {
  background: var(--color-secondary);
  box-shadow: var(--shadow-soft);
}

.button.secondary:hover {
  background: #db2777;
  box-shadow: var(--shadow-medium);
}

.button.danger {
  background: #ef4444;
  box-shadow: var(--shadow-soft);
}

.button.danger:hover {
  background: #dc2626;
  box-shadow: var(--shadow-medium);
}

.button[data-loading] {
  pointer-events: none;
  opacity: 0.75;
}

.button[data-loading]::after {
  content: '';
  position: absolute;
  right: 18px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.6);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

.button.warning {
  background: var(--color-warning);
}

.grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 720px) {
  .grid.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid.three-col {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.routine-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  background: rgba(79, 70, 229, 0.08);
  border-radius: var(--radius-card);
  min-height: var(--touch-target);
}

.routine-item h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.routine-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.routine-meta {
  color: var(--color-muted);
  font-size: 16px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.list-item {
  background: rgba(15, 23, 42, 0.05);
  padding: 16px;
  border-radius: var(--radius-card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: var(--touch-target);
}

.pin-input {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.pin-input input {
  width: 64px;
  height: 64px;
  text-align: center;
  font-size: 32px;
  border-radius: 16px;
  border: 2px solid rgba(79, 70, 229, 0.4);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.12);
  color: var(--color-primary);
  font-weight: 600;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.5);
  padding: 32px;
  backdrop-filter: blur(6px);
  z-index: 1000;
}

.modal-content {
  background: var(--color-surface);
  padding: 28px;
  border-radius: 20px;
  width: min(420px, 90vw);
  box-shadow: var(--shadow-soft);
}

.toast-container {
  position: fixed;
  bottom: 32px;
  right: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2000;
}

.toast {
  background: var(--color-surface);
  color: var(--color-text);
  padding: 16px 24px;
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  font-weight: 600;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.fade-out {
  opacity: 0;
  transform: translateY(8px);
}

.high-contrast body {
  background: #000;
  color: #fff;
}

.high-contrast .card,
.high-contrast .list-item,
.high-contrast .routine-item {
  background: #000;
  color: #fff;
  border: 2px solid #fff;
}

.no-js-warning {
  background: #b91c1c;
  color: #fff;
  padding: 24px;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes overlayFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes overlayPop {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 약속하기 타이머 스타일 */
.promise-timer-modal {
  z-index: 2000;
}

.promise-timer-content {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 50%, #c44569 100%);
  color: #fff;
  padding: 32px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(238, 90, 111, 0.4);
  animation: overlayPop 0.3s ease-out;
}

.promise-timer-title {
  margin: 0 0 24px;
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.promise-timer-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.promise-timer-label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.promise-timer-label-text {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.promise-timer-select {
  padding: 14px 18px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  font-size: 16px;
  font-weight: 600;
  color: #c44569;
  cursor: pointer;
  transition: all 0.2s ease;
}

.promise-timer-select:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: #fff;
  transform: translateY(-1px);
}

.promise-timer-select:focus {
  outline: none;
  border-color: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
}

.promise-timer-buttons {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.promise-timer-start-btn {
  flex: 1;
  background: #fff;
  color: #c44569;
  font-weight: 800;
  font-size: 18px;
  padding: 16px;
  border: none;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.promise-timer-start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.promise-timer-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 50%, #c44569 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  animation: overlayFade 0.3s ease-out;
}

.promise-timer-display {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 32px;
  padding: 40px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 400px;
  width: 90%;
  animation: overlayPop 0.4s ease-out;
}

.promise-timer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.promise-timer-display-title {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #c44569;
}

.promise-timer-close {
  background: rgba(196, 69, 105, 0.1);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 24px;
  color: #c44569;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.promise-timer-close:hover {
  background: rgba(196, 69, 105, 0.2);
  transform: scale(1.1);
}

.promise-timer-info {
  margin-bottom: 24px;
}

.promise-timer-kid {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
  color: #6b7280;
}

.promise-timer-time {
  margin: 20px 0;
  position: relative;
}

.promise-timer-time.is-paused {
  opacity: 0.6;
}

.promise-timer-time-value {
  font-size: 64px;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  color: #c44569;
  text-shadow: 0 2px 8px rgba(196, 69, 105, 0.2);
  line-height: 1;
  display: block;
}

.promise-timer-paused-label {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
  color: #ee5a6f;
  text-shadow: 0 1px 4px rgba(238, 90, 111, 0.3);
}

.promise-timer-total {
  margin: 12px 0 0;
  font-size: 14px;
  color: #9ca3af;
  font-weight: 600;
}

.promise-timer-controls {
  display: flex;
  gap: 12px;
  width: 100%;
}

.promise-timer-pause-btn {
  flex: 1;
  background: #fff;
  color: #c44569;
  font-weight: 700;
  font-size: 16px;
  padding: 14px;
  border: 2px solid #c44569;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.promise-timer-pause-btn:hover {
  background: #c44569;
  color: #fff;
  transform: translateY(-1px);
}

.promise-timer-stop-btn {
  flex: 1;
  background: #c44569;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  padding: 14px;
  border: none;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.promise-timer-stop-btn:hover {
  background: #b03a5a;
  transform: translateY(-1px);
}

.promise-timer-complete {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 50%, #c44569 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  animation: overlayFade 0.3s ease-out;
}

.promise-timer-complete-content {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 32px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  max-width: 500px;
  width: 90%;
  animation: overlayPop 0.5s ease-out;
}

.promise-timer-complete-icon {
  font-size: 80px;
  margin-bottom: 20px;
  animation: pulse 1s ease-in-out infinite;
}

.promise-timer-complete-title {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 800;
  color: #c44569;
  text-shadow: 0 2px 8px rgba(196, 69, 105, 0.2);
}

.promise-timer-complete-message {
  margin: 0 0 20px;
  font-size: 20px;
  font-weight: 700;
  color: #ee5a6f;
}

.promise-timer-complete-kid {
  margin: 0 0 32px;
  font-size: 18px;
  font-weight: 600;
  color: #6b7280;
}

.promise-timer-complete-btn {
  width: 100%;
  background: #c44569;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  padding: 16px;
  border: none;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(196, 69, 105, 0.3);
}

.promise-timer-complete-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(196, 69, 105, 0.4);
}

/* Responsive adjustments for iPad/smaller screens to keep action buttons visible */
@media (max-width: 1024px), (max-height: 820px) {
  .screen { overflow: hidden; }

  .screen-header { margin-bottom: 8px; }

  .kid-shell__header {
    padding: 8px clamp(10px, 2.5vw, 16px) 6px;
  }

  .kid-shell__pokemon-item {
    width: 36px;
    height: 36px;
    min-width: 36px;
  }

  .kid-dashboard {
    overflow: visible;
  }

  .kid-dashboard__grid {
    gap: 4px;
  }

  .kid-panel {
    padding: 8px;
    gap: 4px;
  }

  .kid-panel__header {
    padding-bottom: 4px;
  }

  .kid-panel__name {
    font-size: 15px;
  }
  .kid-panel__earned {
    gap: 6px;
    padding: 3px 8px;
  }
  .kid-panel__earned-label {
    font-size: 11px;
  }
  .kid-panel__earned-today,
  .kid-panel__earned-total {
    font-size: 15px;
  }

  .kid-panel__coin-badge {
    padding: 4px 8px;
    font-size: 12px;
  }

  .kid-panel__tasks {
    margin-bottom: 0;
    max-height: none;
  }

  .kid-panel__verse-btn {
    min-height: 30px;
    font-size: 12px;
    padding: 6px 10px;
  }

  .kid-panel__done {
    min-height: 34px;
    font-size: 12px;
    padding: 8px 10px;
  }

  .verse-card {
    padding: 6px;
  }

  .verse-card__title {
    font-size: 13px;
  }

  .verse-card__date {
    font-size: 10px;
  }

  .verse-card__text {
    font-size: 22px;
    line-height: 1.45;
    margin-bottom: 4px;
  }

  .verse-card__reference {
    font-size: 13px;
  }

  /* Keep action buttons always visible at the bottom of each panel */
  .kid-panel {
    overflow: hidden;
  }
  .kid-panel__tasks {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .kid-panel__footer {
    position: sticky;
    bottom: 0;
    background: linear-gradient(to top, rgba(255,255,255,0.96), rgba(255,255,255,0.9));
    box-shadow: 0 -6px 16px rgba(0,0,0,0.06);
    padding-top: 6px;
  }

  /* Avoid page-level scroll; confine scroll to content areas */
  .kid-dashboard { overflow: hidden; }
  .kid-dashboard__grid { overflow: visible; }
  .kid-shell__main { overflow: hidden; }
  .verse-card__content { max-height: 28vh; overflow: auto; -webkit-overflow-scrolling: touch; }
}
