/* Tokens and parts follow design-system/hom-nay-an-gi/pages/planner.md. Be Vietnam Pro is self-hosted (ADR-0004), no network. */
@font-face {
  font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/be-vietnam-pro-400-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/be-vietnam-pro-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/be-vietnam-pro-600-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/be-vietnam-pro-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("fonts/be-vietnam-pro-800-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("fonts/be-vietnam-pro-800-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 900; font-display: swap;
  src: url("fonts/be-vietnam-pro-900-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Be Vietnam Pro"; font-style: normal; font-weight: 900; font-display: swap;
  src: url("fonts/be-vietnam-pro-900-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Design A: swipe deck. Tomato red darkened from #E23744 (white on it 4.32:1, under AA) to #D92F3D (4.75:1). */
:root {
  --bg: #FFFFFF; --card: #FFFFFF; --fg: #0F172A; --muted: #475569;
  --primary: #D92F3D; --on-primary: #FFFFFF; --border: #E2E8F0; --notice: #FEF3C7;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --radius-chip: 999px; --radius-btn: 16px; --radius-card: 28px;
  --font: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 var(--font);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--fg); outline-offset: 2px; }
#app { min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: 32rem; margin: 0 auto; padding: var(--space-3) var(--space-4) 0; display: flex; flex-direction: column; }

.today { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
h1 { margin: 0 0 var(--space-3); font-size: 24px; line-height: 1.2; font-weight: 900; letter-spacing: -0.02em; }

.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; border: 0; }
.chip {
  min-height: 44px; padding: 0 14px; border-radius: var(--radius-chip); cursor: pointer;
  border: 1.5px solid var(--border); background: var(--card); color: var(--fg);
  font: 600 15px/1 var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.chip[aria-checked="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

.mood-row { display: flex; gap: 6px; }
.mood-row .chip { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px; padding: 4px 2px; min-height: 56px; border-radius: 18px; font-size: 13px; white-space: nowrap; }
.mood-row .chip .face { font: 22px/1 var(--font-emoji); }

@media (max-width: 380px) { .mood-row { gap: 4px; } .mood-row .chip { padding: 4px 0; font-size: 12px; } }

#notice { margin: var(--space-3) 0 0; padding: var(--space-2) var(--space-3); background: var(--notice); border-radius: 12px; font-size: 13px; }

.stage { flex: 1; position: relative; min-height: 340px; margin: var(--space-4) 0 var(--space-3); }
.prompt { margin: 0; height: 100%; display: grid; place-items: center; text-align: center; font-size: 17px; color: var(--muted); border: 2px dashed var(--border); border-radius: var(--radius-card); padding: var(--space-5); }
.deck { position: absolute; inset: 0 var(--space-3) 24px; }

.card {
  position: absolute; inset: 0; border-radius: var(--radius-card); overflow: hidden; color: #fff;
  background: linear-gradient(160deg, #FED7AA, #FDBA74); box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  transform-origin: 50% 90%; will-change: transform;
}
.card.peek { pointer-events: none; }
.card.peek-1 { transform: translateY(14px) scale(0.95) rotate(-3deg); filter: brightness(0.97); }
.card.peek-2 { transform: translateY(26px) scale(0.9) rotate(3deg); filter: brightness(0.94); }
.card.top { touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none; z-index: 3; }
.card.top.dragging { cursor: grabbing; }
.card.top.chosen { cursor: default; touch-action: auto; }
.art { position: absolute; inset: 0 0 38% 0; display: grid; place-items: center; font: 120px/1 var(--font-emoji); }
.art.photo { inset: 0; }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.scrim { position: absolute; inset: 0; background: linear-gradient(to top, rgba(15, 23, 42, 0.94) 0%, rgba(15, 23, 42, 0.78) 38%, rgba(15, 23, 42, 0) 70%); }
.info { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--space-5) var(--space-5) var(--space-5); }
.card h2 { margin: var(--space-2) 0 var(--space-1); font-size: 32px; line-height: 1.1; font-weight: 900; letter-spacing: -0.02em; }
.card .reason { margin: 0; font-size: 15px; line-height: 1.4; color: #F1F5F9; }
.meta { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 3px 10px; border-radius: var(--radius-chip); font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, 0.22); color: #fff; }
.count { position: absolute; top: var(--space-3); left: var(--space-3); padding: 3px 10px; border-radius: var(--radius-chip); background: rgba(255, 255, 255, 0.92); font-size: 13px; font-weight: 700; color: var(--fg); }
.stamp {
  position: absolute; top: 28px; left: 20px; padding: 2px 14px; border: 4px solid #fff; border-radius: 12px; color: #fff; background: var(--primary);
  font-size: 34px; font-weight: 900; letter-spacing: 0.02em; transform: rotate(-14deg); opacity: 0; pointer-events: none;
}

.actions { display: flex; align-items: center; justify-content: center; gap: var(--space-4); padding: var(--space-2) 0 var(--space-3); }
.actions.chosen { flex-direction: column; align-items: stretch; gap: var(--space-2); }
.round {
  flex: none; width: 56px; height: 56px; border-radius: 50%; cursor: pointer; background: var(--card); color: var(--fg);
  border: 2px solid var(--border); box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1); display: grid; place-items: center; font: 24px/1 var(--font-emoji);
}
.round svg { width: 24px; height: 24px; }
.btn {
  min-height: 56px; border-radius: var(--radius-btn); cursor: pointer; font: 800 17px/1 var(--font); padding: 0 var(--space-5);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); text-decoration: none;
}
.btn svg { width: 22px; height: 22px; flex: none; }
.actions .btn-primary { flex: 1; }
.btn-primary { border: 0; background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 16px rgba(217, 47, 61, 0.3); }
.btn-big { min-height: 64px; font-size: 19px; }
.btn-secondary { background: var(--card); color: var(--fg); border: 2px solid var(--border); }
button:disabled { opacity: 0.4; cursor: default; box-shadow: none; }

footer { max-width: 32rem; width: 100%; margin: 0 auto; padding: 0 var(--space-4) var(--space-3); font-size: 12px; color: var(--muted); text-align: center; }

.sheet { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; }
.backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.5); }
.sheet-panel { position: relative; width: 100%; max-width: 32rem; background: #fff; border-radius: 24px 24px 0 0; padding: var(--space-5) var(--space-4) calc(var(--space-4) + env(safe-area-inset-bottom)); }
.sheet-panel h2 { margin: 0 0 var(--space-3); font-size: 20px; font-weight: 900; }
.group + .group { margin-top: var(--space-3); }
.group-label { margin: 0 0 var(--space-2); font-size: 14px; font-weight: 700; color: var(--muted); }
.sheet-panel .btn { width: 100%; margin-top: var(--space-4); }

@media (prefers-reduced-motion: no-preference) {
  .chip, .btn, .round { transition: background-color 150ms, border-color 150ms; }
  .card.top:not(.dragging) { transition: transform 220ms ease-out; }
  .card.peek { transition: transform 220ms ease-out; }
  .sheet-panel { animation: slide-up 220ms ease-out; }
}
@keyframes slide-up { from { transform: translateY(100%); } }
