/* =========================================================
   BabyBlah — "Pop Sticker" design system
   Saturated baby blue, navy outlines, hard offset shadows, sunny highlights.
   ========================================================= */
:root {
  --sky: #8fd3f7;          /* signature baby blue */
  --sky-soft: #e8f6fe;
  --sky-mid: #c4e8fb;
  --sky-deep: #1c6fa8;
  --ink: #0e2a47;
  --ink-2: #2d4a68;
  --ink-3: #4f6985;
  --cream: #fffdf6;
  --white: #ffffff;
  --sun: #ffd84d;
  --sun-soft: #fff4c2;
  --peach: #ffe1d8;
  --mint: #c9f2e3;
  --danger: #e0405e;

  --bw: 3px;               /* border width */
  --line: var(--bw) solid var(--ink);
  --line-thin: 2px solid var(--ink);
  --pop-sm: 3px 3px 0 var(--ink);
  --pop: 5px 5px 0 var(--ink);
  --pop-lg: 9px 9px 0 var(--ink);
  --radius: 18px;
  --radius-lg: 28px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);

  --font-display: 'Fredoka', 'Noto Sans SC', ui-rounded, system-ui, sans-serif;
  --font-body: 'Nunito', 'Noto Sans SC', ui-rounded, system-ui, -apple-system, 'Segoe UI', 'Noto Sans KR', 'Noto Sans JP', sans-serif;
}
html.ui-zh {
  --font-display: 'Noto Sans SC', 'Fredoka', system-ui, sans-serif;
  --font-body: 'Noto Sans SC', 'Nunito', system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html:not(.i18n-ready) body { opacity: 0; }
body {
  margin: 0; font-family: var(--font-body); font-weight: 600; color: var(--ink); background: var(--cream);
  line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; transition: opacity .2s;
}
img { max-width: 100%; display: block; }
a { color: var(--sky-deep); text-decoration: none; font-weight: 800; }
a:hover { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.12; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
html.ui-zh h1, html.ui-zh h2, html.ui-zh h3 { font-weight: 900; letter-spacing: 0; word-break: keep-all; overflow-wrap: anywhere; }
::selection { background: var(--sun); color: var(--ink); }
:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 3px; border-radius: 8px; }
[hidden] { display: none !important; }

.container { width: min(1200px, 100% - 40px); margin-inline: auto; }
.muted { color: var(--ink-3); }
.small { font-size: .86rem; }
.center { text-align: center; }
.hint { font-size: .84rem; color: var(--ink-3); font-weight: 700; }
.mark { background: var(--sun); border: var(--line); border-radius: 14px; padding: 0 .18em; display: inline-block; transform: rotate(-1.5deg); line-height: 1.1; }
.kicker { display: inline-block; font-weight: 900; font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; background: var(--white); border: var(--line-thin); border-radius: 999px; padding: 5px 14px; box-shadow: var(--pop-sm); margin-bottom: 16px; }
html.ui-zh .kicker { letter-spacing: .08em; }
kbd { display: inline-block; padding: 1px 7px; border-radius: 6px; border: 2px solid var(--ink); border-bottom-width: 3px; background: var(--white); font-family: inherit; font-size: .78em; font-weight: 900; color: var(--ink); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--sky); border-bottom: var(--line); }
.nav { display: flex; align-items: center; gap: 18px; height: 74px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 1.5rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 42px; height: 42px; transition: transform .5s var(--spring); }
.brand:hover .brand-mark { transform: rotate(-12deg) scale(1.1); }
.nav-links { display: flex; gap: 6px; margin-left: 10px; }
.nav-links a { padding: 8px 16px; border-radius: 999px; color: var(--ink); font-weight: 800; border: 2px solid transparent; transition: background .2s, border-color .2s, transform .2s var(--spring); }
.nav-links a:hover { background: rgba(255,255,255,.55); transform: translateY(-2px); }
.nav-links a.active { background: var(--white); border-color: var(--ink); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang-switch { display: flex; border: var(--line-thin); border-radius: 999px; overflow: hidden; background: var(--white); }
.lang-switch button { border: 0; background: none; padding: 7px 12px; font-weight: 900; font-size: .85rem; cursor: pointer; min-height: 36px; transition: background .2s; }
.lang-switch button.on { background: var(--ink); color: var(--white); }
.lang-switch button:not(.on):hover { background: var(--sky-soft); }
.streak-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--sun); border: var(--line-thin); font-weight: 900; font-size: .9rem; }
.streak-pill svg { width: 16px; height: 16px; color: #e0560b; }
.user-chip { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; border: var(--line-thin); background: var(--white); padding: 4px 14px 4px 4px; border-radius: 999px; cursor: pointer; font-weight: 800; box-shadow: var(--pop-sm); transition: transform .2s var(--spring), box-shadow .2s; }
.user-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--sun); border: 2px solid var(--ink); display: grid; place-items: center; font-size: .85rem; font-weight: 900; flex: none; }
.menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 230px; background: var(--white); border: var(--line); border-radius: 18px; box-shadow: var(--pop); padding: 8px; opacity: 0; transform: translateY(-6px) scale(.97); pointer-events: none; transition: .2s var(--ease); transform-origin: top right; z-index: 60; }
.menu.open { opacity: 1; transform: none; pointer-events: auto; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 10px; color: var(--ink); background: none; border: 0; cursor: pointer; font-weight: 800; }
.menu a:hover, .menu button:hover { background: var(--sky-soft); }
.menu .menu-meta { padding: 8px 12px 10px; border-bottom: var(--line-thin); margin-bottom: 6px; font-size: .85rem; color: var(--ink-3); }
.menu .menu-meta strong { display: block; color: var(--ink); font-size: .95rem; }
.badge-admin { display: inline-block; font-size: .7rem; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: white; margin-left: 6px; vertical-align: middle; }
.burger { display: none; background: var(--white); border: var(--line-thin); border-radius: 12px; padding: 6px 8px; cursor: pointer; }
.burger span { display: block; width: 20px; height: 2.5px; background: var(--ink); margin: 4px 0; border-radius: 2px; }

