/* Keep all controls on one quiet surface; illustrations are the buttons. */
.train-service-buttons button,.train-service-buttons button.ready{background:transparent;border:0;border-radius:0;box-shadow:none;padding:3px;color:#426158}
.train-service-buttons button{grid-template-columns:46px 1fr;min-height:68px;cursor:pointer}
.train-service-buttons img{height:52px;width:52px;transition:filter .2s;filter:drop-shadow(0 2px 2px #4e493b24)}
.train-service-buttons button.ready img{animation:service-wiggle 4s ease-in-out infinite;filter:drop-shadow(0 0 6px #d4b77566)}
.train-service-buttons button:disabled{opacity:.46}.train-service-buttons button:hover:not(:disabled) img{filter:drop-shadow(0 2px 5px #9c945b55)}
@keyframes service-wiggle{0%,14%,100%{transform:rotate(0)}3%,9%{transform:rotate(-9deg)}6%,12%{transform:rotate(8deg)}}
/* Opacity is driven solely by camera position: pause/reverse at any zoom. */
.travel-scene .train-interior{opacity:var(--interior-blend,0);transform:scale(var(--interior-scale,.86));transition:none;transform-origin:50% 62%;border-radius:10px}
.travel-scene .journey-world{opacity:var(--exterior-blend,1);visibility:visible}
.travel-scene .world-guide{opacity:var(--exterior-blend,1)}
.inside-train .journey-world,.inside-train .world-guide{visibility:hidden}
.interior-landscape{transition:background-image 1s ease;background-size:auto 150%}
.station-front{z-index:4}.platform-people{position:absolute;inset:0;z-index:5;pointer-events:none;overflow:visible}
.platform-person,.platform-conductor{position:absolute;color:#343b38;transform-origin:50% 100%;pointer-events:none}
.platform-person>svg,.platform-conductor>svg{display:block;width:100%;height:100%;overflow:visible}
.platform-conductor>svg:nth-child(2){position:absolute;inset:0;opacity:0}.platform-conductor.whistling>svg:first-child{opacity:0}.platform-conductor.whistling>svg:nth-child(2){opacity:1}
.platform-conductor.ready{filter:drop-shadow(0 0 2px #f5d37a) drop-shadow(0 0 5px #ffe2a3)}
.platform-person.walking .person-leg-a,.platform-conductor.walking .person-leg-a{animation:platform-step .8s ease-in-out infinite alternate;animation-delay:var(--walk-delay,0s)}
.platform-person.walking .person-leg-b,.platform-conductor.walking .person-leg-b{animation:platform-step .8s ease-in-out infinite alternate-reverse;animation-delay:var(--walk-delay,0s)}
.platform-person.walking .person-arm-a{animation:platform-arm .8s ease-in-out infinite alternate-reverse;animation-delay:var(--walk-delay,0s)}
.platform-person.walking .person-arm-b{animation:platform-arm .8s ease-in-out infinite alternate;animation-delay:var(--walk-delay,0s)}
@keyframes platform-step{from{transform:rotate(-15deg)}to{transform:rotate(15deg)}}@keyframes platform-arm{from{transform:rotate(-10deg)}to{transform:rotate(10deg)}}
.platform-doors{position:absolute;inset:0;pointer-events:none}.platform-door{position:absolute;border-radius:14% 14% 0 0;background:linear-gradient(90deg,#352f25,#70634a 55%,#343129);box-shadow:inset 0 1px 1px #e3ca87;transform-origin:center}
/* Boxes are objects, never cards. Modal header remains available to AT. */
#modal.floating-box-modal{width:min(720px,96vw);height:min(560px,88dvh);max-height:88dvh;background:transparent;border:0;box-shadow:none;overflow:visible;padding:0;color:#304d42}
.floating-box-modal::backdrop{background:#e1e6ddc9;backdrop-filter:blur(3px)}
.floating-box-modal .modal-heading{padding:0;border:0;min-height:34px;justify-content:flex-end;background:transparent}
.floating-box-modal .modal-heading h2{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.floating-box-modal .modal-heading button{background:transparent;border:0;box-shadow:none;position:absolute;right:8px;top:8px;z-index:5;color:#355c51}
.floating-box-modal .modal-body{padding:0;height:100%;max-height:none;overflow:visible}
.box-unopened{height:100%;display:grid;place-items:center}.floating-box{border:0;background:transparent;padding:0;width:min(360px,80vw);height:min(360px,80vw);cursor:pointer;animation:crate-wiggle 4.8s ease-in-out infinite;transform-origin:50% 82%}
.floating-box>.train-box-art{display:block;width:100%;height:100%;filter:drop-shadow(0 10px 9px #5d534226)}
.floating-box:focus-visible,.garage-box:focus-visible{outline:2px solid #567967;outline-offset:5px;border-radius:20px}
@keyframes crate-wiggle{0%,16%,100%{transform:rotate(0)}4%,12%{transform:rotate(-3deg)}8%{transform:rotate(3deg)}}
.box-opening{position:relative;height:100%;min-height:0;overflow:hidden}.box-opening-crate{position:absolute;top:210px;left:50%;width:270px;height:270px;transform:translateX(-50%)}
.box-opening-crate .train-box-art{width:100%;height:100%}.crate-before,.crate-after{position:absolute;inset:0;transition:opacity .55s ease,transform .65s ease}.crate-after{opacity:0;transform:scale(.96)}.rolling .crate-after{opacity:1;transform:scale(1)}.rolling .crate-before{opacity:0}
.box-opening.rolling .box-opening-crate{animation:none}
.box-reel-window{position:absolute;top:50px;left:0;right:0;height:220px;margin:0;background:transparent;border:0;border-radius:0;mask-image:linear-gradient(90deg,transparent,#000 18%,#000 82%,transparent)}
.box-reel{transition:transform 7.6s cubic-bezier(.12,.58,.08,1);top:24px}.box-reel-card{background:transparent;border:0;box-shadow:none;border-radius:0;height:180px;gap:9px;padding:10px 3px}.box-reel-card .carriage-art{height:80px!important}.box-reel-card .rarity-badge{align-self:center;background:transparent;font-size:11px;padding:0}
.box-pointer{height:9px;top:8px;bottom:auto;width:0;background:transparent;box-shadow:none}.box-pointer:before{border-top-color:#859477;border-top-width:8px;border-left-width:5px;border-right-width:5px;left:-5px}
.box-result{position:relative;padding-top:24px}.box-result .box-prize{height:170px;margin:0 auto 10px;width:min(560px,94%)}.box-result h3{font-size:20px;margin:0 10px 8px}.box-result>.rarity-badge{background:transparent}.box-result-crate{width:240px;height:240px;margin:-8px auto 0}.box-result-crate img{height:100%;width:100%}
.garage-boxes{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin:4px 0 12px}.garage-boxes:empty{display:none}.garage-box{position:relative;width:92px;height:90px;padding:0;border:0;background:transparent;cursor:pointer}.garage-box .train-box-art{width:100%;height:100%;object-fit:contain;transform:scale(1.18);transform-origin:50% 84%}.box-count{position:absolute;right:0;top:32px;min-width:23px;height:23px;display:grid;place-items:center;background:#f6f5e9;color:#496050;border:1px solid currentColor;border-radius:50%;font-size:12px;font-weight:600}.garage-box.rarity-rare .box-count{color:#427fa0}.garage-box.rarity-epic .box-count{color:#89629f}.garage-box.rarity-legendary .box-count{color:#a57d37}
/* Puzzle opens directly. No workbench, choice screen or finish button. */
#modal.workshop-modal{width:min(440px,94vw);background:#f6f5ec;border:0;box-shadow:0 18px 60px #344c4020;padding:20px;border-radius:14px}
.workshop-modal .modal-heading{border:0;padding:0;justify-content:flex-end;min-height:28px}.workshop-modal .modal-heading h2{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.workshop-modal .modal-body{padding:10px 0 0}.repair-condition{display:flex;flex-direction:column;align-items:center;gap:8px;font-size:11px;color:#76816b;margin:0 0 20px}.repair-condition span{font-size:16px;color:#42634e;position:relative}.repair-gain{position:absolute;left:100%;top:0;margin-left:14px;color:#548c4f;white-space:nowrap;animation:repair-pop .65s ease-out}.repair-cables{max-width:300px;margin:0 auto;background:transparent;padding:0;border:0;gap:6px}.repair-footer{max-width:300px;margin:15px auto 0;border:0;font-size:11px;color:#74836b;justify-content:space-between}.repair-footer button{font-size:11px}.repair-success{padding:45px 0;text-align:center;display:flex;flex-direction:column;align-items:center;gap:12px}.repair-success strong{font-size:24px}.repair-success p{font-size:13px}.repair-done .cable-tile{opacity:1;background:#e6ecd9}@keyframes repair-pop{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(-3px)}}
@media(max-width:650px){.train-service-buttons button{grid-template-columns:38px 1fr;min-height:38px;padding:0}.train-service-buttons img{width:38px;height:38px}.floating-box-modal .modal-body{min-height:0}.box-opening-crate{top:185px;width:240px;height:240px}.box-reel-window{top:38px}.box-result .box-prize{height:135px}.box-result h3{font-size:16px}.box-result-crate{height:210px;width:210px}}
.reduce-motion .train-service-buttons button.ready img,.reduce-motion .floating-box,.reduce-motion .platform-person *,.reduce-motion .platform-conductor *,.reduce-motion .repair-gain{animation:none!important}.reduce-motion .crate-after,.reduce-motion .crate-before{transition:none}
@media(prefers-reduced-motion:reduce){.train-service-buttons button.ready img,.floating-box,.platform-person *,.platform-conductor *,.repair-gain{animation:none!important}.crate-after,.crate-before{transition:none}}
/* The contract board stays alongside route planning, outside the editor. */
.route-builder{max-width:1160px}.journey-planning-layout{display:grid;grid-template-columns:minmax(0,1fr) 268px;gap:18px;align-items:start}.journey-planning-layout .route-editor-card{min-width:0;padding:22px}.journey-contract-sidebar{position:sticky;top:20px;border:1px solid #d6dccb;border-radius:16px;padding:16px;background:#f3f4e9;min-width:0}.journey-contract-sidebar>header{display:flex;align-items:center;justify-content:space-between;gap:8px}.journey-contract-sidebar h2{font:400 24px var(--serif);margin:0}.journey-contract-sidebar>p{font-size:11px;color:#788575;line-height:1.5;margin:8px 0 14px}.sidebar-contract-list{display:grid;gap:9px;max-height:500px;overflow:auto;padding:2px}.sidebar-contract{border:1px solid #dce2d4;border-radius:9px;padding:11px;background:#fafaf2;display:flex;flex-direction:column;gap:5px}.sidebar-contract>small{font-size:9px;color:#75816d}.sidebar-contract>strong{font-size:13px}.sidebar-contract p{font-size:10px;line-height:1.5;margin:0;color:#7a8673}.sidebar-contract>div{display:flex;justify-content:space-between;align-items:center;gap:7px;font-size:11px}.sidebar-contract>div>span{display:flex;align-items:center;gap:4px}.sidebar-contract .text-button{font-size:10px;padding:6px 0}.contract-premium{border:1px solid #c1a35b!important;box-shadow:inset 0 0 0 1px #e8dca944!important}.contract-premium>small:first-child,.contract-premium-label{color:#96762d!important}.journey-contract-sidebar .contract-compact{display:block;margin:10px 0;padding:10px}.journey-contract-sidebar .contract-compact .text-button{padding:5px 0}.all-contracts{font-size:11px;margin-top:10px}.route-favorite-actions .premium-surface,.trip-route-heart.premium-surface{border:1px solid #c1a35b!important;box-shadow:0 0 0 1px #e8dca944!important}.journey-planning-layout .route-card-heading{flex-wrap:wrap;gap:10px}.journey-planning-layout .route-favorite-actions{flex-wrap:wrap;gap:6px}.journey-planning-layout .route-favorite-actions .button{font-size:10px;padding:7px 9px}
@media(max-width:1050px){.journey-planning-layout{grid-template-columns:minmax(0,1fr) 230px;gap:12px}.journey-planning-layout .route-editor-card{padding:18px 14px}.journey-contract-sidebar{padding:12px}}
@media(max-width:780px){.journey-planning-layout{grid-template-columns:1fr}.journey-contract-sidebar{position:static}.sidebar-contract-list{grid-template-columns:repeat(2,minmax(0,1fr));max-height:none}}
@media(max-width:440px){.sidebar-contract-list{grid-template-columns:1fr}.journey-planning-layout .route-editor-card{padding:18px 12px}}

.floating-box-modal .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
