/* ==========================================================================
   Screens C — battle (.scr-battle) and results (.scr-results)
   Mobile-first. Local tokens only; no dependencies on other screen sheets.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Battle
   -------------------------------------------------------------------------- */

.scr-battle {
  --sb-bg: #05060d;
  --sb-panel: rgba(10, 12, 30, 0.72);
  --sb-panel-strong: rgba(14, 16, 38, 0.92);
  --sb-line: rgba(255, 255, 255, 0.14);
  --sb-text: #f5f2ff;
  --sb-dim: #aeaad0;
  --sb-ally: #62cbff;
  --sb-foe: #ff6384;
  --sb-heal: #63f0a6;
  --sb-dmg: #ffb65e;
  --sb-shield: #97b9ff;
  --sb-gold: #ffd166;
  --sb-radius: 12px;

  position: relative;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: var(--sb-text);
  background:
    radial-gradient(120% 70% at 50% 110%, rgba(98, 60, 180, 0.35), transparent 60%),
    radial-gradient(80% 50% at 50% -10%, rgba(40, 90, 200, 0.25), transparent 70%),
    var(--sb-bg);
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.scr-battle__stage {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.scr-battle__stage canvas {
  display: block;
}

/* HUD sits above the stage; only the controls take taps. */
.scr-battle__hud {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding:
    max(10px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  pointer-events: none;
}

.scr-battle__top {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scr-battle__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.scr-battle__title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.scr-battle__stage-name {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.scr-battle__tag {
  flex: none;
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(255, 209, 102, 0.18);
  color: var(--sb-gold);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scr-battle__turn {
  flex: none;
  padding: 4px 10px;
  border: 1px solid var(--sb-line);
  border-radius: 99px;
  background: var(--sb-panel);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.scr-battle__teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 8px;
}

.scr-battle__team-label {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
  color: var(--sb-dim);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.scr-battle__team--foe .scr-battle__team-label {
  flex-direction: row-reverse;
}

.scr-battle__bar-count {
  color: var(--sb-text);
  font-variant-numeric: tabular-nums;
}

.scr-battle__bar {
  height: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Enemy bar drains toward the middle, mirroring ours. */
.scr-battle__team--foe .scr-battle__bar {
  transform: scaleX(-1);
}

.scr-battle__bar-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2d7dff, var(--sb-ally));
  transition: width 0.35s ease;
}

.scr-battle__team--foe .scr-battle__bar-fill {
  background: linear-gradient(90deg, #e2244f, var(--sb-foe));
}

.scr-battle__team.is-low .scr-battle__bar-fill {
  animation: scr-battle-low 0.9s ease-in-out infinite alternate;
}

.scr-battle__vs {
  padding-bottom: 1px;
  color: var(--sb-gold);
  font-size: 0.78rem;
  font-style: italic;
  font-weight: 900;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
}

.scr-battle__bottom {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Ticker: newest line at the bottom, older lines fade out. */
.scr-battle__ticker {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 4px;
  min-height: 7.6em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scr-battle__line {
  max-width: 100%;
  padding: 4px 10px;
  border: 1px solid var(--sb-line);
  border-left: 3px solid var(--sb-dim);
  border-radius: 10px;
  background: var(--sb-panel);
  font-size: 0.82rem;
  line-height: 1.35;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: scr-battle-line-in 0.22s ease-out;
}

/* Older lines step back but stay readable over a busy battlefield. */
.scr-battle__line:nth-last-child(2) { opacity: 0.88; }
.scr-battle__line:nth-last-child(3) { opacity: 0.75; }
.scr-battle__line:nth-last-child(n + 4) { opacity: 0.6; }

.scr-battle__line.is-hit { border-left-color: var(--sb-dmg); }
.scr-battle__line.is-heal { border-left-color: var(--sb-heal); }
.scr-battle__line.is-shield { border-left-color: var(--sb-shield); }
.scr-battle__line.is-buff { border-left-color: var(--sb-gold); }
.scr-battle__line.is-burn { border-left-color: #ff7a3d; }
.scr-battle__line.is-boss {
  border-left-color: var(--sb-foe);
  background: rgba(70, 10, 30, 0.8);
  font-weight: 700;
}
.scr-battle__line.is-ko {
  border-left-color: #fff;
  font-weight: 800;
}

.scr-battle__skill {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(255, 209, 102, 0.2);
  color: var(--sb-gold);
  font-size: 0.72rem;
  font-weight: 800;
  vertical-align: 1px;
}

.scr-battle__t-ally { color: var(--sb-ally); font-weight: 700; }
.scr-battle__t-foe { color: var(--sb-foe); font-weight: 700; }
.scr-battle__t-dmg { color: var(--sb-dmg); font-weight: 800; font-variant-numeric: tabular-nums; }
.scr-battle__t-heal { color: var(--sb-heal); font-weight: 800; font-variant-numeric: tabular-nums; }
.scr-battle__t-shield { color: var(--sb-shield); font-weight: 700; }
.scr-battle__t-skill { color: var(--sb-gold); font-weight: 700; }
.scr-battle__t-ko { color: var(--sb-dmg); font-weight: 800; }

.scr-battle__controls {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  pointer-events: auto;
}

.scr-battle__ctl {
  min-width: 48px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--sb-line);
  border-radius: var(--sb-radius);
  background: var(--sb-panel-strong);
  color: var(--sb-text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: transform 0.1s ease, border-color 0.15s ease, color 0.15s ease;
}

.scr-battle__ctl:active { transform: scale(0.95); }
.scr-battle__ctl:focus-visible { outline: 2px solid var(--sb-gold); outline-offset: 2px; }
.scr-battle__ctl:disabled { opacity: 0.5; cursor: default; }

.scr-battle__ctl--speed {
  min-width: 56px;
  font-variant-numeric: tabular-nums;
}

.scr-battle__ctl.is-fast,
.scr-battle__ctl.is-active {
  border-color: rgba(255, 209, 102, 0.6);
  color: var(--sb-gold);
}

.scr-battle__ctl--skip { padding: 0 16px; }

/* Paused veil sits under the HUD so the controls stay usable. */
.scr-battle__paused {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  background: rgba(4, 5, 14, 0.5);
  color: var(--sb-text);
  font: inherit;
  cursor: pointer;
}

.scr-battle__paused[hidden] { display: none; }

.scr-battle__paused-label {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.scr-battle__paused-hint {
  color: var(--sb-dim);
  font-size: 0.85rem;
}

.scr-battle__loading {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background:
    radial-gradient(60% 40% at 50% 50%, rgba(98, 60, 180, 0.35), transparent 70%),
    var(--sb-bg);
  text-align: center;
  transition: opacity 0.4s ease;
}

.scr-battle__loading.is-done {
  opacity: 0;
  pointer-events: none;
}

.scr-battle__loading-text {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.scr-battle__loading-stage {
  margin: 0;
  color: var(--sb-gold);
  font-weight: 700;
}

.scr-battle__loading-hint {
  max-width: 26ch;
  margin: 6px 0 0;
  color: var(--sb-dim);
  font-size: 0.85rem;
}

.scr-battle__loading-hint[hidden] { display: none; }

.scr-battle__spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--sb-gold);
  border-radius: 50%;
  animation: scr-battle-spin 0.8s linear infinite;
}

/* No battle / fallback cards */
.scr-battle__missing,
.scr-battle__fallback {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(92vw, 380px);
  padding: 24px 20px;
  border: 1px solid var(--sb-line);
  border-radius: 18px;
  background: var(--sb-panel-strong);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  text-align: center;
  transform: translate(-50%, -50%);
  animation: scr-battle-card-in 0.3s ease-out;
}

.scr-battle__missing-icon {
  font-size: 2.2rem;
  line-height: 1;
}

.scr-battle__missing-title,
.scr-battle__fallback-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
}

.scr-battle__missing-text,
.scr-battle__fallback-text {
  margin: 0;
  color: var(--sb-dim);
}

.scr-battle__missing-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}

.scr-battle__fallback-kicker {
  margin: 0;
  color: var(--sb-dim);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scr-battle__fallback.is-victory .scr-battle__fallback-title { color: var(--sb-gold); }
.scr-battle__fallback.is-defeat .scr-battle__fallback-title { color: var(--sb-foe); }

.scr-battle__fallback-stars {
  display: flex;
  gap: 6px;
  font-size: 1.8rem;
  color: rgba(255, 255, 255, 0.18);
}

.scr-battle__fallback-stars .is-on {
  color: var(--sb-gold);
  text-shadow: 0 0 12px rgba(255, 209, 102, 0.6);
}

.scr-battle__fallback > button,
.scr-battle__missing-actions > * {
  width: 100%;
}

/* Plain button look, used only if the shared kit has no button(). */
.scr-battle__btn {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--sb-line);
  border-radius: var(--sb-radius);
  background: rgba(255, 255, 255, 0.08);
  color: var(--sb-text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.scr-battle__btn.is-primary {
  border-color: transparent;
  background: linear-gradient(180deg, #ffd166, #f5a524);
  color: #2a1a00;
}

@media (min-width: 720px) {
  .scr-battle__hud { padding-inline: 20px; }
  .scr-battle__heading,
  .scr-battle__teams {
    width: 100%;
    max-width: 680px;
    margin-inline: auto;
  }
  .scr-battle__ticker { max-width: 460px; }
  .scr-battle__line { font-size: 0.9rem; }
}

/* Short landscape phones: the HUD would cover most of the arena. Put the
   ticker beside the controls and keep only its two newest lines. */
@media (orientation: landscape) and (max-height: 500px) {
  .scr-battle__hud { gap: 6px; padding-top: max(6px, env(safe-area-inset-top)); }
  .scr-battle__top { gap: 4px; }
  .scr-battle__bottom {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
  }
  .scr-battle__ticker { flex: 1 1 auto; min-height: 0; max-width: 60%; }
  .scr-battle__line { font-size: 0.78rem; padding: 3px 8px; }
  .scr-battle__line:nth-last-child(n + 3) { display: none; }
}

@keyframes scr-battle-line-in {
  from { opacity: 0; transform: translateY(6px); }
  to { transform: none; }
}

@keyframes scr-battle-low {
  from { filter: brightness(1); }
  to { filter: brightness(1.6); }
}

@keyframes scr-battle-spin {
  to { transform: rotate(360deg); }
}

@keyframes scr-battle-card-in {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

/* --------------------------------------------------------------------------
   Results
   -------------------------------------------------------------------------- */

.scr-results {
  --sr-bg: #070812;
  --sr-panel: rgba(255, 255, 255, 0.06);
  --sr-panel-strong: rgba(18, 20, 44, 0.94);
  --sr-line: rgba(255, 255, 255, 0.12);
  --sr-text: #f5f2ff;
  --sr-dim: #aeaad0;
  --sr-gold: #ffd166;
  --sr-gold-deep: #f5a524;
  --sr-heal: #63f0a6;
  --sr-dmg: #ffb65e;
  --sr-foe: #ff6384;
  --sr-accent: var(--sr-gold);

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  min-height: 100vh;
  min-height: 100dvh;
  padding:
    max(12px, env(safe-area-inset-top))
    16px
    0;
  color: var(--sr-text);
  background:
    radial-gradient(90% 45% at 50% 0%, rgba(255, 190, 80, 0.2), transparent 70%),
    var(--sr-bg);
}

.scr-results.is-defeat,
.scr-results.is-draw {
  --sr-accent: #8fa3d9;
  background:
    radial-gradient(90% 45% at 50% 0%, rgba(120, 60, 110, 0.28), transparent 70%),
    var(--sr-bg);
}

.scr-results > * {
  width: 100%;
  max-width: 560px;
}

.scr-results__wallet {
  display: flex;
  justify-content: flex-end;
  min-height: 0;
}

.scr-results__wallet:empty { display: none; }

/* Banner */
.scr-results__banner {
  position: relative;
  padding: 18px 0 4px;
  overflow: visible;
  text-align: center;
}

.scr-results__rays {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: 420px;
  height: 420px;
  margin: -210px 0 0 -210px;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 209, 102, 0.14) 0 10deg, transparent 10deg 24deg);
  -webkit-mask-image: radial-gradient(circle, #000 20%, transparent 65%);
  mask-image: radial-gradient(circle, #000 20%, transparent 65%);
  pointer-events: none;
  opacity: 0;
  animation: scr-results-rays-in 0.8s 0.2s ease-out forwards, scr-results-spin 30s linear infinite;
}

.scr-results.is-defeat .scr-results__rays,
.scr-results.is-draw .scr-results__rays {
  display: none;
}

.scr-results__kicker,
.scr-results__title,
.scr-results__subtitle {
  position: relative;
  z-index: 1;
}

.scr-results__kicker {
  margin: 0 0 4px;
  color: var(--sr-dim);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scr-results__title {
  margin: 0;
  background: linear-gradient(100deg, #fff4c9 0%, var(--sr-gold) 30%, var(--sr-gold-deep) 50%, #fff4c9 60%, var(--sr-gold) 80%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(2.6rem, 14vw, 4.4rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.06em;
  filter: drop-shadow(0 4px 14px rgba(245, 165, 36, 0.45));
  animation:
    scr-results-slam 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both,
    scr-results-shine 2.6s 0.9s ease-in-out infinite;
}

.scr-results.is-defeat .scr-results__title,
.scr-results.is-draw .scr-results__title {
  background: linear-gradient(180deg, #e6e9ff 0%, #8fa3d9 55%, #5a6594 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 4px 14px rgba(120, 60, 110, 0.5));
  animation: scr-results-drop 0.8s ease-out both;
}

.scr-results__subtitle {
  margin: 8px 0 0;
  color: var(--sr-dim);
  font-size: 0.95rem;
  animation: scr-results-fade-up 0.4s 0.45s ease-out both;
}

/* Stars */
.scr-results__stars {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.scr-results__star-row {
  display: flex;
  gap: 10px;
}

.scr-results__star {
  position: relative;
  display: inline-block;
  font-size: 2.6rem;
  line-height: 1;
}

.scr-results__star:nth-child(2) {
  font-size: 3.1rem;
  transform: translateY(-6px);
}

.scr-results__star-empty {
  color: rgba(255, 255, 255, 0.14);
}

.scr-results__star-fill {
  position: absolute;
  inset: 0;
  color: var(--sr-gold);
  text-shadow: 0 0 16px rgba(255, 209, 102, 0.7);
  opacity: 0;
  transform: scale(0);
}

.scr-results__star.is-earned .scr-results__star-fill {
  animation: scr-results-star 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) forwards;
  animation-delay: calc(var(--i, 0) * 280ms + 550ms);
}

.scr-results__best {
  padding: 3px 10px;
  border-radius: 99px;
  background: linear-gradient(180deg, #ff7aa8, #e2366f);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(226, 54, 111, 0.45);
  animation: scr-results-pop 0.4s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  animation-delay: calc(var(--i, 3) * 280ms + 700ms);
}

.scr-results__star-note {
  margin: 2px 0 0;
  color: var(--sr-dim);
  font-size: 0.82rem;
}

/* Callouts */
.scr-results__callouts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scr-results__callout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.16), rgba(255, 209, 102, 0.04));
  animation: scr-results-fade-up 0.4s 1.3s ease-out both;
}

.scr-results__callout--unlock,
.scr-results__callout--chapter {
  border-color: rgba(98, 203, 255, 0.35);
  background: linear-gradient(90deg, rgba(98, 203, 255, 0.16), rgba(98, 203, 255, 0.04));
  animation-delay: 1.5s;
}

.scr-results__callout-icon {
  flex: none;
  font-size: 1.5rem;
  line-height: 1;
}

.scr-results__callout-title {
  display: block;
  font-size: 0.95rem;
}

.scr-results__callout-text {
  display: block;
  color: var(--sr-dim);
  font-size: 0.85rem;
}

/* Section titles */
.scr-results__section-title {
  margin: 0 0 8px;
  color: var(--sr-dim);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Rewards */
.scr-results__reward-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.scr-results__reward {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--sr-line);
  border-radius: 14px;
  background: var(--sr-panel);
  animation: scr-results-fade-up 0.35s 1.2s ease-out both;
}

.scr-results__reward-text {
  display: flex;
  flex-direction: column;
}

.scr-results__reward-value {
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.scr-results__reward--gold .scr-results__reward-value { color: var(--sr-gold); }
.scr-results__reward--scrolls .scr-results__reward-value { color: #d7b8ff; }

.scr-results__reward-value.is-done {
  animation: scr-results-pop 0.3s ease-out;
}

.scr-results__reward-label {
  color: var(--sr-dim);
  font-size: 0.78rem;
  font-weight: 700;
}

.scr-results__reward-icon {
  flex: none;
  width: 30px;
  height: 30px;
  font-size: 30px;
  line-height: 1;
}

.scr-results__reward-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.scr-results__coin {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff4c9 0 18%, var(--sr-gold) 40%, var(--sr-gold-deep) 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25), 0 0 12px rgba(255, 209, 102, 0.45);
}

.scr-results__scroll {
  flex: none;
  font-size: 1.6rem;
  line-height: 1;
}

.scr-results__note {
  margin: 0;
  color: var(--sr-dim);
  text-align: center;
}

/* Defeat tip */
.scr-results__tip {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px 12px;
  padding: 14px;
  border: 1px solid rgba(143, 163, 217, 0.4);
  border-radius: 16px;
  background: rgba(143, 163, 217, 0.1);
  animation: scr-results-fade-up 0.4s 0.8s ease-out both;
}

.scr-results__tip-icon {
  font-size: 1.5rem;
  line-height: 1.2;
}

.scr-results__tip-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
}

.scr-results__tip-text {
  margin: 2px 0 0;
  color: var(--sr-dim);
  font-size: 0.88rem;
  line-height: 1.4;
}

.scr-results__tip > :last-child:not(.scr-results__tip-body) {
  grid-column: 1 / -1;
}

/* MVP */
.scr-results__mvp {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 209, 102, 0.45);
  border-radius: 18px;
  background:
    radial-gradient(80% 120% at 0% 50%, rgba(255, 209, 102, 0.18), transparent 70%),
    var(--sr-panel);
  box-shadow: 0 0 0 1px rgba(255, 209, 102, 0.08), 0 10px 30px rgba(0, 0, 0, 0.35);
  animation: scr-results-fade-up 0.45s 1s ease-out both;
}

.scr-results.is-defeat .scr-results__mvp,
.scr-results.is-draw .scr-results__mvp {
  border-color: var(--sr-line);
  background: var(--sr-panel);
}

.scr-results__mvp-ribbon {
  position: absolute;
  top: -10px;
  left: 14px;
  padding: 2px 10px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--sr-gold), var(--sr-gold-deep));
  color: #2a1a00;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.scr-results__mvp-portrait {
  flex: none;
  display: grid;
  place-items: center;
  width: 88px;
  min-height: 88px;
  overflow: hidden;
  border-radius: 14px;
}

.scr-results__mvp-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.scr-results__mvp-name {
  margin: 0;
  overflow: hidden;
  font-size: 1.25rem;
  font-weight: 900;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.scr-results__mvp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.scr-results__level {
  padding: 1px 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  font-weight: 800;
}

.scr-results__mvp-stats {
  display: flex;
  gap: 16px;
  margin: 4px 0 0;
}

.scr-results__stat dt {
  color: var(--sr-dim);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scr-results__stat dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.scr-results__stat--dmg dd { color: var(--sr-dmg); }
.scr-results__stat--heal dd { color: var(--sr-heal); }

/* Team rows */
.scr-results__heroes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scr-results__hero {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--sr-line);
  border-radius: 12px;
  background: var(--sr-panel);
  animation: scr-results-fade-up 0.3s ease-out both;
}

.scr-results__hero:nth-child(1) { animation-delay: 1.1s; }
.scr-results__hero:nth-child(2) { animation-delay: 1.18s; }
.scr-results__hero:nth-child(3) { animation-delay: 1.26s; }
.scr-results__hero:nth-child(4) { animation-delay: 1.34s; }
.scr-results__hero:nth-child(5) { animation-delay: 1.42s; }

.scr-results__hero.is-mvp { border-color: rgba(255, 209, 102, 0.45); }

.scr-results__hero.is-down .scr-results__hero-portrait {
  filter: grayscale(0.9) brightness(0.7);
}

.scr-results__hero-portrait {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  overflow: hidden;
  border-radius: 10px;
}

.scr-results__portrait-img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.scr-results__portrait-blank {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 900;
}

.scr-results__hero-main {
  flex: 1;
  min-width: 0;
}

.scr-results__hero-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scr-results__hero-name {
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.scr-results__hero-state {
  flex: none;
  color: var(--sr-foe);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scr-results__hero-state.is-up { color: var(--sr-heal); }

.scr-results__hero-bar {
  height: 4px;
  margin: 5px 0 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
}

.scr-results__hero-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sr-dmg), var(--sr-gold));
  transform-origin: left center;
  animation: scr-results-grow 0.6s 1.5s ease-out both;
}

.scr-results__hero-stats {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.scr-results__mini--dmg { color: var(--sr-dmg); }
.scr-results__mini--heal { color: var(--sr-heal); }

/* Actions: sticky at the bottom on phones */
.scr-results__actions {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding: 16px 0 max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, var(--sr-bg) 28%);
}

.scr-results__action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.scr-results__action-row > * {
  flex: 1 1 0;
  min-width: 0;
}

.scr-results__action-row > :first-child {
  flex-basis: 100%;
}

.scr-results__action-extra {
  display: flex;
  justify-content: center;
}

/* Plain button look, used only if the shared kit has no button(). */
.scr-results__btn {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--sr-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--sr-text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.scr-results__btn.is-primary {
  border-color: transparent;
  background: linear-gradient(180deg, var(--sr-gold), var(--sr-gold-deep));
  color: #2a1a00;
}

.scr-results__btn.is-ghost {
  min-height: 36px;
  border-color: transparent;
  background: transparent;
  color: var(--sr-dim);
}

.scr-results__btn:disabled { opacity: 0.5; cursor: default; }
.scr-results__btn:focus-visible { outline: 2px solid var(--sr-gold); outline-offset: 2px; }

@media (min-width: 720px) {
  .scr-results { padding-top: 28px; gap: 18px; }
  .scr-results__action-row > :first-child { flex-basis: 0; }
  .scr-results__action-row > * { flex: 1 1 0; }
}

@keyframes scr-results-slam {
  0% { opacity: 0; transform: scale(1.9); }
  60% { opacity: 1; transform: scale(0.94); }
  100% { opacity: 1; transform: none; }
}

@keyframes scr-results-shine {
  0%, 100% { background-position: 100% 0; }
  50% { background-position: 0% 0; }
}

@keyframes scr-results-drop {
  0% { opacity: 0; transform: translateY(-24px); }
  55% { opacity: 1; transform: translateY(4px); }
  70% { transform: translateX(-4px); }
  85% { transform: translateX(3px); }
  100% { opacity: 1; transform: none; }
}

@keyframes scr-results-rays-in {
  to { opacity: 1; }
}

@keyframes scr-results-spin {
  to { transform: rotate(360deg); }
}

@keyframes scr-results-star {
  0% { opacity: 0; transform: scale(0) rotate(-40deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes scr-results-pop {
  0% { opacity: 0; transform: scale(0.6); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes scr-results-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes scr-results-grow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .scr-battle *,
  .scr-results,
  .scr-results * {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scr-results__rays { display: none; }
}
