.sv-game{position:fixed;z-index:11000;left:var(--sv-left,0);top:var(--sv-top,0);width:var(--sv-width,100vw);height:var(--sv-height,100dvh);display:grid;grid-template-rows:60px minmax(0,1fr) 135px;background:#f5ecd8;color:#514638;font:14px/1.35 system-ui,sans-serif;overflow:hidden;isolation:isolate;box-sizing:border-box;letter-spacing:normal;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);text-align:left}.sv-game *{box-sizing:border-box}.sv-game [hidden]{display:none!important}.sv-game button,.sv-game a{font:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}.sv-game button{cursor:pointer}.sv-game button:focus-visible,.sv-game a:focus-visible{outline:3px solid #66517c;outline-offset:2px}.sv-game button:focus:not(:focus-visible){outline:none}.sv-header{display:flex;align-items:center;justify-content:center;gap:10px;padding:7px 10px;margin:0;border:0;background:none;min-width:0}.sv-header h1{font:600 21px Georgia,serif;line-height:1.15;margin:3px 0 0;letter-spacing:0;color:#514638}.sv-header small{font:9px system-ui,sans-serif;letter-spacing:.08em;text-transform:uppercase;display:block;white-space:nowrap;color:#8d7c65}.sv-header>div{min-width:0}.sv-close,.sv-pause{display:grid;place-items:center;width:44px;height:44px;flex:0 0 44px;border-radius:50%;border:1px solid #c1ad8e;background:#fff7e5;color:#81705e;text-decoration:none;padding:0}.sv-close{font-size:26px!important}.sv-pause i{width:12px;height:14px;border-left:4px solid currentColor;border-right:4px solid currentColor}.sv-score{white-space:nowrap;font-size:12px;color:#9c8b71}.sv-score b{font-size:19px;color:#6f8061;margin-right:3px}.sv-stage{display:grid;place-items:center;min-width:0;min-height:0;overflow:hidden;background:radial-gradient(ellipse at center,#e8ddc4 0,transparent 70%)}.sv-picture{position:relative;flex:none}.sv-scene{display:block;width:100%;height:100%;overflow:visible}.sv-target{position:absolute;display:block;padding:0!important;margin:0!important;min-width:44px;min-height:44px;border:0!important;background:transparent!important;box-shadow:none!important;border-radius:10px;color:transparent}.sv-target:focus-visible{outline:2px solid #75618b;outline-offset:-2px}.sv-footer{padding:4px 14px 8px;display:flex;flex-direction:column;gap:4px;align-items:center;justify-content:flex-start;margin:0;border:0;background:transparent;min-height:0}.sv-carry{display:flex;align-items:center;justify-content:center;gap:9px;min-height:22px;width:100%;font-size:12px}.sv-carry span{color:#9a896f}.sv-carry b{font-weight:500;color:#6a7158}.sv-next{display:flex;justify-content:center;gap:6px;min-height:0;max-width:100%}.sv-next:empty{display:none}.sv-next button{min-height:44px;max-width:150px;white-space:nowrap;border:1px solid #ccbc9e;border-radius:12px;background:#ede2ca;color:#7d6c53;padding:5px 10px;box-shadow:none;font-size:12px}.sv-next span{margin-left:6px;font-size:17px}.sv-status{font-size:12px;line-height:1.3;text-align:center;padding:0;margin:0;max-width:540px;color:#7b6c56;min-height:31px}.sv-modal{position:absolute;inset:0;z-index:50;display:grid;place-items:center;background:#41363977;padding:18px}.sv-panel{width:min(100%,370px);max-height:100%;overflow:auto;border:1px solid #c7b38e;border-radius:22px;background:#fff8e7;padding:23px;color:#62513d;box-shadow:0 15px 50px #594d3820}.sv-panel h2{font:25px/1.2 Georgia,serif;text-align:center;margin:0 0 13px}.sv-panel p{font:13px/1.5 system-ui,sans-serif;margin:10px 0}.sv-panel button{display:block;width:100%;min-height:46px;border:0;border-radius:12px;padding:8px 12px;background:#7c718b;color:#fff9e8;margin:12px 0 0;box-shadow:none}.sv-resume{position:sticky;top:0;z-index:2;margin:0!important}.sv-help{border-top:1px solid #e0d2b8;margin-top:15px}.sv-panel a{display:block;text-align:center;color:#786748;min-height:44px;padding:12px 2px;text-decoration:underline;font-size:12px}.sv-game[data-short="true"]{grid-template-rows:54px minmax(0,1fr) 128px}.sv-game[data-short="true"] .sv-header{gap:6px;padding:4px 6px}.sv-game[data-short="true"] .sv-header h1{font-size:19px}.sv-game[data-short="true"] .sv-header small{font-size:8px}.sv-game[data-short="true"] .sv-footer{padding:0 10px 5px}.sv-game[data-landscape="true"]{grid-template-columns:minmax(0,1fr) 230px;grid-template-rows:110px minmax(0,1fr);padding:0 8px}.sv-game[data-landscape="true"] .sv-stage{grid-column:1;grid-row:1/3}.sv-game[data-landscape="true"] .sv-header{grid-column:2;grid-row:1;flex-wrap:wrap;gap:7px;align-content:center;padding:6px}.sv-game[data-landscape="true"] .sv-header>div{order:-1;width:100%;text-align:center}.sv-game[data-landscape="true"] .sv-footer{grid-column:2;grid-row:2;justify-content:center;padding:10px}.sv-game[data-landscape="true"] .sv-carry{flex-direction:column;gap:3px}.sv-game[data-landscape="true"] .sv-next{flex-direction:column;width:100%}.sv-game[data-landscape="true"] .sv-next button{max-width:none}.sv-game[data-landscape="true"] .sv-status{margin-top:5px}@media(prefers-reduced-motion:reduce){.sv-game *{scroll-behavior:auto;animation:none!important;transition:none!important}}

.sv-discard-options{display:grid;gap:8px;margin:15px 0}.sv-discard-options button{display:flex;align-items:center;gap:12px;text-align:left;margin:0;min-height:56px;background:#8b7c70}.sv-discard-options svg{width:42px;height:40px;flex:0 0 42px}.sv-discard-options span{line-height:1.3}.sv-panel .sv-discard-cancel{background:#e8ddc5;color:#65563e}

/* Reset host footer margins and reserve real touch-target space. */
.sv-footer>*,.sv-next button{margin:0;flex:none}.sv-next{min-height:44px}.sv-next button{height:44px}.sv-status{flex:none}
/* Expanded floors retain full touch targets; queue lives above the stairwell. */
.sv-score em{font:inherit;font-style:normal;color:inherit}.sv-score>small{display:block;font-size:9px;line-height:1.2;color:#8d7c65}.sv-next button{display:flex;align-items:center;justify-content:center;gap:5px}.sv-next .sv-command-name{margin:0;font:inherit;overflow:hidden;text-overflow:ellipsis}.sv-next button>span:last-child{margin:0;font-size:16px;flex:none}.sv-game[data-level="2"]:not([data-landscape="true"]),.sv-game[data-level="3"]:not([data-landscape="true"]){grid-template-rows:50px minmax(0,1fr) 77px}.sv-game[data-level="2"] .sv-header,.sv-game[data-level="3"] .sv-header{padding:2px 6px;gap:6px}.sv-game[data-level="2"] .sv-header h1,.sv-game[data-level="3"] .sv-header h1{font-size:19px}.sv-game[data-level="2"] .sv-header>div>small,.sv-game[data-level="3"] .sv-header>div>small{font-size:8px}.sv-game[data-level="2"] .sv-footer,.sv-game[data-level="3"] .sv-footer{padding:5px 10px;gap:4px}.sv-game[data-level="2"] .sv-status,.sv-game[data-level="3"] .sv-status{height:32px;min-height:32px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.sv-map-queue{position:absolute;z-index:5;display:flex!important;flex-direction:row!important;gap:6px;min-height:44px}.sv-map-queue:empty{display:none!important}.sv-map-queue button{height:44px;min-height:44px;min-width:44px;max-width:none;width:0;flex:1 1 0;padding:4px;font-size:10px;gap:2px}.sv-game[data-scene-scroll="true"] .sv-stage{overflow:auto;place-items:start center}.sv-level-options{display:grid;gap:9px}.sv-level-options button{text-align:left;margin:0;background:#e8ddc5;color:#65563e;display:grid;gap:4px;min-height:82px}.sv-level-options button b{font-size:16px}.sv-level-options button span{font-size:12px}.sv-level-options button small{font-size:11px;color:#8a775c}.sv-intro p{font-size:13px;line-height:1.5}.sv-recipe-cover{position:absolute;inset:0;z-index:35;background:#4a3f3529}.sv-recipe{position:absolute;z-index:40;border:1px solid #bca983;border-radius:16px;padding:10px;background:#fff8e7;color:#65533c;box-shadow:0 7px 20px #4d403b25}.sv-recipe h2{font:18px/1.2 Georgia,serif;margin:0 0 8px;text-align:center}.sv-recipe-options{display:grid;gap:6px}.sv-recipe button{min-height:44px;width:100%;margin:0;border:1px solid #c8b692;border-radius:10px;padding:6px 8px;background:#e8ddc5;color:#65533c;box-shadow:none}.sv-recipe-options button{display:flex;align-items:center;gap:8px;text-align:left;min-height:52px;font-size:12px}.sv-recipe-options svg{width:36px;height:34px;flex:none}.sv-recipe>button{margin-top:8px;background:transparent}.sv-game[data-landscape="true"] .sv-map-queue{flex-direction:row}.sv-game[data-landscape="true"] .sv-header{padding:6px}.sv-game[data-landscape="true"] .sv-footer{padding:10px}

.sv-recipe-options small{display:block;font-size:11px;font-weight:400;line-height:1.35;color:#79755f;margin-top:2px}

/* Desktop is an edge-to-edge room. Phone layouts above remain unchanged. */
.sv-game[data-desktop="true"][data-level] {
  --sv-toolbar-height: 60px;
  --sv-status-height: 76px;
  position: fixed;
  z-index: 11000;
  top: var(--sv-top, 0px);
  left: var(--sv-left, 0px);
  right: auto;
  bottom: auto;
  width: var(--sv-width, 100vw);
  height: var(--sv-height, 100dvh);
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
  box-sizing: border-box;
  margin: 0;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px);
  border: 0;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  aspect-ratio: auto;
  transform: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--sv-toolbar-height) minmax(0, 1fr) var(--sv-status-height);
  gap: 0;
  overflow: hidden;
  overscroll-behavior: none;
  isolation: isolate;
  background: #f3e8d2;
  color: #514638;
  font: 14px/1.35 system-ui, sans-serif;
  letter-spacing: normal;
  text-align: left;
}
.sv-game[data-desktop="true"] > * {
  min-width: 0;
  min-height: 0;
}
.sv-game[data-desktop="true"] .sv-header {
  position: relative;
  z-index: 10;
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 44px;
  grid-template-rows: 44px;
  align-items: center;
  align-content: center;
  justify-content: stretch;
  gap: 14px;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 7px max(20px, env(safe-area-inset-right, 0px)) 7px max(20px, env(safe-area-inset-left, 0px));
  border: 0;
  border-bottom: 1px solid #bba58070;
  border-radius: 0;
  background: #f5ecd8;
  box-shadow: none;
}
.sv-game[data-desktop="true"] .sv-header > div {
  order: 0;
  width: auto;
  margin: 0;
  padding: 0;
  text-align: left;
}
.sv-game[data-desktop="true"] .sv-header h1 {
  max-width: none;
  margin: 2px 0 0;
  padding: 0;
  font: 600 22px/1.1 Georgia, serif;
  letter-spacing: 0;
}
.sv-game[data-desktop="true"] .sv-header > div > small {
  margin: 0;
  font: 9px/1.2 system-ui, sans-serif;
  letter-spacing: .08em;
}
.sv-game[data-desktop="true"] .sv-close,
.sv-game[data-desktop="true"] .sv-pause {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: none;
  margin: 0;
  padding: 0;
  box-shadow: none;
}
.sv-game[data-desktop="true"] .sv-score {
  margin: 0 4px 0 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.1;
  text-align: right;
}
.sv-game[data-desktop="true"] .sv-score b { font-size: 22px; }
.sv-game[data-desktop="true"] .sv-score > small {
  margin-top: 3px;
  font-size: 10px;
}
.sv-game[data-desktop="true"] .sv-stage {
  position: relative;
  z-index: 0;
  grid-column: 1;
  grid-row: 2;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  isolation: isolate;
  background: #f3e8d2;
  box-shadow: none;
}
.sv-game[data-desktop="true"][data-scene-scroll="true"] .sv-stage {
  overflow: auto;
  place-items: start center;
}
.sv-game[data-desktop="true"] .sv-desktop-world {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  pointer-events: none;
}
.sv-game[data-desktop="true"] .sv-picture {
  position: relative;
  z-index: 1;
  flex: none;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.sv-game[data-desktop="true"] .sv-footer {
  position: relative;
  z-index: 10;
  grid-column: 1;
  grid-row: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, .68fr);
  grid-template-rows: 22px minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  gap: 2px 24px;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 9px max(92px, env(safe-area-inset-right, 0px)) 9px max(20px, env(safe-area-inset-left, 0px));
  border: 0;
  border-top: 1px solid #a68b6666;
  border-radius: 0;
  background: #f0e3c9;
  box-shadow: none;
  color: #7b6c56;
  overflow: hidden;
}
.sv-game[data-desktop="true"] .sv-footer > * {
  min-width: 0;
  max-width: none;
  margin: 0;
}
.sv-game[data-desktop="true"] .sv-carry {
  grid-column: 1;
  grid-row: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  min-height: 0;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
}
.sv-game[data-desktop="true"] .sv-carry > span { flex: none; }
.sv-game[data-desktop="true"] .sv-carry > b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sv-game[data-desktop="true"] .sv-status {
  grid-column: 1;
  grid-row: 2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 0;
  height: auto;
  max-height: 31px;
  margin: 0;
  padding: 0;
  font: 12px/1.3 system-ui, sans-serif;
  text-align: left;
  overflow: hidden;
}
.sv-game[data-desktop="true"] .sv-next {
  position: static;
  grid-column: 2;
  grid-row: 1 / 3;
  display: flex;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  min-height: 44px;
  margin: 0;
  padding: 0;
}
.sv-game[data-desktop="true"] .sv-next:empty { display: none !important; }
.sv-game[data-desktop="true"] .sv-next button {
  flex: 1 1 0;
  width: auto;
  min-width: 44px;
  max-width: 200px;
  height: 44px;
  min-height: 44px;
  margin: 0;
  padding: 6px 11px;
  gap: 8px;
  font: 12px/1.2 system-ui, sans-serif;
}
.sv-game[data-desktop="true"] .sv-footer:has(> .sv-next:empty) .sv-carry,
.sv-game[data-desktop="true"] .sv-footer:has(> .sv-next:empty) .sv-status {
  grid-column: 1 / -1;
}
.sv-game[data-desktop="true"] .sv-modal {
  padding: 20px;
  overflow: hidden;
}
.sv-game[data-desktop="true"] .sv-panel {
  width: min(100%, 440px);
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  padding: 24px;
  overflow: auto;
  overscroll-behavior: contain;
}
.sv-game[data-desktop="true"] .sv-panel button,
.sv-game[data-desktop="true"] .sv-panel a,
.sv-game[data-desktop="true"] .sv-recipe button {
  min-height: 44px;
}
.sv-game[data-desktop="true"] .sv-recipe {
  min-width: 0;
  min-height: 0;
  max-width: calc(100% - 16px);
  max-height: calc(var(--sv-height, 100dvh) - 80px);
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
}
@media (max-height: 620px) {
  .sv-game[data-desktop="true"][data-level] {
    --sv-toolbar-height: 52px;
    --sv-status-height: 72px;
  }
  .sv-game[data-desktop="true"] .sv-header { padding-top: 3px; padding-bottom: 3px; }
  .sv-game[data-desktop="true"] .sv-header h1 { font-size: 20px; }
  .sv-game[data-desktop="true"] .sv-footer { padding-top: 7px; padding-bottom: 7px; }
  .sv-game[data-desktop="true"] .sv-modal { padding: 12px; }
  .sv-game[data-desktop="true"] .sv-panel { padding: 20px; }
}
/* Very shallow desktop windows use one joined rail and a full-height room. */
@media (max-height: 483px) {
  .sv-game[data-desktop="true"][data-level] {
    grid-template-columns: minmax(0, 1fr) 272px;
    grid-template-rows: 108px minmax(0, 1fr);
  }
  .sv-game[data-desktop="true"] .sv-stage {
    grid-column: 1;
    grid-row: 1 / 3;
  }
  .sv-game[data-desktop="true"] .sv-header {
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    grid-template-rows: 34px 44px;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 0;
    border-left: 1px solid #bba58070;
  }
  .sv-game[data-desktop="true"] .sv-header > div {
    grid-column: 1 / -1;
    grid-row: 1;
    text-align: center;
  }
  .sv-game[data-desktop="true"] .sv-close { grid-column: 1; grid-row: 2; }
  .sv-game[data-desktop="true"] .sv-score {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    text-align: center;
  }
  .sv-game[data-desktop="true"] .sv-pause { grid-column: 3; grid-row: 2; }
  .sv-game[data-desktop="true"] .sv-footer {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    align-items: start;
    align-content: start;
    gap: 12px;
    padding: 12px 16px 52px;
    border-top: 0;
    border-left: 1px solid #bba58070;
    background: #f5ecd8;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .sv-game[data-desktop="true"] .sv-carry {
    grid-column: 1;
    grid-row: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    white-space: normal;
  }
  .sv-game[data-desktop="true"] .sv-status {
    grid-column: 1;
    grid-row: 2;
    -webkit-line-clamp: 4;
    max-height: 63px;
  }
  .sv-game[data-desktop="true"] .sv-next {
    grid-column: 1;
    grid-row: 3;
    flex-direction: column !important;
    align-items: stretch;
    justify-content: flex-start;
    gap: 6px;
    max-width: none;
  }
  .sv-game[data-desktop="true"] .sv-next button {
    flex: none;
    width: 100%;
    max-width: none;
  }
}

.sv-game[data-desktop="true"] .sv-world-panel{display:none}
/* The desktop worktop is one continuous background surface, not a second
   central cabinet laid over its extended wings. Mobile keeps its small frame. */
.sv-game[data-desktop="true"] .sv-backdrop .sv-counter-frame{display:none}

/* Bounded breakfast scene preparation and retry. */
.sv-loading{margin:10px 0 16px;padding:12px;border:1px solid #c8b698;border-radius:12px;background:#f6eddc}.sv-loading[hidden]{display:none}.sv-loading p{margin:0 0 10px;line-height:1.4}.sv-loading progress{display:block;width:100%;height:12px;accent-color:#788b69}.sv-loading [data-action]{margin-top:12px;min-height:44px}.sv-loading [hidden]{display:none}
.sv-loading-cancel{display:flex;align-items:center;min-height:44px;margin-top:6px;color:#655740}
