/* Pixel item art is always sampled with nearest-neighbor scaling. */
.pixel-icon { display: block; flex: none; width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; }
.shard-wallet { position: absolute; z-index: 4; right: 27px; top: 106px; display: flex; align-items: center; gap: 7px; padding: 5px 10px 5px 6px; border: 1px solid #e5bd6755; border-radius: 5px; background: #0b0c0eea; color: #f0d494; font: 9px 'Space Grotesk', sans-serif; letter-spacing: .4px; pointer-events: none; }
.shard-wallet b { font-size: 13px; font-weight: 500; }
.shard-wallet .pixel-icon { width: 32px; height: 32px; }
.hearts { display: inline-flex; align-items: center; gap: 2px; }
.hearts .pixel-icon { width: 20px; height: 20px; }
.hearts .pixel-icon.empty { filter: grayscale(1); opacity: .35; }
.heart-total { display: flex; align-items: center; gap: 5px; color: #f0bd76; font: 12px 'Space Grotesk', sans-serif; font-variant-numeric: tabular-nums; }
.heart-total small { color: #8f9888; font-size: 9px; }
.powerup-hud { position: absolute; z-index: 4; top: 155px; left: 27px; display: flex; gap: 6px; max-width: calc(100% - 54px); pointer-events: none; }
.powerup-status { --power-color: #76dce9; position: relative; display: flex; align-items: center; gap: 7px; width: 125px; min-height: 52px; padding: 7px 8px 10px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--power-color) 45%, transparent); border-radius: 5px; background: #0b0c0eea; color: var(--power-color); }
.powerup-cloak { --power-color: #bd98ff; }
.powerup-frenzy { --power-color: #f6bf5c; }
.powerup-shield { --power-color: #d9e5ef; }
.powerup-status-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.powerup-name { color: #cdd1c7; font: 7px 'Space Grotesk', sans-serif; line-height: 1.3; text-transform: uppercase; letter-spacing: .3px; }
.powerup-time { font: 10px 'Space Grotesk', sans-serif; font-variant-numeric: tabular-nums; }
.powerup-timer { position: absolute; height: 3px; bottom: 0; left: 0; right: 0; background: #343c34; }
.powerup-timer i { display: block; width: 100%; height: 100%; background: var(--power-color); transform-origin: left; transition: transform .1s linear; }
.powerup-status.expiring { animation: power-expiring .6s ease-in-out infinite alternate; }
@keyframes power-expiring { to { border-color: var(--power-color); box-shadow: inset 0 0 12px color-mix(in srgb, var(--power-color) 20%, transparent); } }

.shop-dialog { background: #030405dc; backdrop-filter: blur(7px); padding: 12px; }
.shop-dialog .modal-card { width: min(950px, 100%); max-height: 100%; display: flex; flex-direction: column; padding: 26px 28px 20px; text-align: left; overflow: hidden; border: 1px solid #77603a; border-radius: 9px; background: radial-gradient(ellipse at top right, #32241555, transparent 60%), #0b0c0e; box-shadow: 0 20px 100px #000b; }
.shop-dialog .modal-close { top: 10px; right: 13px; width: 44px; height: 44px; touch-action: manipulation; border: 1px solid #75634755; border-radius: 5px; color: #e3c491; }
.shop-dialog .modal-symbol { position: absolute; right: 66px; top: 13px; margin: 0; opacity: .75; }
.shop-dialog .modal-symbol .pixel-icon { width: 32px; height: 32px; }
.shop-dialog .eyebrow { justify-content: flex-start; margin: 0 0 10px; color: #f59e0b; font-size: 8px; letter-spacing: 1.7px; }
.shop-dialog .modal-card h2 { margin: 0 0 9px; color: #f3eddf; font-size: 32px; }
.shop-dialog .modal-copy { margin: 0 0 17px; font-size: 11px; color: #969d96; }
.shop-dialog #modal-extra { min-height: 0; overflow: auto; padding: 1px 5px 1px 1px; scrollbar-width: thin; scrollbar-color: #6a5736 #151719; overscroll-behavior: contain; }
.shop-dialog .modal-card .result-actions > .play-button { flex: none; align-self: flex-end; width: 270px; min-height: 45px; margin-top: 15px; padding: 13px 16px; background: #f59e0b; color: #1c180f; border-color: #fbc366; font-size: 9px; letter-spacing: 1px; }
.shop-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; padding: 10px 13px; border: 1px solid #514022; background: linear-gradient(100deg, #261e12, #111315); border-radius: 5px; }
.shop-wallet { display: flex; align-items: center; gap: 10px; }
.shop-wallet .pixel-icon { width: 64px; height: 64px; margin: -8px 0; }
.shop-wallet > div { display: flex; flex-direction: column; gap: 3px; }
.shop-wallet span { color: #a09c8e; font-size: 9px; letter-spacing: .6px; text-transform: uppercase; }
.shop-wallet strong { color: #f7c36f; font: 23px 'Space Grotesk', sans-serif; font-variant-numeric: tabular-nums; }
.shop-night { display: flex; flex-direction: column; gap: 5px; color: #e9d5b5; font: 10px 'Space Grotesk', sans-serif; letter-spacing: 1px; text-align: right; }
.shop-night small { color: #7d827b; font-size: 7px; letter-spacing: 1.5px; }
.upgrade-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.upgrade-card { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-width: 0; padding: 13px; border: 1px solid #363b38; border-radius: 6px; background: linear-gradient(135deg, #1a1c1b, #101214); transition: border-color .2s, background .2s; }
.upgrade-card:hover { border-color: #6e5933; background: linear-gradient(135deg, #211e18, #111315); }
.upgrade-card.is-featured { border-color: #c38a2d; background: linear-gradient(125deg, #39291244, #151513); box-shadow: inset 0 0 24px #e2a43a0d; }
.upgrade-card.is-featured .shop-icon-slot { border-color: #c38a2d; }
.campfire-deal { display: inline-block; margin-top: 6px; padding: 3px 5px; border: 1px solid #bf81295c; background: #68431733; color: #f4c875; font: 7px 'Space Grotesk', sans-serif; letter-spacing: .8px; }
.shop-buy s { color: #9b8c72; font-size: 8px; font-weight: 400; text-decoration-color: #c47d4d; }
.shop-icon-slot { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid #675333; border-radius: 4px; background: #050708; box-shadow: inset 0 0 0 2px #171b1a, inset 0 -10px 25px #f59e0b09; }
.shop-icon-slot .pixel-icon { width: 64px; height: 64px; }
.upgrade-details { min-width: 0; }
.upgrade-heading { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.upgrade-heading h3 { margin: 0; color: #eee7d6; font: 15px Georgia, serif; }
.upgrade-level { display: flex; align-items: center; gap: 7px; margin-top: 7px; color: #8f978e; font: 8px 'Space Grotesk', sans-serif; }
.level-pips { display: flex; align-items: center; gap: 3px; }
.level-pips i { width: 5px; height: 5px; border: 1px solid #77735d; background: #0b0c0e; }
.level-pips i.filled { background: #f59e0b; border-color: #fbd18a; box-shadow: 0 0 5px #f59e0b44; }
.upgrade-details p { margin: 8px 0; color: #949c93; font-size: 9px; line-height: 1.5; }
.upgrade-stat { color: #c6d0b7; font-size: 9px; line-height: 1.5; }
.shop-buy { touch-action: manipulation; align-self: end; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; width: 58px; min-height: 78px; padding: 5px; border: 1px solid #a66a14; border-radius: 4px; background: #33250f; color: #f8c575; font: 12px 'Space Grotesk', sans-serif; font-variant-numeric: tabular-nums; transition: background .2s, border-color .2s, transform .2s; }
.shop-buy:hover:not(:disabled) { background: #634419; border-color: #f59e0b; transform: translateY(-1px); color: #ffe5bb; }
.shop-buy small { margin-top: 4px; font-size: 7px; letter-spacing: 1px; color: #cfab73; }
.shop-buy:disabled { opacity: .4; background: #191c1b; border-color: #55584c; cursor: not-allowed; }
.is-maxed .shop-buy { width: 58px; min-height: 44px; font-size: 8px; opacity: .65; }
.is-maxed .shop-icon-slot { border-color: #6b674a; }
.maxed-badge { padding: 3px 4px; border: 1px solid #9c7c344d; color: #dfbd76; background: #51401a22; font: 6px 'Space Grotesk', sans-serif; letter-spacing: 1px; }
.just-purchased { animation: purchase-flash .6s ease-out; }
@keyframes purchase-flash { 0% { border-color: #ffe4a6; background: #71501d; transform: scale(.97); box-shadow: 0 0 20px #f59e0b55; } 45% { transform: scale(1.015); } 100% { transform: scale(1); } }
.shop-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.coat-choices { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.coat-choices > span { margin-right: 3px; color: #8c938b; font-size: 9px; }
.coat-choice { min-width: 44px; min-height: 44px; touch-action: manipulation; padding: 7px 9px; border: 1px solid #3c413c; border-radius: 4px; background: #111315; color: #9ca599; font-size: 8px; }
.coat-choice.equipped { border-color: #b7832d; color: #efc87e; background: #5e431f33; }
.shop-reroll { touch-action: manipulation; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 3px 10px; border: 1px solid #6e5935; border-radius: 4px; background: #191a18; color: #c4b38f; font-size: 9px; }
.shop-reroll:disabled { opacity: .4; cursor: not-allowed; }
.shop-reroll b { color: #f3c577; font: 11px 'Space Grotesk', sans-serif; }
.shop-note { color: #7b847a; font-size: 9px; line-height: 1.6; margin: 13px 0 0; }
@media (max-width: 900px) { .upgrade-card { grid-template-columns: 64px minmax(0, 1fr); } .shop-buy { grid-column: 2; flex-direction: row; gap: 5px; min-height: 44px; width: 100%; align-self: center; } .shop-buy small { margin: 0 0 0 4px; } .is-maxed .shop-buy { width: 100%; min-height: 44px; } .shop-icon-slot { align-self: start; } }
@media (max-width: 700px) {
  .shard-wallet { top: 185px; right: 14px; padding: 2px 7px 2px 3px; font-size: 7px; }
  .shard-wallet b { font-size: 11px; }
  .powerup-hud { top: 130px; left: 13px; right: 13px; max-width: none; gap: 4px; }
  .powerup-status { flex: 1; width: 0; min-width: 0; min-height: 52px; flex-direction: column; gap: 2px; padding: 2px 3px 8px; }
  .powerup-status-copy { gap: 0; text-align: center; }
  .powerup-name { display: none; }
  .powerup-time { font-size: 8px; }
  .has-powers .best-score { opacity: 0; }
  .shop-dialog { padding: 8px; }
  .shop-dialog .modal-card { padding: 23px 14px 14px; }
  .shop-dialog .modal-card h2 { font-size: 28px; padding-right: 44px; }
  .shop-dialog .modal-copy { font-size: 10px; line-height: 1.6; margin-bottom: 12px; }
  .shop-dialog .eyebrow { font-size: 6px; letter-spacing: 1px; padding-right: 44px; }
  .shop-dialog .modal-symbol { display: none; }
  .shop-dialog .modal-card .result-actions > .play-button { width: 100%; min-height: 44px; margin-top: 12px; }
  .upgrade-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .upgrade-card { grid-template-columns: 64px minmax(0, 1fr) 58px; gap: 10px; padding: 11px 9px; }
  .shop-buy { grid-column: auto; flex-direction: column; min-height: 75px; width: 58px; }
  .shop-buy small { margin: 4px 0 0; }
  .is-maxed .shop-buy { width: 58px; min-height: 44px; }
  .shop-night small { display: none; }
  .shop-wallet strong { font-size: 21px; }
  .shop-wallet span { font-size: 8px; }
}
@media (max-width: 360px) { .upgrade-card { grid-template-columns: 64px minmax(0, 1fr); } .shop-buy { grid-column: 2; width: 100%; flex-direction: row; gap: 5px; min-height: 44px; } .is-maxed .shop-buy { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .just-purchased, .powerup-status.expiring { animation: none; } .powerup-timer i { transition: none; } }

/* The same action nodes serve compact dialogs and the mission-clear choice. */
.result-actions { display: contents; }
.result-dialog { padding: 12px; background: #040706d9; }
.result-dialog .modal-card { width: min(700px, 100%); max-height: 100%; padding: 28px; border-color: #96703888; background: radial-gradient(ellipse at 50% 0, #49331a55, transparent 65%), #0b0c0e; }
.result-dialog .modal-symbol { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 15px; border: 1px solid #f1bb5b66; border-radius: 50%; background: #f59e0b0d; box-shadow: 0 0 30px #eab15912; }
.result-dialog .modal-symbol .pixel-icon { width: 64px; height: 64px; }
.result-dialog .eyebrow { color: #f0b653; margin-bottom: 10px; }
.result-dialog .modal-card h2 { font-size: 36px; margin-bottom: 12px; }
.result-dialog .modal-copy { max-width: 430px; margin: 0 auto 22px; color: #a9b0a3; font-size: 11px; line-height: 1.7; }
.clear-summary { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; padding: 17px 4px; border-top: 1px solid #cfb77b26; border-bottom: 1px solid #cfb77b26; }
.clear-summary > div { display: flex; flex-direction: column; gap: 8px; border-right: 1px solid #cfb77b26; }
.clear-summary > div:last-child { border: 0; }
.clear-summary b { color: #f2e8cc; font: 27px 'Space Grotesk', sans-serif; font-variant-numeric: tabular-nums; }
.clear-summary span { color: #8b9685; font: 7px 'Space Grotesk', sans-serif; letter-spacing: 1.2px; }
.clear-rewards { display: flex; align-items: center; justify-content: space-between; gap: 18px; text-align: left; padding: 14px; background: #201b1280; border: 1px solid #795b2b55; border-radius: 5px; }
.clear-wallet { display: flex; align-items: center; gap: 9px; }
.clear-wallet > .pixel-icon { width: 64px; height: 64px; }
.clear-wallet > span { display: flex; flex-direction: column; gap: 6px; }
.clear-wallet small { color: #a89a7b; font: 7px 'Space Grotesk', sans-serif; letter-spacing: 1px; }
.clear-wallet strong { color: #f4c46d; font: 26px 'Space Grotesk', sans-serif; font-variant-numeric: tabular-nums; }
.clear-wallet strong > span { color: #c6bca5; font-size: 10px; }
.clear-reward-lines { display: flex; flex-direction: column; gap: 5px; color: #9da894; font-size: 9px; }
.clear-reward-lines > span { display: flex; align-items: center; justify-content: flex-end; gap: 5px; min-height: 20px; }
.clear-reward-lines b { color: #e7d9b7; min-width: 25px; font: 10px 'Space Grotesk', sans-serif; text-align: right; }
.clear-reward-lines .pixel-icon { width: 20px; height: 20px; margin-left: auto; }
.next-night-preview { padding: 16px 8px 17px; text-align: left; }
.next-night-preview > span { color: #d0b681; font: 7px 'Space Grotesk', sans-serif; letter-spacing: 1px; }
.next-night-preview > p { margin: 7px 0 0; color: #8d9a85; font-size: 10px; line-height: 1.6; }
.result-dialog .result-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.result-dialog .result-actions > button { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 76px; margin: 0; padding: 12px; border: 1px solid #dc9d35; border-radius: 5px; text-align: left; touch-action: manipulation; }
.result-dialog .result-actions > button > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 7px; }
.result-dialog .result-actions b { font: 600 9px 'Space Grotesk', sans-serif; letter-spacing: 1px; }
.result-dialog .result-actions small { font: 8px/1.5 'DM Sans', sans-serif; letter-spacing: 0; opacity: .75; }
.result-action-icon { display: grid; place-items: center; width: 36px; height: 40px; flex: none; }
.result-dialog #modal-secondary { background: #392a1555; color: #f0c879; box-shadow: inset 0 0 0 1px #f59e0b0d; }
.result-dialog #modal-secondary:hover { background: #63441988; color: #ffe5bb; transform: translateY(-2px); }

.pack-complete-notice { position: absolute; top: 26%; left: 50%; z-index: 9; transform: translateX(-50%); display: flex; align-items: center; gap: 13px; width: min(530px, calc(100% - 32px)); padding: 16px 12px 16px 16px; overflow: hidden; border: 1px solid #e7b754b0; border-radius: 6px; background: linear-gradient(115deg, #282414f5, #0d1813f5); box-shadow: 0 10px 40px #0006, inset 0 0 24px #f59e0b08; pointer-events: none; }
.pack-notice-icon { display: grid; place-items: center; flex: none; width: 48px; height: 48px; border: 1px solid #b58d3c66; border-radius: 4px; background: #0a120d; }
.pack-notice-copy { flex: 1; min-width: 0; }
.pack-notice-eyebrow { color: #c2a464; font: 6px 'Space Grotesk', sans-serif; letter-spacing: 1.5px; }
.pack-notice-copy h2 { margin: 6px 0 7px; color: #ffe3a0; font: 600 18px 'Space Grotesk', sans-serif; letter-spacing: 1px; }
.pack-notice-copy p { margin: 0; color: #bdc8aa; font-size: 10px; line-height: 1.6; }
.pack-notice-dismiss { align-self: flex-start; display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 4px; background: transparent; color: #c5b386; font-size: 22px; pointer-events: auto; touch-action: manipulation; }
.pack-notice-dismiss:hover { background: #f59e0b15; }
.pack-notice-duration { position: absolute; bottom: 0; left: 0; height: 2px; width: 100%; background: #e5b453; transform-origin: left; }
.pack-complete-notice.announcing { animation: pack-notice-enter .25s ease-out; }
.pack-complete-notice.announcing .pack-notice-duration { animation: pack-notice-time 4.2s linear forwards; }
.objective.pack-ready { border-color: #e0b15a88; background: #252714ee; box-shadow: 0 0 22px #f59e0b12; }
.objective.pack-ready .objective-label { color: #ffe0a0; }
@keyframes pack-notice-enter { from { opacity: 0; margin-top: -8px; } to { opacity: 1; margin-top: 0; } }
@keyframes pack-notice-time { to { transform: scaleX(0); } }
@media (max-width: 700px) {
  .result-dialog { padding: 8px; }
  .result-dialog .modal-card { padding: 20px 16px 16px; }
  .result-dialog .modal-symbol { width: 48px; height: 48px; margin-bottom: 11px; }
  .result-dialog .modal-symbol .pixel-icon { width: 32px; height: 32px; }
  .result-dialog .modal-card h2 { font-size: 29px; }
  .result-dialog .modal-copy { font-size: 10px; margin-bottom: 14px; }
  .clear-summary { margin-bottom: 12px; padding: 13px 0; }
  .clear-summary b { font-size: 22px; }
  .clear-summary span { font-size: 6px; letter-spacing: .7px; }
  .clear-rewards { flex-direction: column; align-items: stretch; gap: 8px; padding: 9px 12px; }
  .clear-wallet { justify-content: center; }
  .clear-wallet > .pixel-icon { width: 32px; height: 32px; }
  .clear-wallet strong { font-size: 23px; }
  .clear-reward-lines > span { justify-content: space-between; }
  .clear-reward-lines .pixel-icon { margin-left: auto; }
  .next-night-preview { padding: 12px 3px; }
  .result-dialog .result-actions { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .result-dialog .result-actions > button { min-height: 66px; padding: 10px 12px; }
  .pack-complete-notice { top: 26%; width: calc(100% - 26px); gap: 9px; padding: 11px 6px 13px 11px; }
  .pack-notice-icon { width: 36px; height: 42px; }
  .pack-notice-copy h2 { font-size: 14px; letter-spacing: .7px; }
  .pack-notice-copy p { font-size: 9px; }
  .pack-notice-eyebrow { font-size: 5px; letter-spacing: .9px; }
}
@media (prefers-reduced-motion: reduce) { .pack-complete-notice.announcing { animation: none; } }
@media (max-height: 540px) and (min-width: 701px) {
  .result-dialog .modal-card { padding: 15px 20px; }
  .result-dialog .modal-symbol, .result-dialog .modal-copy { display: none; }
  .result-dialog .eyebrow { margin-bottom: 7px; font-size: 7px; }
  .result-dialog .modal-card h2 { margin-bottom: 8px; font-size: 25px; }
  .clear-summary { margin-bottom: 8px; padding: 9px 0; }
  .clear-summary > div { gap: 4px; }
  .clear-summary b { font-size: 20px; }
  .clear-summary span { font-size: 6px; }
  .clear-rewards { padding: 6px 12px; }
  .clear-wallet > .pixel-icon { width: 32px; height: 32px; }
  .clear-wallet strong { font-size: 22px; }
  .clear-reward-lines { gap: 1px; }
  .clear-reward-lines > span { min-height: 18px; font-size: 8px; }
  .next-night-preview { padding: 8px 3px; }
  .next-night-preview > p { margin-top: 4px; font-size: 9px; }
  .result-dialog .result-actions > button { min-height: 57px; padding: 8px 12px; }
  .result-dialog .result-actions > button > span:nth-child(2) { gap: 4px; }
}
.result-dialog #modal-action { background: #392a1555; color: #f0c879; border-color: #dc9d35; box-shadow: inset 0 0 0 1px #f59e0b0d; }
.result-dialog #modal-action:hover { background: #63441988; color: #ffe5bb; }
.result-dialog #modal-secondary { background: #f59e0b; border-color: #ffd07c; color: #1f2418; box-shadow: 0 5px 30px #db8c072b; }
.result-dialog #modal-secondary:hover { background: #ffc367; color: #182116; }
.result-dialog .result-actions b { font-size: 11px; }
.result-dialog .result-actions small { font-size: 9px; }
@media (max-width: 700px) { .result-dialog .result-actions b { font-size: 10px; } }
