/* Story mode page (uses hub.css for the page frame). --accent and --tint come from the storyline. */

body.story { --accent: var(--chili); --tint: #fde7d3; }
.back-cafe {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: #fff;
  border: 1.5px solid var(--line); color: var(--ink); font-weight: 700; text-decoration: none;
}
.back-cafe::before { content: "←"; }
#story { display: grid; gap: 18px; max-width: 620px; }
.s-hero { padding-block: 6px 0; }
.s-hero .kicker { color: var(--accent); }
.s-hero h1 { margin: 10px 0 6px; font-size: clamp(32px, 8vw, 48px); }
.s-hero .lede { font-size: 16.5px; }
.wallet {
  display: inline-block; margin-top: 10px; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 15px;
  background: #fff6dc; border: 1.5px solid #f0d58a; color: #8a5a00;
}
.sec-head { margin-bottom: 4px; }
.sec-head h2 { font-size: 22px; }
.sec-p { color: var(--ink-soft); font-size: 14.5px; margin: 0 0 10px; }

/* The picture card: scene or map */
.pic-card {
  border-radius: 22px; background: linear-gradient(180deg, var(--tint), #fff 180px); border: 1.5px solid var(--line);
  box-shadow: 0 4px 0 var(--line); padding: 12px; display: grid; gap: 12px; min-width: 0;
}
.pic-card.pop .scene svg, .pic-card.pop .album .pc.own:last-of-type { animation: s-pop .5s ease-out; }
@keyframes s-pop { 40% { transform: scale(1.03); } }
.zones { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.zones::-webkit-scrollbar { display: none; }
.zone { flex: none; font-size: 12.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); color: var(--ink-soft); }
.zone.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.zone.ok { color: var(--mint); border-color: color-mix(in srgb, var(--mint) 40%, var(--line)); }
.scene { border-radius: 16px; overflow: hidden; border: 1.5px solid var(--line); aspect-ratio: 360 / 230; max-width: 100%; }
.scene svg { display: block; width: 100%; height: 100%; }
.scene .spot { animation: s-spot 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes s-spot { 50% { opacity: .55; } }
.job-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.job-t { display: grid; min-width: 0; line-height: 1.2; }
.job-t small { color: var(--ink-soft); font-size: 12.5px; font-weight: 700; }
.job-t b { font: 700 19px/1.2 var(--display); }
.job-go { white-space: nowrap; }
.jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.jobs li { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; padding: 6px 10px; border-radius: 10px; background: rgba(255, 255, 255, .7); }
.jobs li small { color: var(--ink-soft); font-weight: 700; }
.jobs li.ok { color: var(--mint); }
.jobs li.now { outline: 2px dashed #f2a51d; }
.all-done { font-weight: 800; text-align: center; color: var(--mint); }

/* Snack Trek */
.world { border-radius: 16px; overflow: hidden; max-width: 100%; }
.world svg { display: block; width: 100%; height: auto; }
.city-head { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: center; }
.city-face svg { width: 56px; height: 56px; display: block; }
.city-head div { display: grid; min-width: 0; line-height: 1.25; }
.city-head small { color: var(--ink-soft); font-size: 12.5px; font-weight: 700; }
.city-head b { font: 700 22px/1.1 var(--display); }
.city-head span { font-size: 14.5px; font-style: italic; }
.album-h { font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0; }
.album { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pc { position: relative; display: grid; gap: 2px; min-width: 0; }
.pc svg { width: 100%; height: auto; display: block; }
.pc small { font-size: 12.5px; font-weight: 700; text-align: center; line-height: 1.2; }
.pc:not(.own) small { color: var(--ink-soft); }
.pc.now svg { outline: 2px dashed #f2a51d; outline-offset: 2px; border-radius: 8px; }
.pc-cost { position: absolute; top: 34%; left: 50%; transform: translate(-50%, -50%); font-weight: 800; color: #8a5a00; background: #fff6dc; border: 1.5px solid #f0d58a; padding: 2px 10px; border-radius: 999px; font-size: 14px; }
.stamps { display: flex; flex-wrap: wrap; gap: 10px; }
.stamp { display: grid; justify-items: center; width: 82px; text-align: center; }
.stamp svg { width: 64px; height: 64px; transform: rotate(-8deg); }
.stamp small { font-size: 11.5px; font-weight: 700; line-height: 1.2; }

/* Daily Tiffin */
.daily-tiffin {
  border-radius: 20px; padding: 12px 14px; display: grid; gap: 10px;
  background: linear-gradient(135deg, #eaf6ee, #fff); border: 1.5px solid #b9dfc6; box-shadow: 0 4px 0 #b9dfc6;
}
.dt-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: center; }
.dt-head > div { display: grid; min-width: 0; line-height: 1.25; }
.dt-head b { font: 700 19px/1.2 var(--display); }
.dt-head small { color: var(--ink-soft); font-size: 13.5px; }
.dt-face svg { display: block; }
.dt-head .streak { grid-column: 1 / -1; font-weight: 800; font-size: 13.5px; color: var(--chili); }
.dt-items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dt-item { display: grid; justify-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; text-align: center; min-width: 0; }
.dt-item b { font-size: 13px; line-height: 1.15; }
.dt-item small { font-size: 11.5px; color: var(--ink-soft); line-height: 1.2; }
.dt-item.done small { color: #f2a51d; font-size: 13px; }
.dt-share { justify-self: start; }
.mini { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.mini svg { width: 30px; height: 30px; }
.cal { display: grid; gap: 6px; }
.cal-h { font-size: 12.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin: 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-day { display: grid; justify-items: center; font-size: 10.5px; color: var(--ink-soft); }
.cal-day svg { width: 22px; height: auto; }
.cal-day.today { font-weight: 800; color: var(--ink); }
.cal-day.later { opacity: .35; }

/* Open orders */
.order-list { display: grid; gap: 8px; }
.order {
  position: relative; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 12px; border-radius: 16px; background: #fff; border: 1.5px solid var(--line); color: var(--ink); text-decoration: none;
}
.order.next { border: 2px solid var(--accent); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 35%, transparent); }
.next-tag { position: absolute; top: -10px; left: 12px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; padding: 1px 9px; border-radius: 999px; letter-spacing: .04em; }
.o-art { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; }
.o-art svg { width: 36px; height: 36px; }
.o-text { display: grid; min-width: 0; line-height: 1.2; }
.o-text small { font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.o-text b { font-size: 16px; }
.o-goal { font-size: 13.5px; color: var(--ink-soft); }

/* Sharpness */
.skills-card { border-radius: 20px; padding: 12px 14px; background: #fff; border: 1.5px solid var(--line); }
.skills-card.locked p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.sk-head { display: flex; justify-content: space-between; align-items: baseline; }
.sk-head b { font: 700 19px/1.2 var(--display); }
.sharp { font: 700 26px/1 var(--display); color: var(--accent); }
.sk-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sk-bars li { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; }
.sk-bars i { height: 9px; border-radius: 5px; background: #f3e7d3; overflow: hidden; }
.sk-bars b { display: block; height: 100%; background: var(--accent); border-radius: 5px; min-width: 2px; }

.taste-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 12px 14px; border-radius: 18px;
  background: #fff; border: 1.5px dashed var(--accent); color: var(--ink); text-decoration: none;
}
.taste-card small { grid-column: 1; color: var(--ink-soft); }
.taste-card .btn { grid-row: 1 / 3; grid-column: 2; }

.switch-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.switch-row small { font-weight: 700; }
.chip-btn { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); }
.chip-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Story panels */
.beat {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 60px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  background: rgba(30, 18, 10, .72); opacity: 0; transition: opacity .25s; cursor: pointer;
}
.beat.open { opacity: 1; }
.beat-card {
  width: min(100%, 440px); display: grid; justify-items: center; gap: 6px; text-align: center;
  background: var(--paper); border-radius: 26px; padding: 18px 20px 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
.beat-face { width: 112px; height: 112px; margin-top: -64px; }
.beat-face svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); }
.beat-who { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.beat-say { font: 600 21px/1.3 var(--display); text-wrap: balance; min-height: 2.6em; display: grid; place-items: center; }
.beat-say.aside { font: italic 600 18px/1.35 var(--display); color: var(--ink-soft); }
.beat-say.in { animation: s-in .35s ease-out; }
@keyframes s-in { from { opacity: 0; transform: translateY(6px); } }
.beat-dots { display: flex; gap: 5px; }
.beat-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.beat-dots i.on { background: var(--accent); }
.beat-hint { font-size: 12.5px; color: var(--ink-soft); }
.beat-skip {
  position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px));
  border: 0; border-radius: 999px; padding: 7px 14px; background: rgba(255, 255, 255, .9); font-weight: 700; color: var(--ink);
}
@media (prefers-reduced-motion: reduce) { .scene .spot, .pic-card.pop .scene svg { animation: none; } }

/* Taste Test */
body.taste-page { min-height: 100dvh; }
.tt-intro, .tt-result { display: grid; gap: 12px; max-width: 520px; padding-block: 18px 40px; justify-items: start; }
.tt-intro h1, .tt-result h1 { font: 700 clamp(30px, 8vw, 44px)/1.08 var(--display); margin: 6px 0 0; text-wrap: balance; }
.tt-q { font: 700 20px/1.2 var(--display); margin: 8px 0 0; }
.motives { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; width: 100%; }
.motive { padding: 16px 10px; border-radius: 16px; border: 1.5px solid var(--line); background: #fff; font: inherit; font-weight: 800; font-size: 16px; color: var(--ink); box-shadow: 0 3px 0 var(--line); }
.motive:active { transform: translateY(2px); box-shadow: none; }
.tt-play {
  position: fixed; inset: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: var(--paper);
  padding-top: env(safe-area-inset-top, 0px);
}
.tt-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px)); border-bottom: 1.5px solid var(--line); }
.tt-name { display: grid; line-height: 1.15; min-width: 0; }
.tt-name small { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--chili); }
.tt-name b { font: 700 18px/1.15 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-ring {
  --p: 1; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--chili) calc(var(--p) * 360deg), #f1e4d0 0); transition: --p 1s linear;
}
.tt-ring b { width: 32px; height: 32px; border-radius: 50%; background: var(--paper); display: grid; place-items: center; font-size: 14px; }
.tt-ring.up { background: #2f9a62; }
.tt-stage { position: relative; min-height: 0; }
.tt-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.tt-foot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px max(12px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); border-top: 1.5px solid var(--line); background: #fff; }
.tt-heart { border: 1.5px solid #f2b8c6; background: #fff; color: #c2185b; border-radius: 999px; padding: 10px 14px; font: inherit; font-weight: 800; font-size: 15px; }
.tt-heart.on { background: #e0457a; border-color: #e0457a; color: #fff; }
.tt-dots { display: flex; justify-content: center; gap: 5px; }
.tt-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tt-dots i.on { background: var(--chili); }
.tt-dots i.done { background: #2f9a62; }
.tt-next { white-space: nowrap; }
.nudge { animation: tt-nudge 1s ease-in-out infinite; }
@keyframes tt-nudge { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .nudge { animation: none; } }
.tt-favs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; }
.tt-favs li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 14px; background: #fff; border: 1.5px solid var(--line); }
.tt-favs small { color: var(--ink-soft); font-weight: 700; }
@media (max-width: 380px) { .tt-heart { padding: 10px; font-size: 14px; } .tt-dots { display: none; } .tt-foot { grid-template-columns: auto minmax(0, 1fr); } .tt-next { justify-self: end; } }
