/* All tablet rules are input-specific. Desktop selectors and assets stay unchanged. */
.touch-controls{display:none}#joystick{width:112px;height:112px;border-radius:50%;border:2px solid #9fae8a;position:relative;background:#e5e9d8;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;flex-shrink:0}.joystick-ring{position:absolute;inset:14px;border:1px solid #c0caac;border-radius:50%;pointer-events:none}.joystick-knob{position:absolute;width:44px;height:44px;left:32px;top:32px;border:2px solid #6b846a;border-radius:50%;background:#91a18b;box-shadow:0 3px 0 #5c70584d;pointer-events:none}#joystick.held .joystick-knob{background:#789572}.joystick-label{position:absolute;left:0;right:0;bottom:5px;font-size:9px;color:#62755c;pointer-events:none}.touch-actions{display:flex;gap:12px;align-items:center}#touch-action{min-width:108px;max-width:210px;min-height:64px;line-height:1.4;white-space:normal}#touch-action span{display:block;max-width:180px;font-size:12px;margin-top:4px}#touch-pause{min-width:72px;min-height:48px}.fallback-dpad{display:none}.herb-drawer{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}.herb-drawer img{-webkit-user-drag:none}.ingredient-drag-ghost{position:fixed;z-index:100;pointer-events:none;transform:translate(-50%,-70%);max-width:190px;padding:12px;background:#f0e2c4e8;border:2px solid #70563d;border-radius:6px;box-shadow:0 4px 12px #1a372740;font-size:14px;line-height:1.6;color:#293f3b}.ingredient-drag-ghost img{display:block;width:100px;height:80px;object-fit:contain;image-rendering:pixelated}.decoction-pot.drop-ready{outline:3px dashed #789572;outline-offset:4px;border-radius:6px}
html[data-input=touch],html[data-input=touch] body{height:var(--game-vh,100dvh);overflow:hidden;overscroll-behavior:none}html[data-input=touch] #app{height:var(--game-vh,100dvh);min-height:0;display:flex;flex-direction:column}html[data-input=touch] .topbar{height:64px;min-height:64px;padding:0 max(16px,env(safe-area-inset-left));gap:10px;flex-shrink:0}html[data-input=touch] .topbar>.icon-button{min-width:44px;min-height:44px;margin:0}html[data-input=touch] main{width:100%;max-width:1480px;min-height:0;flex:1;display:flex;flex-direction:column;padding:12px max(16px,env(safe-area-inset-left)) 8px}html[data-input=touch] .chapter{margin-bottom:8px;flex-shrink:0}html[data-input=touch] .chapter h1{font-size:20px;margin:0}html[data-input=touch] .chapter p,html[data-input=touch] .chapter .eyebrow,html[data-input=touch] .day-stamp,html[data-input=touch] .below{display:none}html[data-input=touch] .tabs{display:flex;gap:0;flex-shrink:0;margin:0 0 10px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}html[data-input=touch] .tabs button{min-height:44px;padding:9px 14px;white-space:nowrap;font-size:13px;touch-action:manipulation}html[data-input=touch] .layout{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 238px;gap:14px;align-items:stretch}html[data-input=touch] .world-card{display:flex;flex-direction:column;min-height:0}html[data-input=touch] .world-top{height:36px;flex-shrink:0;font-size:12px;padding:0 12px}html[data-input=touch] .world-top .muted{display:none}html[data-input=touch] .canvas-wrap{min-height:0;height:auto;flex:1;display:flex;align-items:center;justify-content:center;background:#304d3b;overflow:hidden}html[data-input=touch] canvas#world{width:100%;height:100%;max-width:960px;max-height:576px;object-fit:contain;image-rendering:pixelated;touch-action:pan-x pan-y}html[data-input=touch] .controls{display:none}html[data-input=touch] .touch-controls{display:flex;justify-content:space-between;align-items:center;gap:16px;min-height:122px;padding:5px 14px max(5px,env(safe-area-inset-bottom));flex-shrink:0;border-top:1px solid #d8ddca}html[data-input=touch] .map-note{font-size:9px;padding:7px;bottom:8px;left:10px}html[data-input=touch] .map-note span{display:none}html[data-input=touch] .interaction{min-height:44px;bottom:8px;right:10px;padding:8px 12px;font-size:12px}html[data-input=touch] .sidebar{display:flex;flex-direction:column;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;gap:10px}html[data-input=touch] .journal-card{padding:14px;flex-shrink:0}html[data-input=touch] .section-heading h2{font-size:17px}html[data-input=touch] .quest-item{padding:8px 0}html[data-input=touch] .quest-item canvas{width:30px;height:30px}html[data-input=touch] .mentor-card{padding:12px;flex-shrink:0}html[data-input=touch] .mentor-card p{font-size:15px;margin:6px 0}html[data-input=touch] #app>footer{min-height:24px;flex-shrink:0;padding:5px 16px;font-size:9px;margin:0;max-width:none}html[data-input=touch] .modal-layer{top:var(--visual-top,0px);height:var(--game-vh,100dvh);bottom:auto;padding:12px max(12px,env(safe-area-inset-left));overscroll-behavior:none}html[data-input=touch] #modal{width:min(1120px,100%);max-height:100%;display:flex;flex-direction:column;overflow:hidden}html[data-input=touch] .modal-header{padding:14px 18px;flex-shrink:0}html[data-input=touch] .modal-header h2{font-size:23px}html[data-input=touch] .modal-header .icon-button{min-width:44px;min-height:44px}html[data-input=touch] #modal-body{padding:16px 18px;min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}html[data-input=touch] button,html[data-input=touch] input:not([type=checkbox]):not([type=range]),html[data-input=touch] select{min-height:44px;touch-action:manipulation}html[data-input=touch] input[type=range]{min-height:44px}html[data-input=touch] input[type=checkbox]{width:22px;height:22px}html[data-input=touch] label{min-height:44px}html[data-input=touch] .text-button{padding:9px 6px}html[data-input=touch] .modal-actions{gap:10px}html[data-input=touch] #modal-body>.modal-actions:last-of-type{position:sticky;bottom:-16px;z-index:2;background:#f6f3e9;padding:12px 0;margin-bottom:0;border-top:1px solid #d8ddca}html[data-input=touch] .clinic-layout{grid-template-columns:230px minmax(0,1fr);gap:18px}html[data-input=touch] .question-button{min-height:52px;font-size:15px;padding:13px}html[data-input=touch] .question-area .modal-actions{position:sticky;bottom:-16px;background:#f6f3e9;padding:10px 0;z-index:1}html[data-input=touch] .chart{max-height:240px;overflow:auto;overscroll-behavior:contain}html[data-input=touch] .speech{font-size:17px}html[data-input=touch] .dispensing-layout{grid-template-columns:minmax(0,1fr) 250px;gap:16px}html[data-input=touch] .wooden-shelf{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}html[data-input=touch] .herb-drawer{touch-action:none;min-height:70px;font-size:14px;padding:10px}html[data-input=touch] .decoction-desk{position:sticky;top:0;align-self:start;padding:12px}html[data-input=touch] .selected-ingredients{max-height:180px;overflow:auto;overscroll-behavior:contain}html[data-input=touch] .decoction-pot{max-width:215px}html[data-input=touch] .room-vignette{height:54px}html[data-input=touch] .dex-grid,html[data-input=touch] .herb-visual-grid{grid-template-columns:repeat(3,minmax(0,1fr))}html[data-input=touch] .herb-visual img{height:128px}html[data-input=touch] .herb-enlarged{max-width:100%;height:auto;aspect-ratio:4/3;max-height:40vh}html[data-input=touch] .toolbar input{font-size:16px}html[data-input=touch] .save-slot-grid{grid-template-columns:repeat(3,minmax(0,1fr))}html[data-input=touch] .save-slot{padding:12px}html[data-input=touch] .save-slot .modal-actions{gap:7px;flex-wrap:wrap}
@media(max-width:1050px){html[data-input=touch] .layout{grid-template-columns:minmax(0,1fr) 210px;gap:10px}html[data-input=touch] .tabs button{padding:9px 10px;font-size:12px}html[data-input=touch] .tabs button:before{display:none}html[data-input=touch] .status .stat-count{display:none}html[data-input=touch] .dispensing-layout{grid-template-columns:minmax(0,1fr) 218px}html[data-input=touch] .wooden-shelf{grid-template-columns:repeat(2,minmax(0,1fr))}html[data-input=touch] .herb-drawer{min-height:64px}html[data-input=touch] .decoction-pot{max-width:180px}}
@media(orientation:portrait),(max-width:760px){html[data-input=touch] .brand b{font-size:16px}html[data-input=touch] .status .xp-block,html[data-input=touch] .chapter{display:none}html[data-input=touch] .tabs{margin-bottom:8px}html[data-input=touch] .tabs button{padding:8px 9px;font-size:12px}html[data-input=touch] .layout{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr)}html[data-input=touch] .sidebar{display:none}html[data-input=touch] .touch-controls{min-height:122px}html[data-input=touch] .clinic-layout{grid-template-columns:1fr}html[data-input=touch] .patient-badge{margin-bottom:10px}html[data-input=touch] .patient-badge canvas{width:48px;height:48px}html[data-input=touch] .chart{max-height:145px}html[data-input=touch] .dispensing-layout{grid-template-columns:minmax(0,1fr) 200px}html[data-input=touch] .save-slot-grid{grid-template-columns:1fr}html[data-input=touch] .settings-grid{grid-template-columns:1fr}html[data-input=touch] .scope-list{grid-template-columns:1fr}html[data-input=touch] #app>footer span:last-child{display:none}}
@media(max-width:540px){html[data-input=touch] .topbar{gap:4px;padding:0 8px}html[data-input=touch] .brand{gap:5px}html[data-input=touch] .brand b{font-size:12px}html[data-input=touch] .seal{width:28px;height:32px}html[data-input=touch] .topbar>.icon-button{min-width:40px}html[data-input=touch] main{padding:8px}html[data-input=touch] .dispensing-layout{grid-template-columns:1fr}html[data-input=touch] .decoction-desk{position:static}html[data-input=touch] .dex-grid,html[data-input=touch] .herb-visual-grid{grid-template-columns:repeat(2,minmax(0,1fr))}html[data-input=touch] .touch-actions{gap:6px}html[data-input=touch] #touch-action{min-width:92px}html[data-input=touch] #touch-pause{min-width:60px}}
@media(max-height:600px) and (orientation:landscape){html[data-input=touch] .topbar{height:52px;min-height:52px}html[data-input=touch] .chapter{display:none}html[data-input=touch] .tabs{margin-bottom:5px}html[data-input=touch] main{padding-top:5px}html[data-input=touch] .touch-controls{min-height:106px}html[data-input=touch] #joystick{width:96px;height:96px}html[data-input=touch] .joystick-knob{left:24px;top:24px}html[data-input=touch] .joystick-label{display:none}html[data-input=touch] .modal-header h2{font-size:19px}html[data-input=touch] .modal-header{padding:8px 14px}html[data-input=touch] #modal-body{padding:12px 14px}html[data-input=touch] .room-vignette{height:36px}html[data-input=touch] .selected-ingredients{max-height:95px}html[data-input=touch] .decoction-pot{max-width:140px}}
@media(max-width:540px){html[data-input=touch] .status{display:none}}
.modal-controls{display:flex;align-items:center;gap:8px;flex-shrink:0}#modal-pause{display:none}html[data-input=touch] #modal-pause:not(.hidden){display:inline-grid}html[data-input=touch] .modal-header>div:first-child{min-width:0}
