/* v1.0 preparation: keep the control travel unchanged; give the game more room. */
:root{--ink:#283f35;--muted:#7c8972;--green:#41694d;--coral:#cc806f;--line:#e1e3d4;background:#f5f0e6;color:var(--ink)}
body{background:radial-gradient(ellipse at 15% 0,#e4ead7aa,transparent 48%),radial-gradient(ellipse at 95% 100%,#f0d6bf66,transparent 55%);overscroll-behavior-y:none}
.shell{max-width:1180px}
.stage-wrap{border-color:#d4ddc5;background:#e3e9d8;box-shadow:0 12px 32px #3c563411}
.stage-heading{align-items:flex-start;gap:10px}
.stage-heading h2{line-height:1.1;text-wrap:balance}
.stage-meta{display:flex;flex-direction:column;align-items:flex-end;gap:6px;flex-shrink:0}
.best-record{font-size:10px;color:#5f7756;font-weight:650;white-space:nowrap;background:#fffdf3df;border:1px solid #dde3cd;border-radius:12px;padding:5px 8px}
.best-record[hidden]{display:none}
.dashboard{background:#fffdf5;box-shadow:0 9px 28px #46603b10}
.order-card:not(:disabled):hover{border-color:#a3b58f;background:#eff3e6}
.order-card.clamped:not(:disabled):hover{background:#fff1ce;border-color:#c5a966}
.help-button,.icon-button{min-width:44px;min-height:44px}
.storage-notice{padding:10px 13px;margin:0 0 12px;border:1px solid #dfc791;background:#fff2d8;border-radius:12px;color:#886232;font-size:12px;line-height:1.5}
.storage-notice[hidden]{display:none}
.update-notice{display:flex;align-items:center;gap:10px;padding:9px 12px;margin-bottom:10px;border:1px solid #cddbc0;border-radius:12px;background:#edf4e7;color:#4e6f44;font-size:12px;line-height:1.4}
.update-notice[hidden]{display:none}.update-notice button{margin-left:auto;flex-shrink:0;min-height:40px;padding:6px 12px;border:1px solid #b7cba6;border-radius:10px;color:#49683f;background:#fffdf4;font-size:12px;font-weight:650}
.table-tip{display:none}.table-tip[hidden]{display:none}
.fatal button{min-height:44px;border:1px solid #d1a58a;background:#fff8e9;color:#8e5d48;padding:9px 16px;border-radius:12px;font-size:13px;margin-top:12px;cursor:pointer}
.result-metrics{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:18px 0 12px}
.result-metrics>div{background:#eef2e5;border:1px solid #dfe6d3;border-radius:16px;padding:14px 8px}
.result-metrics small{display:block;font-size:8px;letter-spacing:1px;color:#81916d;font-weight:700;margin-bottom:6px}
.result-metrics strong{display:block;font-size:21px;color:#486d49;font-weight:700;letter-spacing:-.6px}
.result-record{display:inline-block;background:#f6e7bc;border:1px solid #e6d59d;border-radius:12px;padding:5px 10px;color:#98733d;font-size:10px;font-weight:700;margin:3px 0 8px}
.level-record{display:block;margin-top:6px;font-size:9px;color:#7a9067;font-weight:500}
.level-card{min-height:105px}
.modal-note{max-width:310px;margin-inline:auto}
.modal-card p{font-size:13px}
.modal-card li{font-size:12px}
.page-footer{letter-spacing:.1px}
@media(min-width:621px) and (min-height:501px){#stage{flex:1}.stage-footer{flex-shrink:0}}

@media(max-width:620px){
  .shell{padding:12px max(12px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));padding-top:max(12px,env(safe-area-inset-top))}
  .topbar{margin-bottom:8px;gap:8px;min-height:44px}
  .brand{gap:9px}.brand-mark{width:38px;height:38px;border-radius:13px}.brand-mark svg{width:25px}
  h1{font-size:23px}.brand .eyebrow{font-size:7px;letter-spacing:1.6px}
  .levels-button{height:44px;min-width:44px;font-size:11px;padding:0 10px;border-radius:14px}
  .icon-button{width:44px;height:44px}
  .journey{font-size:10px;margin-bottom:9px;padding-bottom:9px}
  .play-area{display:flex;flex-direction:column;gap:9px}
  .stage-wrap{border-radius:25px}
  .stage-heading{top:16px;left:17px;right:17px}
  .stage-heading h2{font-size:21px;margin-top:5px;max-width:210px}
  .stage-heading .eyebrow{font-size:9px;letter-spacing:1.3px}
  .safe-tag{font-size:8px;padding:6px 8px}
  .best-record{font-size:8px;padding:4px 7px}
  #stage{height:clamp(240px,45svh,450px);min-height:0}
  .stage-footer{min-height:40px;padding:7px 12px;font-size:10px;gap:6px}
  .stage-footer #subtitle{max-width:calc(100% - 68px)}
  .stage-footer button{min-width:44px;min-height:32px;font-size:11px;padding:4px}
  .toast{bottom:48px;font-size:10px;padding:7px 12px;max-width:94%}
  .dashboard{position:relative;display:grid;grid-template-columns:minmax(0,1fr) 142px;grid-template-rows:auto auto auto;gap:7px 12px;padding:12px;border-radius:24px}
  .order-section{grid-column:1;grid-row:1;min-width:0}
  .order-heading{margin-bottom:6px}.order-heading .eyebrow{font-size:8px;letter-spacing:1px}.order-heading #progress{font-size:10px;padding:3px 7px}
  .orders{display:flex;flex-direction:column;gap:5px}
  .order-card,.order-card:only-child{max-width:none;min-height:36px;display:grid;grid-template-columns:25px minmax(0,1fr);grid-template-rows:auto;padding:6px 8px;gap:0 7px;text-align:left;border-radius:11px}
  .order-card svg{width:24px;height:24px;grid-column:1;grid-row:1 / span 2;margin:0}
  .order-card .order-name{font-size:11px;line-height:1.2;align-self:center}
  .order-card .order-state{font-size:8px;line-height:1.2;min-height:0;margin:1px 0 0}
  .order-card.clamped:before,.order-card.delivered:before{top:5px;right:6px;font-size:12px}
  .table-tip{display:block;font-size:10px;line-height:1.55;color:#7b8c6c;margin-top:12px;max-width:150px}
  .control-section{grid-column:2;grid-row:1 / span 2;position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:0;margin:0;padding-top:4px}
  .control-copy{position:absolute;top:-4px;right:-3px;z-index:3}
  .control-heading h3,.control-caption,.control-section .tip{display:none}
  .help-button{width:28px;height:28px;min-width:28px;min-height:28px;font-size:12px;box-shadow:0 2px 5px #30422d09}
  .joystick-wrap{margin:0;gap:5px}.joystick-pad{width:138px;height:138px;min-height:0;margin:0}
  .joystick-pad .pad-ring{width:92px;height:92px}.joystick-pad .support-dot{width:40px;height:40px}
  .control-strength{font-size:8px;min-height:10px}
  .clamp-status{grid-column:1;grid-row:2;align-self:start;margin:0;padding:5px 0 0;gap:6px;border-bottom:0;border-top:1px solid var(--line)}
  .clamp-symbol{width:22px;height:22px;border-radius:8px;flex-shrink:0}.clamp-symbol svg{width:15px}
  .clamp-status .eyebrow{font-size:6px;letter-spacing:.7px}.clamp-status strong{font-size:9px;line-height:1.2;margin-top:2px}
  .clamp-status button{font-size:9px;padding:4px 5px;min-height:36px;min-width:36px;margin-left:auto;border-radius:10px}
  .action-row{grid-column:1 / -1;grid-row:3;gap:8px;padding-top:2px;margin:0}
  .action-row button{min-height:44px;font-size:12px;border-radius:14px;padding:8px}
  .page-footer{font-size:8px;margin-top:8px}
  .storage-notice{font-size:11px;margin-bottom:9px;padding:8px 10px}
  .level-card{min-height:108px}.level-card .level-name{font-size:10px}.level-record{font-size:8px}
  .level-sheet{padding:22px 17px}.sheet-caption{font-size:11px}
  .modal-card{padding:24px 24px 22px}.modal-card h2{font-size:30px}.modal-card li{font-size:12px}.modal-card .modal-note{font-size:11px}
}
@media(max-width:360px){
  h1{font-size:20px}.brand .eyebrow{font-size:6px}.brand-mark{width:34px;height:34px}.topbar{gap:6px}
  .levels-button{font-size:10px;padding:0 8px;gap:5px}.levels-button svg{width:13px}.icon-button{width:40px;min-width:40px}
  .dashboard{grid-template-columns:minmax(0,1fr) 122px;gap:7px 8px;padding:10px}
  .joystick-pad{width:120px;height:120px}.joystick-pad .pad-ring{width:77px;height:77px}
  .order-card{grid-template-columns:22px minmax(0,1fr);padding:6px;gap:0 5px}.order-card svg{width:21px}.order-card .order-name{font-size:10px}
  .stage-heading h2{font-size:19px;max-width:170px}.stage-heading{left:13px;right:13px}.safe-tag{font-size:7px}
}
@media(max-width:620px) and (max-height:700px){
  .stage-meta .best-record{display:none}
  .shell{padding-top:max(8px,env(safe-area-inset-top));padding-bottom:8px}.topbar{margin-bottom:5px;min-height:40px}.journey{margin-bottom:6px;padding-bottom:5px;font-size:9px}
  .levels-button{height:40px;min-height:40px}.icon-button{height:40px;min-height:40px}
  #stage{height:clamp(150px,27.5svh,225px);min-height:0}.stage-heading{position:relative;top:auto;left:auto;right:auto;min-height:47px;padding:8px 13px 6px;background:#e2e8d8}.stage-heading h2{font-size:17px}.stage-heading .eyebrow{font-size:7px}
  .stage-footer{min-height:32px;padding:4px 9px;font-size:9px}.stage-footer button{min-height:28px;font-size:10px}.toast{bottom:38px;font-size:9px;padding:6px 9px}
  .play-area{gap:7px}.dashboard{grid-template-columns:minmax(0,1fr) 112px;padding:7px;gap:5px 9px}
  .control-section{grid-column:2;grid-row:1 / span 2;padding-top:0}.joystick-pad{width:108px;height:108px}.joystick-pad .pad-ring{width:66px;height:66px}.joystick-pad .support-dot{width:34px;height:34px}
  .joystick-wrap{gap:3px}.control-strength{font-size:7px;min-height:9px}.order-card,.order-card:only-child{min-height:30px;grid-template-columns:22px minmax(0,1fr) auto;padding:4px 6px;gap:0 4px}.order-card svg{grid-row:1;width:20px;height:20px}.order-card .order-name{grid-column:2;grid-row:1;font-size:10px}.order-card .order-state{grid-column:3;grid-row:1;margin:0;font-size:7px}.order-card.clamped:before,.order-card.delivered:before{display:none}.order-heading{margin-bottom:4px}
  .clamp-status{padding-top:3px;gap:5px}.clamp-status button{min-height:30px;min-width:32px}.clamp-symbol{display:none}
  .table-tip{font-size:9px;line-height:1.45;margin-top:7px}
  .action-row button{min-height:40px;font-size:11px}.page-footer{display:none}
}
@media(min-width:621px) and (max-width:1100px) and (max-height:500px){
  .help-button{min-width:26px;min-height:26px}.icon-button{min-width:32px;min-height:32px}
  .stage-heading h2{font-size:17px}.stage-meta{gap:3px}.best-record{font-size:8px;padding:3px 6px}
  .dashboard{padding:10px;gap:8px}.level-card{min-height:105px}
}

/* A small service objective and a manual next step keep the table in view. */
.service-goal{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;margin-top:10px;padding:8px 9px;border:1px solid #dfdfca;border-radius:12px;background:#f5f3e6;color:#6d785d;min-width:0}
.service-goal-copy{min-width:0;font-size:10px;line-height:1.35;overflow-wrap:anywhere}
.service-goal-copy strong{display:block;color:#536b47;font-size:11px;font-weight:700;line-height:1.3}
.service-goal-copy span{display:block;margin-top:2px}
.service-goal-status{display:inline-flex;align-items:center;justify-content:center;min-width:30px;padding:4px 6px;border:1px solid #ded3a8;border-radius:9px;background:#f6edcc;color:#93763e;font-size:9px;font-weight:750;line-height:1.25;text-align:center;white-space:nowrap}
.service-goal.is-earned{border-color:#cbdcbb;background:#edf4e4}.service-goal.is-earned .service-goal-status{border-color:#c2d4b0;background:#e1edd5;color:#527b44}
.service-goal-copy small{display:block;font-size:8px;font-weight:700;line-height:1.35;letter-spacing:.15px;color:#879175}
#mastery-count{display:inline-flex;align-items:center;gap:4px;flex-shrink:0;margin-inline:8px;padding:3px 7px;border:1px solid #dfd4ad;border-radius:10px;background:#f7edcf;color:#977742;font-size:9px;font-weight:700;line-height:1.2;white-space:nowrap}
.service-win{position:absolute;z-index:4;left:16px;right:16px;bottom:63px;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:14px;row-gap:3px;align-items:center;width:calc(100% - 32px);max-width:420px;margin-inline:auto;padding:11px 13px;border:1px solid #c4d4b3;border-radius:16px;background:#fffdf3f5;box-shadow:0 7px 24px #344e3020;color:#47683d;pointer-events:auto}
.service-win>strong{grid-column:1;grid-row:1;font-size:14px;line-height:1.25;font-weight:750;min-width:0;overflow-wrap:anywhere}
.service-win>span{grid-column:1;grid-row:2;font-size:10px;line-height:1.35;color:#7b8969;min-width:0;overflow-wrap:anywhere}
#service-win-kicker{display:none}
#service-next{grid-column:2;grid-row:1 / span 2;align-self:center;min-height:44px;max-width:128px;padding:8px 13px;border:1px solid #4e7045;border-radius:11px;background:#597a4e;color:#fffdf0;font-size:11px;font-weight:700;line-height:1.25;box-shadow:0 2px 0 #3c5b35}
#service-next:hover{background:#4d6e43}.stage-wrap:has(.service-win:not([hidden])) .toast{visibility:hidden}
.service-goal[hidden],.service-win[hidden],#mastery-count[hidden]{display:none!important}

@media(max-width:620px){
  .clamp-status{display:none}
  .service-goal{gap:5px;margin-top:6px;padding:5px 6px;border-radius:9px}
  .service-goal-copy{font-size:9px;line-height:1.3}.service-goal-copy strong{font-size:10px}.service-goal-copy span{margin-top:1px}
  .service-goal-status{min-width:25px;padding:3px 4px;font-size:8px;border-radius:7px}
  #mastery-count{font-size:8px;margin-inline:5px;padding:3px 5px}
  .service-win{left:10px;right:10px;bottom:48px;width:calc(100% - 20px);max-width:380px;padding:9px 10px;column-gap:9px;border-radius:13px}
  .service-win>strong{font-size:12px}.service-win>span{font-size:9px}
  #service-next{min-height:44px;max-width:108px;font-size:10px;padding:7px 10px;border-radius:10px}
}
@media(max-width:360px){
  .service-goal{gap:4px;padding:4px 5px}.service-goal-copy{font-size:8px}.service-goal-copy strong{font-size:9px}.service-goal-status{font-size:7px;min-width:22px;padding:3px}
  #mastery-count{font-size:7px;margin-inline:3px;padding:3px 4px}
  .service-win{column-gap:7px;padding:8px}.service-win>strong{font-size:11px}.service-win>span{font-size:8px}#service-next{max-width:94px;padding:7px 8px;font-size:9px}
}
@media(max-width:620px) and (max-height:700px){
  .service-goal{margin-top:4px;padding:4px 5px}.service-goal-copy{font-size:8px;line-height:1.25}.service-goal-copy strong{font-size:9px}.service-goal-status{font-size:7px;padding:3px;min-width:22px}
  .service-win{bottom:38px;padding:7px 9px;row-gap:2px}.service-win>strong{font-size:11px}.service-win>span{font-size:8px}
}
@media(min-width:621px) and (max-width:1100px) and (max-height:500px){
  .service-goal{margin-top:5px;padding:4px 5px;gap:4px;border-radius:8px}.service-goal-copy{font-size:7px;line-height:1.25}.service-goal-copy strong{font-size:8px}.service-goal-status{font-size:7px;min-width:21px;padding:3px;border-radius:6px}
  #mastery-count{font-size:7px;margin-inline:4px;padding:2px 5px}
  .service-win{left:10px;right:10px;bottom:39px;width:calc(100% - 20px);max-width:340px;padding:7px 9px;border-radius:12px;column-gap:9px;row-gap:2px}.service-win>strong{font-size:11px}.service-win>span{font-size:8px}#service-next{padding:6px 10px;font-size:9px}
}
@media(prefers-reduced-motion:reduce){.service-win,#service-next,#mastery-count{animation:none!important;transition:none!important}}

/* Small permanent cafe keepsakes live in the existing table menu. */
.cafe-rewards{padding:14px;border:1px solid #dedfca;border-radius:18px;background:#f5f2e6;margin:8px 0 22px;color:#61764f}
.cafe-rewards-heading{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:10px}
.cafe-rewards-heading h3{font-size:14px;letter-spacing:-.2px}
.cafe-rewards-heading>span{font-size:9px;color:#90967c;white-space:nowrap}
.cafe-rewards-list{list-style:none;padding:0;margin:0;display:grid;gap:8px}
.cafe-reward{display:grid;grid-template-columns:30px minmax(0,1fr) auto;align-items:center;gap:9px;color:#8e9681}
.cafe-reward-mark{display:grid;place-items:center;width:30px;height:30px;border:1px solid #dce0ce;border-radius:10px;background:#eceee1;font-size:18px;color:#a0ab8d}
.cafe-reward strong{display:block;font-size:11px;font-weight:700;line-height:1.3}
.cafe-reward div>span{display:block;font-size:9px;line-height:1.35;margin-top:2px;color:#9a9f8b}
.cafe-reward-state{font-size:8px;white-space:nowrap;padding:4px 6px;border:1px solid #dedfcd;border-radius:8px}
.cafe-reward.unlocked{color:#537744}.cafe-reward.unlocked .cafe-reward-mark{background:#e4ecd5;border-color:#ccd9b9;color:#63884f}.cafe-reward.unlocked .cafe-reward-state{border-color:#ced9bc;background:#e8efdb;color:#63824e}
#cafe-rewards-note{font-size:9px;color:#889379;line-height:1.4;margin-top:10px}
.result-reward{padding:9px 12px;border-radius:12px;background:#edf2df;color:#63834e!important;font-size:12px!important}
.level-sheet>.sheet-heading{position:sticky;top:-28px;z-index:2;background:#fffdf5;padding-top:10px;padding-bottom:8px}
@media(max-width:620px){
  .cafe-rewards{padding:11px;margin-bottom:17px;border-radius:14px}.cafe-rewards-heading h3{font-size:12px}
  .cafe-reward{grid-template-columns:26px minmax(0,1fr) auto;gap:7px}.cafe-reward-mark{width:26px;height:26px;border-radius:8px;font-size:16px}
  .cafe-reward strong{font-size:10px}.cafe-reward div>span{font-size:8px}.cafe-reward-state{font-size:7px;padding:4px}
  .level-sheet>.sheet-heading{top:-22px}
}

@media(min-width:1101px) and (min-height:501px) and (max-height:900px){
  .dashboard{padding:18px}
  .order-heading{margin-bottom:8px}.order-card{min-height:76px;padding:9px 4px}
  .order-card svg{width:30px;height:30px;margin:0 auto 5px}.order-card .order-name{font-size:11px}.order-card .order-state{font-size:8px}
  .service-goal{margin-top:8px;padding:6px 8px}
  .control-section{margin-top:14px}.control-caption{font-size:10px;line-height:1.45}.control-section .tip{font-size:10px;line-height:1.4;margin-top:6px}
  .joystick-wrap{margin-top:10px;gap:5px}.joystick-pad{width:138px;height:138px;min-height:0;margin:0}.joystick-pad .pad-ring{width:92px;height:92px}.joystick-pad .support-dot{width:40px;height:40px}
  .clamp-status{margin-top:10px;padding:8px 0}.action-row{padding-top:10px}
}
