/* Only these two tools and their own result/inventory dialogs are affected. */
:is(#toolChestSim, #toolRandomTank, .game-tool-modal) [hidden] { display: none !important; }
:is(#toolChestSim, #toolRandomTank, .game-tool-modal) .game-eyebrow { display: block; color: var(--accent); font-size: .72rem; letter-spacing: .1em; font-weight: 700; margin-bottom: 8px; }
:is(#toolChestSim, #toolRandomTank, .game-tool-modal) h3 { font-size: 1.2rem; line-height: 1.5; }
:is(#toolChestSim, #toolRandomTank, .game-tool-modal) p { color: var(--text-secondary); font-size: .85rem; line-height: 1.8; }
:is(#toolChestSim, #toolRandomTank, .game-tool-modal) button { min-height: 40px; border-radius: 10px; }
:is(#toolChestSim, #toolRandomTank, .game-tool-modal) button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
:is(#toolChestSim, #toolRandomTank, .game-tool-modal) .game-block-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
:is(#toolChestSim, #toolRandomTank, .game-tool-modal) .game-block-heading > span { color: var(--text-muted); font-size: .75rem; }
:is(#toolChestSim, #toolRandomTank, .game-tool-modal) .game-empty { padding: 40px 16px; text-align: center; color: var(--text-secondary); line-height: 1.8; font-size: .85rem; }
body #toolChestSim .supply-account { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(220px, 1fr); gap: 24px; margin-bottom: 24px; }
#toolChestSim .supply-account-title h3 { font-size: 1.4rem; margin-bottom: 8px; }
#toolChestSim .supply-wallet { border-left: 1px solid var(--arena-edge); padding-left: 28px; }
#toolChestSim .supply-wallet > span { color: var(--text-secondary); font-size: .78rem; }
#toolChestSim .supply-wallet > strong { display: block; font: 700 2rem/1.5 var(--font-mono); color: var(--price); }
#toolChestSim .supply-wallet > div { display: flex; gap: 12px; flex-wrap: wrap; }
#toolChestSim .supply-wallet button { padding: 0; min-height: 28px; background: transparent; border: 0; color: var(--text-secondary); font-size: .75rem; }
#toolChestSim .supply-wallet button:hover { color: var(--accent); }
#toolChestSim .supply-shortcuts { grid-column: 1/-1; display: flex; gap: 12px; border-top: 1px solid var(--arena-edge); padding-top: 20px; }
#toolChestSim .supply-shortcuts button { padding: 10px 18px; display: flex; gap: 16px; align-items: center; }
#toolChestSim .supply-shortcuts small { font-size: .72rem; font-weight: 400; }
#toolChestSim .supply-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 24px; align-items: start; }
body #toolChestSim .supply-catalog, body #toolChestSim .supply-detail { padding: 24px; }
#toolChestSim .chest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#toolChestSim .supply-chest-card { display: block; padding: 14px; min-width: 0; width: 100%; white-space: normal; text-align: left; border: 1px solid var(--arena-edge); background: var(--surface-muted); border-radius: 14px; color: var(--text); }
#toolChestSim .supply-chest-card:hover { border-color: var(--accent-border); background: var(--surface-inset); }
#toolChestSim .supply-chest-card[aria-pressed=true] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
#toolChestSim .supply-chest-card img { display: block; width: 100%; height: 118px; object-fit: contain; margin-bottom: 12px; }
#toolChestSim .supply-chest-card strong { display: block; font-size: .875rem; line-height: 1.5; min-height: 2.6em; overflow-wrap: anywhere; }
#toolChestSim .supply-chest-card .chest-card-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .72rem; line-height: 1.7; color: var(--text-secondary); margin: 8px 0 12px; min-height: 3.4em; }
#toolChestSim .chest-card-footer { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: .72rem; color: var(--text-muted); }
#toolChestSim .chest-card-footer b { color: var(--price); font-family: var(--font-mono); font-size: .85rem; }
#toolChestSim .chest-card-footer small { font-size: .65rem; }
#toolChestSim .supply-detail { position: sticky; top: calc(var(--site-header-height, 80px) + 100px); scroll-margin-top: calc(var(--site-header-height, 80px) + 140px); }
#toolChestSim .supply-catalog { scroll-margin-top: calc(var(--site-header-height, 80px) + 140px); }
#toolChestSim .supply-change { display: none; }
#toolChestSim .supply-hero { text-align: center; }
#toolChestSim .supply-hero .game-eyebrow { text-align: left; }
#toolChestSim .supply-hero img { display: block; width: 100%; height: 172px; object-fit: contain; margin: 4px auto 16px; }
#toolChestSim .supply-hero h3 { font-size: 1.35rem; margin-bottom: 8px; }
#toolChestSim .supply-cost { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 16px; padding: 16px 0; border-top: 1px solid var(--arena-edge); border-bottom: 1px solid var(--arena-edge); font-size: .8rem; color: var(--text-secondary); }
#toolChestSim .supply-cost strong { color: var(--price); font: 700 1.3rem var(--font-mono); }
#toolChestSim .supply-cost small { font: 400 .75rem var(--font-sans, sans-serif); }
#toolChestSim #buyChestBtn { width: 100%; margin: 0; min-height: 46px; }
#toolChestSim .game-feedback { margin-top: 12px; color: var(--red); }
#toolChestSim .pool-heading { margin: 28px 0 16px; }
#toolChestSim .pool-section + .pool-section { margin-top: 20px; }
#toolChestSim .pool-section h5 { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: .8rem; margin-bottom: 12px; }
#toolChestSim .pool-section h5 span { color: var(--accent); font-weight: 400; }
#toolChestSim .pool-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--border-subtle); padding: 10px 0; font-size: .8rem; }
#toolChestSim .pool-item .pool-icon { color: var(--accent); font-size: 1.2rem; text-align: center; }
#toolChestSim .pool-item small { display: block; margin-top: 3px; color: var(--text-muted); font-size: .7rem; }
#toolChestSim .pool-item b { color: var(--accent); font-family: var(--font-mono); font-size: .8rem; }
#toolChestSim .pool-note { font-size: .7rem; margin-top: 10px; color: var(--text-muted); }
body .game-tool-modal .modal-card { background: var(--arena-panel); border-color: var(--arena-edge); border-radius: 20px; padding: 28px; width: min(760px, calc(100vw - 32px)); max-width: 760px; max-height: calc(100dvh - 48px); overflow-y: auto; }
.game-tool-modal .modal-header { margin-bottom: 24px; border-bottom: 1px solid var(--arena-edge); padding-bottom: 16px; }
.game-tool-modal .chest-opening-stage { text-align: center; padding: 20px 0; }
.game-tool-modal .chest-opening-stage img { width: min(240px, 100%); height: 190px; object-fit: contain; }
.game-tool-modal .chest-opening-stage.is-revealing img { animation: game-chest-reveal .6s ease-in-out alternate infinite; }
.game-tool-modal .chest-opening-stage button { margin-top: 16px; padding: 8px 18px; }
.game-tool-modal .reward-summary { margin-bottom: 20px; text-align: center; }
.game-tool-modal .reward-grid, .game-tool-modal .inventory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.game-tool-modal .reward-card { border: 1px solid var(--border); background: var(--surface-muted); border-radius: 14px; padding: 18px 14px; text-align: center; min-width: 0; }
.game-tool-modal .reward-card.is-rare { border-color: var(--accent-border); background: var(--accent-soft); }
.game-tool-modal .reward-icon { display: grid; place-items: center; height: 60px; font-size: 2rem; color: var(--accent); }
.game-tool-modal .reward-icon img { width: 100%; height: 60px; object-fit: contain; }
.game-tool-modal .reward-card h4 { font-size: .9rem; line-height: 1.5; margin: 10px 0; overflow-wrap: anywhere; }
.game-tool-modal .reward-card .reward-rarity { color: var(--text-secondary); font-size: .7rem; }
.game-tool-modal .reward-card.is-rare .reward-rarity { color: var(--accent); }
.game-tool-modal .reward-card strong { display: block; font: 700 1.2rem var(--font-mono); color: var(--price); margin-top: 12px; }
.game-tool-modal .reward-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.game-tool-modal .reward-footer button { padding: 10px 18px; width: auto; margin: 0; }
.game-tool-modal .inventory-summary { color: var(--text-secondary); font-size: .85rem; margin-bottom: 20px; }
.game-tool-modal .inventory-record { margin-top: 12px; text-align: left; border-top: 1px solid var(--border); padding-top: 12px; }
.game-tool-modal .inventory-record summary { color: var(--text-muted); font-size: .7rem; cursor: pointer; }
.game-tool-modal .inventory-record p { font-size: .7rem; margin-top: 8px; }
body #toolRandomTank .tank-picker { padding: 28px; }
#toolRandomTank .game-block-heading h3 { font-size: 1.45rem; margin: 0 0 4px; }
#toolRandomTank .tank-pool-count { flex-shrink: 0; border: 1px solid var(--border); border-radius: 24px; padding: 8px 12px; font-size: .75rem; }
#toolRandomTank .tank-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 12px; padding: 16px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: 12px; }
#toolRandomTank .tank-filters label { display: flex; flex-direction: column; min-width: 0; gap: 6px; font-size: .75rem; color: var(--text-secondary); }
#toolRandomTank .tank-filters select { height: 40px; width: 100%; font-size: .8rem; }
#toolRandomTank .tank-filters button { padding: 8px 14px; font-size: .75rem; }
#toolRandomTank .tank-reel-window { --reel-card-width: 180px; --reel-gap: 14px; position: relative; overflow: hidden; height: 210px; margin: 20px 0 12px; border: 1px solid var(--arena-edge); border-radius: 16px; background: var(--surface-inset); }
#toolRandomTank .tank-reel { position: absolute; left: 50%; top: 26px; display: flex; gap: var(--reel-gap); width: max-content; will-change: transform; }
#toolRandomTank .tank-reel-card { width: var(--reel-card-width); flex: 0 0 var(--reel-card-width); height: 158px; border: 1px solid var(--border); border-radius: 12px; background: var(--card-bg); padding: 12px; text-align: center; }
#toolRandomTank .tank-reel-card img { width: 100%; height: 88px; object-fit: contain; }
#toolRandomTank .tank-reel-card b { display: block; color: var(--text); font-size: .8rem; line-height: 1.5; margin-top: 4px; }
#toolRandomTank .tank-reel-card small { font-size: .65rem; color: var(--text-muted); }
#toolRandomTank .tank-reel-focus { position: absolute; width: calc(var(--reel-card-width) + 8px); height: 166px; top: 22px; left: 50%; transform: translateX(-50%); border: 2px solid var(--accent); border-radius: 14px; pointer-events: none; z-index: 2; }
#toolRandomTank .tank-reel-pointer { position: absolute; top: 7px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--accent); }
#toolRandomTank .tank-picker-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 16px 0 20px; }
#toolRandomTank .tank-picker-actions .submit-btn { width: auto; min-width: 170px; padding: 12px 20px; margin: 0; }
#toolRandomTank .tank-picker-actions > span { font-size: .75rem; color: var(--text-secondary); }
#toolRandomTank .tank-picker-actions > button:not(.submit-btn) { padding: 10px 16px; }
#toolRandomTank .tank-recommendation { background: var(--surface-muted); border: 1px solid var(--border); border-radius: 14px; min-height: 150px; }
#toolRandomTank .tank-result-placeholder { display: flex; align-items: center; gap: 24px; padding: 32px; min-height: 150px; }
#toolRandomTank .tank-result-placeholder > span { color: var(--accent); font-size: 3rem; }
#toolRandomTank .tank-result-placeholder h4 { font-size: 1rem; margin-bottom: 8px; }
#toolRandomTank .tank-result { display: grid; grid-template-columns: minmax(140px, .9fr) minmax(0, 1.1fr); align-items: center; gap: 20px; padding: 18px 28px; }
#toolRandomTank .tank-result img { width: 100%; height: 128px; object-fit: contain; }
#toolRandomTank .tank-result h4 { font-size: 1.6rem; color: var(--text); margin: 6px 0 12px; overflow-wrap: anywhere; }
#toolRandomTank .tank-result-tags { display: flex; flex-wrap: wrap; gap: 8px; }
#toolRandomTank .tank-result-tags span { padding: 5px 10px; background: var(--surface-inset); border: 1px solid var(--border); border-radius: 6px; color: var(--text-secondary); font-size: .72rem; }
#toolRandomTank .tank-result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
#toolRandomTank .tank-result-actions button { padding: 8px 14px; font-size: .75rem; }
#toolRandomTank .tank-source { margin-top: 16px; color: var(--text-muted); font-size: .65rem; }
#toolRandomTank .tank-source a { color: var(--text-secondary); }
@media (min-width: 901px) {
  #toolChestSim .chest-grid { max-height: 760px; overflow-y: auto; scrollbar-width: thin; padding: 2px 6px 2px 2px; }
  body #toolRandomTank .tank-picker { padding: 24px; }
  #toolRandomTank .game-block-heading { margin-bottom: 16px; }
  #toolRandomTank .tank-filters { padding: 12px; }
  #toolRandomTank .tank-reel-window { height: 190px; margin-top: 16px; }
  #toolRandomTank .tank-reel { top: 16px; }
  #toolRandomTank .tank-reel-focus { top: 12px; }
  #toolRandomTank .tank-reel-pointer { top: 1px; }
  #toolRandomTank .tank-picker-actions { margin: 12px 0 16px; }
  #toolRandomTank .tank-recommendation { min-height: 128px; }
  #toolRandomTank .tank-result { padding: 12px 24px; }
  #toolRandomTank .tank-result img { height: 104px; }
  #toolRandomTank .tank-source { margin-top: 12px; }
}
@keyframes game-chest-reveal { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-10px) rotate(3deg); } }
@media (max-width: 900px) {
  #toolChestSim .supply-layout { grid-template-columns: minmax(0, 1fr); }
  #toolChestSim .supply-detail { position: static; }
  #toolChestSim .supply-change { display: inline-flex; margin-bottom: 16px; padding: 8px 14px; }
  #toolChestSim .chest-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  body #toolChestSim .supply-account { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  #toolChestSim .supply-wallet { border: 0; border-top: 1px solid var(--arena-edge); padding: 16px 0 0; }
  #toolChestSim .supply-shortcuts { gap: 8px; }
  #toolChestSim .supply-shortcuts button { flex: 1; justify-content: center; gap: 8px; padding: 8px 10px; font-size: .8rem; }
  #toolChestSim .chest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body #toolChestSim .supply-catalog, body #toolChestSim .supply-detail, body #toolRandomTank .tank-picker { padding: 20px 16px; }
  #toolChestSim .supply-chest-card { padding: 10px; }
  #toolChestSim .supply-chest-card img { height: 100px; }
  #toolRandomTank .game-block-heading { align-items: start; flex-wrap: wrap; gap: 12px; }
  #toolRandomTank .tank-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  #toolRandomTank .tank-reel-window { --reel-card-width: 148px; --reel-gap: 12px; }
  #toolRandomTank .tank-picker-actions .submit-btn { flex: 1; }
  #toolRandomTank .tank-picker-actions > span { flex-basis: 100%; }
  #toolRandomTank .tank-result { grid-template-columns: minmax(0, 1fr); text-align: center; gap: 8px; padding: 20px; }
  #toolRandomTank .tank-result-tags { justify-content: center; }
  #toolRandomTank .tank-result-placeholder { padding: 24px 16px; gap: 16px; }
  #toolRandomTank .tank-result-placeholder > span { font-size: 2rem; }
  body .game-tool-modal .modal-card { padding: 20px 16px; }
  .game-tool-modal .reward-grid, .game-tool-modal .inventory-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .game-tool-modal .chest-opening-stage.is-revealing img { animation: none; }
}