@media (max-width: 860px) {
  .burger { display: block; }
  .nav-links { position: fixed; inset: 74px 0 auto 0; flex-direction: column; background: var(--sky); padding: 12px 20px 20px; border-bottom: var(--line); margin: 0; transform: translateY(-130%); transition: transform .35s var(--ease); z-index: -1; }
  .nav-links.open { transform: none; }
  .nav-right .btn-ghost, .user-btn .uname { display: none; }
  .user-btn { padding: 4px; }
}
@media (max-width: 480px) { .streak-pill { display: none; } .brand span { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--ink); --fg: var(--white); --sh: var(--sun);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; min-height: 46px; border-radius: 16px; border: var(--line); cursor: pointer;
  background: var(--bg); color: var(--fg); font-weight: 900; font-size: 1rem;
  box-shadow: 4px 4px 0 var(--sh); white-space: nowrap;
  transition: transform .2s var(--spring), box-shadow .2s var(--ease), opacity .2s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--sh); color: var(--fg); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--sh); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-blue { --bg: var(--sky); --fg: var(--ink); --sh: var(--ink); }
.btn-sun { --bg: var(--sun); --fg: var(--ink); --sh: var(--ink); }
.btn-ghost { --bg: var(--white); --fg: var(--ink); --sh: var(--ink); }
.btn-danger { --bg: var(--danger); --sh: var(--ink); }
.btn-sm { padding: 7px 14px; min-height: 38px; font-size: .88rem; border-width: 2px; box-shadow: 3px 3px 0 var(--sh); border-radius: 12px; }
.btn-sm:hover { box-shadow: 4px 4px 0 var(--sh); }
.btn-lg { padding: 16px 30px; font-size: 1.1rem; border-radius: 18px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: var(--line-thin); background: var(--white); cursor: pointer; color: var(--ink); box-shadow: var(--pop-sm); transition: transform .2s var(--spring), box-shadow .2s; }
.icon-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:disabled { opacity: .35; cursor: default; transform: none; box-shadow: none; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 900; font-size: .92rem; }
.input, .select, .textarea {
  width: 100%; padding: 12px 16px; border-radius: 14px; border: var(--line-thin);
  background: var(--white); outline: none; font-weight: 700; transition: box-shadow .2s, transform .2s;
}
.input:focus, .select:focus, .textarea:focus { box-shadow: var(--pop-sm); transform: translate(-1px, -1px); }
.input.bad { border-color: var(--danger); }
.textarea { min-height: 220px; resize: vertical; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, 'Noto Sans Mono CJK SC', monospace; font-size: .92rem; line-height: 1.7; font-weight: 500; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230e2a47' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.form-error { background: var(--peach); border: var(--line-thin); padding: 10px 14px; border-radius: 12px; font-weight: 800; font-size: .92rem; margin-bottom: 14px; display: none; }
.form-error.show { display: block; animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

/* ---------- Cards / chips ---------- */
.card { background: var(--white); border: var(--line); border-radius: var(--radius-lg); box-shadow: var(--pop); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 900; background: var(--sky-soft); border: 2px solid var(--ink); }
.chip.sun { background: var(--sun); }
.chip.peach { background: var(--peach); }
.chip.mint { background: var(--mint); }

/* ---------- Toast ---------- */
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: white; padding: 12px 20px; border-radius: 14px; font-weight: 800; border: var(--line); box-shadow: 4px 4px 0 var(--sun); animation: toastIn .45s var(--spring) both; }
.toast.error { background: var(--danger); box-shadow: var(--pop-sm); }
.toast.out { animation: toastOut .3s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.9) rotate(-3deg); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(30px) rotate(var(--rot, 0deg)); transition: opacity .8s var(--ease), transform .8s var(--spring); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: rotate(var(--rot, 0deg)); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 90px; padding: 30px 0; border-top: var(--line); background: var(--white); font-weight: 800; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; }
.footer-inner .brand { font-size: 1.15rem; }
.footer-inner .brand-mark { width: 32px; height: 32px; }

