/* ==========================================================================
   Lucy & Friends · Master Stage Screens Stylesheet
   Approved Overlay Pattern: Integrated Header, Character Overhang & Modal
   ========================================================================== */

@import url('./tokens.css');

@font-face {
  font-family: 'DM Sans';
  src: url('./dm-sans.woff') format('woff');
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
}

/* Self-hosted, SIL OFL licensed (see ./courier-prime-OFL.txt) — matches the website and
   design-system, which already moved off the unlicensed-for-embedding system "Courier New"
   for exactly this reason. Font-family fallback keeps 'Courier New' after it only as a
   same-device visual backstop if this file somehow fails to load, not as the primary face. */
@font-face {
  font-family: 'Courier Prime';
  src: url('./courier-prime-bold.ttf') format('truetype');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --cream: #FFF7EB;
  --charcoal: #262523;
  --leaf: #A9C797;
  --pink: #ED8796;
  --sky: #79A9BE;
  --butter: #F4D889;
  --courier: 'Courier Prime', 'Courier New', Courier, monospace;
  --sans: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Base resets for screen overlay elements */
.stage-screen * {
  box-sizing: border-box;
}

/* ── INTEGRATED FULL-WIDTH TOP BAR ── */
.header-bar-integrated {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 38px;
  background: var(--cream);
  border-bottom: 2px solid var(--charcoal);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 50;
}

.header-bar-integrated .left-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-bar-integrated .logo-text {
  font-family: var(--courier);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.05em;
  color: var(--charcoal);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pixel-heart {
  width: 10px;
  height: 9px;
  background: var(--pink);
  display: inline-block;
  clip-path: polygon(0% 25%, 25% 0%, 50% 25%, 75% 0%, 100% 25%, 100% 60%, 50% 100%, 0% 60%);
}

.header-bar-integrated .slogan-text {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  color: #666;
  border-left: 1px solid #ccc;
  padding-left: 10px;
}

.header-audio-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.audio-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 5px;
  background: var(--cream);
  border: 1.5px solid var(--charcoal);
  box-shadow: 1.5px 1.5px 0 var(--charcoal);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--charcoal);
  transition: all 0.15s ease;
}

.audio-icon-btn svg {
  width: 14px;
  height: 14px;
}



.music-bar-box {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--cream);
  border: 1.5px solid var(--charcoal);
  border-radius: 5px;
  padding: 0 6px 0 4px;
  height: 28px;
  box-shadow: 1.5px 1.5px 0 var(--charcoal);
  transition: all 0.15s ease;
}



.music-mute-btn {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--charcoal);
  padding: 0;
  margin: 0;
  flex-shrink: 0;
}

.music-slider {
  width: 50px;
  height: 14px;
  accent-color: var(--charcoal);
  cursor: pointer;
}

/* ── BACKDROP DIMMER & OVERLAY CONTAINER ── */
.stage-screen.overlay,
.overlay {
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(24, 23, 22, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  z-index: 30;
}

.hidden,
[hidden],
.overlay.hidden,
.stage-screen.hidden {
  display: none !important;
}

/* ── UNIFIED MASTER MODAL FRAME ── */
.modal-frame {
  position: relative;
  width: 100%;
  max-width: 510px;
  min-height: 290px;
  height: auto;
  max-height: calc(100% - 20px);
  background: var(--cream);
  border: 2.5px solid var(--charcoal);
  border-radius: 14px;
  box-shadow: 6px 6px 0 var(--charcoal);
  padding: 15px 18px 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: auto;
}

/* Character Overhang */
.overhang-lucy {
  position: absolute;
  top: -25px;
  left: 0px;
  width: 78px;
  height: 78px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(3px 3px 0 var(--charcoal));
  z-index: 10;
}

/* In-Game Style Speech Bubble */
.bubble-style-ingame {
  position: absolute;
  top: -24px;
  left: 80px;
  background: #FFFAF1;
  border: 2px solid var(--charcoal);
  border-radius: 12px;
  padding: 4px 14px;
  font-family: var(--courier);
  font-weight: 700;
  font-size: 13px;
  color: var(--charcoal);
  box-shadow: 0 3px 0 rgba(38, 37, 35, 0.25);
  z-index: 12;
  white-space: nowrap;
}

.bubble-style-ingame::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 14px;
  width: 9px;
  height: 9px;
  background: #FFFAF1;
  border-right: 2px solid var(--charcoal);
  border-bottom: 2px solid var(--charcoal);
  transform: rotate(45deg);
}

