* {
      box-sizing: border-box;
    }

    :root {
      --bg-1: #fff8c6;
      --bg-2: #ffd6ec;
      --bg-3: #d7f4ff;

      --pink: #ff4f94;
      --pink-soft: #ffb6d9;
      --purple: #7f8cff;
      --purple-dark: #5c66ff;
      --green: #43c463;
      --mint: #00b7a8;
      --red: #ff7f7f;
      --yellow: #ffbe0b;
      --blue: #3aa6ff;

      --card-border: #8fd3ff;
      --panel-bg: rgba(255, 255, 255, 0.82);
      --panel-border: #ffb3d9;
      --text: #444;
      --shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
      --radius-xl: 28px;
      --radius-lg: 22px;
      --radius-md: 16px;
    }

    body {
      position: relative;
      margin: 0;
      font-family: "Arial", "맑은 고딕", sans-serif;
      background:
        radial-gradient(circle at 12% 12%, rgba(255,255,255,0.95) 0 8%, transparent 22%),
        radial-gradient(circle at 88% 16%, rgba(255,255,255,0.75) 0 7%, transparent 20%),
        linear-gradient(135deg, var(--bg-1), var(--bg-2), var(--bg-3));
      min-height: 100vh;
      color: var(--text);
      overflow-x: hidden;
    }

    body::before {
      content: "";
      position: fixed;
      inset: 0;
      pointer-events: none;
      background-image:
        radial-gradient(circle, rgba(255,255,255,0.9) 0 3px, transparent 4px),
        radial-gradient(circle, rgba(255,190,11,0.34) 0 4px, transparent 5px),
        radial-gradient(circle, rgba(127,140,255,0.25) 0 5px, transparent 6px);
      background-position: 24px 30px, 120px 96px, 220px 54px;
      background-size: 190px 150px, 260px 210px, 310px 230px;
      animation: candyFloat 16s linear infinite;
      opacity: 0.8;
      z-index: -1;
    }

    @keyframes candyFloat {
      from { transform: translate3d(0, 0, 0); }
      to { transform: translate3d(0, -80px, 0); }
    }

    .container {
      padding: 18px;
    }

    .children-area {
      position: relative;
      background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255,255,255,0.76));
      border-radius: 30px;
      padding: 20px;
      box-shadow: 0 18px 36px rgba(92, 102, 255, 0.13);
      border: 5px dashed #ff9ecf;
      overflow: hidden;
    }

    .children-area::before {
      content: "";
      position: absolute;
      inset: 10px;
      border: 3px solid rgba(255,255,255,0.74);
      border-radius: 24px;
      pointer-events: none;
    }

    .title {
      font-size: 32px;
      font-weight: 900;
      text-align: center;
      margin: 0 0 18px;
      color: var(--pink);
      text-shadow: 2px 2px 0 #fff;
      animation: titlePop 2.2s ease-in-out infinite alternate;
    }

    @keyframes titlePop {
      from { transform: translateY(0) scale(1); }
      to { transform: translateY(-3px) scale(1.015); }
    }

    .tabs {
      display: flex;
      justify-content: center;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 16px;
    }

    .tab-btn,
    .tool-btn,
    .final-check-btn,
    .save-record-btn,
    .export-excel-btn,
    .delete-record-btn,
    .reset-btn {
      border: none;
      border-radius: 16px;
      color: white;
      cursor: pointer;
      font-weight: 900;
      box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
    }

    .tab-btn {
      font-size: 18px;
      padding: 10px 18px;
      background: #b6b6d9;
    }

    .tab-btn.active {
      background: var(--purple);
      transform: translateY(-2px) scale(1.05);
      box-shadow: 0 10px 20px rgba(127, 140, 255, 0.32);
    }

    .top-tools {
      display: flex;
      justify-content: center;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 18px;
    }

    .tool-btn {
      font-size: 16px;
      padding: 10px 14px;
    }

    .edit-mode-btn {
      background: var(--purple);
    }

    .edit-mode-btn.active {
      background: var(--purple-dark);
      transform: scale(1.03);
    }

    .save-btn {
      background: var(--mint);
    }

    .clear-save-btn {
      background: #ff8b8b;
    }

    .card-list {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
      gap: 12px;
      align-items: stretch;
    }

    .child-card,
    .add-card-tile {
      min-height: 295px;
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow);
    }

    .child-card {
      position: relative;
      background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(145deg, #8fd3ff, #ffd36b, #ff9ecf) border-box;
      padding: 12px;
      border: 4px solid transparent;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      align-items: stretch;
      transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
    }

    .child-card::before {
      content: "";
      position: absolute;
      inset: -35%;
      background: conic-gradient(from 180deg, transparent, rgba(255,255,255,0.65), transparent 32%);
      transform: translateX(-72%) rotate(12deg);
      opacity: 0;
      pointer-events: none;
    }

    .child-card:hover {
      transform: translateY(-6px) scale(1.015);
      box-shadow: 0 18px 34px rgba(127, 140, 255, 0.2);
    }

    .child-card.combo::before {
      animation: cardShine 0.7s ease;
    }

    @keyframes cardShine {
      0% { opacity: 0; transform: translateX(-72%) rotate(12deg); }
      25% { opacity: 0.9; }
      100% { opacity: 0; transform: translateX(72%) rotate(12deg); }
    }

    .child-card.done {
      background: #d8ffd8;
      border-color: #53c653;
    }

    .child-card.partial-one {
      background: #fff7cc;
      border-color: #ffcc4d;
    }

    .child-card.partial-two {
      background: #e6f7ff;
      border-color: #6fc7ff;
    }

    .status-area {
      min-height: 50px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 8px;
    }

    .status-badge {
      width: 100%;
      min-height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 8px 6px;
      border-radius: 14px;
      font-size: 13px;
      font-weight: 900;
      text-align: center;
      letter-spacing: -0.3px;
      color: white;
      white-space: nowrap;
      box-shadow: 0 4px 10px rgba(0,0,0,0.10);
    }

    .status-badge.idle { background: var(--pink-soft); }
    .status-badge.effort { background: var(--yellow); }
    .status-badge.almost { background: var(--blue); }
    .status-badge.done { background: var(--green); }

    .delete-card-btn {
      position: absolute;
      top: 7px;
      right: 7px;
      width: 32px;
      height: 32px;
      border: none;
      border-radius: 50%;
      background: var(--red);
      color: white;
      font-size: 20px;
      font-weight: 900;
      cursor: pointer;
      display: none;
      z-index: 2;
    }

    .child-card.editing .delete-card-btn {
      display: block;
    }

    .left-info {
      text-align: center;
      display: flex;
      flex-direction: column;
      align-items: center;
      flex: 1;
    }

    .child-photo {
      width: 78px;
      height: 78px;
      border-radius: 50%;
      object-fit: cover;
      border: 4px solid #ffd36b;
      box-shadow: 0 4px 10px rgba(0,0,0,0.08);
      display: block;
      margin: 0 auto 8px;
      background: #fff8f0;
      flex-shrink: 0;
    }

    .name-input {
      width: 100%;
      font-size: 18px;
      font-weight: 900;
      text-align: center;
      padding: 7px 8px;
      border-radius: 12px;
      border: 3px solid #d7c8ff;
      outline: none;
      color: #6a4cff;
      margin-bottom: 8px;
      background: #f5f5f5;
    }

    .name-input:disabled {
      color: #6a4cff;
      opacity: 1;
      cursor: default;
    }

    .upload-wrap {
      margin-bottom: 6px;
      text-align: center;
      min-height: 42px;
    }

    .upload-label {
      display: none;
      font-size: 12px;
      font-weight: 900;
      padding: 7px 10px;
      border-radius: 12px;
      background: var(--pink-soft);
      color: white;
      cursor: pointer;
      margin-bottom: 4px;
    }

    .child-card.editing .upload-label {
      display: inline-block;
    }

    .photo-input {
      display: none;
    }

    .upload-guide {
      font-size: 11px;
      font-weight: 700;
      color: #777;
      display: none;
    }

    .child-card.editing .upload-guide {
      display: block;
    }

    .item-control {
      text-align: center;
      margin-top: auto;
      user-select: none;
      min-height: 136px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
    }

    .item-btn {
      position: relative;
      width: 126px;
      height: 126px;
      border: none;
      border-radius: 24px;
      background:
        radial-gradient(circle at 50% 18%, rgba(255,255,255,0.9), rgba(255,255,255,0.22) 34%, transparent 60%),
        linear-gradient(180deg, #ffffff, #fff1fb);
      cursor: pointer;
      padding: 5px;
      margin-top: 2px;
      flex-shrink: 0;
      overflow: hidden;
      box-shadow:
        inset 0 0 0 3px rgba(255,255,255,0.8),
        0 11px 18px rgba(92, 102, 255, 0.17);
      transition: transform 0.16s ease, box-shadow 0.16s ease;
    }

    .item-btn:hover {
      transform: translateY(-3px) rotate(-1deg);
      box-shadow:
        inset 0 0 0 3px rgba(255,255,255,0.9),
        0 16px 24px rgba(92, 102, 255, 0.23);
    }

    .item-empty {
      position: absolute;
      inset: 12px;
      display: grid;
      place-items: center;
      border: 3px dashed rgba(127,140,255,0.24);
      border-radius: 18px;
      color: var(--purple-dark);
      background: rgba(255,255,255,0.62);
      font-size: 13px;
      font-weight: 900;
      line-height: 1.25;
      z-index: 0;
    }

    .item-visual {
      position: absolute;
      inset: 5px;
      z-index: 1;
      overflow: hidden;
      border-radius: 20px;
      transform-origin: center;
      will-change: opacity, transform;
    }

    .item-image {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: contain;
      filter: drop-shadow(0 8px 10px rgba(0,0,0,0.14));
      user-select: none;
      pointer-events: none;
    }

    .item-fill {
      position: absolute;
      left: var(--fill-left, 23%);
      right: var(--fill-right, 21%);
      bottom: var(--fill-bottom, 17%);
      height: var(--item-fill, 72%);
      border-radius: 0 0 30px 30px;
      background:
        radial-gradient(circle at 35% 18%, rgba(255,255,255,0.94), transparent 28%),
        var(--fill-gradient, linear-gradient(180deg, #fffef5, #fff4cf));
      box-shadow: inset 0 6px 12px rgba(255,255,255,0.78), 0 -2px 8px rgba(255,255,255,0.62);
      transition: height 0.45s cubic-bezier(.2,.8,.25,1), opacity 0.3s ease;
      overflow: hidden;
      z-index: 1;
      pointer-events: none;
    }

    .item-fill::before {
      content: "";
      position: absolute;
      left: -12%;
      right: -12%;
      top: -8px;
      height: 18px;
      border-radius: 50%;
      background: rgba(255,255,255,0.92);
      animation: milkWave 1.4s ease-in-out infinite alternate;
    }

    .meal-stage .item-image {
      transform: scale(0.98);
      transition: transform 0.35s ease, filter 0.35s ease, clip-path 0.42s cubic-bezier(.2,.8,.25,1), opacity 0.28s ease;
      clip-path: inset(0 0 0 0);
    }

    .item-btn.level-1 .meal-stage .item-image,
    .item-btn.level-2 .meal-stage .item-image {
      transform: scale(0.98) rotate(-1deg);
    }

    .item-btn.level-1 .meal-stage .item-image {
      clip-path: inset(0 33.333% 0 0);
      transform: scale(0.96) rotate(-1deg);
    }

    .item-btn.level-2 .meal-stage .item-image {
      clip-path: inset(0 66.666% 0 0);
      transform: scale(0.94) rotate(-1deg);
    }

    .item-btn.level-3 .meal-stage .item-image {
      clip-path: inset(0 100% 0 0);
      opacity: 0;
      transform: scale(0.9) rotate(-1deg);
    }

    .item-btn.level-3 .item-fill {
      opacity: 0;
    }

    @keyframes milkWave {
      from { transform: translateX(-4px) rotate(-1deg); }
      to { transform: translateX(4px) rotate(1deg); }
    }

    .milk-shine {
      position: absolute;
      inset: 0;
      z-index: 3;
      background: linear-gradient(115deg, transparent 18%, rgba(255,255,255,0.22) 38%, transparent 54%);
      opacity: 0.45;
      pointer-events: none;
    }

    .cookie-stage {
      overflow: hidden;
    }

    .cookie-stage .item-image {
      transform: scale(0.98);
      transition: transform 0.35s ease, filter 0.35s ease, clip-path 0.42s cubic-bezier(.2,.8,.25,1), opacity 0.28s ease;
      clip-path: inset(0 0 0 0);
    }

    .item-btn.level-1 .cookie-stage .item-image {
      clip-path: inset(0 33.333% 0 0);
      transform: scale(0.96) rotate(-1deg);
    }

    .item-btn.level-2 .cookie-stage .item-image {
      clip-path: inset(0 66.666% 0 0);
      transform: scale(0.94) rotate(-1deg);
    }

    .item-btn.level-3 .cookie-stage .item-image {
      clip-path: inset(0 100% 0 0);
      opacity: 0;
      transform: scale(0.9) rotate(-1deg);
    }

    .cookie-eaten-edge {
      position: absolute;
      top: 10px;
      bottom: 10px;
      width: 22px;
      right: 0;
      z-index: 3;
      opacity: 0;
      background:
        radial-gradient(circle at 45% 14%, #fff1fb 0 8px, transparent 9px),
        radial-gradient(circle at 55% 34%, #fff1fb 0 10px, transparent 11px),
        radial-gradient(circle at 42% 55%, #fff1fb 0 7px, transparent 8px),
        radial-gradient(circle at 58% 78%, #fff1fb 0 9px, transparent 10px);
      transform: translateX(8px);
      transition: right 0.42s cubic-bezier(.2,.8,.25,1), opacity 0.2s ease;
    }

    .item-btn.level-1 .cookie-eaten-edge {
      right: 32%;
      opacity: 1;
    }

    .item-btn.level-2 .cookie-eaten-edge {
      right: 65%;
      opacity: 1;
    }

    .meal-eaten-edge {
      position: absolute;
      top: 8px;
      bottom: 8px;
      width: 24px;
      right: 0;
      z-index: 3;
      opacity: 0;
      background:
        radial-gradient(circle at 40% 14%, #fffef7 0 8px, transparent 9px),
        radial-gradient(circle at 58% 32%, #1f382b 0 11px, transparent 12px),
        radial-gradient(circle at 42% 56%, #fffef7 0 8px, transparent 9px),
        radial-gradient(circle at 58% 78%, #f7c16a 0 10px, transparent 11px);
      transform: translateX(8px);
      transition: right 0.42s cubic-bezier(.2,.8,.25,1), opacity 0.2s ease;
    }

    .item-btn.level-1 .meal-eaten-edge {
      right: 32%;
      opacity: 1;
    }

    .item-btn.level-2 .meal-eaten-edge {
      right: 65%;
      opacity: 1;
    }

    .cookie-crumb {
      position: absolute;
      z-index: 4;
      width: 7px;
      height: 7px;
      border-radius: 999px;
      background: #d98a3e;
      opacity: 0;
      transition: opacity 0.25s ease, transform 0.35s ease;
    }

    .crumb-1 { top: 29px; right: 25px; }
    .crumb-2 { top: 70px; right: 48px; width: 5px; height: 5px; }
    .crumb-3 { right: 30px; bottom: 30px; width: 6px; height: 6px; }
    .meal-stage .crumb-1 { background: #fffef7; box-shadow: 0 0 0 1px rgba(30,40,35,0.06); }
    .meal-stage .crumb-2 { background: #26372d; }
    .meal-stage .crumb-3 { background: #f7c16a; }

    .item-btn.level-1 .crumb-1,
    .item-btn.level-2 .crumb-1,
    .item-btn.level-2 .crumb-2,
    .item-btn.level-3 .cookie-crumb {
      opacity: 1;
      transform: translate(-5px, 3px) rotate(12deg);
    }

    .item-visual.burst-out {
      animation: snackBurst 0.45s ease both;
    }

    @keyframes snackBurst {
      0% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
      55% { opacity: 1; transform: translateY(-8px) scale(1.08) rotate(-4deg); }
      100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
    }

    .spark {
      position: fixed;
      width: 10px;
      height: 10px;
      border-radius: 999px;
      pointer-events: none;
      z-index: 999;
      background: var(--spark-color, #ffbe0b);
      box-shadow: 0 0 0 4px rgba(255,255,255,0.65);
    }

    .item-help {
      display: none;
      margin-top: 5px;
      font-size: 10px;
      font-weight: 700;
      color: #666;
      line-height: 1.35;
      min-height: 28px;
    }

    .child-card.editing .item-help {
      display: block;
    }

    .add-card-tile {
      display: none;
      border: 4px dashed #9bc6ff;
      background: rgba(255,255,255,0.8);
      align-items: center;
      justify-content: center;
      text-align: center;
      padding: 12px;
      cursor: pointer;
      transition: 0.2s ease;
    }

    .add-card-tile.show {
      display: flex;
    }

    .add-card-tile:hover {
      transform: translateY(-2px);
      border-color: var(--purple);
      background: #f8fbff;
    }

    .add-card-inner {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
    }

    .add-card-plus {
      width: 58px;
      height: 58px;
      border-radius: 50%;
      background: var(--purple);
      color: white;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 34px;
      font-weight: 900;
      box-shadow: 0 6px 12px rgba(0,0,0,0.14);
    }

    .add-card-text {
      font-size: 16px;
      font-weight: 900;
      color: var(--purple-dark);
    }

    .add-card-guide {
      font-size: 12px;
      font-weight: 700;
      color: #666;
      line-height: 1.4;
    }

    .bottom-panel {
      padding: 0 18px 22px;
    }

    .check-box,
    .history-box {
      max-width: 1600px;
      margin: 0 auto 18px;
      background: var(--panel-bg);
      border-radius: var(--radius-xl);
      padding: 18px;
      border: 5px dashed var(--panel-border);
      box-shadow: var(--shadow);
    }

    .center-tools {
      text-align: center;
    }

    .final-check-btn,
    .save-record-btn,
    .export-excel-btn,
    .delete-record-btn,
    .reset-btn {
      font-size: 18px;
      padding: 11px 16px;
      margin: 4px;
    }

    .final-check-btn { background: var(--purple); }
    .save-record-btn { background: var(--mint); }
    .export-excel-btn { background: #4f93ff; }
    .delete-record-btn { background: var(--red); }
    .reset-btn { background: #ff8ac2; }

    .result-text {
      margin-top: 16px;
      font-size: 19px;
      font-weight: 900;
      line-height: 1.75;
      color: #5a3cff;
      background: #fffdf4;
      border-radius: 18px;
      padding: 16px;
      min-height: 130px;
      text-align: left;
      word-break: keep-all;
    }

    .record-tools {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      align-items: center;
      justify-content: center;
      margin-bottom: 14px;
    }

    .record-date {
      font-size: 18px;
      font-weight: 900;
      padding: 10px 14px;
      border-radius: 14px;
      border: 3px solid #d7c8ff;
    }

    .history-title {
      font-size: 28px;
      font-weight: 900;
      color: var(--pink);
      text-align: center;
      margin: 0 0 14px;
    }

    .history-table-wrap {
      overflow-x: auto;
    }

    .history-table {
      width: 100%;
      border-collapse: collapse;
      background: white;
      overflow: hidden;
    }

    .history-table th,
    .history-table td {
      border: 2px solid #f0d7e8;
      padding: 9px;
      font-size: 15px;
      text-align: left;
      vertical-align: top;
    }

    .history-table th {
      background: #ffe4f1;
      font-size: 17px;
    }

    .empty-history {
      font-size: 20px;
      font-weight: 800;
      color: #666;
      background: #fffdf4;
      border-radius: 18px;
      padding: 18px;
      text-align: center;
    }

    @media (max-width: 768px) {
      .title {
        font-size: 27px;
      }

      .card-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      }

      .child-card,
      .add-card-tile {
        min-height: 280px;
      }

      .result-text {
        font-size: 17px;
      }
    }

    @media (max-width: 480px) {
      .container,
      .bottom-panel {
        padding-left: 12px;
        padding-right: 12px;
      }

      .card-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
      }

      .child-card,
      .add-card-tile {
        min-height: 265px;
      }

      .child-photo {
        width: 70px;
        height: 70px;
      }

      .item-btn {
        width: 94px;
        height: 98px;
      }
    }