/* V64.28 — reference HUD hierarchy, using the existing live game controls.
   Preserve approved action gradients, red fill, character assets and rules. */
.reference-game {
  --game-number-size: 44px;
  --game-status-height: 74px;
  --game-action-height: clamp(145px, 17.8svh, 166px);
  --game-action-icon: 36px;
  --game-action-title: 28px;
}
.reference-game .reference-turn-status { gap: 7px; }
.reference-game .reference-danger-card {
  width: 62%;
  min-height: var(--game-status-height);
  padding: 6px 12px;
  border-radius: 20px;
  border-color: #71344d66;
  background: radial-gradient(ellipse at 50% 0, #79132b22, transparent 65%), linear-gradient(180deg, #100811, #040912);
  box-shadow: inset 0 1px #ffb4bd0f, 0 -5px 18px #ff143810;
}
.reference-game .reference-danger-card small,
.reference-game .reference-xp-bank small {
  font-size: 13px;
  line-height: 16px;
}
.reference-game .reference-danger-card strong {
  margin-top: 1px;
  font-size: var(--game-number-size);
  line-height: 1;
  letter-spacing: -.025em;
  text-shadow: 0 1px 3px #0008, 0 0 14px #ffffff14;
}
.reference-game .reference-risk-track { height: 14px; }
.reference-game .reference-xp-bank {
  width: 72%;
  min-height: calc(var(--game-status-height) + 2px);
  padding: 6px 10px;
  border-radius: 17px;
  --spark-card-fill: linear-gradient(145deg, #0b131cfb, #040c12fc);
  --spark-card-edge: linear-gradient(125deg, #58677d57, #263a4e70 65%, #175e705c);
}
.reference-game .reference-xp-bank strong {
  margin-top: 3px;
  font-size: var(--game-number-size);
  line-height: 1;
  gap: 10px;
  letter-spacing: 0;
}
.reference-game .reference-xp-bolt {
  width: 29px;
  height: 37px;
  flex-basis: 29px;
  transform: none;
  filter: drop-shadow(0 0 4px #ffbd247d) drop-shadow(0 0 10px #ff9a0038);
}
.reference-game .reference-action-grid button {
  min-height: var(--game-action-height);
  padding: 10px 7px;
  border-radius: 18px;
}
.reference-game .reference-action-grid .reference-action-icon {
  width: 40px;
  height: var(--game-action-icon);
}
.reference-game .reference-hold .reference-action-icon svg { width: 29px; }
.reference-game .reference-action-grid button > strong {
  font-size: var(--game-action-title);
  line-height: 1.05;
  margin: 5px 0 8px;
}
.reference-game .reference-action-grid button > small {
  font-size: 16px;
  line-height: 1.1;
  gap: 6px;
}
.reference-game .reference-action-grid button > small b {
  font-size: clamp(15px, 4.4cqw, 18px);
  line-height: 1.1;
}
.reference-game .reference-game-note { font-size: 13px; line-height: 16px; }

/* Short Telegram WebViews retain side-by-side status, readable controls and
   room for the character. No fixed visual heights are added to the turn. */
@media (max-height: 740px) {
  .reference-game {
    --game-number-size: 36px;
    --game-status-height: 60px;
    --game-action-height: 114px;
    --game-action-icon: 28px;
    --game-action-title: 25px;
  }
  .reference-game .reference-danger-card,
  .reference-game .reference-xp-bank {
    width: 100%;
    min-height: var(--game-status-height);
    padding: 4px 8px;
    border-radius: 14px;
  }
  .reference-game .reference-danger-card small,
  .reference-game .reference-xp-bank small { font-size: 12px; line-height: 14px; }
  .reference-game .reference-xp-bank strong { margin-top: 1px; gap: 7px; }
  .reference-game .reference-xp-bolt { width: 24px; height: 31px; flex-basis: 24px; }
  .reference-game .reference-risk-track { height: 12px; }
  .reference-game .reference-action-grid button { padding: 7px 5px; }
  .reference-game .reference-hold .reference-action-icon svg { width: 23px; }
  .reference-game .reference-action-grid button > strong { margin: 3px 0 6px; }
  .reference-game .reference-action-grid button > small { font-size: 14px; gap: 4px; }
  .reference-game .reference-game-note { font-size: 12px; line-height: 15px; }
}
@media (min-width: 700px) {
  .reference-game .reference-turn {
    --turn-height: calc(var(--tg-viewport-stable-height, var(--spark-viewport-height)) - 148px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }
}
