:root{--ink:#254c45;--green:#247b61;--paper:#fbfcf4;--line:#dbe5d9;--orange:#e48b49;font-family:ui-rounded,"PingFang SC","Microsoft YaHei",system-ui,sans-serif;color:var(--ink);background:#edf3ec;font-synthesis:none}*{box-sizing:border-box}body{margin:0;padding:22px 28px 14px}button,input{font:inherit}button,.file-button{cursor:pointer;border:0;color:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #257fa3;outline-offset:3px}button{transition:transform .16s,background .16s;user-select:none}button:active{transform:scale(.96)}button:disabled{opacity:.38;cursor:default}button[hidden],[hidden]{display:none!important}#app{max-width:1100px;margin:auto}header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:22px}.brand{display:flex;align-items:center;gap:13px}.brand-icon{background:#d7e7cf;border:1px solid #bfd3b8;width:54px;height:54px;display:grid;place-items:center;border-radius:18px;font-size:35px}.eyebrow{font-size:10px;font-weight:800;letter-spacing:2px;color:#6f897b}h1{font-size:27px;letter-spacing:2px;margin:3px 0 0}h2{font-size:24px;margin:6px 0}.header-actions{display:flex;gap:9px}.small,.round,.file-button{background:#fbfcf5;border:1px solid var(--line);min-height:46px;border-radius:14px;padding:10px 16px;font-size:14px;font-weight:650}.round{min-width:46px;padding:5px;font-size:25px}.station{position:relative;isolation:isolate;overflow:hidden;border:1px solid #d1e1cf;border-radius:30px;background:#e5efdf;box-shadow:0 8px 22px #45634309}.landscape{position:absolute;inset:0;z-index:-1;overflow:hidden;background:linear-gradient(#d8ece7,#f3f1d9 72%)}.sun{position:absolute;right:17%;top:18px;width:65px;height:65px;background:#f4cf74;border:10px solid #fae3a1;border-radius:50%}.cloud{position:absolute;background:#f9fbec;width:110px;height:22px;border-radius:50px;opacity:.8}.cloud:before{content:"";position:absolute;left:20px;top:-15px;width:50px;height:40px;border-radius:50%;background:inherit}.c1{left:30%;top:52px}.c2{right:4%;top:90px;transform:scale(.7)}.hill{position:absolute;width:75%;height:220px;border-radius:50% 50% 0 0;background:#bfd4b4;bottom:0;left:-25%;transform:rotate(10deg)}.h2{left:42%;background:#cbdcbd;bottom:20px}.h3{left:10%;bottom:-110px;background:#afcba6;width:110%}.station-top{padding:18px 23px;display:flex;justify-content:space-between;gap:10px;font-size:12px;font-weight:650}.station-sign{display:flex;align-items:center;gap:8px}.station-sign i{width:8px;height:8px;border-radius:50%;background:#5d9873}.playing .station-sign i{background:#df8040;box-shadow:0 0 0 4px #df804020}.journey{height:91px;display:flex;gap:14px;align-items:center;padding:0 30px}.journey-text{display:flex;flex-direction:column;gap:6px;font-size:13px}.journey-text b{font-size:19px}.journey #follow{margin-left:auto}#engine{width:110px;align-self:end;flex-shrink:0}#engine svg{display:block;width:100%}.playing #engine{animation:engine .55s ease-in-out infinite alternate}@keyframes engine{to{transform:translateY(-3px)}}#track{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;padding:22px 34px 25px}.car{position:relative;border:0;background:transparent;padding:0 0 14px;min-width:0}.car-body{border-radius:18px 18px 12px 12px;background:#fff9e9;border:3px solid #e6b885;box-shadow:0 7px 0 #c99464;min-height:150px;padding:8px;display:flex;flex-direction:column;position:relative;transition:background .15s,transform .15s,box-shadow .15s}.car:nth-child(2) .car-body{border-color:#a9c9c6;box-shadow:0 7px 0 #7ca7a3;background:#f1f9ef}.car:nth-child(3) .car-body{border-color:#c7b8d3;box-shadow:0 7px 0 #a899b4;background:#faf3f8}.car:nth-child(4) .car-body{border-color:#c4cc95;box-shadow:0 7px 0 #9da66e;background:#f8fae7}.car:after{content:"";height:7px;background:#7d8d75;position:absolute;right:-21px;bottom:17px;width:24px;z-index:-1}.car:last-child:after{display:none}.wheels{position:absolute;bottom:0;left:15%;width:70%;display:flex;justify-content:space-between}.wheels i{background:#42594f;border:5px solid #6f8370;width:29px;height:29px;border-radius:50%;box-shadow:inset 0 0 0 5px #d4debd}.car-top{display:flex;justify-content:space-between;font-size:11px;font-weight:700;color:#8d977e}.car-top .number{border-radius:7px;background:#ffffffbb;min-width:22px;padding:2px}.car-sounds{height:93px;display:grid;grid-template-columns:repeat(2,1fr);grid-template-rows:repeat(2,1fr);gap:0;align-items:center;justify-items:center}.car-sounds svg{height:47px;width:64px;max-width:100%;filter:drop-shadow(0 2px 0 #1232)}.car-sounds .empty{grid-column:1/-1;grid-row:1/-1;font-size:32px;opacity:.4}.car.single .car-sounds svg{grid-column:1/-1;grid-row:1/-1;height:81px;width:105px}.car-syllable{font-size:13px;font-weight:700;color:#587467;min-height:19px}.car.active .car-body{transform:translateY(-8px);background:#fff4b5;outline:4px solid #f0bc52;box-shadow:0 9px 0 #c4913e,0 0 25px #ffec9a}.car.active .car-sounds svg{animation:hit .26s ease-out}@keyframes hit{50%{transform:scale(.87) rotate(-6deg)}}.car.flash .car-body{animation:place .25s ease-out}@keyframes place{50%{transform:translateY(-7px)}}.rail{height:10px;border-block:3px solid #73876f;position:absolute;left:0;right:0;bottom:83px;background:repeating-linear-gradient(90deg,transparent 0 25px,#a6af85 25px 38px,transparent 38px 50px)}.route{min-height:80px;display:flex;align-items:center;gap:8px;padding:12px 24px;background:#eff3da9c}.route .round{background:#f8faedc9;flex-shrink:0}#pages{display:flex;gap:6px;flex:1;overflow-x:auto;padding:3px;scrollbar-width:thin}.page-button{min-width:49px;min-height:45px;border-radius:12px;background:#fafbed;color:#7b8d70;border:1px solid #d1dbb7;font-size:12px;flex-shrink:0}.page-button.selected{background:#436c57;color:white;border-color:#436c57}.page-button.sounding{box-shadow:inset 0 -4px #ffc65b}.add{background:#fdf7dc;border:1px dashed #9baf79;border-radius:14px;font-size:22px;padding:8px 16px;min-height:46px;white-space:nowrap}.add span{font-size:14px;font-weight:750}.workbench{padding:20px 0 0}.section-label{display:flex;align-items:center;justify-content:space-between;font-size:13px;margin:0 5px 11px}.muted{color:#728579;font-size:12px;line-height:1.7}.text-button{background:transparent;font-size:13px;min-height:40px;padding:8px 10px}#tools{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}.tool{border:2px solid #dce4d7;background:var(--paper);border-radius:20px;display:flex;align-items:center;justify-content:center;gap:9px;padding:9px;min-height:91px;position:relative}.tool svg{width:65px;height:65px;flex-shrink:0}.tool .tool-label{display:flex;flex-direction:column;gap:3px;text-align:left}.tool b{font-size:14px}.tool small{font-size:10px;color:#7f9186;letter-spacing:.5px}.tool.chosen{border-color:#42856b;background:#e2f0df;box-shadow:0 3px 0 #43836a}.tool.chosen:after{content:"✓";position:absolute;top:3px;right:7px;font-size:12px;color:#327b5a}.tool .moon{font-size:41px;width:54px}.transport{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-top:24px;background:#f8faf2;border:1px solid #dce5d5;border-radius:22px;padding:14px 20px}.tempo{display:flex;flex-direction:column;gap:6px;font-size:11px;color:#718277}.segmented{display:flex;background:#e9eee1;border-radius:11px;padding:3px}.segmented button{background:transparent;min-height:38px;padding:6px 11px;font-size:12px;border-radius:8px}.segmented .chosen{background:#fffdf3;color:#326f54;box-shadow:0 2px 4px #354b3815}.play{display:flex;align-items:center;justify-content:center;gap:12px;border-radius:18px;background:#247b61;color:white;min-width:225px;min-height:64px;box-shadow:0 5px 0 #14533f;font-size:18px;font-weight:750}.play small{font-size:10px;letter-spacing:1px;opacity:.6}.play.loading{opacity:.7}.save{background:transparent;display:flex;align-items:center;gap:8px;font-size:24px;min-height:48px;padding:10px}.save span{font-size:13px;font-weight:650}footer{display:flex;justify-content:space-between;gap:8px;color:#748578;font-size:11px;min-height:36px;padding:13px 7px 0}.loop-label{white-space:nowrap;color:#94a18e}dialog{color:var(--ink);background:#fbfcf4;width:min(590px,calc(100% - 28px));border:1px solid #d7e3d1;border-radius:25px;padding:25px;max-height:85dvh;box-shadow:0 25px 90px #153a4440}dialog::backdrop{background:#163e3c66;backdrop-filter:blur(5px)}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}dialog p,dialog li{font-size:14px;line-height:1.9}dialog ol{padding-left:22px}dialog li{margin:9px 0}.pattern{width:100%;background:#f0f4e7;border:1px solid #d9e3cc;border-radius:18px;padding:15px;margin:6px 0;display:flex;align-items:center;justify-content:space-between;gap:12px}.pattern b{font-size:15px}.pattern small{display:block;margin-top:5px;color:#7b8d75;text-align:left}.pattern .mini{font-size:22px;letter-spacing:6px}.dialog-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}.file-button{display:inline-flex;align-items:center}.file-button input{position:absolute;width:1px;height:1px;opacity:0}.saved{background:#f0f4e7;border-radius:15px;margin:9px 0;padding:10px;display:flex;gap:8px}.saved .load{flex:1;text-align:left;background:transparent;padding:9px;min-height:62px}.saved .load b{display:block;margin-bottom:8px}.saved .delete{align-self:center}.saved small{color:#7b8d75}details{font-size:13px;padding-top:14px}summary{cursor:pointer;min-height:42px}a{color:#217d63}#notice{position:fixed;z-index:100;bottom:18px;left:50%;transform:translateX(-50%);background:#70452f;color:white;box-shadow:0 4px 20px #3333;padding:13px 16px;border-radius:15px;display:flex;align-items:center;gap:14px;width:max-content;max-width:94vw;font-size:13px}#notice button{background:none;color:white;font-size:24px;min-width:36px;min-height:36px}
@media(min-width:900px) and (min-height:850px){body{padding-top:38px}header{margin-bottom:30px}.journey{height:120px}#track{padding-top:30px;padding-bottom:28px}.car-body{min-height:182px}.car-sounds{height:118px}.car-sounds svg{height:58px;width:78px}.car.single .car-sounds svg{height:98px;width:122px}.tool{min-height:105px}.transport{margin-top:30px}}
@media(max-width:700px){body{padding:14px 12px}header{margin-bottom:14px}.brand{gap:8px}.brand-icon{width:42px;height:42px;font-size:28px;border-radius:14px}.eyebrow{font-size:8px;letter-spacing:1px}h1{font-size:22px}.header-actions{gap:5px}.header-actions .small{padding:8px 11px}.header-actions .small span{display:none}.station{border-radius:23px}.station-top{padding:16px;font-size:11px}.journey{padding:0 17px;height:83px;gap:10px}#engine{width:81px}.journey-text b{font-size:15px}.journey-text span{font-size:11px;line-height:1.5;max-width:205px}.journey #follow{position:absolute;right:14px;top:43px;font-size:11px;min-height:32px;padding:5px 8px}#track{gap:9px;padding:22px 14px 24px}.car-body{min-height:132px;padding:5px;border-width:2px;border-radius:13px 13px 9px 9px}.car-sounds{height:80px}.car-sounds svg{height:38px;width:45px}.car.single .car-sounds svg{height:67px;width:78px}.car-top{font-size:9px}.car-top .number{min-width:19px}.car-syllable{font-size:10px}.wheels{left:10%;width:80%}.wheels i{width:22px;height:22px;border-width:4px;box-shadow:inset 0 0 0 3px #d4debd}.car:after{width:17px;right:-13px;bottom:13px}.route{padding:10px 13px;gap:5px;min-height:72px}.rail{bottom:75px}.route .round{min-width:38px;min-height:44px}.add{padding:7px 10px}.add span{font-size:12px}.page-button{min-width:43px;font-size:11px}.workbench{padding-top:14px}.section-label{margin-bottom:8px;font-size:12px}.section-label .muted{display:none}#tools{gap:7px}.tool{padding:7px 2px;flex-direction:column;gap:2px;min-height:100px;border-radius:15px}.tool svg{width:49px;height:49px}.tool .tool-label{text-align:center;gap:1px}.tool b{font-size:12px}.tool small{font-size:9px;letter-spacing:0}.tool .moon{font-size:36px;height:49px;width:auto;display:grid;place-items:center}.transport{padding:12px;gap:10px;margin-top:17px;flex-wrap:wrap;border-radius:19px}.play{order:-1;min-width:0;flex:1;min-height:58px}.save{font-size:22px;padding:6px}.save span{max-width:52px;font-size:12px;line-height:1.5}.tempo{width:100%;flex-direction:row;align-items:center;justify-content:space-between}.segmented{flex:1;max-width:260px}.segmented button{flex:1;min-height:36px}.play small{display:none}footer{font-size:10px;line-height:1.5}.loop-label{display:none}dialog{padding:20px}.pattern .mini{font-size:17px;letter-spacing:3px}}
@media(max-width:350px){body{padding:10px 8px}.brand-icon{display:none}h1{font-size:21px}.car-top .accent{display:none}.car-sounds svg{width:32px}.journey-text span{font-size:10px}.tool small{font-size:8px}.add{padding-inline:7px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
/* Keep playback reachable without shrinking the carriage hit areas. */
@media(min-width:701px) and (max-height:850px){body{padding-top:16px;padding-bottom:8px}header{margin-bottom:15px}.station-top{padding-block:13px}.journey{height:70px}#engine{width:92px}#track{padding-top:16px;padding-bottom:19px}.car-body{min-height:128px;padding:6px}.car-sounds{height:77px}.car-sounds svg{height:39px}.car.single .car-sounds svg{height:70px}.route{min-height:70px;padding-block:8px}.rail{bottom:73px}.workbench{padding-top:10px}.section-label{margin-bottom:6px}.section-label .text-button{min-height:30px}.tool{min-height:79px}.tool svg{height:55px;width:55px}.transport{margin-top:16px;padding:11px 18px}.play{min-height:58px}footer{padding-top:10px}}
@media(max-width:700px){#app{padding-bottom:145px}.transport{position:fixed;bottom:max(8px,env(safe-area-inset-bottom));left:12px;right:12px;z-index:5;box-shadow:0 -6px 28px #31554018;margin:0;background:#f8faf2f5;backdrop-filter:blur(10px)}.save{order:-1}.save span{max-width:60px}.tempo{order:0}.car.active .car-body{outline-width:3px}.route .page-button{min-width:46px}.sun{right:9%;opacity:.7}}
@media(max-width:350px){.play{font-size:16px;gap:8px}.save span{max-width:48px;font-size:11px}.transport{left:8px;right:8px;padding:10px}.station-top{padding:12px}.journey{height:70px}#track{padding-top:17px;padding-bottom:18px}.route{padding-inline:10px}.car-body{min-height:124px}.car-sounds{height:73px}}
@media(min-width:701px) and (max-height:500px){#app{padding-bottom:100px}.transport{position:fixed;left:28px;right:28px;bottom:8px;z-index:5;margin:0;box-shadow:0 -6px 28px #31554018}}

#track{padding-bottom:8px}
@media(min-width:701px) and (max-height:850px){#track{padding-bottom:7px}}

/* The shared Home button replaces the standalone brand icon. */
header>.brand{flex:1;min-width:0}.brand-icon{display:none}.header-actions{flex-shrink:0}h1{letter-spacing:0}header>a{flex-shrink:0}.saved .load{min-width:0;overflow-wrap:anywhere}.car-syllable{overflow-wrap:anywhere}.pattern>span:first-child{min-width:0}.pattern .mini{flex-shrink:0}
@media(max-width:700px){header{gap:8px}header .eyebrow{display:none}h1{font-size:clamp(16px,4.6vw,22px);line-height:1.15}.header-actions .small{min-width:44px;padding:8px}.header-actions .round{min-width:44px}.car-syllable{font-size:9px}.car-sounds{flex-shrink:0}.station-top{align-items:center}#count{white-space:nowrap}.pattern .mini{letter-spacing:1px;font-size:15px}}
@media(max-width:350px){.car-syllable{font-size:8px}.station-sign{font-size:10px}.tool b{font-size:11px}.save span{max-width:54px}}
html[lang=en] .tool small{display:none}html[lang=en] .car-syllable{font-size:10px}html[lang=en] .journey-text b{font-size:17px}html[lang=en] .section-label .muted{font-size:11px}
@media(max-width:700px){html[lang=en] .car-syllable{font-size:8px}html[lang=en] .journey-text b{font-size:14px}}
@media(max-width:700px) and (max-height:650px){
 body{padding:8px}header{margin-bottom:8px}.station{border-radius:18px}.station-top{padding:8px 12px}.journey{height:48px;padding:0 12px;gap:8px}#engine{width:60px}.journey-text span{font-size:9px;line-height:1.25}.journey-text{gap:3px}.journey-text b,html[lang=en] .journey-text b{font-size:12px}#track{padding:12px 12px 6px;gap:8px}.car-body{min-height:88px;padding:4px}.car-sounds{height:47px}.car-sounds svg{height:24px;width:32px}.car.single .car-sounds svg{height:47px;width:58px}.car-syllable{min-height:12px;font-size:8px}.car-top{font-size:8px}.car-top .accent{display:none}.route{min-height:56px;padding:5px 10px}.rail{bottom:59px}.route .page-button{min-height:44px}.workbench{padding-top:7px}.section-label{margin-bottom:3px;font-size:11px}.section-label .text-button{min-height:28px;padding:4px 8px}.tool{min-height:70px;padding:3px 2px}.tool svg{width:38px;height:38px}.tool .moon{height:38px;font-size:30px}.tool b{font-size:10px}.tool small{font-size:8px}.transport{padding:8px;gap:7px;left:8px;right:8px}.play{min-height:50px}.tempo .segmented button{min-height:32px}.save span{font-size:10px}
}