/* World & Stage Butter Badge */
.overhang-badge {
  position: absolute;
  top: -14px;
  right: 18px;
  background: var(--butter);
  border: 2px solid var(--charcoal);
  border-radius: 20px;
  padding: 4px 14px;
  font-family: var(--courier);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.05em;
  box-shadow: 2.5px 2.5px 0 var(--charcoal);
  z-index: 10;
}

/* ── START SCREEN ELEMENTS ── */
.start-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1px;
  margin-left: 78px;
  margin-bottom: 8px;
  padding-bottom: 0;
}

.modal-title-start {
  font-family: var(--courier);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--charcoal);
}

.compact-chip-stage {
  background: #EAF3F7;
  border: 1.5px solid var(--sky);
  border-radius: 6px;
  padding: 3px 10px;
  font-family: var(--courier);
  font-weight: 700;
  font-size: 12px;
  color: var(--charcoal);
  box-shadow: 1.5px 1.5px 0 var(--charcoal);
  flex-shrink: 0;
}

/* Jump Guide Box */
.jump-guide-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #EAF3F7;
  border: 1.5px solid var(--sky);
  border-radius: 8px;
  padding: 6px 8px;
  margin-bottom: 12px;
}

.jump-guide-box svg {
  width: auto;
  height: 100% !important;
  background: #FFFDF9;
  border: 1px solid var(--sky);
  border-radius: 5px;
  display: block;
}

.modal-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.speed-pills-row {
  display: flex;
  align-items: center;
  gap: 3px;
}

.speed-pill-lbl {
  font-size: 10px;
  font-weight: 700;
  color: #666;
  margin-right: 2px;
}

.speed-btn-svg {
  min-width: 44px;
  height: 34px;
  border: 1.5px solid var(--leaf);
  background: var(--cream);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--charcoal);
}

.speed-btn-svg.active,
.speed-btn-svg:has(input:checked) {
  border: 2px solid var(--charcoal);
  background: var(--leaf);
  box-shadow: 2px 2px 0 var(--charcoal);
}

.speed-btn-svg svg {
  height: 18px;
  max-width: 32px;
}

.speed-btn-svg input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Primary Action Buttons */
.primary-action-btn,
button.primary {
  background: var(--pink);
  color: var(--charcoal);
  border: 2px solid var(--charcoal);
  border-radius: 6px;
  box-shadow: 3px 3px 0 var(--charcoal);
  padding: 9px 24px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.1s;
}

.primary-action-btn:active,
button.primary:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--charcoal);
}

/* ── VICTORY SCREEN ELEMENTS ── */
.victory-stars-inline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /*
  margin-left: 72px;
  margin-top: 1px;
  margin-bottom: 10px;
  */
  margin: 10px 0 10px 72px;
}

.modal-title-victory {
  font-family: var(--courier);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--charcoal);
  margin: 0;
}

.stars-with-comment {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grand-stars-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.star-badge {
  background: var(--leaf);
  border: 2px solid var(--charcoal);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-family: var(--courier);
  color: var(--charcoal);
  box-shadow: 1.5px 1.5px 0 var(--charcoal);
  transition: all 0.2s;
}

.star-badge.s1 {
  width: 30px;
  height: 30px;
  font-size: 17px;
}

.star-badge.s2 {
  width: 36px;
  height: 36px;
  font-size: 21px;
}

.star-badge.s3 {
  width: 42px;
  height: 42px;
  font-size: 26px;
  border-radius: 7px;
  box-shadow: 2px 2px 0 var(--charcoal);
}

.star-badge.locked {
  background: #E8E0D2 !important;
  border-color: #888;
  color: #999;
  box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.15);
  opacity: 0.65;
}

.stars-comment-pill {
  background: #EAF3F7;
  border: 1.5px solid var(--sky);
  border-radius: 14px;
  padding: 4px 11px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--charcoal);
  white-space: nowrap;
}

/* 3-Column Items Grid */
.victory-items-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  background: #EAF3F7;
  border: 1.5px solid var(--sky);
  border-radius: 9px;
  padding: 8px 10px;
  margin: 10px 0;
}

.item-card {
  background: #FFFDF9;
  border: 1.5px solid var(--charcoal);
  border-radius: 7px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 1px 1px 0 rgba(38, 37, 35, 0.08);
}

.item-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  background: #F5EAD4;
  border: 1.5px solid var(--charcoal);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.item-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.item-val {
  font-family: var(--courier);
  font-weight: 700;
  font-size: 15px;
  color: var(--charcoal);
}

