#mainMenuEditorButton .main-menu-editor-lock {
  position: absolute;
  z-index: 3;
  left: 15px;
  top: 50%;
  width: 24px;
  height: 24px;
  object-fit: contain;
  transform: translateY(-50%);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.8));
  pointer-events: none;
}
#mainMenuEditorButton.task-locked {
  opacity: .58 !important;
  background-color: #34373b !important;
  transform: none !important;
  box-shadow: 0 0 12px rgba(0,0,0,.58) !important;
}
#mainMenuEditorButton.task-locked > span { color: #b7bcc1 !important; }
#mainMenuEditorButton.task-locked:hover,
#mainMenuEditorButton.task-locked:focus-visible,
#mainMenuEditorButton.task-locked:active {
  background-color: #34373b !important;
  transform: none !important;
}

.toy-task-panel {
  position: absolute;
  z-index: 8;
  top: var(--toy-task-start-top, clamp(230px, 31vh, 340px));
  right: clamp(18px, 3vw, 56px);
  width: clamp(310px, 25vw, 390px);
  padding: 14px;
  border: 5px solid #050608;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(45,48,55,.98), rgba(20,22,27,.98));
  color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.2), 0 18px 46px rgba(0,0,0,.58);
  max-height: max(190px, calc(100% - var(--toy-task-start-top, 230px) - 10px));
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: #ccff00 #15171a;
}

