/* 초파리 과일잔치 — 디자인 언어: "늦여름 밤 부엌, 나무 도마 위 과일 잔치. 어두운 방에 창문빛 같은 호박색 한 점."
   다이얼: VARIANCE 4 · MOTION 6 · DENSITY 4 */
@font-face { font-family: "Pretendard Variable"; src: url("/static/fonts/PretendardVariable.woff2") format("woff2-variations"); font-weight: 45 920; font-display: swap; }

:root {
  --bg: #14171C; --bg-2: #191D23; --surface: #1E232B; --surface-2: #252B35;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.16);
  --text: #E9EDF2; --text-2: #A7B0BD; --text-3: #6E7988;
  --amber: #FFB547; --amber-soft: rgba(255,181,71,.14); --leaf: #7CC24B; --berry: #E5394A;
  --wood: #6E4A2B;
  --r-1: 10px; --r-2: 16px; --r-3: 22px;
  --sh-1: 0 1px 0 rgba(255,255,255,.04) inset, 0 6px 18px rgba(0,0,0,.28);
  --sh-2: 0 20px 50px rgba(0,0,0,.45);
  --ease: cubic-bezier(.2,.8,.2,1); --ease-back: cubic-bezier(.34,1.56,.64,1);
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--bg); word-break: keep-all;
  background-image: radial-gradient(120% 60% at 85% -10%, rgba(255,181,71,.10), transparent 60%), radial-gradient(90% 50% at -10% 110%, rgba(124,194,75,.06), transparent 60%);
  font: 16px/1.55 "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  letter-spacing: -.01em; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

/* 상단 */
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); max-width: 980px; margin: 0 auto; padding: 10px 14px 6px; }
.brand { display: inline-flex; align-items: baseline; gap: 6px; text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -.03em; }
.brand small { font-size: 12px; font-weight: 650; color: var(--text-3); letter-spacing: 0; }
.tools { display: flex; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 700; transition: transform .2s var(--ease), background .2s, border-color .2s; }
.pill:hover { transform: translateY(-1px); border-color: rgba(255,181,71,.5); }
.pill:active { transform: scale(.96); }
.pill svg { width: 16px; height: 16px; }
.pill[aria-pressed="false"] { color: var(--text-3); }

/* 공통 머리말 아래 작은 줄 */
.fm-bar { display: flex; align-items: center; gap: 8px; max-width: 980px; margin: 0 auto; height: 42px; padding: 0 14px; }
.fm-bar a { color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 700; padding: 6px 2px; }
.fm-bar a:active { transform: scale(.95); }
.fm-bar .sp { flex: 1; }
.fm-bar h1 { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: -.02em; }
.fm-badge { display: inline-block; padding: 1px 8px; border-radius: 99px; background: rgba(255,181,71,.14); color: var(--amber); font-size: 11.5px; font-weight: 800; margin-right: 4px; }