.item-lbl {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.coin-dot {
  width: 16px;
  height: 16px;
  background: #e5a922;
  border: 1.5px solid var(--charcoal);
  border-radius: 50%;
  box-shadow: inset -1px -1px 0 #b37e09;
}

.cookie-shape {
  width: 18px;
  height: 15px;
  background: var(--butter);
  border: 1.5px solid var(--charcoal);
  border-radius: 4px;
}

.rare-bone-svg {
  fill: #FFD700;
  stroke: var(--charcoal);
  stroke-width: 1.5;
  width: 22px;
  height: 15px;
}

.victory-score-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFDF9;
  border: 1.5px solid var(--charcoal);
  padding: 7px 14px;
  border-radius: 7px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #555;
  margin: 10px 0;
}

.victory-score-strip strong {
  font-family: var(--courier);
  font-size: 18px;
  font-weight: 900;
  color: var(--charcoal);
}

.icon-map-btn,
.icon-replay-btn {
  background: var(--cream);
  color: var(--charcoal);
  border: 2px solid var(--charcoal);
  border-radius: 6px;
  box-shadow: 2px 2px 0 var(--charcoal);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.1s;
}

.icon-map-btn:active,
.icon-replay-btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--charcoal);
}
/* Capability-aware screen refinement, 19 September 2026. */
.header-bar-integrated { height:56px; padding:0 12px; }
.header-audio-group { gap:8px; }
.audio-icon-btn,.music-mute-btn { width:44px; height:44px; }
.music-bar-box { height:44px; gap:0; padding:0 6px 0 0; }
.music-slider { height:44px; width:64px; margin:0; }
.audio-icon-btn.muted,.music-bar-box.muted { opacity:1; }

