/* The app's look, matched to the home page ("Genkan Pop", web/home.css): Zen Maru Gothic headings, warm paper, sun
   yellow for the main action, rounded cards with an ink outline, and the app icon as the mark. Loaded after style.css
   on the tablet, the parent phone and the demo view; it changes only how things look, never what they do. */

:root {
  --bg: #fbf7f0; --ink: #2b2620; --muted: #6f665d; --card: #fffdf9; --line: #eadfcf;
  --hover: #fff6e3; --press: #f6edd9;
  --accent: #e07a3f; --accent-text: #a3501f; --on-accent: #2b2620;
  --ok: #2f7550; --watch: #8a5d00; --urgent: #b0362f;
  --stage-top: #f3e6d4; --stage-bottom: #e9d6bd;
  --sun: #ffc94a; --sun-deep: #f5b82e; --leaf: #cdebc4; --sky: #bfe0ff; --peach: #ffe9dc; --cocoa: #5b3a1e;
  --scrim: rgb(43 38 32 / .86); --on-scrim: #fbf7f0;
  --display: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", ui-rounded, system-ui, sans-serif;
  --font: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  --ink-shadow: 0 6px 0 -1px var(--ink);
  --soft-shadow: 0 10px 30px -14px rgb(91 58 30 / .35);
  color-scheme: light;
}
/* one look for the demo, whatever the device's theme (the home page is light too) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #fbf7f0; --ink: #2b2620; --muted: #6f665d; --card: #fffdf9; --line: #eadfcf; --hover: #fff6e3; --press: #f6edd9;
    --accent-text: #a3501f; --ok: #2f7550; --watch: #8a5d00; --urgent: #b0362f; --stage-top: #f3e6d4; --stage-bottom: #e9d6bd;
  }
  :root:not([data-theme="light"]) .tablet #avatar-wrap { background-blend-mode: normal; background-color: transparent; }
}

body { background: radial-gradient(900px 520px at 85% -10%, rgb(255 201 74 / .22), transparent 70%), var(--bg); min-height: 100vh; }
h1, h2, h3, summary, .rail-label, .brand, .drill-head b { font-family: var(--display); }

/* the top bar: the app icon, おかえり, and the status as a soft chip */
.bar { border-bottom: 1.5px solid var(--line); background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 22px; letter-spacing: .02em; }
a.brand { color: inherit; text-decoration: none; border-radius: 14px; }
a.brand:hover { opacity: .85; }
a.brand:focus-visible { outline: 3px solid var(--sun-deep); outline-offset: 4px; }
.brand::before { content: ""; width: 34px; height: 34px; flex: none; background: url("/static/favicon.svg") center / contain no-repeat; }
.brand small { font: 700 11px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 10px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: 700 13px/1.2 var(--display); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2fb36b; box-shadow: 0 0 0 4px rgb(47 179 107 / .18); flex: none; }

