/* Silk Road Passport: loaded after the shared styles.css. Swaps the palette and fonts for China:
   rice paper, cinnabar red, imperial gold and jade green. */
:root {
  --paper: #FFF8EE; --paper2: #F7EBD9; --washi: #F3E4CC; --line: #EAD7BD;
  --ink: #1F2B4D; --ink-soft: #5A6178; --sea: #CDEAF2;
  --beni: #C2272D; --beni-deep: #8C1C22; --sakura: #F8C6CB; --gold: #E9A23B; --matcha: #2E8B6B;
  --accent: var(--beni); --band: #FDE5E2;
  --f-display: "ZCOOL KuaiLe", "Noto Sans SC", system-ui, sans-serif;
  --f-body: "Noto Sans SC", system-ui, sans-serif;
  --f-mincho: "Ma Shan Zheng", "ZCOOL KuaiLe", serif;
  --f-kana: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

.theme-spring { --accent: #D9607F; --band: #FDE3E8; }
.theme-summer { --accent: #2E8B6B; --band: #DDF2E6; }
.theme-autumn { --accent: #D9822B; --band: #FCEAD2; }
.theme-winter { --accent: #2F7FB5; --band: #E0EEF9; }
.theme-night { --accent: #E0303F; }

/* the map of China is wide */
.mapbox { aspect-ratio: 1000 / 760; max-width: 980px; margin-inline: auto; }
.japan.cathay .maplabel { font-family: var(--f-body); font-weight: 500; font-size: 15px; stroke: #FFF8EE; }
.japan.cathay .maplabel.sea { font-style: italic; font-size: 16px; fill: #3F7FA0; }
.japan.cathay .maplabel.land { fill: #8C8FA3; stroke: none; font-size: 13px; letter-spacing: .2em; }
.japan.cathay .cartouche rect { fill: #FFF8EE; stroke: var(--gold); }
.japan.cathay .ct-jp { font-family: "Ma Shan Zheng", serif; font-weight: 400; font-size: 34px; }
.japan.cathay .ct-en { fill: var(--beni); }

/* map motion */
.cathay .flow { animation: cn-flow 2.4s linear infinite; }
@keyframes cn-flow { to { stroke-dashoffset: -32; } }
.cathay .sun .rays { transform-origin: 0 0; animation: cn-spin 30s linear infinite; }
@keyframes cn-spin { to { transform: rotate(360deg); } }
.cathay .cloud { animation: cn-drift 26s ease-in-out infinite alternate; }
.cathay .cloud.slow { animation-duration: 38s; }
@keyframes cn-drift { to { transform: translateX(60px); } }
.cathay .wave-s { animation: cn-bob 3s ease-in-out infinite alternate; }
.cathay .sway-p { transform-box: fill-box; transform-origin: 50% 100%; animation: cn-sway 4s ease-in-out infinite alternate; }
@keyframes cn-sway { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
.cathay .ele .leg.a { animation: cn-step .9s ease-in-out infinite alternate; }
.cathay .ele .leg.b { animation: cn-step .9s ease-in-out infinite alternate-reverse; }
@keyframes cn-step { to { transform: translateY(-2px); } }
.cathay .ele { animation: cn-walk 14s ease-in-out infinite alternate; }
@keyframes cn-walk { to { transform: translateX(-46px); } }
.cathay .bob-b { animation: cn-bob 1.6s ease-in-out infinite alternate; }
@keyframes cn-bob { to { transform: translateY(-2px); } }
.cathay .munch { transform-box: fill-box; transform-origin: 50% 100%; animation: cn-munch 1.2s ease-in-out infinite alternate; }
@keyframes cn-munch { to { transform: rotate(3deg) translateY(-1px); } }
.cathay .flame { transform-box: fill-box; transform-origin: 50% 100%; animation: cn-flicker .6s ease-in-out infinite alternate; }
@keyframes cn-flicker { to { transform: scale(.85, 1.12); } }
.cathay .steam { animation: cn-steam 2.1s ease-out infinite; }
@keyframes cn-steam { 0% { opacity: 0; transform: translateY(4px); } 30% { opacity: .9; } 100% { opacity: 0; transform: translateY(-14px); } }
.cathay .glow-win { animation: cn-glow 3s ease-in-out infinite alternate; }
@keyframes cn-glow { from { opacity: .5; } to { opacity: 1; } }
.cathay .neon { animation: cn-neon 1.6s steps(2) infinite; }
@keyframes cn-neon { 50% { opacity: .25; } }
.cathay .glint { animation: cn-glint 2.6s ease-in-out infinite; }
@keyframes cn-glint { 50% { r: 4; opacity: .5; } }
.cathay .lantern-up { animation: cn-rise 8s ease-in infinite; }
@keyframes cn-rise { 0% { opacity: 0; translate: 0 10px; } 15% { opacity: 1; } 100% { opacity: 0; translate: 8px -60px; } }
@media (prefers-reduced-motion: reduce) { .cathay *, .cathay *::before { animation: none !important; } }

/* characters are grouped by topic */
.kgroup { margin: 14px 0 6px; font-weight: 500; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.kana-row.hanzi { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
.big-kana, .kana, .kcell b { line-height: 1.3; }

/* the night chapters glow with red lanterns */
.player.theme-night { --night: #1A0D16; --night-card: #2A1220; --line: #4A2635; }

/* ---------- tones: pitch lines under pinyin ---------- */
.tsyl { display: inline-flex; flex-direction: column; align-items: center; vertical-align: top; line-height: 1.15; }
.tsyl .tone-svg { width: 1.25em; min-width: 18px; height: .8em; min-height: 11px; margin-top: 1px; }
.prompt .ro .tsyl .tone-svg { min-width: 16px; min-height: 10px; }
.tone-svg.big { width: 44px; height: 32px; flex: none; }
.tone-teach .h2 { margin: 6px 0 12px; }
.tone-chart { display: grid; gap: 8px; width: 100%; text-align: left; }
.trow { display: grid; grid-template-columns: 44px minmax(64px, 1fr) minmax(0, 1.4fr) auto; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid var(--line); border-radius: 14px; background: #fff; }
.trow .tn { display: grid; } .trow .tn small { color: var(--ink-soft); }
.trow .tw { display: grid; line-height: 1.2; } .trow .tw b { font-family: var(--f-kana); font-size: 26px; } .trow .tw small { color: var(--ink-soft); font-weight: 600; font-size: 13px; }
.trow .say-pair { display: flex; }
.numerals { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: 100%; margin: 6px 0; }
.numerals span { display: grid; place-items: center; padding: 8px 4px; border: 2px solid var(--line); border-radius: 12px; background: #fff; text-align: center; }
.numerals b { font-family: var(--f-kana); font-size: 30px; line-height: 1.2; } .numerals small { color: var(--ink-soft); font-weight: 700; }
.numerals.radicals { grid-template-columns: repeat(4, 1fr); } .numerals.radicals small { font-weight: 500; font-size: 12px; line-height: 1.3; }
.player.theme-night .trow, .player.theme-night .numerals span { background: var(--night-card); }

/* chapter extras: zodiac finder, face changing, hotpot builder */
.mini-row { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-row input { font: inherit; padding: 8px 12px; border: 2px solid var(--line); border-radius: 12px; width: 120px; background: #fff; color: var(--ink); }
.bianlian svg { width: 120px; height: 130px; display: block; margin: 0 auto 4px; }
.bianlian.swap svg { animation: cn-swap .32s ease-in-out; }
@keyframes cn-swap { 50% { transform: scaleX(.05) rotate(8deg); filter: blur(2px); } }
@media (max-width: 420px) { .trow { grid-template-columns: 34px minmax(56px, auto) 1fr auto; gap: 8px; padding: 6px 8px; } .tone-svg.big { width: 34px; height: 26px; } .trow .say.slow span { display: none; } .numerals.radicals { grid-template-columns: repeat(2, 1fr); } }