.stage-screen.overlay,.overlay { top:56px; overflow:auto; padding:42px 20px 20px; }
.modal-frame { max-width:620px; min-height:0; max-height:none; flex-shrink:0; gap:10px; }
.overhang-badge { top:12px; right:14px; }
.start-top-row,.victory-stars-inline-bar { margin:30px 0 0 64px; gap:12px; flex-wrap:wrap; }
.modal-title-start,.modal-title-victory { font-size:24px; margin:0; }
.bubble-style-ingame { max-width:calc(100% - 92px); white-space:normal; }
.speed-btn-svg { height:44px; }
.speed-pills-row { gap:8px; }
.primary-action-btn,.icon-map-btn,.icon-replay-btn { min-height:44px; font-size:16px; }
.modal-bottom-row { flex-wrap:wrap; gap:12px; }
.jump-guide-box { margin:0; }
.victory-items-grid { background:transparent; border:0; padding:0; margin:0; gap:12px; }
.item-card { flex-direction:column; text-align:center; gap:6px; padding:10px 6px; }
.item-icon-box { width:52px; height:52px; border:0; background:transparent; }
.reward-art { width:52px; height:52px; object-fit:contain; image-rendering:pixelated; }
.item-meta { gap:4px; }
.item-val { font-size:22px; }
.item-total { font-size:16px; color:var(--charcoal); }
.item-lbl { font-size:14px; color:var(--charcoal); text-transform:none; letter-spacing:0; }
.item-detail { font:500 12px/1.3 var(--sans); color:var(--charcoal); }
.rare-card { background:var(--cream); border-style:dashed; }
.rare-card.collected { background:#fff0c4; border-style:solid; }
.victory-score-strip { margin:0; }
.navigation-note { margin:0; font:500 12px/1.4 var(--sans); }
.stage-screen :is(button,input):focus-visible,.header-bar-integrated :is(button,input):focus-visible,
.speed-btn-svg:has(input:focus-visible) { outline:3px solid var(--charcoal); outline-offset:3px; box-shadow:0 0 0 3px var(--cream); }
.stage-screen :is(h2,span,p) { user-select:text; }
.shell:not(.playing) .hud { visibility:hidden; }
.hud { top:64px; }
.rotate-nudge-dismiss { min-height:44px; }
@media(max-width:600px) {
  .header-bar-integrated .logo-text { font-size:11px; letter-spacing:0; }
  .header-bar-integrated { padding:0 6px; }
  .music-slider { width:44px; }
  .stage-screen.overlay:not(#pauseScreen) { position:relative; inset:auto; margin-top:56px; min-height:470px; padding:40px 12px 16px; }
  .game-wrap:has(:is(#startScreen,#endScreen):not(.hidden)) > canvas { position:absolute; inset:0; height:100%; object-fit:cover; }
  .game-wrap:has(:is(#startScreen,#endScreen):not(.hidden)) { min-height:540px; }
  .modal-frame { padding:14px 12px; }
  .start-top-row,.victory-stars-inline-bar { margin:34px 0 0; }
  .modal-title-start,.modal-title-victory { font-size:22px; }
  .overhang-badge { font-size:10px; right:10px; padding:4px 8px; }
  .victory-items-grid { gap:6px; }
  .item-detail { font-size:12px; }
  .item-val { font-size:20px; }
  .item-total { font-size:14px; }
}
@media(max-height:520px) and (orientation:landscape) {
  .game-wrap:has(:is(#startScreen,#endScreen):not(.hidden)) { width:min(960px,100vw - 8px); height:calc(100svh - 8px); max-height:none; }
  .stage-screen.overlay { position:absolute; top:56px; margin:0; min-height:0; padding:34px 16px 16px; }
  .modal-frame { margin:auto; }
  .jump-guide-box svg { height:80px; }
}
@media(prefers-reduced-motion:reduce) {
  .stage-screen *, .header-bar-integrated * { transition:none; }
  .overlay { backdrop-filter:none; }
}
.icon-replay-btn.primary-action-btn { background:var(--pink); }
@media(max-height:520px) and (orientation:landscape) {
  .modal-frame { gap:6px; padding:10px 12px; }
  .start-top-row,.victory-stars-inline-bar { margin:24px 0 0 66px; flex-wrap:nowrap; }
  .modal-title-start,.modal-title-victory { font-size:20px; }
  .stars-with-comment { gap:4px; }
  .stars-comment-pill { padding:4px 6px; }
  .item-card { flex-direction:row; text-align:left; padding:6px; gap:4px; }
  .item-icon-box,.reward-art { width:36px; height:36px; }
  .item-val { font-size:18px; }
  .item-lbl { font-size:12px; }
  .item-detail { font-size:11px; }
  .victory-score-strip { padding:4px 10px; }
  .navigation-note { font-size:11px; }
}
/* Orientation advice belongs to entry, never covers results after a rotation. */
.shell:has(#startScreen.hidden) .rotate-nudge { display:none; }
@media(max-width:600px) and (orientation:portrait) {
  .overhang-badge { top:26px; }
  .start-top-row,.victory-stars-inline-bar { margin-top:46px; }
}

/* Approved Pixel Lucy wordmark and readable Courier slogan. */
.header-bar-integrated .stage-brand-logo { width:160px; height:auto; display:block; flex-shrink:0; }
.header-bar-integrated .slogan-text { font-family:var(--courier); font-size:14px; font-weight:700; color:var(--charcoal); white-space:nowrap; }
@media(max-width:760px) {
  .header-bar-integrated .stage-brand-logo { width:140px; }
}

/* Keep the approved slogan visible; stack it on narrow layouts. */
.header-bar-integrated .left-logo { min-width:0; }
.header-bar-integrated .slogan-text { display:block; }
.header-audio-group { flex-shrink:0; }
@media(max-width:600px) {
  .header-bar-integrated .left-logo { flex-direction:column; align-items:flex-start; gap:0; width:140px; }
  .header-bar-integrated .slogan-text { width:140px; padding:0; border:0; white-space:normal; font-size:12px; line-height:1.05; }
  .header-bar-integrated .stage-brand-logo { width:130px; }
}

@media(max-width:600px) {
  .header-bar-integrated .slogan-text span { display:block; white-space:nowrap; }
}

/* Landscape phone menus use the available browser height, with safe overflow. */
@media(max-height:520px) and (orientation:landscape) {
  .game-wrap,.game-wrap:has(:is(#startScreen,#endScreen):not(.hidden)) {
    width:min(100%,calc((100svh - 8px) * 16 / 9));
    height:calc(100svh - 8px); min-height:0; max-height:none; margin:auto;
  }
  .game-wrap > canvas { width:100%; height:100%; }
  .header-bar-integrated { height:28px; padding:0 8px; }
  .header-bar-integrated .stage-brand-logo { width:118px; }
  .header-bar-integrated .left-logo { flex-direction:row; align-items:center; gap:10px; width:auto; }
  .header-bar-integrated .slogan-text { font-size:12px; width:auto; white-space:nowrap; }
  .header-bar-integrated .slogan-text span { display:inline; }
  .header-audio-group { gap:2px; }
  .header-audio-group .audio-icon-btn,
  .header-audio-group .music-bar-box { border:0; box-shadow:none; background:transparent; }
  .header-audio-group .music-bar-box { height:28px; gap:0; padding:0; }
  .header-audio-group :is(.audio-icon-btn,.music-mute-btn,.music-slider) { height:28px; }
  .header-audio-group .music-slider { width:44px; }
  .overlay { top:28px; }
  .hud { top:36px; }
  .game-wrap:has(:is(#startScreen,#endScreen):not(.hidden)) > canvas {
    position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
  }
  .stage-screen.overlay { top:28px; align-items:flex-start; padding:28px 12px 10px; }
  .stage-screen .modal-frame { margin:auto; max-width:560px; }
  .stage-screen .overhang-badge { position:static; align-self:flex-end; width:max-content; max-width:100%; font-size:10px; padding:3px 8px; }
  #startScreen .modal-frame { display:grid; grid-template-columns:minmax(0,1fr); gap:6px; }
  #startScreen .overhang-badge { grid-column:1; grid-row:1; justify-self:end; }
  #startScreen .start-top-row { grid-column:1; grid-row:2; margin:0 0 0 56px; gap:12px; }
  #startScreen .modal-title-start { font-size:16px; }
  #startScreen .jump-guide-box,#startScreen .modal-bottom-row { grid-column:1 / -1; }
  .stage-screen .jump-guide-box svg { height:56px; }
  #endScreen .victory-stars-inline-bar { margin:0 0 0 66px; }
  .stage-screen .overhang-lucy { width:64px; height:64px; }
  .stage-screen .bubble-style-ingame { left:66px; font-size:12px; }
}

/* Pausing preserves the gameplay frame and canvas dimensions. */
#pauseScreen.overlay { position:absolute; margin:0; min-height:0; padding:12px; align-items:center; }
#pauseScreen .modal-frame { width:min(340px,100%); margin:auto; }

/* Matching glyphs and explicit mute marks, without disabled styling. */
.header-audio-group .audio-glyph { width:22px; height:20px; display:block; }
.header-audio-group .mute-mark { display:none; }
.header-audio-group .muted .mute-mark { display:block; }
.header-audio-group .muted .sound-wave { display:none; }

/* Explicit guide sizes on phones avoid percentage-height SVG sizing cycles. */
@media (pointer:coarse), (max-width:760px) {
  .jump-guide-box { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .jump-guide-box svg { width:100%; min-width:0; height:115px !important; }
}
@media (max-height:520px) and (orientation:landscape) {
  .stage-screen .jump-guide-box { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .stage-screen .jump-guide-box svg { width:100%; min-width:0; height:90px !important; }
}

@media (max-height:340px) and (orientation:landscape) {
  .stage-screen .jump-guide-box svg { height:76px !important; }
  #startScreen .modal-frame { gap:4px; padding:8px 10px; }
}

/* Fixed-width translucent collection tiles; digits never change the layout. */
.hud .hud-box {
  display:flex; flex-direction:column; align-items:stretch; gap:5px;
  flex:0 0 88px; width:88px; min-width:88px; max-width:88px;
  padding:0; background:none; border:0; box-shadow:none;
  font:700 11px/18px var(--courier); font-variant-numeric:tabular-nums;
}
.hud-box .hearts,.hud-box .stat {
  display:flex; align-items:center; justify-content:center; gap:3px;
  box-sizing:border-box; width:100%; min-width:0; height:23px;
  padding:2px 4px; white-space:nowrap;
  background:rgba(255,247,235,.78); border:1px solid rgba(255,247,235,.4);
  border-radius:4px; box-shadow:none;
}
.hud-box .hearts { font-size:14px; letter-spacing:2px; line-height:18px; }
.hud-box .stat { justify-content:flex-start; }
.hud-box .stat-name { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.hud-box .stat::before { display:none; }
.hud-box .stat-total { font-size:10px; }
.hud-box .score-stat { font-size:11px; gap:4px; }
.hud-box .score-label { font-size:9px; font-weight:700; }
.hud-box .hud-collectible { flex:0 0 17px; width:17px; height:17px; object-fit:contain; image-rendering:pixelated; }

/* Symbols/labels stay left; the complete quantity stays right. */
.hud-box .stat-value { margin-left:auto; display:flex; align-items:baseline; justify-content:flex-end; gap:0; text-align:right; }

/* The rare item sits beside the hearts, without another tile or visible count. */
.hud .hud-box { position:relative; }
.hud-rare-indicator { position:absolute; left:94px; top:0; width:26px; height:23px; display:flex; align-items:center; justify-content:center; }
.hud-rare-indicator img { width:26px; height:23px; object-fit:contain; image-rendering:pixelated; opacity:.3; filter:grayscale(1); }
.hud-rare-indicator.collected img { opacity:1; filter:drop-shadow(0 0 2px #fff7eb); }

/* High-resolution coin needs filtered reduction; other pixel artwork stays crisp. */
img[src$="paw-coin-approved.png"] { image-rendering:auto !important; }
