:root{--sky: #7cc8ff;--blue: #1f76d2;--deep-blue: #0f4fa8;--cream: #fff8e8;--panel-bg: #fffdf6;--tile-empty: #f5ddb0;--tile-grass: #79c84a;--tile-grass-dark: #4a9b2f;--rail: #7b5a3a;--rail-metal: #d7d7d7;--red: #e94b35;--green: #27b84a;--yellow: #ffc928;--text: #24324a;--card-radius: 24px;--card-shadow: 0 12px 24px rgba(0,0,0,.18);--card-border: 4px solid rgba(255,255,255,.8)}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}html,body,#root{height:100%}body{font-family:system-ui,-apple-system,BlinkMacSystemFont,Hiragino Sans,Noto Sans JP,sans-serif;font-weight:700;color:var(--text);background:linear-gradient(160deg,#a8d8ff,#7cc8ff,#b8e8b0 60%,#c8d8a0,#d8c890);background-attachment:fixed;min-height:100vh;overflow:hidden;-webkit-tap-highlight-color:transparent;touch-action:manipulation}.game-shell{max-width:1600px;margin:0 auto;padding:12px 18px 16px;height:100vh;height:100dvh;display:grid;grid-template-columns:220px 1fr;grid-template-rows:auto 1fr auto;grid-template-areas:"header header" "palette board" "controls controls";gap:10px}.card{background:var(--panel-bg);border-radius:var(--card-radius);box-shadow:var(--card-shadow);border:var(--card-border)}.header{grid-area:header;flex-shrink:0;height:78px;display:flex;align-items:center;gap:16px;padding:0 20px;background:linear-gradient(135deg,#1f76d2,#0f4fa8);border-radius:22px;box-shadow:0 8px 20px #0f4fa866;border:3px solid rgba(255,255,255,.35)}.header-title{display:flex;align-items:center;gap:10px;flex:1;min-width:0}.header-train-icon{width:40px;height:40px;background:#fff;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:22px;flex-shrink:0;box-shadow:0 3px 8px #0003}.header-title-text{font-size:clamp(18px,2.4vw,30px);font-weight:900;line-height:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 2px 6px rgba(0,0,0,.3)}.title-kumikae{color:#fd5;text-shadow:0 2px 4px rgba(0,0,0,.4)}.title-train{color:#adf;text-shadow:0 2px 4px rgba(0,0,0,.4)}.header-stage-container{display:flex;align-items:center;gap:8px;flex-shrink:0}.stage-arrow-btn{width:32px;height:32px;border-radius:50%;border:2px solid rgba(255,255,255,.4);background:linear-gradient(135deg,#ffffff40,#ffffff1a);color:#fff;font-size:13px;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:transform .15s,background .15s;box-shadow:0 3px 6px #00000026;-webkit-user-select:none;user-select:none}.stage-arrow-btn:hover{background:#ffffff59;transform:scale(1.1)}.stage-arrow-btn:active{transform:scale(.9)}.header-stage{background:linear-gradient(135deg,#1a5db5,#0d3e82);border-radius:20px;padding:6px 16px;border:2px solid rgba(255,255,255,.3);text-align:center;white-space:nowrap;flex-shrink:0}.stage-label{font-size:10px;color:#acf;letter-spacing:1px}.stage-number{font-size:18px;font-weight:900;color:var(--yellow)}.header-stars{background:#ffffff26;border-radius:18px;padding:6px 14px;display:flex;gap:4px;align-items:center;border:2px solid rgba(255,255,255,.3);flex-shrink:0}.star-icon{font-size:20px;animation:starGlow 2s ease-in-out infinite}.star-icon:nth-child(2){animation-delay:.3s}.star-icon:nth-child(3){animation-delay:.6s}@keyframes starGlow{0%,to{filter:brightness(1) drop-shadow(0 0 2px #ffc928)}50%{filter:brightness(1.3) drop-shadow(0 0 6px #ffc928)}}.header-buttons{display:flex;gap:6px;flex-shrink:0}.icon-btn{width:40px;height:40px;border-radius:50%;border:2px solid rgba(255,255,255,.4);background:linear-gradient(135deg,#ffffff40,#ffffff1a);color:#fff;font-size:13px;font-weight:700;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;transition:transform .15s,background .15s;line-height:1.1}.icon-btn span{font-size:9px}.icon-btn:hover{background:#ffffff59;transform:scale(1.08)}.icon-btn:active{transform:scale(.95)}.main-layout{grid-area:board;display:flex;gap:12px;min-height:0;overflow:hidden}.panel-palette{grid-area:palette;padding:14px;display:flex;flex-direction:column;gap:10px;overflow-y:auto}.palette-heading{background:linear-gradient(90deg,var(--blue),var(--deep-blue));color:#fff;border-radius:12px;padding:6px 14px;font-size:14px;font-weight:900;text-align:center;letter-spacing:1px;flex-shrink:0}.palette-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.panel-card{position:relative;background:var(--cream);border-radius:14px;border:3px solid rgba(255,255,255,.9);box-shadow:0 4px 10px #0000001f;padding:8px 6px 6px;display:flex;flex-direction:column;align-items:center;gap:4px;cursor:grab;transition:transform .15s,box-shadow .15s,background .15s,border-color .15s;-webkit-user-select:none;user-select:none;-webkit-user-drag:element}.panel-card:active{cursor:grabbing}.panel-card>*{pointer-events:none}.panel-card:hover{transform:translateY(-3px);box-shadow:0 8px 18px #0000002e;border-color:var(--blue)}.panel-card.selected{border-color:var(--blue);background:#e8f4ff;box-shadow:0 0 0 3px #1f76d24d,0 4px 10px #0000001f}.panel-count-badge{position:absolute;top:-6px;right:-6px;background:linear-gradient(135deg,#ff4e50,#f9d423);color:#fff;border:2px solid #fff;border-radius:50%;width:22px;height:22px;font-size:11px;font-weight:900;display:flex;align-items:center;justify-content:center;box-shadow:0 3px 6px #00000040;text-shadow:0 1px 2px rgba(0,0,0,.2);z-index:5;animation:popBadgeIn .3s cubic-bezier(.34,1.56,.64,1)}@keyframes popBadgeIn{0%{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}.panel-card.disabled{opacity:.38;cursor:not-allowed!important;pointer-events:none!important}.panel-card.disabled:hover{transform:none!important;box-shadow:0 4px 10px #0000001f!important;border-color:#ffffffe6!important}.panel-card.disabled .panel-count-badge{background:#999;box-shadow:none}.palette-total-counter{background:linear-gradient(135deg,#24324a,#1a2536);color:#fff;border-radius:16px;padding:10px 14px;display:flex;flex-direction:column;align-items:center;gap:4px;border:2px solid rgba(255,255,255,.15);box-shadow:inset 0 2px 5px #0000004d;margin-bottom:6px;flex-shrink:0;-webkit-user-select:none;user-select:none}.counter-label{font-size:10px;color:#acf;font-weight:700;letter-spacing:1px;text-transform:uppercase}.counter-value{display:flex;align-items:baseline;gap:3px;font-family:monospace,system-ui}.current-val{font-size:24px;font-weight:900;color:var(--yellow);text-shadow:0 0 8px rgba(255,201,40,.4)}.slash{font-size:16px;color:#666;font-weight:700}.total-val{font-size:16px;font-weight:700;color:#888}.unit{font-size:10px;color:#888;margin-left:2px;font-weight:700}.panel-preview{width:54px;height:54px;border-radius:10px;background:var(--tile-grass);border:2px solid var(--tile-grass-dark);position:relative;overflow:hidden;flex-shrink:0}.panel-label{font-size:11px;font-weight:700;color:var(--text);text-align:center}.palette-divider{border:none;border-top:2px dashed #ddd;margin:4px 0;flex-shrink:0}.eraser-card{background:#fff0ee;border-radius:12px;border:2px solid #fcc;padding:8px 14px;display:flex;align-items:center;gap:8px;cursor:pointer;transition:transform .15s,background .15s;flex-shrink:0}.eraser-card:hover{background:#ffe4e1;transform:translateY(-2px)}.eraser-icon{font-size:22px}.eraser-label{font-size:13px;font-weight:900;color:var(--red)}.eraser-card.selected{background:#ffd5d0;border-color:var(--red);box-shadow:0 0 0 3px #e94b354d}.board-wrapper{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:12px;overflow:auto}.board-frame{--tile-size: 90px;background:var(--panel-bg);border-radius:var(--card-radius);box-shadow:var(--card-shadow);border:var(--card-border);padding:12px;display:inline-flex;flex-direction:column;position:relative}.board-header-row{display:flex;align-items:center;padding-left:30px;margin-bottom:4px}.col-label{width:var(--tile-size);text-align:center;font-size:14px;font-weight:900;color:#999}.board-rows{display:flex;flex-direction:column;position:relative}.board-row{display:flex;align-items:center}.row-label{width:30px;text-align:center;font-size:14px;font-weight:900;color:#999;flex-shrink:0}.train-overlay{position:absolute;left:0;top:0;width:var(--tile-size);height:var(--tile-size);pointer-events:none;z-index:20;transform:translate(calc(30px + var(--train-col, 0) * var(--tile-size)),calc(var(--train-row, 0) * var(--tile-size)));transition:transform .4s cubic-bezier(.4,0,.2,1)}.tile{width:var(--tile-size);height:var(--tile-size);border:2px solid rgba(0,0,0,.1);position:relative;cursor:pointer;overflow:hidden;transition:filter .15s}.tile>*{pointer-events:none}.tile:first-of-type{border-radius:10px 0 0}.tile:last-of-type{border-radius:0 10px 0 0}.board-row:last-child .tile:first-of-type{border-radius:0 0 0 10px}.board-row:last-child .tile:last-of-type{border-radius:0 0 10px}.tile:hover{filter:brightness(1.06)}.tile-empty{background:var(--tile-empty);background-image:radial-gradient(circle,rgba(180,140,80,.25) 1px,transparent 1px);background-size:14px 14px}.tile-filled{background:var(--tile-grass)}.tile-obstacle{background:linear-gradient(135deg,#d2a172,#b08257)!important;border:2px solid rgba(0,0,0,.15)!important;cursor:not-allowed!important}.tile-obstacle:hover{filter:brightness(1)!important}.tile-route:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:#7df5ff0f;pointer-events:none}.rail-svg{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;overflow:visible}.route-glow{animation:routeGlow 1.8s ease-in-out infinite}@keyframes routeGlow{0%,to{opacity:.6;filter:drop-shadow(0 0 4px #7df5ff)}50%{opacity:1;filter:drop-shadow(0 0 10px #7df5ff)}}.station{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:calc(var(--tile-size) * .02);z-index:2}.station-building{display:flex;flex-direction:column;align-items:center}.station-roof{width:calc(var(--tile-size) * .7);height:0;border-left:calc(var(--tile-size) * .35) solid transparent;border-right:calc(var(--tile-size) * .35) solid transparent}.station-start .station-roof{border-bottom:calc(var(--tile-size) * .28) solid #1a6cc4}.station-goal .station-roof{border-bottom:calc(var(--tile-size) * .28) solid #c42030}.station-body{width:calc(var(--tile-size) * .58);height:calc(var(--tile-size) * .35);display:flex;align-items:flex-end;justify-content:center;gap:calc(var(--tile-size) * .05);padding-bottom:calc(var(--tile-size) * .04);border-radius:0 0 calc(var(--tile-size) * .05) calc(var(--tile-size) * .05)}.station-start .station-body{background:#38d}.station-goal .station-body{background:#e04050}.station-window{width:calc(var(--tile-size) * .11);height:calc(var(--tile-size) * .14);background:#c8e8ff;border-radius:calc(var(--tile-size) * .04) calc(var(--tile-size) * .04) 0 0}.station-door{width:calc(var(--tile-size) * .14);height:calc(var(--tile-size) * .19);border-radius:calc(var(--tile-size) * .04) calc(var(--tile-size) * .04) 0 0}.station-start .station-door{background:#1a5cb0}.station-goal .station-door{background:#b02030}.station-label{border-radius:calc(var(--tile-size) * .1);padding:calc(var(--tile-size) * .02) calc(var(--tile-size) * .09);font-size:calc(var(--tile-size) * .13);font-weight:900;color:#fff;margin-top:calc(var(--tile-size) * .02);box-shadow:0 calc(var(--tile-size) * .02) calc(var(--tile-size) * .07) #00000040;white-space:nowrap}.station-start .station-label{background:#1a6cc4}.station-goal .station-label{background:#c42030}.station-rail{position:absolute;bottom:calc(var(--tile-size) * .15);left:0;right:0;height:calc(var(--tile-size) * .07);background:repeating-linear-gradient(90deg,#7b5a3a 0px,#7b5a3a 5px,transparent 5px,transparent 10px)}.station-rail:before,.station-rail:after{content:"";position:absolute;left:0;right:0;height:1.5px;background:#d0d0d0}.station-rail:before{top:0}.station-rail:after{bottom:0}.train-wrapper{position:absolute;bottom:18px;left:50%;transform:translate(-50%);z-index:10;animation:trainBob 1.2s ease-in-out infinite}@keyframes trainBob{0%,to{transform:translate(-50%) translateY(0)}50%{transform:translate(-50%) translateY(-4px)}}.train{display:flex;flex-direction:column;align-items:center;filter:drop-shadow(0 4px 8px rgba(0,0,0,.3))}.train-body{width:calc(var(--tile-size) * .8);height:calc(var(--tile-size) * .42);background:linear-gradient(180deg,#38e,#15c 60%,#0f44aa);border-radius:calc(var(--tile-size) * .15) calc(var(--tile-size) * .15) calc(var(--tile-size) * .05) calc(var(--tile-size) * .05);position:relative;border:1.5px solid rgba(255,255,255,.3);display:flex;align-items:center}.train-front{position:absolute;right:calc(var(--tile-size) * -.09);top:calc(var(--tile-size) * .05);bottom:calc(var(--tile-size) * .05);width:calc(var(--tile-size) * .16);background:linear-gradient(90deg,#15c,#0f44aa);border-radius:0 calc(var(--tile-size) * .09) calc(var(--tile-size) * .09) 0}.train-stripe{position:absolute;left:0;right:0;height:calc(var(--tile-size) * .07);background:#f44;top:50%;transform:translateY(-50%)}.train-windows{display:flex;gap:calc(var(--tile-size) * .06);padding:calc(var(--tile-size) * .06) calc(var(--tile-size) * .09) calc(var(--tile-size) * .04);z-index:1}.train-window{width:calc(var(--tile-size) * .16);height:calc(var(--tile-size) * .16);background:#c8e8ff;border-radius:calc(var(--tile-size) * .04);border:1px solid rgba(255,255,255,.5)}.train-light{position:absolute;right:calc(var(--tile-size) * -.03);top:calc(var(--tile-size) * .06);width:calc(var(--tile-size) * .09);height:calc(var(--tile-size) * .09);background:#ffeb3b;border-radius:50%;box-shadow:0 0 8px #ffeb3b}.train-undercarriage{width:calc(var(--tile-size) * .72);height:calc(var(--tile-size) * .08);background:#333;margin-top:calc(var(--tile-size) * -.02);border-radius:calc(var(--tile-size) * .03)}.train-wheels{display:flex;justify-content:space-around;width:calc(var(--tile-size) * .65);margin-top:calc(var(--tile-size) * -.04)}.train-wheel{width:calc(var(--tile-size) * .16);height:calc(var(--tile-size) * .16);background:radial-gradient(circle at 35% 35%,#888,#333);border-radius:50%;border:1.5px solid #555;position:relative}.train-wheel:after{content:"";position:absolute;inset:calc(var(--tile-size) * .04);background:#666;border-radius:50%}.cursor-place .tile-empty:hover{background-color:#ffe6a0;outline:3px dashed var(--blue);outline-offset:-3px}.cursor-rotate .tile-filled:hover{filter:brightness(1.1) drop-shadow(0 0 6px rgba(31,118,210,.4));cursor:pointer}.cursor-eraser .tile-filled:hover{filter:brightness(1.1) saturate(.6);outline:3px dashed var(--red);outline-offset:-3px;cursor:pointer}.cursor-eraser .tile-empty{cursor:not-allowed}.tile-drag-over{background-color:#ffe6a0!important;outline:4px dashed var(--blue);outline-offset:-4px;filter:drop-shadow(0 0 8px rgba(31,118,210,.5))}.tile-drag-over:after{content:"＋";position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;font-size:30px;font-weight:900;color:var(--blue);opacity:.7;pointer-events:none}.tile-dragging{opacity:.35!important;filter:grayscale(.5);transform:scale(.95);transition:transform .1s ease,opacity .1s ease}.tile-filled[draggable=true]{cursor:grab}.tile-filled[draggable=true]:active{cursor:grabbing}.tile-fail{animation:failPulse .7s ease-in-out infinite alternate}.tile-fail.tile-empty{animation:failPulseEmpty .7s ease-in-out infinite alternate}@keyframes failPulse{0%{box-shadow:inset 0 0 #e94b3500;background-color:var(--tile-grass)}to{box-shadow:inset 0 0 0 6px #e94b35d9,0 0 16px #e94b35b3;background-color:#fcc}}@keyframes failPulseEmpty{0%{box-shadow:inset 0 0 #e94b3500}to{box-shadow:inset 0 0 0 6px #e94b35d9,0 0 16px #e94b35b3}}.control-bar{grid-area:controls;display:flex;gap:10px;justify-content:center;flex-shrink:0}.ctrl-btn{flex:1;max-width:180px;min-height:56px;border-radius:18px;border:4px solid rgba(255,255,255,.8);font-size:clamp(13px,1.4vw,18px);font-weight:900;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:6px;box-shadow:0 8px 16px #0003,inset 0 1px #ffffff4d;transition:transform .15s,box-shadow .15s;text-shadow:0 2px 4px rgba(0,0,0,.3);font-family:inherit}.ctrl-btn:hover{transform:translateY(-3px);box-shadow:0 12px 22px #00000040,inset 0 1px #ffffff4d}.ctrl-btn:active{transform:translateY(1px);box-shadow:0 3px 8px #0003}.ctrl-btn:focus-visible{outline:3px solid #fff;outline-offset:2px}.ctrl-btn-icon{font-size:1.2em}.ctrl-run{background:linear-gradient(135deg,#2ecc71,#1aa055)}.ctrl-stop{background:linear-gradient(135deg,#e74c3c,#c0392b)}.ctrl-reset{background:linear-gradient(135deg,#f39c12,#d68910)}.ctrl-undo{background:linear-gradient(135deg,#3498db,#2176ae)}.modal-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#0f1e3c8c;display:flex;align-items:center;justify-content:center;z-index:100;animation:fadeIn .2s ease-out}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.modal-card{background:linear-gradient(180deg,#fffef0,#fff8d8);border-radius:28px;box-shadow:0 24px 60px #00000059,0 0 0 6px #fff9 inset;border:5px solid rgba(255,255,255,.9);padding:28px 36px 26px;text-align:center;max-width:400px;animation:popIn .35s cubic-bezier(.34,1.56,.64,1)}@keyframes popIn{0%{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}.modal-icon{font-size:56px;line-height:1;margin-bottom:6px}.modal-card h2{font-size:30px;color:var(--blue);margin-bottom:10px;font-weight:900;letter-spacing:1px}.modal-card p{font-size:15px;color:var(--text);margin-bottom:16px}.modal-btn{background:linear-gradient(135deg,#2ecc71,#1aa055);color:#fff;border:4px solid rgba(255,255,255,.85);border-radius:18px;padding:12px 32px;font-size:17px;font-weight:900;cursor:pointer;box-shadow:0 8px 20px #0003;font-family:inherit;letter-spacing:1px;transition:transform .15s}.modal-btn:hover{transform:translateY(-3px)}.modal-btn:active{transform:translateY(1px)}.fail-toast{position:fixed;top:22px;left:50%;transform:translate(-50%);background:linear-gradient(135deg,#e94b35,#c0392b);color:#fff;padding:12px 24px;border-radius:18px;font-size:16px;font-weight:900;border:4px solid rgba(255,255,255,.85);box-shadow:0 10px 24px #e94b3580;z-index:90;animation:toastIn .4s cubic-bezier(.34,1.56,.64,1)}@keyframes toastIn{0%{transform:translate(-50%,-40px);opacity:0}to{transform:translate(-50%);opacity:1}}.rotate-prompt{display:none;position:fixed;top:0;right:0;bottom:0;left:0;background:linear-gradient(160deg,var(--sky),var(--blue));color:#fff;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:40px;z-index:1000}.rotate-prompt .rotate-icon{font-size:88px;animation:rotateAnim 1.8s ease-in-out infinite;margin-bottom:16px}.rotate-prompt h2{font-size:28px;margin-bottom:8px;font-weight:900;text-shadow:0 3px 8px rgba(0,0,0,.3)}.rotate-prompt p{font-size:16px;opacity:.9}@keyframes rotateAnim{0%,45%,to{transform:rotate(0)}60%,90%{transform:rotate(-90deg)}}@media (max-width: 1200px){.main-layout{grid-template-columns:200px 1fr;gap:10px}.header{height:66px}}@media (max-width: 900px){.game-shell{grid-template-columns:1fr auto;grid-template-rows:auto 1fr auto;grid-template-areas:"header header" "board controls" "palette palette";padding:4px 6px;gap:4px;height:100vh;height:100dvh;overflow:hidden}.header{height:36px;padding:0 10px;gap:6px;border-radius:12px;box-shadow:0 4px 12px #0f4fa84d;border-width:2px}.header-train-icon{width:24px;height:24px;font-size:13px}.header-title-text{font-size:13px}.header-stage-container{gap:4px}.stage-arrow-btn{width:24px;height:24px;font-size:10px;border-width:1.5px}.header-stage{padding:2px 8px;border-radius:10px;border-width:1.5px}.stage-label{font-size:8px}.stage-number{font-size:12px}.header-stars{display:none}.icon-btn{width:26px;height:26px;font-size:10px;border-width:1.5px}.icon-btn span{display:none}.header-buttons{gap:4px}.main-layout{grid-area:board;display:flex;min-height:0;overflow:hidden}.panel-palette{padding:4px 8px;flex-direction:row;align-items:center;gap:6px;overflow-x:auto;overflow-y:hidden;border-radius:12px;border-width:2px;flex-shrink:0;max-height:none;-webkit-overflow-scrolling:touch;scrollbar-width:none}.panel-palette::-webkit-scrollbar{display:none}.palette-heading{font-size:10px;padding:3px 8px;border-radius:8px;white-space:nowrap;flex-shrink:0}.palette-total-counter{flex-direction:row;gap:6px;padding:4px 10px;border-radius:10px;margin-bottom:0;flex-shrink:0;border-width:1.5px}.counter-label{font-size:8px;white-space:nowrap}.counter-value{gap:2px}.current-val{font-size:16px}.slash,.total-val{font-size:12px}.unit{font-size:8px}.palette-grid{display:flex;flex-direction:row;gap:5px;flex-shrink:0}.panel-card{padding:4px 4px 3px;border-width:2px;border-radius:10px;flex-direction:column;align-items:center;gap:1px;min-width:54px}.panel-preview{width:36px;height:36px;border-width:1.5px;border-radius:7px}.panel-label{font-size:8px;white-space:nowrap}.palette-divider{border:none;border-left:2px dashed #ddd;margin:0 2px;height:36px;flex-shrink:0}.eraser-card{padding:4px 8px;border-radius:10px;flex-shrink:0;gap:3px;flex-direction:column;align-items:center;min-width:46px}.eraser-icon{font-size:18px}.eraser-label{font-size:8px}.board-wrapper{padding:2px;grid-column:1;grid-row:1}.board-frame{padding:4px;border-radius:12px;border-width:2px;box-shadow:0 6px 16px #00000026}.row-label{width:16px;font-size:10px}.col-label{font-size:10px}.board-header-row{padding-left:16px;margin-bottom:1px}.train-overlay{transform:translate(calc(16px + var(--train-col, 0) * var(--tile-size)),calc(var(--train-row, 0) * var(--tile-size)))}.tile{border-width:1.5px}.control-bar{grid-area:controls;flex-direction:column;gap:4px;justify-content:center;align-items:stretch}.ctrl-btn{min-height:0;max-width:none;width:44px;padding:6px 2px;font-size:9px;border-width:2px;border-radius:10px;gap:2px;flex-direction:column;text-shadow:0 1px 2px rgba(0,0,0,.3);box-shadow:0 4px 10px #00000026,inset 0 1px #ffffff4d}.ctrl-btn-icon{font-size:1.1em}.modal-card{padding:18px 24px 16px;border-radius:20px;border-width:3px;max-width:300px}.modal-icon{font-size:40px}.modal-card h2{font-size:22px;margin-bottom:6px}.modal-card p{font-size:13px;margin-bottom:10px}.modal-btn{font-size:14px;padding:8px 20px;border-width:3px;border-radius:14px}.fail-toast{top:10px;padding:8px 16px;font-size:13px;border-width:2px;border-radius:12px}}@media (max-height: 400px) and (max-width: 900px){.game-shell{padding:2px 4px;gap:2px}.header{height:30px;border-radius:10px;padding:0 8px;gap:4px}.header-train-icon{width:20px;height:20px;font-size:11px}.header-title-text{font-size:11px}.stage-arrow-btn{width:20px;height:20px;font-size:9px}.header-stage{padding:1px 6px;border-radius:8px}.stage-label{font-size:7px}.stage-number{font-size:10px}.icon-btn{width:22px;height:22px;font-size:9px}.board-frame{padding:3px}.panel-palette{padding:2px 6px;gap:4px;border-radius:8px}.panel-card{padding:2px 2px 1px;min-width:44px;border-radius:8px}.panel-preview{width:28px;height:28px;border-radius:6px}.panel-label{font-size:7px}.palette-heading{font-size:8px;padding:2px 6px;border-radius:6px}.palette-total-counter{padding:2px 6px;border-radius:8px}.current-val{font-size:13px}.slash,.total-val{font-size:10px}.eraser-card{padding:2px 4px;min-width:38px;border-radius:8px}.eraser-icon{font-size:14px}.eraser-label{font-size:7px}.ctrl-btn{width:36px;font-size:8px;padding:4px 1px;border-radius:8px;gap:1px}}@media (orientation: portrait){body{overflow:hidden}.game-shell>*:not(.rotate-prompt){display:none!important}.rotate-prompt{display:flex!important}}