/* ---------- Page header (inner pages) ---------- */
.page-hero { position: relative; padding: 50px 0 54px; background: var(--sky); border-bottom: var(--line); margin-bottom: 40px; overflow: hidden; }
.page-hero h1 { font-size: clamp(2.2rem, 4.5vw, 3.4rem); }
.page-hero p { max-width: 640px; font-size: 1.1rem; font-weight: 700; margin: 0; }
.page-hero > .container { position: relative; z-index: 1; }
.page-hero .dot { position: absolute; z-index: 0; border-radius: 50%; border: var(--line); pointer-events: none; animation: bob 6s ease-in-out infinite; }
.page-hero .dot.d1 { width: 110px; height: 110px; right: 34%; top: -44px; background: var(--sun); }
.page-hero .dot.d2 { width: 56px; height: 56px; right: 4%; top: 18%; background: var(--white); animation-delay: -2s; }
.page-hero .dot.d3 { width: 34px; height: 34px; right: 42%; bottom: 12%; background: var(--peach); animation-delay: -4s; }
@media (max-width: 800px) { .page-hero .dot { display: none; } }
@keyframes bob { 50% { transform: translateY(-12px) rotate(8deg); } }

.skeleton { background: linear-gradient(90deg, var(--sky-soft), var(--sky-mid), var(--sky-soft)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 3px solid currentColor; border-right-color: transparent; display: inline-block; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

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

.tm { font-size: .45em; font-weight: 800; vertical-align: super; margin-left: 1px; line-height: 0; }
