:root {
  color-scheme: light;
  font-family: system-ui, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  color: #22403a;
  background: #eef6ee;
  -webkit-text-size-adjust: 100%;
  --ink: #22403a;
  --muted: #587068;
  --brand: #1f8a72;
  --brand-deep: #14685a;
  --paper: #fffdf7;
  --line: #d6e3d6;
  --tone: #1f8a72;
  --tint: #dcf2e8;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100svh; color: var(--ink);
  background:
    radial-gradient(circle at 8% 4%, #fff3c4 0, transparent 26%),
    radial-gradient(circle at 96% 18%, #dbeefc 0, transparent 30%),
    radial-gradient(circle at 60% 100%, #ffe4ea 0, transparent 34%),
    #eef6ee;
}
a { color: inherit; }
.home { max-width: 1200px; margin: 0 auto; padding: 28px 32px 30px; }

/* Brand bar */
.brand { display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 800; letter-spacing: -.7px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; padding: 8px; color: #fff; background: var(--brand); border-radius: 14px; box-shadow: 0 3px 0 var(--brand-deep); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-note { margin-left: auto; font-weight: 600; font-size: 13px; color: var(--muted); letter-spacing: 0; padding: 6px 12px; border-radius: 20px; background: #ffffffaa; border: 1px solid var(--line); }

/* Hero: words on the left, a little toy pile on the right */
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, .9fr); gap: 24px; align-items: center; padding: 40px 0 34px; }
.eyebrow { color: var(--brand); font-size: 13px; font-weight: 800; letter-spacing: 1.4px; margin: 0 0 12px; }
h1 { font-size: clamp(30px, 5vw, 46px); margin: 0; letter-spacing: -1.8px; line-height: 1.25; text-wrap: balance; }
.sub { color: var(--muted); font-size: 17px; margin: 14px 0 0; line-height: 1.65; max-width: 34em; word-break: keep-all; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 24px; }
.pick {
  display: inline-flex; align-items: center; gap: 10px; min-height: 58px; padding: 0 26px 0 20px;
  font: inherit; font-size: 18px; font-weight: 800; color: #fff; cursor: pointer;
  background: linear-gradient(#ffb64a, #f28c1e); border: 2px solid #f9c874; border-radius: 30px;
  box-shadow: 0 7px 0 #c46a0f, 0 12px 22px #f28c1e33, inset 0 2px 0 #ffe2ad;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  transition: transform .14s, box-shadow .14s;
}
.pick svg { width: 26px; height: 26px; }
.pick:hover { transform: translateY(-2px); box-shadow: 0 9px 0 #c46a0f, 0 16px 26px #f28c1e40, inset 0 2px 0 #ffe2ad; }
.pick:active { transform: translateY(4px); box-shadow: 0 2px 0 #c46a0f, inset 0 2px 0 #ffe2ad; }
.pick:focus-visible, a:focus-visible { outline: 3px solid #1f6fb5; outline-offset: 4px; }
.count-chip { font-size: 14px; font-weight: 600; color: var(--muted); padding: 10px 14px; border-radius: 22px; background: #ffffffbb; border: 1px solid var(--line); }
.count-chip strong { color: var(--brand); font-size: 16px; }
.hero-art { display: grid; place-items: center; }
.hero-art svg { width: 100%; max-width: 330px; height: auto; filter: drop-shadow(0 10px 12px #2f5c4d18); }
@keyframes bob { from { transform: translateY(0); } to { transform: translateY(-8px); } }
.hero-art svg { animation: bob 3.2s ease-in-out infinite alternate; }

/* Toy cards: each card carries its own --tone/--tint from catalog.js */
.toys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding: 0; margin: 0; list-style: none; }
.toys>li { min-width: 0; }
.toy {
  height: 100%; display: flex; flex-direction: column; position: relative;
  border: 2px solid #fff; border-radius: 30px; overflow: hidden; background: var(--paper);
  box-shadow: 0 8px 0 color-mix(in srgb, var(--tone) 22%, #cfdccf), 0 14px 26px #2f5c4d12;
  text-decoration: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
a.toy { transition: transform .18s, box-shadow .18s; }
a.toy:hover { transform: translateY(-5px) rotate(-.4deg); box-shadow: 0 12px 0 color-mix(in srgb, var(--tone) 28%, #cfdccf), 0 20px 30px #2f5c4d18; }
a.toy:active { transform: translateY(3px); box-shadow: 0 3px 0 color-mix(in srgb, var(--tone) 28%, #cfdccf); }
a.toy.picked { outline: 4px solid var(--tone); outline-offset: 5px; transform: scale(1.03); box-shadow: 0 12px 0 color-mix(in srgb, var(--tone) 35%, #cfdccf), 0 0 0 12px color-mix(in srgb, var(--tone) 18%, transparent); }
.toy-preview { height: 232px; position: relative; overflow: hidden; display: grid; place-items: center; background: linear-gradient(160deg, #fff 0%, var(--tint) 100%); }
.toy-preview::after { content: ""; position: absolute; inset: auto 0 0; height: 46%; background: linear-gradient(transparent, color-mix(in srgb, var(--tint) 65%, transparent)); pointer-events: none; }
.toy-preview img { width: 100%; height: 100%; object-fit: cover; }
.toy-tag { position: absolute; left: 16px; top: 16px; z-index: 1; padding: 7px 12px; background: var(--tone); color: #fff; border-radius: 20px; font-size: 12px; font-weight: 800; letter-spacing: .2px; box-shadow: 0 3px 0 color-mix(in srgb, var(--tone) 70%, #000 30%); }
.toy-badge { position: absolute; right: 14px; top: 14px; z-index: 1; padding: 6px 10px; background: #fff7d6; color: #a1650f; border: 1px solid #f3d383; border-radius: 16px; font-size: 11px; font-weight: 800; }
.toy-copy { padding: 22px 24px 22px; flex: 1; display: flex; flex-direction: column; }
.toy h2 { font-size: 23px; margin: 0; line-height: 1.35; letter-spacing: -.7px; }
.toy p { font-size: 14.5px; color: var(--muted); line-height: 1.7; margin: 8px 0 18px; word-break: keep-all; }
.play-link {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between; min-height: 50px; padding: 0 8px 0 18px;
  border-radius: 26px; background: var(--tint); color: color-mix(in srgb, var(--tone) 80%, #000); font-size: 15px; font-weight: 800;
  transition: background .18s, color .18s;
}
.play-link>span { border-radius: 50%; background: var(--tone); color: #fff; width: 36px; height: 36px; display: grid; place-items: center; font-size: 13px; padding-left: 2px; box-shadow: 0 2px 0 color-mix(in srgb, var(--tone) 70%, #000 30%); }
a.toy:hover .play-link { background: var(--tone); color: #fff; }
a.toy:hover .play-link>span { background: #fff; color: var(--tone); }

/* Coming-soon cards stay quiet */
.soon { background: #f6f9f4; border: 2px dashed #cbd9cb; box-shadow: 0 6px 0 #dbe6db; }
.soon .toy-preview { background: #e6eee8; }
.soon .toy-preview::after { display: none; }
.soon .toy-preview img { width: 102px; height: 155px; object-fit: contain; opacity: .7; }
.soon h2 { color: #5b7369; }
.soon .toy-tag { background: #fff; color: #5b7065; box-shadow: none; border: 1px solid var(--line); }
.soon .play-link { background: #edf2ec; color: #6b8177; font-weight: 600; }

.home-footer { display: grid; justify-items: center; gap: 8px; margin-top: 40px; font-size: 12px; color: var(--muted); }
.footer-line { display: flex; align-items: center; gap: 7px; }
.footer-line svg { width: 15px; height: 15px; }
.footer-links { display: flex; align-items: center; gap: 10px; }
.text-button { font: inherit; font-size: 12px; font-weight: 600; color: var(--muted); background: none; border: 0; padding: 8px 4px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; -webkit-tap-highlight-color: transparent; }
.text-button:focus-visible { outline: 3px solid #1f6fb5; outline-offset: 2px; border-radius: 6px; }

/* Star stickers on each card */
.toy-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.toy-stars { display: inline-flex; gap: 2px; flex-shrink: 0; font-size: 18px; line-height: 1; color: #d9dfd6; letter-spacing: 0; }
.toy-stars i { font-style: normal; }
.toy-stars i.on { color: #f1b32b; text-shadow: 0 1px 0 #b77f10; }

/* Parent settings dialog */
.parent-dialog { border: 0; border-radius: 26px; padding: 26px 26px 22px; width: min(92vw, 420px); background: var(--paper); color: var(--ink); box-shadow: 0 16px 40px #1b3a3033; }
.parent-dialog::backdrop { background: #1a2f2a66; }
.parent-dialog h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.8px; }
.parent-dialog .eyebrow { margin-bottom: 6px; }
.dialog-note { font-size: 13px; color: var(--muted); margin: 0 0 16px; line-height: 1.6; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); cursor: pointer; }
.setting-row span { display: grid; gap: 3px; }
.setting-row b { font-size: 15px; }
.setting-row small { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.setting-row input { width: 48px; height: 28px; margin: 0; flex-shrink: 0; appearance: none; -webkit-appearance: none; border-radius: 16px; background: #cfdad0; position: relative; cursor: pointer; transition: background .18s; }
.setting-row input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px #0003; transition: transform .18s; }
.setting-row input:checked { background: var(--brand); }
.setting-row input:checked::after { transform: translateX(20px); }
.setting-row input:focus-visible { outline: 3px solid #1f6fb5; outline-offset: 3px; }
.dialog-close { margin-top: 16px; width: 100%; min-height: 48px; border: 0; border-radius: 16px; background: var(--brand); color: #fff; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 0 var(--brand-deep); }
.dialog-close:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--brand-deep); }
.fallback { padding: 30px; gap: 10px; }

@media(min-width:1000px) { .toys { grid-template-columns: repeat(3, minmax(0, 1fr)); } .toy-preview { height: 218px; } .toy-copy { padding: 20px 22px; } .toy h2 { font-size: 22px; } }
@media(max-width:720px) {
  .home { padding: 18px 18px 26px; }
  .brand { font-size: 18px; }
  .brand-note { font-size: 11px; padding: 5px 10px; }
  .hero { grid-template-columns: 1fr; gap: 6px; padding: 26px 0 22px; }
  .hero-art { order: -1; }
  .hero-art svg { max-width: 220px; }
  .eyebrow { font-size: 12px; margin-bottom: 8px; }
  .sub { font-size: 15px; margin-top: 10px; }
  .hero-actions { margin-top: 18px; gap: 10px; }
  .pick { width: 100%; justify-content: center; min-height: 60px; font-size: 19px; }
  .count-chip { margin: 0 auto; }
  .toys { grid-template-columns: 1fr; gap: 18px; }
  .toy { border-radius: 26px; }
  .toy-preview { height: 200px; }
  .toy-copy { padding: 18px 18px 18px; }
  .toy h2 { font-size: 21px; }
  .toy p { margin: 6px 0 14px; font-size: 14px; }
  .soon { display: grid; grid-template-columns: 110px 1fr; }
  .soon .toy-preview { height: 100%; min-height: 170px; }
  .soon .toy-preview img { width: 49px; height: 91px; margin-top: 20px; }
  .soon .toy-tag { top: 10px; left: 10px; font-size: 10px; padding: 5px 8px; }
  .soon .toy-copy { padding: 18px 16px; }
  .soon h2 { font-size: 19px; }
  .soon p { font-size: 13px; }
  .soon .play-link { font-size: 12px; }
}
@media(prefers-reduced-motion:reduce) { a.toy, .pick, .play-link, .setting-row input, .setting-row input::after { transition: none; } .hero-art svg { animation: none; } }

/* Night mode: calmer colors for the evening (html[data-night] is set by toys/shared/night.js) */
.night-toggle { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: #ffffffaa; color: var(--muted); cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.night-toggle svg { width: 20px; height: 20px; }
.night-toggle[aria-pressed="true"] { background: #f3d383; color: #5a4a22; border-color: #e2c25a; }
.night-toggle:focus-visible { outline: 3px solid #1f6fb5; outline-offset: 3px; }
html[data-night] { --ink: #e6eef2; --muted: #a3b6c1; --brand: #5cc7ab; --brand-deep: #2f8a72; --paper: #1f2f3c; --line: #34485a; color: var(--ink); background: #16232e; }
html[data-night] body { background: radial-gradient(circle at 8% 4%, #2b3a4a 0, transparent 26%), radial-gradient(circle at 96% 18%, #22364a 0, transparent 30%), #16232e; }
html[data-night] .brand-note, html[data-night] .count-chip, html[data-night] .night-toggle { background: #1f2f3ccc; }
html[data-night] .night-toggle[aria-pressed="true"] { background: #f3d383; color: #5a4a22; }
html[data-night] .toy { border-color: #2c3f50; box-shadow: 0 8px 0 #0f1a23, 0 14px 26px #0006; }
html[data-night] a.toy:hover { box-shadow: 0 12px 0 #0f1a23, 0 20px 30px #0008; }
html[data-night] .toy-preview { background: linear-gradient(160deg, #2a3d4e, color-mix(in srgb, var(--tone) 28%, #1f2f3c)); }
html[data-night] .toy-preview::after { background: linear-gradient(transparent, #1f2f3ca0); }
html[data-night] .toy-preview img { filter: brightness(.82) saturate(.9); }
html[data-night] .toy-badge { background: #3a2f16; color: #f3d383; border-color: #5a4a22; }
html[data-night] .play-link { background: color-mix(in srgb, var(--tone) 24%, #1f2f3c); color: #fff; }
html[data-night] .pick { filter: saturate(.85) brightness(.92); }
html[data-night] .hero-art svg { filter: drop-shadow(0 10px 12px #0006) brightness(.9); }
html[data-night] .soon { background: #1b2934; border-color: #34485a; box-shadow: 0 6px 0 #0f1a23; }
html[data-night] .soon .toy-preview { background: #22313e; }
html[data-night] .soon .toy-tag { background: #1f2f3c; color: #a3b6c1; }
html[data-night] .soon .play-link { background: #263849; color: #a3b6c1; }
html[data-night] .parent-dialog::backdrop { background: #000a; }
html[data-night] .setting-row input { background: #3a4f62; }
html[data-night] .toy-stars { color: #34485a; }
html[data-night] .toy-stars i.on { color: #f1b32b; }