.toy-task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 0 4px 10px 7px;
  border-bottom: 3px solid #090a0c;
}
.toy-task-header > div > span { display: block; color: #ccff00; font: 900 9px/1 monospace; letter-spacing: .18em; }
.toy-task-header h2 { margin: 4px 0 0; font: 950 25px/1 "Microsoft YaHei", sans-serif; letter-spacing: .08em; text-shadow: 0 3px 0 #000; }

.toy-task-refresh {
  min-width: 76px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 10px;
  border: 4px solid #050608;
  border-radius: 999px;
  background: #34383e;
  color: #fff;
  font: 900 12px/1 "Microsoft YaHei", sans-serif;
}
.toy-task-refresh svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.toy-task-refresh:hover,
.toy-task-refresh:focus-visible { outline: none; color: #ccff00; filter: brightness(1.16); }
.toy-task-refresh:active { transform: scale(.94); }
.toy-task-refresh.busy svg { animation: toyTaskRefreshSpin .7s linear infinite; }
@keyframes toyTaskRefreshSpin { to { transform: rotate(360deg); } }

.toy-task-list { display: grid; gap: 8px; margin-top: 10px; }
.toy-task-item {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 13px;
  border: 3px solid #090a0c;
  border-radius: 15px;
  background: linear-gradient(90deg, #34383e, #282b30);
  transition: border-color .14s ease, filter .14s ease, box-shadow .14s ease;
}
.toy-task-item.completed:not(.claimed) { border-color: #8cab00; box-shadow: inset 4px 0 0 #ccff00, 0 0 16px rgba(204,255,0,.12); }
.toy-task-item.claimed { opacity: .57; filter: saturate(.45); }
.toy-task-copy { min-width: 0; }
.toy-task-copy strong { display: block; overflow: hidden; color: #fff; font: 950 14px/1.25 "Microsoft YaHei", sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.toy-task-copy strong em { color: #ccff00; font-style: normal; }
.toy-task-copy span { display: block; margin-top: 5px; overflow: hidden; color: #9ba5ae; font: 700 9px/1.25 "Microsoft YaHei", sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.toy-task-controls { display: grid; justify-items: end; gap: 5px; }
.toy-task-reward { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-height: 20px; }
.toy-task-reward b { color: #fff; font: 950 15px/1 monospace; text-shadow: 0 2px 0 #000; }
.toy-task-diamond-icon {
  --toy-diamond-scale: .25;
  position: relative;
  display: inline-block;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  overflow: hidden;
  filter: drop-shadow(0 0 5px rgba(80,245,255,.55));
}
.toy-task-diamond-icon::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 76px;
  background: url("../assets/extracted/asset-0209.png") no-repeat -441px -58px;
  content: "";
  transform: translate(-50%, -50%) scale(var(--toy-diamond-scale));
}
.toy-task-action {
  min-width: 82px;
  height: 30px;
  padding: 0 10px;
  border: 3px solid #050608;
  border-radius: 999px;
  background: #4a4e54;
  color: #fff;
  font: 950 11px/1 "Microsoft YaHei", sans-serif;
  text-shadow: 0 2px 0 #000;
}
.toy-task-action:hover,
.toy-task-action:focus-visible { outline: none; background: #ff5fa3; }
.toy-task-action:active { transform: scale(.92); }
.toy-task-action.ready { background: #ccff00; color: #151900; text-shadow: none; box-shadow: 0 0 16px rgba(204,255,0,.34); }
.toy-task-action.claimed { background: #303338; color: #90979e; text-shadow: none; }
.toy-task-status { min-height: 18px; margin-top: 9px; padding: 0 4px; color: #a4adb5; font: 750 9px/1.45 "Microsoft YaHei", sans-serif; text-align: center; }
.toy-task-status[data-tone="success"] { color: #ccff00; }
.toy-task-status[data-tone="error"] { color: #ff684f; }

.toy-game-author-button {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 8px;
  padding: 7px 14px;
  border: 4px solid #050608;
  border-radius: 999px;
  background: #34383e;
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14);
  font: 950 12px/1 "Microsoft YaHei", sans-serif;
  text-shadow: 0 2px 0 #000;
  transition: background-color .12s ease, color .12s ease, transform .1s ease;
}
.toy-game-author-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.toy-game-author-button:hover,
.toy-game-author-button:focus-visible { outline: none; background: #ccff00; color: #151900; text-shadow: none; }
.toy-game-author-button:active { transform: scale(.96); }
.toy-game-author-button.busy { opacity: .68; }

.toy-invite-overlay {
  position: fixed;
  z-index: 14020;
  inset: 0;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(5, 5, 10, .78);
  backdrop-filter: blur(9px) brightness(.58);
}
.toy-invite-overlay.visible { display: grid; }
.toy-invite-panel {
  width: min(470px, 92vw);
  max-height: min(700px, 92vh);
  overflow: auto;
  padding: 18px;
  border: 4px solid #090a0c;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(145deg, #34383e, #22252a 72%);
  box-shadow: 0 0 0 2px rgba(255,255,255,.22), 0 24px 70px rgba(0,0,0,.7), 0 0 28px rgba(204,255,0,.1);
}
.toy-invite-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 12px; border-bottom: 3px solid #090a0c; }
.toy-invite-header span { color: #ccff00; font: 900 10px/1 monospace; letter-spacing: .18em; }
.toy-invite-header h2 { margin: 5px 0 0; font: 950 25px/1 "Microsoft YaHei", sans-serif; letter-spacing: .05em; text-shadow: 0 3px 0 #000; }
.toy-invite-close {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border: 4px solid #090a0c;
  border-radius: 50%;
  color: #fff;
  background: #3a3e43;
  font: 950 27px/1 sans-serif;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.2);
}
.toy-invite-close:hover,
.toy-invite-close:focus-visible { outline: none; color: #141800; background: #ccff00; }
.toy-invite-description { margin: 14px 3px 12px; color: #c7cdd2; font: 750 13px/1.65 "Microsoft YaHei", sans-serif; text-align: center; }
.toy-invite-qr {
  display: grid;
  width: 246px;
  height: 246px;
  margin: 0 auto 12px;
  place-items: center;
  border: 4px solid #090a0c;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 0 20px rgba(204,255,0,.2);
}
.toy-invite-qr img { display: block; width: 224px; height: 224px; object-fit: contain; }
.toy-invite-qr img.unavailable { opacity: 0; }
.toy-invite-link {
  box-sizing: border-box;
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 4px solid #090a0c;
  border-radius: 17px;
  outline: none;
  color: #dfe4e8;
  background: #15171b;
  font: 700 11px/1 monospace;
  box-shadow: inset 0 2px 5px rgba(0,0,0,.6);
}
.toy-invite-link:focus { border-color: #ccff00; color: #121600; background: #ccff00; }
.toy-invite-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.toy-invite-actions > [hidden],
.toy-invite-panel > [hidden] { display: none !important; }
.toy-invite-action {
  min-width: 160px;
  height: 44px;
  padding: 0 18px;
  border: 4px solid #090a0c;
  border-radius: 22px;
  color: #fff;
  background: #3a3e43;
  font: 950 13px/1 "Microsoft YaHei", sans-serif;
  text-shadow: 0 2px 0 #000;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.2);
}
.toy-invite-action:hover,
.toy-invite-action:focus-visible,
.toy-invite-action.primary { outline: none; color: #151900; background: #ccff00; text-shadow: none; }
.toy-invite-action:active { transform: scale(.95); }
.toy-invite-action:disabled { opacity: .55; }
body.toy-invite-open { overflow: hidden; }

.toy-menu-toast {
  min-height: 18px;
  margin-top: 8px;
  color: #d8e1e8;
  text-align: center;
  font: 800 11px/1.4 "Microsoft YaHei", sans-serif;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
}
.toy-menu-toast.visible { opacity: 1; transform: none; }
.toy-menu-toast[data-tone="success"] { color: #ccff00; }
.toy-menu-toast[data-tone="error"] { color: #ff684f; }

.toy-leaderboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 1960;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: rgba(3, 4, 8, .82);
  backdrop-filter: blur(10px) brightness(.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, visibility 0s linear .18s;
}

.toy-leaderboard-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.toy-leaderboard-panel {
  width: min(1040px, 94vw);
  height: min(820px, 90vh);
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: clamp(18px, 2.4vw, 30px);
  border: 5px solid #050608;
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(45,48,55,.99), rgba(18,20,25,.99));
  color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,.25), 0 28px 90px rgba(0,0,0,.8);
  transform: translateY(18px) scale(.985);
  transition: transform .2s ease;
}
.toy-leaderboard-overlay.visible .toy-leaderboard-panel { transform: none; }

.toy-leaderboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #050608;
}
.toy-leaderboard-header h2 { margin: 2px 0 0; font: 950 clamp(28px, 3vw, 46px)/1 "Microsoft YaHei", sans-serif; letter-spacing: .12em; text-shadow: 0 3px 0 #000; }
.toy-leaderboard-kicker { color: #ccff00; font: 900 10px/1.2 monospace; letter-spacing: .22em; }
.toy-leaderboard-close { width: min(180px, 28vw) !important; min-height: 48px !important; }

.toy-leaderboard-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.toy-leaderboard-tab {
  min-height: 56px;
  border: 4px solid #050608;
  border-radius: 16px;
  background: #34383e;
  color: #fff;
  font: 950 clamp(12px, 1.3vw, 18px)/1 "Microsoft YaHei", sans-serif;
  text-shadow: 0 2px 0 #000;
}
.toy-leaderboard-tab:hover,
.toy-leaderboard-tab:focus-visible { outline: none; color: #ccff00; filter: brightness(1.14); }
.toy-leaderboard-tab.selected { background: #ccff00; color: #151900; text-shadow: none; box-shadow: inset 0 -5px 0 rgba(0,0,0,.2); }

.toy-leaderboard-explain { display: flex; align-items: baseline; gap: 16px; padding: 8px 13px; border-radius: 10px; background: rgba(0,0,0,.28); }
.toy-leaderboard-explain strong { color: #ccff00; white-space: nowrap; }
.toy-leaderboard-explain span { color: #bfc7cf; font-size: 12px; }
.toy-leaderboard-my-rank { color: #fff; font-weight: 900; }
.toy-leaderboard-table-head,
.toy-leaderboard-row {
  display: grid;
  grid-template-columns: clamp(42px, 5vw, 64px) minmax(0, 1fr) minmax(76px, .2fr) minmax(128px, .34fr);
  align-items: center;
  column-gap: 8px;
}
.toy-leaderboard-table-head { padding: 0 18px; color: #89939d; font: 800 11px/1.3 "Microsoft YaHei", sans-serif; }
.toy-leaderboard-table-head span:last-child { text-align: right; }

.toy-leaderboard-list { min-height: 0; margin: 0; padding: 0 4px 0 0; overflow: auto; list-style: none; scrollbar-color: #ccff00 #15171a; }
.toy-leaderboard-row { min-height: 62px; margin-bottom: 7px; padding: 7px 16px; border: 3px solid #090a0c; border-radius: 14px; background: linear-gradient(90deg, #30343a, #24272c); }
.toy-leaderboard-row:nth-child(-n+3) { border-color: #202600; box-shadow: inset 5px 0 0 #ccff00; }
.toy-leaderboard-rank { color: #ccff00; font: 950 18px/1 monospace; }
.toy-leaderboard-player { min-width: 0; display: flex; align-items: center; gap: 10px; font-weight: 900; }
.toy-leaderboard-player img { width: 42px; height: 42px; flex: 0 0 auto; border: 3px solid #050608; border-radius: 50%; object-fit: cover; background: #17191d; }
.toy-leaderboard-player span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toy-leaderboard-character { min-width: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 4px 7px; border: 2px solid #090a0c; border-radius: 999px; background: #171a1e; color: #ccff00; font: 900 11px/1.1 "Microsoft YaHei", sans-serif; text-align: center; white-space: nowrap; }
.toy-leaderboard-character img { width: 25px; height: 25px; flex: 0 0 auto; object-fit: contain; }
.toy-leaderboard-character span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.toy-leaderboard-score { color: #fff; text-align: right; font: 950 clamp(16px, 1.6vw, 22px)/1 monospace; }
.toy-leaderboard-status { min-height: 18px; color: #9ba6b0; text-align: center; font-size: 11px; }
.toy-score-formula { padding: 9px 13px; border: 2px solid #090a0c; border-radius: 12px; background: rgba(0,0,0,.2); color: #c6ced6; font-size: 11px; }
.toy-score-formula summary { color: #ccff00; font-weight: 900; }
.toy-score-formula p { margin: 8px 0 0; line-height: 1.6; }

@media (max-height: 820px) {
  .toy-menu-toast { margin-top: 3px; }
  .toy-leaderboard-panel { height: 94vh; padding: 14px; gap: 6px; }
  .toy-leaderboard-tab { min-height: 46px; }
  .toy-leaderboard-row { min-height: 52px; }
  .toy-task-panel { top: var(--toy-task-start-top, 250px); width: min(330px, 26vw); padding: 10px; border-radius: 20px; }
  .toy-task-header { min-height: 42px; padding-bottom: 7px; }
  .toy-task-header h2 { font-size: 20px; }
  .toy-task-list { gap: 5px; margin-top: 7px; }
  .toy-task-item { min-height: 58px; padding: 6px 7px 6px 10px; }
  .toy-task-copy strong { font-size: 12px; }
  .toy-task-copy span { margin-top: 3px; font-size: 8px; }
  .toy-task-action { min-width: 72px; height: 27px; font-size: 10px; }
  .toy-task-diamond-icon { --toy-diamond-scale: .2125; flex-basis: 17px; width: 17px; height: 17px; }
  .toy-task-reward b { font-size: 13px; }
  .toy-task-status { margin-top: 6px; }
  .toy-game-author-button { min-height: 34px; margin-top: 6px; padding: 5px 10px; font-size: 10px; }
  .toy-game-author-button svg { width: 18px; height: 18px; }
}

@media (max-width: 1100px) {
  .toy-task-panel { right: 12px; width: 278px; }
  .toy-task-copy span { max-width: 130px; }
}

@media (max-width: 860px) {
  .toy-task-panel { right: 8px; width: 246px; transform: scale(.88); transform-origin: right top; }
  .toy-task-item { gap: 6px; }
  .toy-task-copy span { display: none; }
}

@media (max-height: 700px) {
  .toy-invite-panel { padding: 12px; }
  .toy-invite-header h2 { font-size: 21px; }
  .toy-invite-description { margin: 8px 2px; font-size: 11px; }
  .toy-invite-qr { width: 178px; height: 178px; margin-bottom: 8px; }
  .toy-invite-qr img { width: 162px; height: 162px; }
  .toy-invite-actions { margin-top: 9px; }
  .toy-invite-action { height: 38px; }
}

@media (max-width: 700px) {
  .toy-leaderboard-tabs { grid-template-columns: 1fr; }
  .toy-leaderboard-tab { min-height: 40px; }
  .toy-leaderboard-explain { display: grid; gap: 4px; }
  .toy-leaderboard-table-head,
  .toy-leaderboard-row {
    grid-template-columns: 38px minmax(0, 1fr) 68px minmax(92px, .44fr);
    column-gap: 6px;
  }
  .toy-leaderboard-character { gap: 3px; padding-inline: 4px; font-size: 9px; }
  .toy-leaderboard-character img { width: 20px; height: 20px; }
  .toy-leaderboard-panel { height: 96vh; }
}

/* The task panel shares the same short-landscape coordinate system as the
   responsive home menu. It remains full-size and scrolls instead of receiving
   the old .88 scale transform. */
@media (orientation: landscape) and (max-height: 620px) {
  #mainMenuOverlay .main-menu-home .toy-task-panel {
    top: var(--toy-task-start-top, var(--qsd-mobile-actions-top, 118px));
    right: max(8px, var(--qsd-safe-right));
    width: var(--qsd-mobile-task-width, clamp(250px, 43vw, 420px));
    max-height: calc(100% - var(--toy-task-start-top, var(--qsd-mobile-actions-top, 118px)) - max(8px, var(--qsd-safe-bottom)));
    padding: 8px;
    border-width: 4px;
    border-radius: 18px;
    box-sizing: border-box;
    overflow-y: auto;
    transform: none;
    transform-origin: right top;
  }

  #mainMenuOverlay .toy-task-header {
    min-height: 42px;
    padding: 0 3px 6px 5px;
  }
  #mainMenuOverlay .toy-task-header h2 { font-size: 19px; }
  #mainMenuOverlay .toy-task-refresh { min-width: 72px; height: 40px; border-width: 3px; }
  #mainMenuOverlay .toy-task-list { gap: 5px; margin-top: 6px; }
  #mainMenuOverlay .toy-task-item { min-height: 56px; padding: 6px 7px 6px 9px; }
  #mainMenuOverlay .toy-task-copy strong { font-size: 12px; }
  #mainMenuOverlay .toy-task-copy span { margin-top: 2px; font-size: 8px; }
  #mainMenuOverlay .toy-task-controls {
    grid-template-columns: auto auto;
    align-items: center;
    gap: 5px;
  }
  #mainMenuOverlay .toy-task-action { min-width: 74px; height: 38px; font-size: 10px; }
  #mainMenuOverlay .toy-task-status { display: none; }
  #mainMenuOverlay .toy-game-author-button { min-height: 42px; margin-top: 6px; font-size: 11px; }
}

@media (orientation: landscape) and (max-height: 420px) {
  #mainMenuOverlay .main-menu-home .toy-task-panel {
    padding: 7px;
    border-radius: 16px;
  }
  #mainMenuOverlay .toy-task-header { min-height: 40px; }
  #mainMenuOverlay .toy-task-item { min-height: 52px; }
  #mainMenuOverlay .toy-task-copy span { display: none; }
}

/* Native touch scrolling must win inside Toy panels. The gameplay stage keeps
   touch-action:none, so each independent menu scroller declares its own pan
   axis and the runtime exempts it from the combat touchmove guard. */
.toy-task-panel,
.toy-task-list,
.toy-leaderboard-list,
.toy-invite-panel {
  touch-action: pan-y !important;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

/* Portrait-locked Bilibili WebViews use the vertical menu flow from
   responsive.css. Keep the task panel in that flow instead of pinning it on
   top of the main buttons. */
@media (orientation: portrait) and (pointer: coarse) {
  html.qsd-mobile-portrait-fallback #mainMenuOverlay .main-menu-home .toy-task-panel {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
    width: min(88vw, 420px) !important;
    max-height: clamp(300px, 54dvh, 520px) !important;
    margin: 7px auto 0 !important;
    padding: 9px !important;
    border-width: 4px !important;
    border-radius: 18px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    transform: none !important;
    transform-origin: center top !important;
  }

  html.qsd-mobile-portrait-fallback #mainMenuOverlay .toy-task-header {
    min-height: 40px !important;
    padding: 0 3px 6px 5px !important;
  }

  html.qsd-mobile-portrait-fallback #mainMenuOverlay .toy-task-header h2 {
    font-size: 19px !important;
  }

  html.qsd-mobile-portrait-fallback #mainMenuOverlay .toy-task-refresh {
    min-width: 70px !important;
    height: 38px !important;
    border-width: 3px !important;
  }

  html.qsd-mobile-portrait-fallback #mainMenuOverlay .toy-task-list {
    gap: 6px !important;
    margin-top: 7px !important;
  }

  html.qsd-mobile-portrait-fallback #mainMenuOverlay .toy-task-item {
    min-height: 56px !important;
    gap: 7px !important;
    padding: 6px 7px 6px 9px !important;
  }

  html.qsd-mobile-portrait-fallback #mainMenuOverlay .toy-task-copy strong {
    font-size: 12px !important;
  }

  html.qsd-mobile-portrait-fallback #mainMenuOverlay .toy-task-copy span {
    display: block !important;
    max-width: none !important;
    font-size: 8px !important;
  }

  html.qsd-mobile-portrait-fallback #mainMenuOverlay .toy-task-action {
    min-width: 72px !important;
    height: 36px !important;
    font-size: 10px !important;
  }

  html.qsd-mobile-portrait-fallback #mainMenuOverlay .toy-game-author-button {
    min-height: 40px !important;
    margin-top: 7px !important;
  }
}

/* The portrait host is rotated by responsive.css into a landscape stage. Keep
   the task tray on the right side of that virtual coordinate system and let it
   scroll independently instead of covering the menu buttons. */
@media (orientation: portrait) {
  html.qsd-mobile-virtual-landscape #mainMenuOverlay .main-menu-home .toy-task-panel {
    position: absolute !important;
    top: var(--qsd-mobile-actions-top, 108px) !important;
    right: max(8px, var(--qsd-safe-right)) !important;
    left: auto !important;
    box-sizing: border-box !important;
    width: var(--qsd-mobile-task-width, clamp(270px, 42%, 390px)) !important;
    max-height: calc(100% - var(--qsd-mobile-actions-top, 108px) - max(7px, var(--qsd-safe-bottom))) !important;
    margin: 0 !important;
    padding: 7px !important;
    border-width: 4px !important;
    border-radius: 17px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    touch-action: pan-y !important;
    transform: none !important;
    transform-origin: right top !important;
  }

  html.qsd-mobile-virtual-landscape #mainMenuOverlay .toy-task-header {
    min-height: 39px !important;
    padding: 0 2px 5px 4px !important;
  }

  html.qsd-mobile-virtual-landscape #mainMenuOverlay .toy-task-header h2 {
    font-size: 18px !important;
  }

  html.qsd-mobile-virtual-landscape #mainMenuOverlay .toy-task-refresh {
    min-width: 68px !important;
    height: 36px !important;
    border-width: 3px !important;
  }

  html.qsd-mobile-virtual-landscape #mainMenuOverlay .toy-task-list {
    gap: 5px !important;
    margin-top: 6px !important;
  }

  html.qsd-mobile-virtual-landscape #mainMenuOverlay .toy-task-item {
    min-height: 52px !important;
    gap: 6px !important;
    padding: 5px 6px 5px 8px !important;
  }

  html.qsd-mobile-virtual-landscape #mainMenuOverlay .toy-task-copy strong {
    font-size: 11px !important;
  }

  html.qsd-mobile-virtual-landscape #mainMenuOverlay .toy-task-copy span {
    display: none !important;
  }

  html.qsd-mobile-virtual-landscape #mainMenuOverlay .toy-task-action {
    min-width: 68px !important;
    height: 34px !important;
    font-size: 9.5px !important;
  }

  html.qsd-mobile-virtual-landscape #mainMenuOverlay .toy-task-status {
    display: none !important;
  }

  html.qsd-mobile-virtual-landscape #mainMenuOverlay .toy-game-author-button {
    min-height: 38px !important;
    margin-top: 6px !important;
    font-size: 10px !important;
  }
}
