/* Yomu pages: Japanese text, the display switch, word popovers, drills. The site theme adds the game look. */
:root { --bg: #fbfaf7; --fg: #1d1d1b; --muted: #6b6a66; --line: #dddad3; --card: #fff; --accent: #c2410c; --ok: #2b8a3e; --bad: #c92a2a; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.6 ui-sans-serif, system-ui, sans-serif; }
main { max-width: 820px; margin: 0 auto; padding: 24px 16px 120px; }
.jp, .line .t, .ex .t { font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", ui-sans-serif, sans-serif; }
.yset { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 10px 12px; margin: 10px 0 18px; font-size: .85rem; }
.yset button { padding: 6px 10px !important; }
.yxp { margin-left: auto; color: var(--accent); }
ruby rt { font-size: .55em; color: var(--muted); }
.line { display: grid; grid-template-columns: 5.5em 1fr auto; gap: 4px 12px; align-items: start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.line.now { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.line .who { color: var(--muted); font-size: .85rem; padding-top: .45em; }
.line .t { font-size: 1.45rem; line-height: 2.2; }
.line .en { grid-column: 2; color: var(--muted); font-size: .95rem; }
.line .act { display: flex; gap: 4px; }
.line .act button, .mini { padding: 4px 8px !important; font-size: 12px !important; }
.w.g { cursor: pointer; border-bottom: 1px dotted transparent; }
.w.g:hover, .w.g:focus { border-bottom-color: var(--accent); outline: none; }
.w.p { color: var(--accent); }
.known-mark .w.known { opacity: .75; }
#pop { position: absolute; z-index: 50; max-width: 300px; padding: 10px 12px; background: var(--card); border: 2px solid var(--line); box-shadow: 4px 4px 0 rgba(0,0,0,.4); }
#pop .big { font-size: 1.8rem; }
#pop .row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.step { margin: 34px 0 10px; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.steps a { padding: 4px 10px; border: 2px solid var(--line); text-decoration: none; font-size: .85rem; }
.steps a.done { border-color: var(--ok); }
.card2 { padding: 14px 16px; margin: 12px 0; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.choices button { font-family: "Hiragino Sans", "Noto Sans JP", ui-sans-serif, sans-serif !important; font-size: 1.05rem !important; text-transform: none !important; }
.right { color: var(--ok); } .wrong { color: var(--bad); }
.kanji { display: grid; grid-template-columns: 120px 1fr; gap: 12px; align-items: start; }
.kanji .glyph { font-size: 64px; line-height: 1; text-align: center; font-family: "Hiragino Mincho ProN", "Noto Serif JP", serif; }
.kanji .stroke { width: 109px; height: 109px; }
.kanji .stroke svg { width: 100%; height: 100%; }
.slots, .pool { display: flex; flex-wrap: wrap; gap: 6px; min-height: 44px; padding: 6px; border: 2px dashed var(--line); margin: 6px 0; }
.slots button, .pool button { font-family: "Hiragino Sans", "Noto Sans JP", ui-sans-serif, sans-serif !important; font-size: 1.1rem !important; text-transform: none !important; }
.muted { color: var(--muted); font-size: .9rem; }
.vocab { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.vocab div { padding: 8px 10px; border: 1px solid var(--line); }
.vocab .jp { font-size: 1.2rem; }
@media (max-width: 600px) { .line { grid-template-columns: 1fr; } .line .en { grid-column: 1; } .line .t { font-size: 1.25rem; } .kanji { grid-template-columns: 1fr; } }
/* hub */
.stage { padding: 12px 16px; margin: 12px 0; border: 2px solid var(--line); }
.stage.here { border-color: var(--accent); box-shadow: 4px 4px 0 color-mix(in srgb, var(--accent) 40%, transparent); }
.stage.here h3::after { content: " ◄ you are here"; color: var(--accent); font-size: .8rem; }
.stage h3 { margin: 0 0 6px; }
.units { margin: 6px 0; padding-left: 22px; }
.units li { margin: 4px 0; }
.units li.done a::after { content: " ✓"; color: var(--ok); }
.decks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.decks a { padding: 8px 10px; border: 2px solid var(--line); text-decoration: none; }
.bar { display: inline-block; width: 80px; height: 8px; border: 1px solid var(--line); vertical-align: middle; }
.bar i { display: block; height: 100%; background: var(--ok); }
.credits { margin-top: 40px; font-size: .8rem; }
[aria-current="page"] { border-color: var(--accent) !important; }
/* kana */
.kana-wrap { display: grid; grid-template-columns: 1fr 220px; gap: 16px; align-items: start; }
.krow { display: grid; grid-template-columns: 28px repeat(6, minmax(0, 1fr)); gap: 4px; margin: 4px 0; }
.kc { display: flex; flex-direction: column; align-items: center; padding: 4px 0 !important; min-height: 56px; text-transform: none !important; }
.kc .jp { font-size: 26px; line-height: 1.2; }
.kc small { font-size: 11px; opacity: .7; }
.kc.empty { border: 0; }
.kana-focus { position: sticky; top: 12px; text-align: center; }
.kana-focus .stroke { width: 140px; height: 140px; margin: 8px auto; }
.kana-focus .stroke svg { width: 100%; height: 100%; }
.right { color: var(--ok); } button.right { border-color: var(--ok) !important; } button.wrong { border-color: var(--bad) !important; opacity: .7; }
/* grammar */
.gp { border-bottom: 1px dashed var(--line); padding: 6px 0; }
.gp summary { cursor: pointer; padding: 4px 0; }
.gp.done summary .num { background: var(--ok); color: #fff; }
.num { display: inline-block; min-width: 2em; text-align: center; border: 1px solid var(--line); font-size: .8rem; }
.gbody { padding: 4px 0 12px 8px; }
.ex { margin: 8px 0; }
.quiz { margin: 10px 0; }
.blank { display: inline-block; min-width: 3em; border-bottom: 2px solid var(--accent); text-align: center; color: var(--accent); }
/* decks and review */
.ktiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; }
.ktile { font-size: 28px !important; padding: 6px 0 !important; }
.ktile.done, .vocab .done { border-color: var(--ok) !important; }
.review { text-align: center; }
.review .front { font-size: 64px; line-height: 1.3; margin: 10px 0; }
.grades { justify-content: center; gap: 8px; display: flex; }
.grades[hidden] { display: none; }
@media (max-width: 600px) { .kana-wrap { grid-template-columns: 1fr; } .kana-focus { position: static; } .decks { grid-template-columns: 1fr; } .kc .jp { font-size: 22px; } }

/* photos of the scenes (yomu/img, free-licensed from Wikimedia Commons; credits.json has the authors) and word pictures */
figure.scene { margin: 12px 0 18px; position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 7; background: color-mix(in srgb, var(--fg) 6%, transparent); }
figure.scene img { width: 100%; height: 100%; object-fit: cover; display: block; }
#photo figcaption.cap { font-size: .7rem !important; line-height: 1.4 !important; } /* the reader's text-size rule would scale it up */
figure.scene figcaption { position: absolute; right: 8px; bottom: 6px; max-width: calc(100% - 16px); font-size: .68rem; line-height: 1.4; color: #fff; background: rgba(0,0,0,.5); padding: 2px 9px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
figure.scene figcaption a { color: #fff; }
figure.hero { aspect-ratio: 16 / 6; }
.pic { font-size: 54px; line-height: 1; margin: 4px 0 8px; }
.vocab .pic, #back .pic { font-size: 1.5rem; margin: 0 6px 0 0; vertical-align: middle; }
.units li { display: flex; align-items: center; gap: 10px; }
.units .thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 8px; flex: none; }
@media (max-width: 600px) { figure.scene { aspect-ratio: 16 / 9; border-radius: 10px; } figure.hero { aspect-ratio: 16 / 8; } }

/* pitch accent contour & badges */
.pitch-info { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; font-size: .88rem; }
.pitch-badge { font-size: .75rem; padding: 2px 7px; border-radius: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; border: 1px solid var(--line); }
.pitch-badge.heiban { background: color-mix(in srgb, #2b8a3e 15%, transparent); color: #2b8a3e; border-color: #2b8a3e; }
.pitch-badge.atamadaka { background: color-mix(in srgb, #c92a2a 15%, transparent); color: #c92a2a; border-color: #c92a2a; }
.pitch-badge.nakadaka { background: color-mix(in srgb, #1c7ed6 15%, transparent); color: #1c7ed6; border-color: #1c7ed6; }
.pitch-badge.odaka { background: color-mix(in srgb, #e8590c 15%, transparent); color: #e8590c; border-color: #e8590c; }
.pitch-curve { display: inline-flex; align-items: center; font-family: "Hiragino Sans", "Noto Sans JP", sans-serif; font-size: 1.15rem; line-height: 1.3; }
.pitch-curve .mora { position: relative; padding: 2px 4px; border-top: 2px solid transparent; }
.pitch-curve .mora.high { border-top-color: var(--accent); }
.pitch-curve .mora.low { border-top-color: transparent; }
.pitch-curve .mora.drop { border-right: 2px solid var(--accent); }
.pitch-curve .downstep { color: var(--accent); font-weight: bold; font-size: .85em; margin-left: 1px; }

/* reader page styles */
.reader-box textarea { width: 100%; min-height: 140px; box-sizing: border-box; font-family: "Hiragino Sans", "Noto Sans JP", sans-serif; font-size: 1.1rem; padding: 10px; border: 1px solid var(--line); border-radius: 6px; }
.reader-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0; align-items: center; font-size: .9rem; color: var(--muted); }
.meter { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); width: 100%; margin: 6px 0; }
.meter span { height: 100%; }
.m-n5 { background: #40c057; } .m-n4 { background: #20c997; } .m-n3 { background: #15aabf; } .m-n2 { background: #4c6ef5; } .m-n1 { background: #7950f2; } .m-other { background: #868e96; }
.meter-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .78rem; margin: 4px 0 14px; }
.meter-legend span { display: inline-flex; align-items: center; gap: 4px; }
.meter-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.reader-article { margin-top: 18px; line-height: 2.2; }
.reader-p { margin-bottom: 24px; }
.reader-sent { padding: 4px 6px; border-radius: 6px; transition: background .15s; }
.reader-sent:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }

