/* Product controls and planning tools; the native game artwork stays separate. */
.target-start { min-width: 0; margin: 0; padding: 0 0 12px; border: 0; border-bottom: 1px solid #d6dcd1; background: transparent; }
.target-start legend { padding: 0; margin-bottom: 6px; color: #62746c; font-size: 11px; }
.target-start-controls { display: flex; align-items: center; gap: 8px; }
.target-start-controls select { flex: 0 1 300px; min-width: 0; }
.target-start-controls button { min-height: 38px; padding: 5px 12px; font-size: 11px; white-space: nowrap; border-radius: 6px; color: #42636a; background: #e5ebdf; border: 1px solid #c6d0bf; }
#targetProgress { margin-top: 12px; padding: 10px; border: 1px solid #d9dfd0; border-radius: 8px; background: #edf0e5; }
.target-form [hidden] { display: none !important; }
.progress-compact { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: 7px; background: #e9eee2; }
.progress-compact strong, .progress-compact span { display: block; font-size: 12px; line-height: 20px; color: #405d62; }
.progress-compact span { font-size: 10px; color: #758178; }
.progress-compact button { flex-shrink: 0; background: transparent; border: 1px solid #bbc9b5; border-radius: 5px; color: #42636a; padding: 6px 10px; min-height: 34px; font-size: 11px; }
.target-dialog[data-editing-progress=true] > :not(.dialog-heading):not(.target-form),
.target-dialog[data-editing-progress=true] .target-goals,
.target-dialog[data-editing-progress=true] .target-advanced,
.target-dialog[data-editing-progress=true] .target-actions,
.target-dialog[data-editing-progress=true] .target-start-controls,
.target-dialog[data-editing-progress=true] .target-start legend { display: none; }
.target-dialog[data-editing-progress=true] .target-start { padding: 0; border: 0; }
.target-dialog[data-editing-progress=true] #targetProgress { margin: 0; border: 0; background: transparent; padding: 0; }
.progress-editor-actions { position: sticky; bottom: -16px; padding: 12px 0 4px; background: #f4f3ec; display: flex; justify-content: flex-end; }
.progress-editor-actions button { min-height: 40px; font-size: 12px; border-radius: 6px; }
.progress-error { color: #a04437; font-size: 12px; }
.progress-main, .progress-pools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.progress-counts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.target-start label { color: #47616a; font-size: 11px; }
.target-start input, .target-start select { min-height: 34px; font-size: 12px; }
.target-start .progress-prize-toggle { display: flex; flex-direction: row; align-items: center; gap: 7px; }
.target-form .progress-prize-toggle input { width: 14px; min-height: 14px; height: 14px; padding: 0; accent-color: #426771; }
.progress-pools label:last-child input { border-color: #af9a70; }
.target-start .target-note { margin: 7px 0 0; font-size: 10px; line-height: 16px; }
@media (max-width: 760px) {
  .target-start { padding-bottom: 10px; }
  .target-start-controls { gap: 6px; }
  .target-start-controls select, .target-start-controls button { font-size: 10px; }
  .target-start-controls button { padding-inline: 6px; }
  .progress-pools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .progress-editor-actions button { width: 100%; }
  .progress-counts { gap: 5px; }
}
.game-stage button:not(.claim):not(.egg-help):hover:enabled { background: transparent; }
.game-stage .claim:hover:enabled { background: linear-gradient(#fff0bf, #d6b362); }
.game-stage .egg-help:hover:enabled { background: #8c7d68; }
button:focus-visible, summary:focus-visible { outline: 2px solid #c69a49; outline-offset: 3px; }
dialog .close:hover:enabled { background: #715d46; color: #fff4d9; }
.bag-close:hover:enabled { background: transparent; filter: brightness(1.2); }
.bag-tabs button:hover:enabled { background: #19506b; }
.bag-dialog { clip-path: inset(3px 2px 3px 2px round 2px); }
.mobile-result-heading, .bag-name { display: none; }
/* The source crop includes one pale screenshot column beyond the icon frame. */
img[src$='/icon-D10.png'] { clip-path: inset(0 3.5% 0 0); }
/* The 38px milestone crops include one right and four bottom pixels of the card. */
img[src*='/milestone-icon-'] { clip-path: inset(0 2.64% 10.53% 0); }

.period-name, .mobile-pool-actions { display: none; }
.game-period { left: 450px; top: 56px; height: 25px; }
.game-stage #eventButton { height: 25px; padding: 2px 8px; border: 1px solid #5b7680; border-radius: 5px; color: #c7dbe3; background: #173345; font: 12px/20px var(--qinglong-font); white-space: nowrap; }
.event-dialog { width: min(460px, calc(100% - 24px)); }
.event-tabs { display: flex; gap: 6px; margin: 12px 0; }
.event-tabs button { flex: 1; min-height: 38px; }
.event-tabs button[aria-pressed=true] { color: #fff9e8; border-color: #3c6269; background: #3c6269; }
.event-list { display: grid; gap: 10px; max-height: 55dvh; overflow-y: auto; }
.event-card { position: relative; padding: 14px; border: 1px solid #c6cfbf; border-radius: 8px; background: #f7f7ee; }
.event-card-title { display: flex; align-items: center; gap: 9px; }
.event-badge { padding: 2px 6px; border-radius: 4px; color: #876022; background: #efe1b6; font-size: 10px; }
.event-card p { margin: 7px 0; font-size: 12px; }
.event-card small { display: block; color: #72868b; font-size: 11px; }
.event-card button { width: 100%; min-height: 38px; margin-top: 12px; }
.event-note { margin-bottom: 0; font-size: 11px; }
.event-archive { color: inherit; font-size: 12px; }
.event-archive .archive-back { min-height: 38px; margin-bottom: 8px; }
.archive-heading h3 { margin: 4px 0; font-size: 16px; }
.archive-heading p { margin: 0; font-weight: 600; }
.archive-heading small { color: var(--muted); }
.archive-availability { padding: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--soft); }
.event-archive h4 { margin: 14px 0 8px; font-size: 13px; }
.archive-milestones { padding: 0; margin: 0; list-style: none; }
.archive-milestones li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.archive-threshold { font-weight: 600; color: var(--accent); white-space: nowrap; }
.archive-milestones strong { font-weight: 600; }
.archive-milestones p { margin: 3px 0; color: var(--muted); line-height: 1.6; }
.archive-milestones small { color: var(--muted); font-size: 11px; }
.archive-rules { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px; }
.archive-rules summary { min-height: 38px; cursor: pointer; }
.archive-rules ul { padding-left: 18px; }
.archive-rules li { margin-bottom: 8px; }
.archive-sources { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.archive-sources a { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; color: inherit; text-decoration: none; }
.archive-sources a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (min-width: 761px) {
  body { isolation: isolate; background: radial-gradient(ellipse at 50% 25%, #2a414d, #14212c 75%); }
  body:before { content: ''; position: fixed; inset: -16px; z-index: -1; pointer-events: none; background: url("/qinglong/static/9d0da5eb2682/assets/interface/desktop-courtyard.webp") center / cover no-repeat; filter: blur(5px) saturate(.88); }
  body:after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(#7d99a614, #7d99a614), radial-gradient(ellipse at 50% 32%, #10202b0d 35%, #08152166 100%), linear-gradient(180deg, #10202b26, #10202b30 70%, #07131e7a); }
  .shell { position: relative; z-index: 1; }
  .simulator-toolbar { border-radius: 12px; background: #0f2130a6; box-shadow: 0 0 28px 12px #0f213044; }
  .page-footer { text-shadow: 0 1px 3px #000, 0 0 10px #000; }
  .result-dialog { transform: translateY(clamp(-80px, calc(43.775% - 50dvh + 16px), 0px)) scale(.8755); transform-origin: center; }
  .result-dialog:not(.art-ready) .mobile-result-heading { display: flex; position: absolute; top: 8%; left: 20%; right: 20%; align-items: center; justify-content: center; }
  .result-dialog:not(.art-ready) .mobile-result-heading h2 { margin: 0; color: #806334; font: 600 24px/32px var(--qinglong-font); }
  .result-dialog:not(.art-ready) .mobile-result-heading .close { position: absolute; right: -7%; top: 0; }
  .result-dialog:not(.art-ready) .result-confirm { background: linear-gradient(#eed494, #c39a47)!important; color: #453616; font: 600 14px var(--qinglong-font); }
  .result-dialog:not(.art-ready) .result-confirm .mobile-only { display: inline; }
  .result-rewards { left: 20%; right: 20%; top: 50%; transform: translateY(-50%); }
  .result-rewards > div { display: flex; flex-direction: column; align-items: center; }
  .result-rewards .egg-caption { left: 50%; transform: translateX(-50%); }
  .result-confirm { left: 43%; }
  .batch-result .result-rewards { left: 20%; right: 20%; display: flex; flex-wrap: wrap; transform: none; }
  .batch-result .result-rewards > div { width: calc(25% - 6px); }
  .batch-result .batch-summary { width: 100%; }
}
dialog .close { position: relative; font-size: 0; width: 34px; height: 34px; min-height: 34px; color: #68776e; background: #e4e6dc; border: 0; }
dialog .close:before, dialog .close:after { content: ''; position: absolute; width: 14px; height: 1.5px; left: 50%; top: 50%; border-radius: 1px; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
dialog .close:after { transform: translate(-50%, -50%) rotate(-45deg); }
.select-item[aria-pressed=true]:after { content: ''; width: 7px; height: 11px; top: 12px; right: 12px; border: 2px solid #a77e32; border-top: 0; border-left: 0; transform: rotate(45deg); }
.select-item[aria-pressed=true]:disabled { opacity: 1; }

.simulator-toolbar { gap: 12px; padding: 12px 18px; font-family: var(--qinglong-font); }
.simulator-toolbar button { border-radius: 8px; font-size: 12px; min-height: 38px; padding: 8px 14px; }
.toolbar-primary { display: flex; gap: 8px; margin-left: auto; }
.toolbar-utilities { display: flex; align-items: center; gap: 6px; padding-left: 12px; border-left: 1px solid #355265; }
.tool-icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.simulator-toolbar .icon-label-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
#bagButton { white-space: nowrap; }
.simulator-toolbar .icon-button { display: grid; place-items: center; width: 38px; padding: 0; }
.simulator-toolbar #newButton { color: #d9c69d; background: transparent; border-color: transparent; padding-inline: 9px; }
.simulator-toolbar #newButton:hover:enabled, .simulator-toolbar #fullscreenButton:hover:enabled { background: #304e61; border-color: #426071; }
.simulator-toolbar #fullscreenButton { background: transparent; border-color: transparent; }
#bagButton kbd { font: 10px/1.4 var(--qinglong-font); color: #a4bfc8; border: 1px solid #526c79; border-radius: 3px; padding: 0 3px; }
.simulator-toolbar #planButton { background: #d7b46b; color: #302712; border-color: #c7a059; font-weight: 600; }
.simulator-toolbar #planButton:hover:enabled { background: #e1c384; }
.simulator-toolbar #bagBadge { padding: 1px 5px; border-radius: 4px; background: #142c3c; font-size: 10px; }
.simulator-toolbar .expense-toggle { display: flex; align-items: center; gap: 12px; background: #192e3d; border-color: #355265; padding: 7px 12px; }
.expense-toggle > span { font-size: 11px; color: #acc3ce; }
.expense-toggle strong { font: 600 19px/1.3 var(--qinglong-font); color: #ecd39d; }
.expense-toggle b { font-weight: 600; }
.expense-toggle[aria-expanded=true] { border-color: #bc9b60; }
.expense-chevron { transition: transform .15s; }
.expense-chevron { margin-left: auto; font-size: 18px!important; }
.session-menu { position: relative; z-index: 5; }
.session-menu summary { display: grid; place-items: center; cursor: pointer; list-style: none; width: 38px; min-height: 38px; border: 1px solid transparent; border-radius: 8px; padding: 7px; color: #bcd0d9; }
.session-menu summary::-webkit-details-marker { display: none; }
.session-menu summary:hover, .session-menu[open] summary { background: #243e50; }
.session-options { position: absolute; right: 0; top: calc(100% + 7px); width: 162px; padding: 6px; border: 1px solid #426071; border-radius: 10px; background: #172c3a; box-shadow: 0 10px 32px #07131c66; }
.session-options button { display: block; width: 100%; text-align: left; border: 0; background: transparent; }

#simulationTools { --text: #243d49; --muted: #687b80; --panel: #f3f4ed; --line: #d6ded7; padding: 0 18px 20px; font-family: var(--qinglong-font); }
#simulationTools .metrics { grid-template-columns: 1fr 1fr 1fr auto; padding: 20px 0; border-radius: 10px; margin: 0; }
#simulationTools .metrics > div { padding: 0 20px; justify-content: center; gap: 3px; }
#simulationTools .metrics strong { font: 600 22px/1.6 var(--qinglong-font); color: #2c5261; }
#simulationTools #purchaseMeta { font: 500 14px/1.8 var(--qinglong-font); letter-spacing: 0; }
#simulationTools .metrics small { font: 12px var(--qinglong-font); }
#simulationTools .metrics label { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: #687b80; }
#simulationTools select { background: #fafbf5; border-color: #bdcec7; }
#simulationTools button:hover:enabled { background: #e3eadf; }
#simulationTools #analysisButton:hover:enabled { background: #16685d; color: #fff; }
#simulationTools .below { gap: 14px; }
#simulationTools .panel { padding: 20px; border-radius: 10px; }
#simulationTools h2 { font-size: 16px; color: #2b4e5b; }
#simulationTools #settleButton { border-color: #b9c8be; background: #e4e9de; color: #536355; font-size: 12px; }
#simulationTools .estimate-grid { border-radius: 8px; background: #e9eee5; }
#simulationTools .subtle, #simulationTools .analysis-note { color: #697e81; }

.expense-dialog { width: min(960px, calc(100% - 24px)); max-width: 960px; max-height: calc(100dvh - 40px); padding: 16px; border: 1px solid #b1baa9; border-radius: 12px; background: #f4f3ec; color: #30444c; font-family: var(--qinglong-font); }
.expense-dialog .dialog-heading { position: sticky; top: -16px; z-index: 8; background: #f4f3ec; padding: 4px 0; margin-bottom: 8px; }
.expense-dialog .dialog-heading h2 { font: 600 16px/1.5 var(--qinglong-font); color: #304c55; margin: 0; }
.expense-dialog .close { width: 32px; height: 32px; min-height: 32px; background: #e4e6dc; border: 0; color: #68776e; }
.expense-dialog .close:hover:enabled { background: #d8ddce; color: #43534d; }
.expense-overview { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px; border-radius: 9px; background: #e8eadd; color: #62756b; font-size: 12px; }
.expense-overview strong { font: 600 28px/1.2 var(--qinglong-font); color: #7c6432; }
.expense-overview b { font-weight: inherit; }
.expense-dialog #simulationTools { padding: 0; }
.expense-dialog #simulationTools .metrics { background: transparent; border: 0; padding: 18px 0; margin: 0; }
.expense-dialog #simulationTools .below { margin-top: 0; }
.expense-dialog #simulationTools .panel { border-color: #d7dfd2; box-shadow: none; padding: 16px; }
.expense-dialog .analysis-result { min-height: 0; }
.expense-dialog .analysis-result > p { margin: 12px 0 0; }
.expense-dialog #simulationTools .metrics > div:first-child { padding-left: 0; }
.expense-dialog #simulationTools .metrics > div:last-child { padding-right: 0; }
@media (max-width: 760px) {
  .expense-dialog { top: auto; bottom: 0; margin: 0 auto; width: 100%; max-width: 600px; max-height: 86dvh; padding: 12px 12px max(14px, env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; }
  .expense-dialog .dialog-heading { top: -12px; }
  .expense-overview { padding: 12px; }
  .expense-overview strong { font-size: 25px; }
  .expense-dialog #simulationTools .metrics { gap: 12px 8px; padding: 14px 0; }
  .expense-dialog #simulationTools .metrics > div { padding: 0; }
  .expense-dialog #simulationTools .metrics label, .expense-dialog #settleButton { width: 100%; }
  .expense-dialog #simulationTools .metrics strong { font-size: 18px; }
  .expense-dialog #simulationTools #purchaseMeta { font-size: 12px; }
  .expense-dialog .metrics select { max-width: none; }
  .expense-dialog #simulationTools #settleButton { min-height: 40px; }
  .expense-dialog .history-list { max-height: 320px; }
}

#selectionDialog { height: min(620px, calc(100dvh - 32px)); max-height: calc(100dvh - 32px); overflow: hidden; background: #eff2ed; border-color: #8fa7aa; border-radius: 12px; font-family: var(--qinglong-font); }
#selectionDialog[open] { display: flex; flex-direction: column; }
#selectionDialog > .dialog-heading, #selectionDialog > .subtle, #selectionDialog > .tier-tabs, #selectionDialog > .dialog-footer { flex-shrink: 0; }
#selectionDialog .selection-grid { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; align-content: start; padding: 3px 3px 3px 0; }
#selectionDialog .dialog-footer { margin-top: 12px; }
.selection-grid { gap: 12px; }
.select-item { min-height: 82px; padding: 12px; gap: 10px; border: 1px solid #a8bcc4; border-radius: 9px; background: #d4e1e5; transition: border-color .15s, box-shadow .15s, background .15s; }
.select-item img { width: 40px; height: 40px; object-fit: contain; border: 0; box-shadow: none; }
.select-item span { line-height: 1.65; padding-right: 5px; }
.select-item:hover:enabled { background: #c7dce4; border-color: #6e96aa; box-shadow: 0 2px 8px #204c6114; }
.select-item[aria-pressed=true] { background: #e4e4cc; border-color: #b18a40; }
.select-item[aria-pressed=true]:hover:enabled { background: #e9e7ce; border-color: #9b742e; }
.select-item[aria-pressed=true]:after { top: 9px; right: 10px; }
.tier-tabs button:hover:enabled { background: #788597; }
.tier-tabs button[aria-pressed=true]:hover:enabled { background: #e4e6d8; }
.exchange-pool-tabs button:hover:enabled { background: #788597; }
.exchange-pool-tabs button[aria-pressed=true]:hover:enabled { background: #e4e6d8; }
.exchange-prize:hover:enabled { background: #c2ccca; }
.exchange-prize[aria-pressed=true]:hover:enabled { background: #e0dbc0; }
.exchange-prize img, .prize img { object-fit: contain; }

.target-dialog { position: fixed; top: 12px; bottom: auto; margin: 0 auto; width: min(900px, calc(100% - 24px)); max-width: 900px; padding: 16px; background: #f4f3ec; border: 1px solid #b1baa9; border-radius: 10px; font-family: var(--qinglong-font); color: #30444c; --line: #d6dcd1; }
.target-dialog .dialog-heading { align-items: center; position: sticky; top: -16px; z-index: 8; background: #f4f3ec; padding: 4px 0; margin-bottom: 8px; }
.target-dialog .dialog-heading h2 { font: 600 16px/1.5 var(--qinglong-font); margin: 0; color: #304c55; }
.target-dialog .close { background: #e5e5d9; color: #68776e; border: 0; width: 32px; height: 32px; min-height: 32px; flex-shrink: 0; }
.target-dialog .close:hover:enabled { background: #d8ddce; color: #43534d; }
.target-dialog > .subtle { font-size: 12px; color: #6e817e; margin: 5px 0 20px; }
.target-presets { gap: 6px; margin: 0 0 10px; }
.target-presets button { min-height: 33px; border-radius: 7px; padding: 5px 15px; color: #5f6a5c; border-color: #cbd2c2; background: #e9ecdf; }
.target-presets button:hover:enabled { background: #e2e6d6; border-color: #b6c0a9; }
.target-presets button[aria-pressed=true] { background: #3b626b; border-color: #3b626b; color: #fff8e8; }
.target-presets button[aria-pressed=true]:hover:enabled { background: #496f75; }
.target-form { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; padding: 0; border: 0; background: transparent; }
.target-goals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.target-form[data-goal=cost] .target-goals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.target-actions { display: flex; justify-content: flex-end; }
.target-actions button { width: 190px; min-height: 40px; border-radius: 6px; padding: 8px 16px; background: #d5b576; border: 1px solid #c29e5b; color: #483816; font: 600 12px var(--qinglong-font); box-shadow: 0 2px 5px #6f57201c; }
.target-actions button:hover:enabled { background: #dfc48e; }
.target-form label { font-size: 11px; line-height: 14px; color: #62746c; gap: 4px; }
.target-form input, .target-form select { min-height: 38px; border-radius: 6px; border-color: #c5cdbc; background: #fafbf4; color: #32484c; font: 12px var(--qinglong-font); padding: 7px 10px; }
.target-form input:focus-visible, .target-form select:focus-visible { outline: 2px solid #82a2a0; outline-offset: 1px; background: #fafbf4; }
.target-advanced { align-self: stretch; padding-top: 0; }
.target-advanced summary, .target-guide summary, .target-alternatives summary, .target-method summary { cursor: pointer; color: #5a7169; font-size: 12px; padding: 5px 0; }
.target-advanced > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding-top: 12px; }
.target-result > p { font-size: 11px; color: #6a7b74; padding: 4px 0; margin: 6px 0; }
.target-guide { margin-top: 10px; padding-top: 6px; border-top: 1px solid #d6dcd1; }
.target-recommendation { border-color: #cbb77d; border-radius: 8px; padding: 14px; background: #f5ecd0; }
.plan-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.plan-summary > div:first-child { flex: 1; min-width: 0; }
.plan-tag { display: inline-block; padding: 3px 7px; border-radius: 4px; background: #e4d6a8; color: #7b6233; font-size: 10px; }
.plan-summary h3 { font-size: 15px; font-weight: 600; color: #4e533e; margin: 5px 0; }
.plan-summary p { font-size: 12px; line-height: 1.7; color: #796c4d; }
.plan-summary .plan-requirement { color: #5e7965; font-size: 11px; margin-top: 2px; }
.plan-price { text-align: right; white-space: nowrap; padding-top: 4px; }
.plan-price span { font-size: 11px; color: #8e7952; }
.plan-price strong { display: block; font: 28px/1.4 var(--qinglong-font); color: #75602e; }
.target-path { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 12px 0 8px; }
.step-mobile-round, .step-mobile-start, .mobile-path-details { display: none; }
.target-path li { position: relative; padding: 12px 8px 0; text-align: center; border: 1px solid #d9ccaa; border-radius: 7px; background: #fffbef; display: flex; flex-direction: column; align-items: center; }
.target-path li:not(:last-child):after { content: none; }
.step-pool { color: #7b816f; font-size: 11px; margin-bottom: 4px; }
.step-prefix { font-size: 10px; color: #9a987e; }
.step-round { font-size: 21px; line-height: 1.4; color: #426270; }
.step-spent { font-size: 11px; margin-top: 6px; color: #7e806e; }
.step-total { color: #6b8a8a; font-size: 10px; margin-top: 3px; }
.step-action { width: calc(100% + 16px); padding: 6px 0; margin-top: 8px; border-top: 1px solid #e8e0c9; border-radius: 0 0 7px 7px; background: #f0eedf; font-size: 10px; color: #82816d; white-space: nowrap; }
.target-path .key-step { border-color: #b8a061; background: #fff5d8; }
.key-step .step-round { color: #8c692e; }
.target-path li:last-child .step-action { background: #dde7d5; color: #587360; }
.target-recommendation .plan-instruction { color: #887d5d; font-size: 11px; line-height: 1.7; margin-top: 8px; }
.target-details { gap: 0; padding: 18px 0; margin: 5px 0; }
.target-details > div { padding: 0 15px; border-right: 1px solid #d4dbcc; }
.target-details > div:first-child { padding-left: 0; }
.target-details > div:last-child { border: 0; }
.target-details span { font-size: 10px; color: #7b897b; }
.target-details b { font-size: 17px; font-weight: 600; margin-top: 7px; color: #365e69; }
.target-reference { border: 0; padding: 5px 0 16px; margin: 0; }
.target-reference h3 { font-size: 13px; color: #5c7169; margin-bottom: 10px; }
.strategy-choices { display: flex; gap: 10px; }
.strategy-choice { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr auto; gap: 6px; text-align: left; padding: 12px 14px; border-radius: 8px; background: #e9eee4; border: 1px solid #d1dccd; color: #476166; }
.strategy-choice:hover:enabled { background: #e1e9db; border-color: #a6bba8; }
.strategy-choice > span { font-size: 12px; }
.strategy-choice strong { font: 600 17px var(--qinglong-font); }
.strategy-choice small { grid-column: 1/-1; font-size: 10px; color: #7b8779; }
.strategy-choice .strategy-link { grid-column: 1/-1; font-size: 10px; color: #5b8080; }
.target-alternatives, .target-guide { border-top: 1px solid #d6dcd0; padding: 10px 0; margin: 0; }
.target-alternatives > .table-scroll, .target-guide > .table-scroll { margin-top: 8px; }
.target-result td button, .target-guide button { background: #e4e9db; border: 1px solid #c5d1bd; border-radius: 5px; color: #526b5d; }
.target-result td button:hover:enabled, .target-guide button:hover:enabled { background: #d6e0cb; }
.target-result tr.chosen-plan { background: #e7eddc; }
.target-dialog .target-note { font-size: 10px; color: #849085; }

@media (max-width: 760px) {
  .simulator-toolbar { padding: 10px; gap: 8px; }
  .simulator-toolbar .expense-toggle { flex: 1; justify-content: flex-start; }
  .toolbar-utilities { padding-left: 0; border: 0; }
  .toolbar-utilities .utility-label { display: none; }
  .simulator-toolbar #newButton { width: 38px; padding: 0; }
  .toolbar-primary { order: 3; width: 100%; margin: 0; }
  .toolbar-primary button { flex: 1; }
  .simulator-toolbar #bagButton { gap: 5px; padding-inline: 8px; }
  #bagButton kbd { display: none; }
  #simulationTools { padding: 0 10px 18px; }
  #simulationTools .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 0; }
  #simulationTools .metrics > div { padding: 0 14px; border: 0; }
  #simulationTools .below { grid-template-columns: 1fr; }
  .selection-grid { gap: 9px; }
  .select-item { padding: 9px; min-height: 78px; gap: 8px; }
  .select-item img { width: 36px; height: 36px; }
  .select-item span { font-size: 11px; }
  .target-dialog { padding: 12px; border-radius: 8px; }
  .target-dialog .dialog-heading { top: -12px; }
  .target-path { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 5px; }
  .target-path li { padding: 6px 2px; justify-content: center; min-width: 0; }
  .target-path .step-pool { margin: 0; font-size: 9px; white-space: nowrap; }
  .target-path .step-prefix, .target-path .step-round, .target-path .step-spent, .target-path .step-total, .target-path .step-action { display: none; }
  .target-path .step-mobile-round { display: block; font: 600 15px/23px var(--qinglong-font); color: #426270; white-space: nowrap; }
  .target-path .step-mobile-start { display: block; font-size: 9px; line-height: 14px; color: #7c8172; white-space: nowrap; }
  .target-path .key-step .step-mobile-round { color: #8c692e; }
  .target-path li:not(:last-child):after { content: '›'; position: absolute; right: -5px; top: 50%; transform: translateY(-50%); color: #9c8a5e; font: 12px var(--qinglong-font); }
  .mobile-path-details { display: block; border-top: 1px solid #dfd4b5; margin-top: 8px; padding-top: 5px; }
  .mobile-path-details summary { color: #7c785d; font-size: 11px; cursor: pointer; padding: 4px 0; }
  .target-path-details { list-style: none; margin: 8px 0 0; padding: 0; }
  .target-path-details li { display: grid; grid-template-columns: 36px 48px 1fr; align-items: center; gap: 2px 6px; border-top: 1px solid #e7dec6; padding: 8px 0; }
  .target-path-details .step-pool { grid-column: 1; grid-row: 1/3; margin: 0; font-size: 10px; }
  .target-path-details .step-prefix, .target-path-details .step-mobile-round { display: none; }
  .target-path-details .step-round { grid-column: 2; grid-row: 1/3; font-size: 12px; }
  .target-path-details .step-spent, .target-path-details .step-total { grid-column: 3; margin: 0; font-size: 10px; }
  .target-path-details .step-action { grid-column: 1/-1; width: auto; margin: 2px 0 0; padding: 0; text-align: right; border: 0; background: none; font-size: 9px; }
}
@media (max-width: 600px) {
  .target-form { padding: 0; gap: 10px; }
  .target-goals, .target-form[data-goal=cost] .target-goals { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 8px; }
  #targetTierField { grid-column: 1/-1; }
  .target-actions button { width: 100%; min-height: 42px; }
  .target-advanced summary { font-size: 11px; line-height: 16px; padding: 2px 0; }
  .target-advanced > div { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .target-presets { flex-wrap: nowrap; overflow-x: auto; }
  .target-presets button { flex: 0 0 auto; min-height: 30px; padding: 4px 10px; font-size: 11px; }
  .target-recommendation { padding: 10px; }
  .plan-summary { gap: 8px; }
  .plan-price span { display: block; max-width: 110px; white-space: normal; font-size: 10px; }
  .plan-price strong { font-size: 25px; }
  .target-path { gap: 7px; }
  .step-round { font-size: 20px; }
  .step-action { font-size: 9px; }
  .target-details { gap: 16px 0; }
  .target-details > div { padding: 0 10px; }
  .target-details > div:nth-child(odd) { padding-left: 0; }
  .target-details > div:nth-child(even) { border: 0; }
  .strategy-choices { flex-direction: column; }
}
.toolbar-analysis { display: flex; align-items: center; gap: 8px; }
.milestone-section { display: contents; }
.milestone-section > summary { display: none; }
.draw-options { display: contents; }
.draw-center:has(.egg-help:hover, .egg-help:focus-visible) .egg-tooltip { display: block; }
.draw-cost-line { display: contents; }
.mobile-only, .mobile-milestone-teaser { display: none; }
.mobile-header, .mobile-panel, .mobile-play-button, .mobile-milestone-button, .mobile-egg-text, .mobile-wheel-hint, .wheel-focus, .wheel-quantity { display: none; }

@media (max-width: 760px) {
  body { padding-bottom: calc(var(--mobile-tools-height, 52px) + 12px); }
  body.mobile-panel-open { padding-bottom: calc(var(--mobile-tools-height, 52px) + 12px); }
  .shell { margin: 0; }
  .game-viewport { aspect-ratio: auto; overflow: visible; }
  .game-viewport:fullscreen { overflow-y: auto; padding-bottom: calc(var(--mobile-tools-height, 52px) + 12px); }
  .game-stage { position: relative; inset: auto; width: 100%; height: auto; transform: none; background: none; padding: calc(var(--mobile-header-height, 70px) + 8px) 12px 8px; font: 13px/1.5 var(--qinglong-font); }
  .game-interface { position: relative; inset: auto; width: 100%; height: auto; display: block; }
  .game-close, .game-rule-help, .rule-tooltip, .coupon-wallet, .milestone-section { display: none; }
  .game-interface > .game-period, .game-interface > .original-reset, .game-interface > .original-exchange { display: none; }
  .mobile-header { position: fixed; inset: 0 0 auto; display: block; padding: max(4px, env(safe-area-inset-top)) 10px 4px; background: #142631; border-bottom: 1px solid #344f5c; z-index: 15; }
  .mobile-header-main { display: flex; align-items: center; height: 34px; gap: 6px; }
  .mobile-header .game-title { display: none; }
  .mobile-header .game-period { position: static; display: block; flex: 1; min-width: 0; height: 34px; }
  .mobile-header #eventButton { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; width: 100%; height: 34px; min-height: 34px; padding: 0; background: transparent; border: 0; font: 10px/15px var(--qinglong-font); }
  .mobile-header .period-name { display: block; color: #efd49a; font-size: 14px; font-weight: 600; line-height: 18px; }
  .mobile-header .period-date { color: #9fbac7; }
  .game-title:before { content: '青龙秘宝'; }
  .mobile-header .game-help { position: static; width: 34px; height: 34px; font: 11px var(--qinglong-font); color: #a7c5d2; }
  .game-help:before { content: '规则'; }
  .mobile-header .toolbar-utilities { gap: 2px; padding: 0; border: 0; }
  .mobile-header .toolbar-utilities > button { display: flex; justify-content: center; align-items: center; width: 32px; height: 34px; padding: 0; color: #b1c6ce; background: transparent; border: 0; }
  .mobile-header .utility-label { display: none; }
  .mobile-header #newButton { width: auto; min-width: 62px; gap: 4px; padding-inline: 4px; }
  .mobile-header #newButton .utility-label { display: inline; font-size: 11px; white-space: nowrap; }
  .mobile-header .session-menu summary { width: 32px; height: 34px; min-height: 34px; padding: 7px; }
  .session-options { top: calc(100% + 6px); bottom: auto; width: 200px; }
  .mobile-header .session-options button { position: static; display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; height: 40px; min-height: 40px; padding: 0 12px!important; font: 12px var(--qinglong-font); border: 0!important; background: transparent!important; color: #c1d2d9; }
  .original-buy:before { content: '补充天字令'; }
  .original-reset:before { content: '重置奖池'; }
  .original-exchange:before { content: '暴击卡兑换'; }
  .original-reset span { position: static; color: #8eabb9; font-size: 11px; }
  .original-reset span b { color: #e4c787; }
  .mobile-header-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 28px; }
  .game-spent { position: static; display: flex; align-items: center; gap: 5px; height: auto; font-size: 11px; white-space: nowrap; }
  .game-spent-label { opacity: 1; font-size: 0; }
  .game-spent-label:after { content: '累计'; font-size: 11px; color: #91aebc; }
  .game-spent .mini-token { display: none; }
  .game-spent strong { position: static; font-size: 15px; font-weight: 600; color: #e9cc88; }
  .token-wallet { position: static; width: auto; height: auto; display: flex; align-items: center; gap: 5px; background: none; font-size: 13px; }
  .token-wallet:before { position: static; background: none; width: auto; height: auto; content: '天字令'; font-size: 11px; font-weight: 400; color: #91aebc; }
  .game-stage .mobile-milestone-button { display: flex; align-items: center; gap: 5px; width: auto; height: 28px; border: 0; background: transparent; color: #b8d2dc; font: 11px var(--qinglong-font); }
  .mobile-milestone-button[aria-expanded=true] { color: #e9cc88; }
  #milestoneBadge { padding: 1px 5px; border-radius: 4px; background: #d6b46c; color: #302a18; font-size: 10px; }
  #milestoneBadge[hidden] { display: none; }
  .board { position: static; width: 100%; height: auto; display: flex; flex-direction: column; gap: 12px; padding: 0; border: 0; background: none; pointer-events: auto; }
  .draw-center { position: relative; inset: auto; grid-column: 2/4; grid-row: 2/4; width: auto; height: auto; min-width: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: 24px 44px 26px 1fr; gap: 3px 2px; padding: 7px; background: #213d4c; border: 1px solid #6e7b6c; border-radius: 8px; z-index: 3; }
  .round-label { position: static; grid-column: 1/4; grid-row: 1; width: auto; height: 24px; padding: 0; display: flex; align-items: center; gap: 3px; line-height: 24px; font-size: 0; text-shadow: none; }
  .round-label:before { content: '轮次'; font-size: 10px; color: #9db8c4; }
  #roundValue { font-size: 14px; color: #e6c788; }
  .draw-center .original-buy { position: static; grid-column: 1/3; grid-row: 2; width: auto; height: 44px; padding: 0; border: 1px solid #5a7987!important; border-radius: 6px!important; background: #315467!important; color: #cbe0e9; font: 11px var(--qinglong-font); }
  .draw-center .original-buy:before { content: '购令'; }
  .original-draw { position: static; grid-column: 3/7; grid-row: 2; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; width: auto; height: 44px; padding: 0; border-radius: 6px!important; background: #d7b46b!important; color: #352911; font-size: 12px; }
  .original-draw:before { content: '立即抽取'; order: 2; line-height: 17px; }
  .original-draw:after { content: none; }
  .original-draw .draw-cost-line { position: static; display: block; order: 1; width: auto; height: auto; color: #654721; font: 9px/14px var(--qinglong-font); }
  .original-draw .mobile-only { position: static; display: inline; width: auto; height: auto; color: inherit; font: inherit; }
  .original-draw #drawCost { position: static; width: auto; height: auto; font: 600 11px/14px var(--qinglong-font); color: #822c20; }
  .draw-options { display: contents; }
  .original-auto, .original-skip { position: static; width: auto; height: 26px; gap: 3px; font: 10px/26px var(--qinglong-font); white-space: nowrap; }
  .original-auto { grid-column: 1/4; grid-row: 3; }
  .original-skip { grid-column: 4/7; grid-row: 3; }
  .original-auto input, .original-skip input { width: 12px; height: 12px; }
  .original-auto input, .original-skip input { position: relative; transform: none; border: 1px solid #7796a4; border-radius: 3px; background: #19323f; margin: 0 2px 0 0; flex-shrink: 0; }
  .original-auto input:checked, .original-skip input:checked { background: #d5b46d; border-color: #d5b46d; }
  .original-auto input:checked:after, .original-skip input:checked:after { content: ''; position: absolute; left: 3px; top: 1px; width: 3px; height: 6px; border: solid #273b40; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
  .egg-dots { position: static; grid-column: 4/7; grid-row: 1; display: flex; align-items: center; justify-content: flex-end; gap: 1px; width: auto; height: 24px; padding: 0; font-size: 10px; color: #aec6d0; white-space: nowrap; }
  .desktop-egg-text { display: none; }
  .mobile-egg-text { display: inline; }
  .game-stage .egg-help { position: static; width: 24px; height: 24px; font-size: 14px; line-height: 24px; flex-shrink: 0; }
  .egg-dots:after { content: none; }
  .egg-tooltip { position: fixed; left: 12px; right: 12px; top: calc(var(--mobile-header-height, 70px) + 8px); bottom: auto; width: auto; border-radius: 8px; font-size: 12px; z-index: 16; }
  .original-draw[aria-label='确认奖池，开始模拟']:before { content: '选奖开抽'; }
  .original-draw[aria-label='本期已结算']:before { content: '已结算'; }
  .original-draw[aria-label='本池已全部抽完']:before { content: '本池已抽完'; }
  .original-draw[data-drawing=true]:before { content: '抽取中…'; }
  .original-draw:is([data-drawing=true], [aria-label='确认奖池，开始模拟'], [aria-label='本期已结算'], [aria-label='本池已全部抽完']) .draw-cost-line { display: none; }
  .simulator-toolbar { position: fixed; inset: auto 0 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; padding: 6px 10px max(6px, env(safe-area-inset-bottom)); background: #142631; z-index: 12; }
  .toolbar-primary { display: contents; }
  .toolbar-analysis { flex: 2.1; min-width: 0; display: flex; gap: 4px; padding-left: 5px; border-left: 1px solid #39505b; }
  .simulator-toolbar button { min-width: 0; min-height: 40px; height: 40px; padding: 3px 5px; font-size: 11px; white-space: nowrap; }
  .simulator-toolbar .mobile-play-button { display: block; flex: .8; background: transparent; border-color: transparent; color: #99b5c2; }
  .mobile-play-button[aria-pressed=true] { color: #edcf88!important; background: #263f4a!important; }
  .simulator-toolbar #bagButton { flex: 1.2; gap: 3px; padding: 3px; background: transparent; border-color: transparent; }
  .simulator-toolbar #bagButton .tool-icon { width: 14px; height: 14px; }
  .simulator-toolbar #bagBadge { padding: 1px 3px; font-size: 9px; }
  .simulator-toolbar #selectButton { flex: .9; background: transparent; border-color: transparent; }
  .simulator-toolbar .expense-toggle { display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 0; padding: 1px 3px; background: transparent; border-color: transparent; }
  .expense-toggle > span { font-size: 10px; line-height: 15px; }
  .expense-toggle strong { font: 600 12px/15px var(--qinglong-font); }
  .expense-toggle .expense-chevron { display: none; }
  .expense-toggle[aria-expanded=true] { background: #263f4a; }
  .simulator-toolbar #planButton { flex: 1; font-size: 10px; color: #e6c787; background: #293d46; border-color: #4d6267; }
  .board { max-width: 420px; margin: 0 auto; gap: 8px; }
  .mobile-pool-actions { display: flex; gap: 8px; }
  .game-stage .mobile-pool-actions button { position: static; display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1; width: auto; height: 40px; min-height: 40px; padding: 0 8px; border: 1px solid #486775; border-radius: 6px; color: #c4d9e2; background: #223e4d!important; font: 11px var(--qinglong-font); }
  .prize-grid { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(4, 82px); gap: 5px; width: 100%; height: auto; margin: 0; padding: 7px; border: 1px solid #8b805e; border-radius: 12px; background: #193442; box-shadow: inset 0 0 0 3px #102631; }
  .prize-grid:before, .prize-grid:after { content: none; }
  .prize { position: relative; inset: auto; grid-column: var(--mobile-column); grid-row: var(--mobile-row); width: auto; height: auto; min-width: 0; min-height: 0; margin: 0; padding: 4px 2px; transform: none; border: 1px solid #3c5b67!important; border-radius: 6px; background: #244352; gap: 3px; z-index: 2; pointer-events: auto; cursor: pointer; touch-action: manipulation; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .prize.side, .prize.won { background: #244352; }
  .prize[data-tier]:before { content: none; }
  .prize .tier, .prize .probability, .prize:hover .probability, .wheel-quantity { display: none; }
  .prize img { width: 35px; height: 35px; margin: 0; object-fit: contain; box-shadow: 0 2px 7px #071d26; }
  .prize .prize-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; width: 100%; color: #d2e0e5; font: 9px/12px var(--qinglong-font); text-align: center; text-shadow: none; }
  .prize .quantity { display: inline; white-space: nowrap; }
  .prize.won { opacity: .42; }
  .prize.won img, .prize.won .prize-name { opacity: 1; }
  .prize.won:after { content: ''; position: absolute; inset: 6px 7px auto auto; width: 5px; height: 8px; border: 1.5px solid #d0d7bc; border-top: 0; border-left: 0; border-radius: 0; background: none; transform: rotate(45deg); }
  .prize.latest { box-shadow: none; }
  .prize.inspected { border-color: #b09a66!important; background: #314d58; }
  .prize.rolling, .prize.landing { border-color: #f4dc9d!important; box-shadow: 0 0 12px #efd29477; background: #64705c; }
  .wheel-focus { position: static; display: flex; grid-column: 1/-1; grid-row: 4; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: auto; min-width: 0; border-top: 1px solid #3e5b67; text-align: center; }
  .wheel-name { color: #e5e2cb; font: 500 10px/13px var(--qinglong-font); }
  .wheel-meta { color: #9fb9c5; font-size: 9px; line-height: 12px; }
  .mobile-wheel-hint { display: block; margin: 0; color: #89a7b7; text-align: center; font-size: 9px; }
  .game-stage .mobile-milestone-teaser { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 60px; padding: 8px 10px; background: #203947; border: 1px solid #3b5761; border-radius: 8px; color: #c0d4dd; font: 11px/17px var(--qinglong-font); text-align: left; }
  .mobile-milestone-teaser img { width: 30px; height: 30px; }
  .mobile-milestone-teaser > span:not(.teaser-action) { flex: 1; }
  .mobile-milestone-teaser strong, .mobile-milestone-teaser small { display: block; font-weight: 400; }
  .mobile-milestone-teaser small { color: #8caab8; font-size: 10px; }
  .teaser-action { color: #ddc58c; flex-shrink: 0; font-size: 10px; }
  .mobile-panel { display: block; }
  .mobile-panel[hidden] { display: none; }
  .panel-open .board { display: none; }
  .mobile-panel-heading { position: sticky; top: var(--mobile-header-height, 70px); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 0; margin-bottom: 8px; background: #142631; z-index: 8; }
  .mobile-panel-heading h2 { color: #e4cd99; font: 500 14px var(--qinglong-font); margin: 0; }
  .game-stage #mobileBack { min-height: 40px; padding: 0 8px; border: 1px solid #395763; border-radius: 7px; background: #233c49; color: #b7d1dd; font: 12px var(--qinglong-font); }
  .mobile-panel .milestone-progress { padding: 8px 0 14px; color: #a1bdca; font-size: 11px; }
  .milestone-progress > div { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .milestone-progress strong { font-size: 17px; color: #e8ca83; margin-inline: 4px; }
  .milestone-progress progress { display: block; width: 100%; height: 5px; margin-top: 10px; border: 0; border-radius: 3px; accent-color: #d2b16a; background: #2e4c5c; }
  .milestone-progress progress::-webkit-progress-bar { background: #2e4c5c; border-radius: 3px; }
  .milestone-progress progress::-webkit-progress-value { background: #d2b16a; border-radius: 3px; }
  .mobile-panel .milestones { position: static; width: auto; height: auto; margin: 0; max-height: none; overflow: visible; }
  .mobile-panel #milestoneList { min-height: 0; display: grid; grid-template-columns: 1fr; gap: 8px; }
  .mobile-panel .milestone { position: relative; inset: auto!important; width: 100%; height: auto; min-height: 74px; display: grid; grid-template-columns: 40px 36px 1fr; gap: 9px; align-items: center; padding: 10px; border: 1px solid #365362; border-radius: 8px; background: #223c4b; }
  .mobile-panel .milestone.reached { border-color: #9e8858; }
  .mobile-panel .milestone.done { border-color: #365362; }
  .mobile-panel .milestone:before, .mobile-panel .milestone:after { content: none; }
  .mobile-panel .milestone-threshold { position: static; width: auto; color: #e5c884; font-size: 14px; text-align: center; }
  .mobile-panel .milestone-image { position: static; width: 36px; height: 36px; }
  .mobile-panel .milestone-copy { position: static; width: auto; display: grid; grid-template-columns: 1fr auto; gap: 4px 6px; align-items: center; }
  .mobile-panel .milestone p { position: static; grid-column: 1; font: 12px/17px var(--qinglong-font); color: #d0dce1; }
  .mobile-panel .milestone-status { position: static; grid-column: 1; color: #8da8b5; font: 11px/16px var(--qinglong-font); }
  .mobile-panel .claim { position: static; grid-column: 2; grid-row: 1/3; padding: 0 10px; min-height: 40px; height: 40px; border: 0; border-radius: 5px; background: #d5b46d; color: #352b19; font: 12px var(--qinglong-font); }
  .mobile-panel #simulationTools { padding: 0; }
  .mobile-panel .expense-overview { margin-bottom: 10px; }
  .mobile-panel #simulationTools .metrics { padding: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 8px; background: #f4f3ec; border: 0; margin: 0; }
  .mobile-panel #simulationTools .metrics > div { padding: 0; }
  .mobile-panel #simulationTools .metrics strong { font-size: 18px; }
  .mobile-panel #simulationTools #purchaseMeta { font-size: 12px; }
  .mobile-panel #simulationTools .metrics label, .mobile-panel #settleButton { width: 100%; }
  .mobile-panel .metrics select { max-width: none; }
  .mobile-panel #simulationTools .below { grid-template-columns: 1fr; margin-top: 12px; gap: 12px; }
  .mobile-panel #simulationTools .panel { padding: 14px; border-color: #d7dfd2; }
  .mobile-panel .analysis-result { min-height: 0; }
  .mobile-panel .analysis-result > p { margin: 12px 0 0; }
  .mobile-panel .history-list { max-height: none; }
  .mobile-panel .section-heading span { font-size: 10px; }
  .mobile-panel .metrics label { gap: 5px; }
  .game-stage #simulationTools button { min-height: 36px; padding: 4px 8px; }
  .page-footer { font-size: 9px; padding-top: 6px; }
  .mobile-panel .bag-stage { position: static; width: auto; height: auto; transform: none; display: flex; flex-direction: column; gap: 12px; background: none; font: 12px/1.5 var(--qinglong-font); }
  .mobile-panel .bag-close { display: none; }
  .mobile-panel .bag-tabs { position: static; display: flex; flex-wrap: wrap; gap: 4px; width: auto; height: auto; }
  .mobile-panel .bag-tabs button { height: 36px; min-height: 36px; font: 11px var(--qinglong-font); border: 1px solid #3b5966; border-radius: 6px; background: #1c3441; color: #b9ced7; }
  .mobile-panel .bag-tabs button[aria-pressed=true] { color: #e5cc91; background: #2d4651; border-color: #a28d5e; box-shadow: none; }
  .mobile-panel .bag-grid { position: static; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 88px; gap: 8px; width: auto; height: auto; overflow: visible; padding: 0; }
  .mobile-panel .bag-slot { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: auto; height: 88px; padding: 6px 3px; background: #1d3441; box-shadow: none; border: 1px solid #3b5966; border-radius: 7px; }
  .mobile-panel .bag-slot.empty-slot { display: none; }
  .mobile-panel .bag-slot img { position: static; width: 36px; height: 36px; object-fit: contain; }
  .mobile-panel .bag-quantity { top: 4px; right: 5px; bottom: auto; color: #ebd093; font: 10px/12px var(--qinglong-font); text-shadow: none; }
  .mobile-panel .bag-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 9px; line-height: 12px; color: #c6dbe4; text-align: center; }
  .mobile-panel .bag-empty { position: static; margin: 8px 0 24px; text-shadow: none; color: #92aebc; }
  .mobile-panel .bag-count { position: static; align-self: flex-start; background: none; gap: 10px; padding: 0; }
  .mobile-panel .bag-count button { min-height: 32px; padding: 4px 10px; border-radius: 5px; }
  .mobile-panel .bag-money { position: static; display: flex; flex-wrap: wrap; gap: 8px 20px; width: auto; height: auto; padding: 10px; border: 1px solid #324d5b; border-radius: 7px; background: #18303c; }
  .mobile-panel .bag-money > div { flex: 1; min-width: 100px; height: auto; }
  .mobile-panel .bag-tooltip { position: fixed; top: auto; bottom: calc(var(--mobile-tools-height, 52px) + 8px); left: 12px; right: 12px; max-height: 35svh; overflow: auto; border-radius: 8px; pointer-events: auto; font: 11px/17px var(--qinglong-font); z-index: 16; }
  .simulator-toolbar #bagButton[aria-expanded=true] { background: #263f4a; color: #edcf88; }
  .result-dialog { inset: 0; margin: auto; width: min(300px, calc(100% - 40px)); height: fit-content; aspect-ratio: auto; max-height: calc(100dvh - 120px); padding: 14px; border: 1px solid #ae955c; border-radius: 12px; background: #1d3543; color: #d1e0e5; overflow-y: auto; box-shadow: 0 12px 45px #05121e88; }
  .result-art { display: none; }
  .mobile-result-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
  .mobile-result-heading h2 { color: #e4c780; font: 600 15px/24px var(--qinglong-font); margin: 0; }
  .mobile-result-heading .close { width: 32px; height: 32px; min-height: 32px; background: #294451; color: #a6c2ce; }
  .result-dialog .result-rewards { position: static; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; max-height: calc(100dvh - 260px); overflow-y: auto; overscroll-behavior: contain; color: #d1e0e5; padding: 0; }
  .result-dialog .result-rewards > div { width: 100px; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; }
  .result-dialog .result-rewards img { width: 44px; height: 44px; object-fit: contain; border: 0; }
  .result-dialog .result-rewards p { margin: 0; font: 11px/16px var(--qinglong-font); }
  .result-dialog .result-rewards .egg-caption { position: static; display: block; order: 2; font: 9px/14px var(--qinglong-font); color: #e6c782; background: #2d4550; border-radius: 3px; padding: 1px 5px; }
  .result-dialog .result-confirm { position: static; width: 100%; height: 40px; min-height: 40px; margin-top: 18px; border: 0; border-radius: 6px; background: #d7b46b!important; color: #302a1b; font: 600 12px var(--qinglong-font); }
  .result-confirm .mobile-only { display: inline; }
  .result-dialog.batch-result { width: min(380px, calc(100% - 24px)); }
  .batch-result .result-rewards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 6px; }
  .batch-result .result-rewards > div { width: auto; }
  .batch-result .batch-summary { grid-column: 1/-1; padding: 8px 0 0; color: #99b6c4; }
}
@media (max-width: 360px) {
  .draw-center { padding: 6px; }
  .original-auto, .original-skip { font-size: 9px; gap: 1px; }
  .original-auto input, .original-skip input { width: 11px; height: 11px; margin-inline: 2px; }
  .egg-dots { font-size: 9px; }
  .game-stage .egg-help { width: 22px; height: 22px; font-size: 13px; line-height: 22px; }
}
@media (max-width: 760px) {
  #selectionDialog { padding: 12px; }
  #selectionDialog .dialog-heading { gap: 8px; }
  #selectionDialog .dialog-heading h2 { margin: 0; font: 600 16px/24px var(--qinglong-font); }
  #selectionDialog > .subtle { margin: 4px 0 8px; font-size: 11px; line-height: 17px; }
  #selectionDialog .tier-tabs { margin: 0 0 10px; padding-bottom: 6px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  #selectionDialog { width: min(900px, 80vw); height: calc(100dvh - 16px); max-width: 900px; max-height: calc(100dvh - 16px); padding: 8px 12px; }
  #selectionDialog .dialog-heading { gap: 8px; }
  #selectionDialog .dialog-heading h2 { margin: 0; font: 600 15px/22px var(--qinglong-font); }
  #selectionDialog > .subtle { margin: 2px 0 6px; font-size: 11px; line-height: 16px; }
  #selectionDialog .tier-tabs { margin: 0 0 6px; padding-bottom: 4px; gap: 6px; }
  #selectionDialog .tier-tabs button { min-height: 32px; padding: 4px 8px; }
  #selectionDialog .selection-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  #selectionDialog .select-item { min-height: 60px; padding: 6px 8px; gap: 7px; }
  #selectionDialog .select-item[aria-pressed=true]:after { top: 3px; right: 6px; width: 6px; height: 9px; }
  #selectionDialog .select-item img { width: 32px; height: 32px; }
  #selectionDialog .select-item span { font-size: 11px; line-height: 16px; }
  #selectionDialog .dialog-footer { margin-top: 6px; gap: 8px; }
  #selectionDialog .dialog-footer button { min-height: 36px; padding: 5px 14px; }
  #selectionDialog .dialog-footer > span { font-size: 11px; }
}
@media (orientation: landscape) and (max-height: 500px) and (max-width: 640px) {
  #selectionDialog .selection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.target-method { margin-top: 8px; }

/* Keep editable controls readable before focus on narrow and touch screens.
   Touch detection also covers the desktop layout used in phone landscape. */
@media (max-width: 760px), (pointer: coarse) {
  :root input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=range]):not([type=hidden]),
  :root select,
  :root textarea { font-size: 16px; }
}

.toolbox-return{display:none}
@media(max-width:760px){.mobile-header .toolbar-utilities>.toolbox-return{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 5px;color:#b1c6ce;font-size:11px;white-space:nowrap;text-decoration:none}}
