.chis-app {
  --accent: #007AFF;
  --ok: #34C759;
  --bad: #FF3B30;
  --warn: #FF9500;
  --text: #1C1C1E;
  --muted: #8E8E93;
  --border: rgba(60,60,67,.14);
  --line: #000;
  --surface: #fff;
  --surface-2: #F2F2F7;
  --surface-3: #F9F9FB;
  --hero-hangul: rgba(28,28,30,.28);
  --hero-bg:
    radial-gradient(90% 120% at 100% 0%, rgba(0,122,255,.16), transparent 50%),
    radial-gradient(70% 90% at 0% 100%, rgba(52,199,89,.1), transparent 45%),
    linear-gradient(180deg, #fff 0%, #F7F8FA 100%);
  --summary-bg:
    radial-gradient(120% 80% at 50% 0%, rgba(0,122,255,.1), transparent 55%),
    var(--surface);
  --ring-track: rgba(60,60,67,.12);
  --shadow-card: 0 8px 20px rgba(0,0,0,.08);
  --feedback-ok-bg: rgba(52,199,89,.12);
  --feedback-ok-fg: #1b7a33;
  --feedback-bad-bg: rgba(255,59,48,.1);
  --feedback-bad-fg: #b42318;
  --choice-ok-bg: rgba(52,199,89,.12);
  --choice-bad-bg: rgba(255,59,48,.1);
  --cal-head-bg: #1C1C1E;
  --cal-head-fg: #fff;
  --cal-empty: #F2F2F7;
  --clock-bg: #111;
  --clock-fg: #7CFFB2;
  --icon-cal-bg: #E8F0FE;
  --icon-cal-fg: #1A56DB;
  --icon-clock-bg: #E8F8EE;
  --icon-clock-fg: #1B7A33;
  --icon-shop-bg: #FFF4E5;
  --icon-shop-fg: #C45C00;
  --tone-thermos-bg: #E8F0FE;
  --tone-thermos-fg: #1A56DB;
  --tone-headphones-bg: #F2F2F7;
  --tone-headphones-fg: #1C1C1E;
  --tone-notebook-bg: #E8F8EE;
  --tone-notebook-fg: #1B7A33;
  --tone-backpack-bg: #FFF4E5;
  --tone-backpack-fg: #C45C00;
  --tone-mug-bg: #F5E9FB;
  --tone-mug-fg: #7B2CBF;
  --tone-plug-bg: #E5F1FF;
  --tone-plug-fg: #007AFF;
  --tone-umbrella-bg: #EEEDFE;
  --tone-umbrella-fg: #5856D6;
  --tone-sneaker-bg: #FFE8E6;
  --tone-sneaker-fg: #C41E16;
  --tip-bg: rgba(255,149,0,.12);
  --tip-fg: #C45C00;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", Pretendard, system-ui, sans-serif;
  color: var(--text);
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 48px;
}

.chis-kicker {
  margin: 0 0 6px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.chis-title {
  margin: 0;
  font-size: clamp(1.85rem, 5vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
}
.chis-lead { margin: 0 0 20px; color: var(--muted); line-height: 1.5; }

.chis-home-hero {
  position: relative;
  margin: 0 0 18px;
  padding: 22px 20px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--hero-bg);
  animation: chis-home-in .45s ease both;
}
.chis-home-hangul {
  margin: 10px 0 0;
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--hero-hangul);
}

.chis-game-list { display: grid; gap: 10px; }
.chis-game-card {
  display: flex;
  gap: 14px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 14px 16px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform .12s ease, box-shadow .18s ease, border-color .15s ease;
  animation: chis-home-in .5s ease both;
}
.chis-game-card:nth-child(1) { animation-delay: .06s; }
.chis-game-card:nth-child(2) { animation-delay: .12s; }
.chis-game-card:nth-child(3) { animation-delay: .18s; }
@keyframes chis-home-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.chis-game-card:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.chis-game-card:not(:disabled):active { transform: scale(.99); }
.chis-game-card.is-soon { opacity: .55; cursor: not-allowed; }

.chis-game-icon {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.chis-game-card--cal .chis-game-icon {
  background: var(--icon-cal-bg);
  color: var(--icon-cal-fg);
}
.chis-game-card--clock .chis-game-icon {
  background: var(--icon-clock-bg);
  color: var(--icon-clock-fg);
}
.chis-game-card--shop .chis-game-icon {
  background: var(--icon-shop-bg);
  color: var(--icon-shop-fg);
}
.chis-game-body {
  display: grid;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.chis-game-body strong {
  font-size: 1.02rem;
  letter-spacing: -.01em;
}
.chis-game-tag {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.chis-game-go {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(118,118,128,.12);
  color: var(--text);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .9rem;
  transition: background .15s, color .15s;
}
.chis-game-card:not(:disabled):hover .chis-game-go {
  background: var(--accent);
  color: #fff;
}

.chis-play-title { margin: 0 0 14px; font-size: 1.25rem; color: var(--text); }
.chis-hint { margin: 0 0 16px; color: var(--muted); font-size: .9rem; line-height: 1.45; }

.chis-stage { margin-bottom: 16px; }
.chis-choices { display: grid; gap: 8px; }
.chis-choice {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}
.chis-choice:hover:not(:disabled) { border-color: var(--accent); }
.chis-choice:disabled { cursor: default; }
.chis-choice.is-correct { border-color: var(--ok); background: var(--choice-ok-bg); }
.chis-choice.is-wrong { border-color: var(--bad); background: var(--choice-bad-bg); }

.chis-feedback {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: .9rem;
}
.chis-feedback.is-ok { background: var(--feedback-ok-bg); color: var(--feedback-ok-fg); }
.chis-feedback.is-bad { background: var(--feedback-bad-bg); color: var(--feedback-bad-fg); }
.chis-actions { margin-top: 14px; text-align: center; }
.chis-end-wrap {
  margin-top: 20px;
  text-align: center;
}

.chis-btn {
  border: 0;
  border-radius: 20px;
  height: 40px;
  padding: 0 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.chis-btn-primary { background: var(--accent); color: #fff; }
.chis-btn-ghost { background: rgba(118,118,128,.18); color: var(--text); }

.chis-summary {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px 20px 24px;
  text-align: center;
  background: var(--summary-bg);
  color: var(--text);
}
.chis-summary.is-enter {
  animation: chis-summary-in .45s ease both;
}
@keyframes chis-summary-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.chis-summary-badge {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(52,199,89,.35);
}
.chis-summary-kicker {
  margin: 0 0 4px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.chis-summary-title {
  margin: 0 0 18px;
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.chis-summary-meters {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 20px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}
.chis-summary-meter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}
.chis-summary-meter-lbl {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}
.chis-summary-ring {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0;
}
.chis-summary-ring svg {
  display: block;
  transform: rotate(-90deg);
}
.chis-summary-ring-bg {
  fill: none;
  stroke: var(--ring-track);
  stroke-width: 10;
}
.chis-summary-ring-fg {
  fill: none;
  stroke: var(--accent);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset .7s ease, stroke .3s ease;
}
.chis-summary-ring.is-high .chis-summary-ring-fg { stroke: var(--ok); }
.chis-summary-ring.is-mid .chis-summary-ring-fg { stroke: var(--warn); }
.chis-summary-ring.is-low .chis-summary-ring-fg { stroke: var(--bad); }
.chis-summary-acc {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-weight: 800;
  font-size: 1.85rem;
  letter-spacing: -.03em;
  line-height: 1;
  color: var(--text);
}
.chis-summary-acc small {
  font-size: .95rem;
  font-weight: 700;
  color: var(--muted);
  margin-top: 6px;
}
.chis-summary-msg {
  margin: 0 0 18px;
  color: var(--text);
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.4;
}
.chis-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 20px;
}
.chis-summary-stat {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  background: var(--surface-3);
}
.chis-summary-stat-val {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--text);
}
.chis-summary-stat-lbl {
  display: block;
  margin-top: 4px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.chis-summary-stat.is-ok .chis-summary-stat-val { color: var(--ok); }
.chis-summary-stat.is-bad .chis-summary-stat-val { color: var(--bad); }
.chis-summary-avg {
  font-size: 1.55rem;
}
.chis-summary-tip {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--tip-bg);
  color: var(--tip-fg);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.4;
}
.chis-summary-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.chis-summary-actions .chis-btn { min-width: 140px; }

/* Calendar */
.chis-cal {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  max-width: 336px;
  margin: 0 auto;
  color: var(--text);
}
.chis-cal-head {
  background: var(--cal-head-bg);
  color: var(--cal-head-fg);
  text-align: center;
  padding: 10px 8px;
  font-weight: 800;
  font-size: .84rem;
}
.chis-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.chis-cal-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: .74rem;
}
.chis-cal-cell:nth-child(7n) { border-right: none; }
.chis-cal-cell.is-empty { background: var(--cal-empty); }
.chis-cal-cell.is-target {
  background: var(--accent);
  color: #fff;
  box-shadow: inset 0 0 0 2px var(--line);
}

/* Clock */
.chis-clock {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}
.chis-clock-face {
  background: var(--clock-bg);
  color: var(--clock-fg);
  font-family: "SF Mono", Menlo, Monaco, ui-monospace, monospace;
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 700;
  letter-spacing: .08em;
  padding: 16px 26px;
  border-radius: 12px;
  border: 3px solid var(--line);
  box-shadow: inset 0 0 18px rgba(0,0,0,.35);
}

/* Shop */
.chis-shop {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
  max-width: 420px;
  margin: 0 auto;
  color: var(--text);
}
.chis-shop-bar {
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px;
  font-size: .8rem;
  font-weight: 700;
  color: var(--muted);
}
.chis-product {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  padding: 16px;
  align-items: center;
}
.chis-product-art {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.chis-product-art--thermos { background: var(--tone-thermos-bg); color: var(--tone-thermos-fg); }
.chis-product-art--headphones { background: var(--tone-headphones-bg); color: var(--tone-headphones-fg); }
.chis-product-art--notebook { background: var(--tone-notebook-bg); color: var(--tone-notebook-fg); }
.chis-product-art--backpack { background: var(--tone-backpack-bg); color: var(--tone-backpack-fg); }
.chis-product-art--mug { background: var(--tone-mug-bg); color: var(--tone-mug-fg); }
.chis-product-art--plug { background: var(--tone-plug-bg); color: var(--tone-plug-fg); }
.chis-product-art--umbrella { background: var(--tone-umbrella-bg); color: var(--tone-umbrella-fg); }
.chis-product-art--sneaker { background: var(--tone-sneaker-bg); color: var(--tone-sneaker-fg); }
.chis-product-icon {
  display: block;
  flex-shrink: 0;
}
.chis-product-name {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 1.05rem;
}
.chis-product-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: .8rem;
}
.chis-product-price {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

/* Dark theme — manual */
[data-theme="dark"] .chis-app {
  --accent: #0A84FF;
  --ok: #30D158;
  --bad: #FF453A;
  --warn: #FF9F0A;
  --text: #F5F5F7;
  --muted: #98989D;
  --border: rgba(255,255,255,.12);
  --line: rgba(255,255,255,.22);
  --surface: #1C1C1E;
  --surface-2: #2C2C2E;
  --surface-3: #2C2C2E;
  --hero-hangul: rgba(245,245,247,.28);
  --hero-bg:
    radial-gradient(90% 120% at 100% 0%, rgba(10,132,255,.22), transparent 50%),
    radial-gradient(70% 90% at 0% 100%, rgba(48,209,88,.12), transparent 45%),
    linear-gradient(180deg, #1C1C1E 0%, #111113 100%);
  --summary-bg:
    radial-gradient(120% 80% at 50% 0%, rgba(10,132,255,.16), transparent 55%),
    var(--surface);
  --ring-track: rgba(255,255,255,.12);
  --shadow-card: 0 10px 28px rgba(0,0,0,.45);
  --feedback-ok-bg: rgba(48,209,88,.16);
  --feedback-ok-fg: #30D158;
  --feedback-bad-bg: rgba(255,69,58,.16);
  --feedback-bad-fg: #FF6961;
  --choice-ok-bg: rgba(48,209,88,.16);
  --choice-bad-bg: rgba(255,69,58,.16);
  --cal-head-bg: #000;
  --cal-head-fg: #F5F5F7;
  --cal-empty: #2C2C2E;
  --clock-bg: #000;
  --clock-fg: #7CFFB2;
  --icon-cal-bg: rgba(10,132,255,.18);
  --icon-cal-fg: #64B5FF;
  --icon-clock-bg: rgba(48,209,88,.16);
  --icon-clock-fg: #30D158;
  --icon-shop-bg: rgba(255,159,10,.16);
  --icon-shop-fg: #FF9F0A;
  --tone-thermos-bg: rgba(10,132,255,.18);
  --tone-thermos-fg: #64B5FF;
  --tone-headphones-bg: rgba(255,255,255,.08);
  --tone-headphones-fg: #F5F5F7;
  --tone-notebook-bg: rgba(48,209,88,.16);
  --tone-notebook-fg: #30D158;
  --tone-backpack-bg: rgba(255,159,10,.16);
  --tone-backpack-fg: #FF9F0A;
  --tone-mug-bg: rgba(191,90,242,.18);
  --tone-mug-fg: #BF5AF2;
  --tone-plug-bg: rgba(10,132,255,.18);
  --tone-plug-fg: #0A84FF;
  --tone-umbrella-bg: rgba(94,92,230,.18);
  --tone-umbrella-fg: #5E5CE6;
  --tone-sneaker-bg: rgba(255,69,58,.16);
  --tone-sneaker-fg: #FF453A;
  --tip-bg: rgba(255,159,10,.16);
  --tip-fg: #FF9F0A;
}

/* Dark theme — auto (OS) */
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] .chis-app {
    --accent: #0A84FF;
    --ok: #30D158;
    --bad: #FF453A;
    --warn: #FF9F0A;
    --text: #F5F5F7;
    --muted: #98989D;
    --border: rgba(255,255,255,.12);
    --line: rgba(255,255,255,.22);
    --surface: #1C1C1E;
    --surface-2: #2C2C2E;
    --surface-3: #2C2C2E;
    --hero-hangul: rgba(245,245,247,.28);
    --hero-bg:
      radial-gradient(90% 120% at 100% 0%, rgba(10,132,255,.22), transparent 50%),
      radial-gradient(70% 90% at 0% 100%, rgba(48,209,88,.12), transparent 45%),
      linear-gradient(180deg, #1C1C1E 0%, #111113 100%);
    --summary-bg:
      radial-gradient(120% 80% at 50% 0%, rgba(10,132,255,.16), transparent 55%),
      var(--surface);
    --ring-track: rgba(255,255,255,.12);
    --shadow-card: 0 10px 28px rgba(0,0,0,.45);
    --feedback-ok-bg: rgba(48,209,88,.16);
    --feedback-ok-fg: #30D158;
    --feedback-bad-bg: rgba(255,69,58,.16);
    --feedback-bad-fg: #FF6961;
    --choice-ok-bg: rgba(48,209,88,.16);
    --choice-bad-bg: rgba(255,69,58,.16);
    --cal-head-bg: #000;
    --cal-head-fg: #F5F5F7;
    --cal-empty: #2C2C2E;
    --clock-bg: #000;
    --clock-fg: #7CFFB2;
    --icon-cal-bg: rgba(10,132,255,.18);
    --icon-cal-fg: #64B5FF;
    --icon-clock-bg: rgba(48,209,88,.16);
    --icon-clock-fg: #30D158;
    --icon-shop-bg: rgba(255,159,10,.16);
    --icon-shop-fg: #FF9F0A;
    --tone-thermos-bg: rgba(10,132,255,.18);
    --tone-thermos-fg: #64B5FF;
    --tone-headphones-bg: rgba(255,255,255,.08);
    --tone-headphones-fg: #F5F5F7;
    --tone-notebook-bg: rgba(48,209,88,.16);
    --tone-notebook-fg: #30D158;
    --tone-backpack-bg: rgba(255,159,10,.16);
    --tone-backpack-fg: #FF9F0A;
    --tone-mug-bg: rgba(191,90,242,.18);
    --tone-mug-fg: #BF5AF2;
    --tone-plug-bg: rgba(10,132,255,.18);
    --tone-plug-fg: #0A84FF;
    --tone-umbrella-bg: rgba(94,92,230,.18);
    --tone-umbrella-fg: #5E5CE6;
    --tone-sneaker-bg: rgba(255,69,58,.16);
    --tone-sneaker-fg: #FF453A;
    --tip-bg: rgba(255,159,10,.16);
    --tip-fg: #FF9F0A;
  }
}