/* 게임 영역 */
.layout { max-width: 980px; margin: 0 auto; padding: 0 12px 40px; display: grid; gap: var(--sp-5); grid-template-columns: minmax(0, 460px); justify-content: center; }
.game { display: flex; flex-direction: column; gap: 10px; padding-top: 50px; min-height: 560px; border-radius: var(--r-3); }
.game > .gk-hud { left: 0; right: 0; top: 4px; }
.game > .gk-ov { border-radius: var(--r-3); }
.game > .gk-tip { bottom: auto; top: 58%; }
.game .gk-card { max-height: 100%; overflow: auto; }
.fm-desc { margin: -6px 0 12px; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.fm-daily { width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; margin-top: 10px; padding: 12px 14px; border-radius: 16px; border: 1px solid rgba(255,181,71,.45); background: linear-gradient(135deg, rgba(255,181,71,.16), rgba(255,181,71,.03) 60%), var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.fm-daily .d1 { font-size: 11.5px; font-weight: 750; color: var(--amber); }
.fm-daily .d2 { font-size: 17px; font-weight: 820; letter-spacing: -.03em; }
.fm-daily .d3 { grid-column: 1; font-size: 12px; color: var(--text-2); }
.fm-daily .go { grid-row: 1 / span 3; grid-column: 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--amber); color: #1A1306; }
.fm-daily .go svg { width: 18px; height: 18px; }
.fm-stars { display: block; margin: 0 0 6px; letter-spacing: 6px; }
.fm-stars i { font-style: normal; font-size: 30px; color: #343A43; }
.fm-stars i.on { color: var(--amber); text-shadow: 0 4px 14px rgba(255,181,71,.45); }
.fm-change { width: 100%; margin-top: 8px; }
.hud { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: stretch; }
.stat { display: flex; flex-direction: column; justify-content: center; padding: 6px 12px; border-radius: var(--r-2); background: var(--surface); border: 1px solid var(--line); min-width: 84px; }
.stat span { font-size: 11px; font-weight: 700; color: var(--text-3); }
.stat b { font-size: 24px; font-weight: 850; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.stat.moves b { color: var(--amber); }
.stat.moves.low b { color: #FF7A6B; animation: beat 1s var(--ease) infinite; }
@keyframes beat { 50% { transform: scale(1.08); } }
.goals { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; padding: 6px 10px; border-radius: var(--r-2); background: var(--bg-2); border: 1px dashed var(--line-2); font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.goal { display: flex; align-items: center; gap: 6px; }
.goal canvas { width: 18px; height: 18px; flex: none; }
.goal b { color: var(--text); font-variant-numeric: tabular-nums; }
.goal.done { color: var(--leaf); }
.goal.done b { color: var(--leaf); }

.meter { position: relative; height: 10px; border-radius: 99px; background: var(--surface-2); margin: 6px 4px 12px; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: linear-gradient(90deg, #7CC24B, #FFB547); transition: width .5s var(--ease); }
.meter .mk { position: absolute; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; color: #3A404A; transition: color .3s, transform .4s var(--ease-back); }
.meter .mk.on { color: var(--amber); transform: scale(1.25); filter: drop-shadow(0 0 6px rgba(255,181,71,.6)); }
.meter .mk svg { width: 100%; height: 100%; display: block; }

.board-wrap { position: relative; width: 100%; aspect-ratio: 7 / 8; border-radius: var(--r-3); box-shadow: var(--sh-2); touch-action: none; user-select: none; -webkit-user-select: none; }
.board-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border-radius: var(--r-3); }
.toast { position: absolute; left: 50%; top: 14px; transform: translate(-50%, -8px); opacity: 0; pointer-events: none; padding: 8px 14px; border-radius: 99px; background: rgba(18,20,23,.86); border: 1px solid var(--line-2); font-size: 13.5px; font-weight: 700; white-space: nowrap; transition: opacity .25s, transform .3s var(--ease); max-width: 92%; overflow: hidden; text-overflow: ellipsis; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.howto { text-wrap: pretty; margin: 2px 4px 0; font-size: 13px; color: var(--text-3); line-height: 1.6; }

/* 설명 */
.info { display: flex; flex-direction: column; gap: var(--sp-4); }
.info h2 { margin: 0; font-size: 13px; font-weight: 750; color: var(--text-3); letter-spacing: .02em; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.legend li { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; }
.legend canvas { width: 44px; height: 44px; border-radius: 12px; background: #5E3F24; }
.legend b { display: block; font-size: 14.5px; font-weight: 750; }
.legend span { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.note { margin: 0; font-size: 12.5px; color: var(--text-3); line-height: 1.65; padding: 12px 14px; border-radius: var(--r-2); background: var(--bg-2); border: 1px solid var(--line); }
.note b { color: var(--text-2); }

/* 시트(시작·결과) */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(8,9,11,.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet.on { opacity: 1; pointer-events: auto; }
.sheet .panel { width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0; background: var(--bg-2); border: 1px solid var(--line-2); border-bottom: 0; box-shadow: var(--sh-2); transform: translateY(24px); transition: transform .4s var(--ease); }
.sheet.on .panel { transform: none; }
@media (min-width: 600px) { .sheet { align-items: center; } .sheet .panel { border-radius: 26px; border-bottom: 1px solid var(--line-2); } }

.kicker { font-size: 12px; font-weight: 750; color: var(--amber); letter-spacing: .04em; }
.title { margin: 4px 0 6px; font-size: 40px; line-height: 1.05; font-weight: 880; letter-spacing: -.05em; }
.title em { font-style: normal; color: var(--amber); }
.lead { text-wrap: balance; margin: 0 0 18px; color: var(--text-2); font-size: 14.5px; }
.daily { width: 100%; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 16px; border-radius: var(--r-3); border: 1px solid rgba(255,181,71,.45); background: linear-gradient(135deg, rgba(255,181,71,.16), rgba(255,181,71,.03) 60%), var(--surface); box-shadow: var(--sh-1); transition: transform .25s var(--ease), box-shadow .25s; }
.daily:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(255,181,71,.5), var(--sh-2); }
.daily:active { transform: scale(.98); }
.daily .d1 { font-size: 12px; font-weight: 750; color: var(--amber); }
.daily .d2 { font-size: 20px; font-weight: 820; letter-spacing: -.03em; }
.daily .d3 { grid-column: 1; font-size: 12.5px; color: var(--text-2); }
.daily .go { grid-row: 1 / span 3; grid-column: 2; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--amber); color: #1A1306; }
.daily .go svg { width: 20px; height: 20px; }
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.lvl { text-align: left; padding: 12px 14px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 2px; transition: transform .2s var(--ease), border-color .2s, background .2s; }
.lvl:hover { transform: translateY(-2px); border-color: var(--line-2); background: var(--surface-2); }
.lvl:active { transform: scale(.97); }
.lvl b { font-size: 17px; font-weight: 800; }
.lvl span { font-size: 12px; color: var(--text-3); line-height: 1.45; }
.lvl i { font-style: normal; font-size: 12px; font-weight: 700; color: var(--text-2); margin-top: 4px; }
.lvl .dots { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: 2px; }
.lvl .dots u { width: 6px; height: 6px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); }
.lvl .dots u.f { background: var(--amber); border-color: var(--amber); }
.fine { margin: 14px 2px 0; font-size: 12px; color: var(--text-3); }

.res-head { text-align: center; }
.res-head .title { font-size: 34px; }
.stars { display: flex; justify-content: center; gap: 10px; margin: 8px 0 6px; }
.stars span { width: 54px; height: 54px; color: #343A43; transform: scale(.6); opacity: .5; transition: transform .45s var(--ease-back), color .3s, opacity .3s; }
.stars span.on { color: var(--amber); transform: scale(1); opacity: 1; filter: drop-shadow(0 4px 14px rgba(255,181,71,.45)); }
.stars span:nth-child(2) { margin-top: -10px; }
.stars svg { width: 100%; height: 100%; display: block; }
.res-score { text-align: center; font-size: 46px; font-weight: 880; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.res-sub { text-align: center; color: var(--text-2); font-size: 14px; margin: 4px 0 2px; min-height: 22px; }
.res-sub .rec { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 99px; background: var(--amber); color: #1A1306; font-size: 12px; font-weight: 800; }
.res-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 16px; }
.res-facts div { padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.res-facts b { display: block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.res-facts span { font-size: 11px; color: var(--text-3); font-weight: 650; }
.btn-main { width: 100%; height: 56px; border: 0; border-radius: 18px; background: var(--amber); color: #1A1306; font-size: 18px; font-weight: 850; letter-spacing: -.02em; box-shadow: 0 10px 26px rgba(255,181,71,.28); transition: transform .2s var(--ease), box-shadow .2s; }
.btn-main:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(255,181,71,.36); }
.btn-main:active { transform: scale(.97); }
.btn-sub { width: 100%; height: 46px; margin-top: 8px; border-radius: 14px; border: 1px solid var(--line-2); background: transparent; font-size: 14.5px; font-weight: 700; color: var(--text-2); }
.btn-sub:hover { background: var(--surface); color: var(--text); }

@media (min-width: 900px) {
  .layout { grid-template-columns: 460px 300px; justify-content: center; gap: 40px; padding-top: 8px; }
  .info { padding-top: 70px; }
}
@media (max-width: 360px) { .stat { min-width: 70px; padding: 6px 9px; } .stat b { font-size: 21px; } .title { font-size: 34px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; } }