/* buttons: rounded pills; the sun is the main action */
button, .button { border-radius: 999px; border: 2px solid var(--line); background: var(--card); font-family: var(--display); font-weight: 700; padding: 10px 18px; transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), background-color .15s, border-color .15s, box-shadow .18s; }
@media (hover: hover) { button:hover, .button:hover { background: var(--hover); border-color: color-mix(in oklab, var(--sun) 60%, var(--line)); transform: translateY(-1px); } }
button:active, .button:active { transform: translateY(1px); }
button.big { border-radius: 999px; }
button.on, button.on:hover { background: var(--sun); color: var(--ink); border-color: var(--ink); }
#start, #mic, #hw-snap, .login-card button[type="submit"] {
  background: var(--sun); color: var(--ink); border-color: var(--sun); box-shadow: 0 5px 0 -1px var(--sun-deep), var(--soft-shadow);
}
@media (hover: hover) { #start:hover, #mic:hover, #hw-snap:hover { background: var(--sun); box-shadow: 0 7px 0 -1px var(--sun-deep), var(--soft-shadow); } }
#start { font-size: 22px; min-height: 64px; padding: 0 32px; }
#mic[aria-pressed="true"] { background: var(--ink); color: var(--sun); border-color: var(--ink); box-shadow: 0 0 0 6px rgb(255 201 74 / .35); }
input, select { border-radius: 14px; border: 2px solid var(--line); }
input:focus-visible, select:focus-visible { border-color: var(--sun-deep); }

/* ── the tablet ─────────────────────────────────────────────────────────── */
.tablet .stage { max-width: 1040px; padding: 20px 16px 32px; }
.tablet .bar { padding-inline: max(16px, calc((100% - 1040px) / 2 + 16px)); }
.tablet #avatar-wrap { height: min(62vh, 580px); border-radius: 32px; border: 2.5px solid var(--ink); box-shadow: 0 10px 0 -2px var(--ink), var(--soft-shadow); }
.banner { font: 700 18px/1.3 var(--display); padding: 10px 20px; border-radius: 999px; box-shadow: var(--soft-shadow); }

/* what to notice at each beat: a speech-bubble card */
.notice { position: relative; border-radius: 22px; border: 2px solid var(--line); border-left: 2px solid var(--line); background: var(--card); padding: 14px 18px 14px 58px; font-size: 16px; box-shadow: var(--soft-shadow); }
.notice::before { content: ""; position: absolute; left: 14px; top: 12px; width: 30px; height: 30px; background: url("/static/favicon.svg") center / contain no-repeat; }
.notice b { font-family: var(--display); }
.notice .next b { color: var(--accent-text); }

/* the demo script: a numbered path of big pills */
.rail { padding: 14px; gap: 10px; border: 2px solid var(--ink); border-radius: 26px; background: var(--card); box-shadow: 0 8px 0 -2px var(--ink); }
.rail-label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: var(--sun); font-size: 14px; font-weight: 900; letter-spacing: .02em; margin-right: 2px; }
.rail button { min-height: 50px; font-size: 16px; border-width: 2px; }
.rail button.running { border-color: var(--sun-deep); background: #fff6e0; animation: railpulse 1s ease-in-out infinite; }
@keyframes railpulse { 50% { box-shadow: 0 0 0 6px rgb(255 201 74 / .35); } }
.rail button.done { color: var(--ok); border-color: color-mix(in oklab, var(--ok) 55%, var(--line)); background: #f2faef; }
.rail button.done::after { content: " ✓"; font-weight: 900; }
.quick { gap: 10px; }
.quick button { min-height: 50px; }
.more { border-radius: 22px; border: 2px solid var(--line); padding: 6px 16px; }
.more > summary { font-family: var(--display); font-weight: 700; color: var(--muted); }
.log-wrap summary { color: var(--muted); font-size: 14px; }

/* home-alone practice over the stage */
.drill { border-radius: 26px; border: 2.5px solid var(--ink); box-shadow: 0 8px 0 -2px var(--ink), var(--soft-shadow); padding: 14px; }
.drill-head b { font-weight: 900; font-size: 19px; }
.drill-head button { border-radius: 50%; }
.drill-screen { border-radius: 16px; border: 4px solid #d9ccb6; }
.drill-caller { border-radius: 16px; background: var(--peach); font-family: var(--display); font-weight: 700; }
.drill-choices button { border-radius: 18px; font-family: var(--display); }
.drill-choices button.right { background: var(--leaf); border-color: var(--ok); color: var(--ink); }

/* today's song and the exercise card */
.lyrics { border-radius: 22px; background: rgb(255 253 249 / .95); color: var(--ink); border: 2.5px solid var(--ink); box-shadow: 0 8px 0 -2px var(--ink); }
.lyrics p { font-family: var(--display); font-weight: 700; }
.lyrics small { color: var(--muted); opacity: 1; font-family: var(--font); font-weight: 400; }
.move { border-radius: 22px; }
.move b, .move .count { font-family: var(--display); }

/* homework */
.hw { border-radius: 26px; border: 2px solid var(--ink); box-shadow: 0 8px 0 -2px var(--ink); padding: 16px; }
.hw-view video, .hw-view img { border-radius: 18px; }
.marks li { font-family: var(--display); }

/* ── the parent phone ──────────────────────────────────────────────────── */
.phone h2 { font-weight: 900; color: var(--cocoa); }
.card { border-radius: 20px; border: 1.5px solid var(--line); box-shadow: 0 2px 0 var(--line); padding: 14px; }
.card b { font-family: var(--display); }
.card.alert.watch { border: 2px solid color-mix(in oklab, var(--watch) 55%, var(--line)); background: #fffbf2; }
.card.alert.urgent { border: 2.5px solid var(--urgent); background: #fff6f5; padding: 13px; }
.card.arrived { background: #f5fbf3; }
.memory button { border-radius: 999px; }

/* the login card */
.login-card { border-radius: 24px; border: 2.5px solid var(--ink); box-shadow: 0 8px 0 -2px var(--ink); }

@media (prefers-reduced-motion: reduce) { .rail button.running { animation: none; } button, .button { transition: none; } }

/* ── the parent phone: a status card, the day as a timeline, calm sections ── */
.phone .p-main { max-width: 560px; margin: 0 auto; padding: 14px 16px 40px; display: grid; gap: 18px; }
.phone .p-sec { padding: 0; max-width: none; margin: 0; }
.phone .p-box { padding: 16px; border-radius: 22px; background: var(--card); border: 1.5px solid var(--line); box-shadow: 0 2px 0 var(--line); }
.p-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.p-head h2 { margin: 0; font-size: 20px; font-weight: 900; color: var(--cocoa); }
.p-note { font-size: 12px; color: var(--muted); }
.phone h3 { margin: 14px 0 6px; font: 700 15px/1.2 var(--display); color: var(--cocoa); }

.p-status { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 16px; border-radius: 22px; border: 2px solid var(--ink); background: var(--card); box-shadow: 0 6px 0 -1px var(--ink); }
.p-status b { display: block; font: 900 19px/1.2 var(--display); }
.p-status span:not(.ps-ic) { display: block; font-size: 14px; color: var(--muted); line-height: 1.4; }
.ps-ic { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 16px; background: var(--press); color: var(--cocoa); }
.ps-ic .i { width: 24px; height: 24px; }
.p-status[data-state="home"] { background: #f2faef; }
.p-status[data-state="home"] .ps-ic { background: var(--leaf); color: var(--ok); }
.p-status[data-state="watch"] { background: #fff8e8; border-color: var(--watch); box-shadow: 0 6px 0 -1px var(--watch); }
.p-status[data-state="watch"] .ps-ic { background: #ffe9b8; color: var(--watch); }
.p-status[data-state="urgent"] { background: #fff2f1; border-color: var(--urgent); box-shadow: 0 6px 0 -1px var(--urgent); }
.p-status[data-state="urgent"] .ps-ic { background: #ffd8d4; color: var(--urgent); }
.p-status[data-state="done"] .ps-ic { background: var(--peach); color: var(--accent-text); }

/* the timeline: time on the left, an icon on the line, then the title and one line */
.phone .cards { position: relative; display: grid; gap: 10px; }
.phone .cards::before { content: ""; position: absolute; left: 63px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.phone .cards:empty::before { position: static; display: block; width: auto; background: none; }
.phone .card { position: relative; display: grid; grid-template-columns: 44px 36px 1fr; align-items: start; gap: 0 10px; margin: 0; padding: 12px 14px 12px 10px; border-radius: 18px; background: var(--card); border: 1.5px solid var(--line); box-shadow: 0 2px 0 var(--line); }
.phone .card time { padding-top: 7px; font: 600 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); text-align: right; }
.phone .c-ic { position: relative; z-index: 1; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--press); color: var(--cocoa); border: 2px solid var(--card); }
.phone .c-ic .i { width: 17px; height: 17px; }
.phone .c-main { min-width: 0; }
.phone .card b { display: block; margin: 6px 0 2px; font: 900 16px/1.25 var(--display); color: var(--ink); }
.phone .card p { margin: 0; font-size: 14.5px; line-height: 1.5; color: #4a423a; }
.phone .card .button { margin-top: 10px; min-height: 40px; padding: 0 16px; background: var(--ink); color: var(--card); border-color: var(--ink); }
.phone .card.arrived .c-ic { background: var(--leaf); color: var(--ok); }
.phone .card.arrived { background: var(--card); }
.phone .card.door .c-ic { background: var(--press); color: var(--muted); }
.phone .card.door b { color: var(--muted); }
.phone .card.homework .c-ic { background: var(--sky); color: #2c6aa8; }
.phone .card.practice .c-ic { background: var(--leaf); color: var(--ok); }
.phone .card.practice b { color: var(--ink); }
.phone .card.exercise .c-ic { background: #fff0c2; color: var(--watch); }
.phone .card.recap .c-ic, .phone .card.song .c-ic { background: var(--peach); color: var(--accent-text); }
.phone .card.alert.watch { background: #fffbf0; border: 2px solid color-mix(in oklab, var(--watch) 60%, var(--line)); }
.phone .card.alert.watch .c-ic { background: #ffe9b8; color: var(--watch); }
.phone .card.alert.watch b { color: var(--watch); }
.phone .card.alert.urgent { background: #fff4f3; border: 2.5px solid var(--urgent); padding: 11px 13px 11px 9px; }
.phone .card.alert.urgent .c-ic { background: #ffd8d4; color: var(--urgent); }
.phone .card.alert.urgent b { color: var(--urgent); }
.phone .card .lines { margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--peach); font: 700 15px/1.6 var(--display); }
.phone .card audio { margin-top: 8px; }
.phone #feed:empty::before { content: "Nothing yet today. Arrivals and check-ins show up here."; padding: 14px 16px; border-radius: 18px; border: 1.5px dashed var(--line); text-align: center; }

/* messages, memory, rules */
.phone .p-box .row { margin: 6px 0; }
.p-note-form { flex-wrap: nowrap !important; }
.p-note-form input { flex: 1; min-width: 0; }
.p-note-form button { background: var(--ink); color: var(--card); border-color: var(--ink); }
.phone #rec { background: var(--sun); border-color: var(--sun); box-shadow: 0 4px 0 -1px var(--sun-deep); }
.phone .memory { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.phone .memory li { display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 12px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); font-size: 15px; }
.phone .memory .kind { flex: none; padding: 3px 9px; border-radius: 999px; background: var(--peach); color: var(--accent-text); font: 700 12px/1.3 var(--display); margin: 0; }
.phone .memory button { margin-left: auto; flex: none; min-height: 32px; padding: 0 12px; font-size: 13px; }
.phone #facts:empty::before, .phone #threads:empty::before { margin: 0; padding: 8px 2px; }
.phone .rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.phone .rules li { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-size: 14.5px; line-height: 1.45; color: #4a423a; }
.phone .rules .i { flex: none; margin-top: 2px; color: var(--ok); }
