/* Final, narrowly scoped readability and first-play affordance overrides. */
:root {
  --ux-safe-bottom: env(safe-area-inset-bottom, 0px);
}

html { scroll-padding-bottom: calc(96px + var(--ux-safe-bottom)); }
body { overflow-x: hidden; }
.app-shell { padding-bottom: calc(108px + var(--ux-safe-bottom)); }
.page, .panel, .character-card, .battle-page { min-width: 0; }

/* First actions and explanations stay legible and easy to reach. */
.first-play-guide,
.summon-intro-copy,
.battle-mode-note,
.battle-result-summary,
.battle-next-actions,
.account-guest-notice {
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.first-play-guide,
.battle-mode-note,
.account-guest-notice {
  padding: 12px 14px;
  border: 1px solid #5b5139;
  border-left: 3px solid var(--gold);
  background: linear-gradient(110deg, #29261e, #1b1c1a);
  color: #e7dfcd;
}
.first-play-guide p, .summon-intro-copy p,
.battle-mode-note p, .account-guest-notice p { margin: 4px 0; }
.first-play-guide-details, .character-details, .growth-details,
.arena-growth-details {
  margin-top: 12px;
  border: 1px solid var(--line);
  background: #15171d;
}
.first-play-guide-details > summary, .character-details > summary,
.growth-details > summary, .arena-growth-details > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 13px;
  color: #d8c38e;
  font-size: 14px;
  cursor: pointer;
  list-style: none;
}
.first-play-guide-details > summary::-webkit-details-marker,
.character-details > summary::-webkit-details-marker,
.growth-details > summary::-webkit-details-marker,
.arena-growth-details > summary::-webkit-details-marker { display: none; }
.first-play-guide-details > summary::after, .character-details > summary::after,
.growth-details > summary::after, .arena-growth-details > summary::after {
  content: "＋";
  color: var(--gold);
}
.first-play-guide-details[open] > summary::after,
.character-details[open] > summary::after,
.growth-details[open] > summary::after,
.arena-growth-details[open] > summary::after { content: "−"; }
.first-play-guide-details > :not(summary), .character-details > :not(summary),
.growth-details > :not(summary), .arena-growth-details > :not(summary) { margin-right: 13px; margin-left: 13px; }
.first-play-guide-details > :last-child, .character-details > :last-child,
.growth-details > :last-child, .arena-growth-details > :last-child { margin-bottom: 13px; }

.summon-intro-copy { max-width: 540px; margin: 10px auto; color: #d2d0c8; }
.summon-intro-copy small, .summon-intro-copy .hint { display: block; margin-top: 7px; font-size: 13px; line-height: 1.6; }
button[data-action="suggest-name"] { min-height: 44px; }
.summon-form .input-hint { font: 13px/1.5 var(--serif); letter-spacing: 0; }
.summon-form .name-suggestion { width: 100%; min-height: 44px; margin-top: 7px; font-size: 13px; }
.summon-form + .hint, .summon-form + p, .summon-name-note { font-size: 14px; line-height: 1.6; }
.button, button { touch-action: manipulation; }
.button { min-height: 44px; }
.actions > button, .actions > a, .battle-next-actions > button,
.battle-next-actions > a { min-height: 44px; }

/* Battle HUD: keep HP/MP readable, preserve a compact two-sided layout. */
.battle-page .fighter .name { font-size: 14px; line-height: 1.35; }
.battle-page .fighter .hp-label,
.battle-page .fighter .mp-label,
.battle-page .fighter [class*="hp-value"],
.battle-page .fighter [class*="mp-value"] { font-size: 12px; }
.battle-page .fighter .status-pill,
.battle-page .fighter .status-chip { min-height: 28px; font-size: 12px; }
button.status-chip[data-status-key] {
  min-width: 44px;
  min-height: 44px;
  padding: 7px 8px;
  border: 1px solid #686047;
  border-radius: 3px;
  background: #24241f;
  color: #e7d8ac;
  cursor: pointer;
}
button.status-chip[data-status-key]:focus-visible,
button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid #e0c27a;
  outline-offset: 2px;
}
.battle-mode-note { margin: 0 0 5px; }
.battle-mode-note > b, .battle-mode-note > span { display: block; }
.battle-mode-note > span { margin-top: 4px; }
.battle-page .battle-result-head { order: -2; display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 26px; margin: 0; }
.battle-page .battle-result-head h2 { margin: 0; font-size: 15px; line-height: 1.35; }
.battle-mode-label { color: #d8c38e; font-size: 12px; line-height: 1.3; }
.battle-page .battle-head { order: 0; }
.battle-page .battle-result-summary { order: 1; }
.battle-page .battle-result-highlight { order: 5; }
.battle-result-summary { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 5px 10px; min-width: 0; padding: 6px 9px; border: 1px solid #78643c; border-left: 3px solid #d9b75f; border-radius: 4px; background: linear-gradient(110deg, #30291d, #1d1d19 72%); box-shadow: inset 0 1px #f3d27b18; }
.battle-result-title { padding-right: 9px; border-right: 1px solid #74613d; color: #f0d27d; font-size: 11px; letter-spacing: .06em; white-space: nowrap; }
.battle-result-items { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-width: 0; margin: 0; padding: 0; list-style: none; color: #e4dece; font-size: 11px; line-height: 1.4; }
.battle-result-items > li { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
.battle-result-items .result-rp strong { color: #f1e6c9; font: 600 12px var(--mono); font-variant-numeric: tabular-nums; }
.result-delta { padding: 1px 5px; border: 1px solid #71613d; border-radius: 3px; font: 700 10px var(--mono); font-variant-numeric: tabular-nums; }
.result-delta.up { border-color: #647c55; background: #34412c; color: #c7e39e; }
.result-delta.down { border-color: #87544a; background: #442b28; color: #f0a393; }
.result-delta.flat { color: #c3b998; }
.result-tag { padding: 1px 4px; border: 1px solid #625640; border-radius: 3px; color: #d9c58f; font-size: 9px; white-space: nowrap; }
.battle-next-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.battle-page, .battle-page.playing, .battle-page:not(.playing) { height: auto; min-height: 0; overflow: visible; }
.battle-page .log { flex: 0 0 clamp(150px, 28dvh, 320px); min-height: 150px; max-height: 320px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; scroll-behavior: auto; }
.battle-page [hidden], .battle-page[hidden] { display: none !important; }

/* Result screens prioritize the decision, with battle history below it. */
.battle-page:not(.playing) .playback-controls { order: 2; }
.battle-page:not(.playing) .log { order: 3; }
.battle-page:not(.playing) .compare-details { order: 4; }
.battle-page:not(.playing) .account-nudge { order: 8; }
.battle-page:not(.playing) .tutorial-next { order: 9; }
.battle-page:not(.playing) .battle-next-actions { order: 10; position: relative; z-index: 1; }
.battle-page:not(.playing) .first-rank-guide { order: 11; }
.battle-result-summary, .battle-next-actions { min-width: 0; overflow-wrap: anywhere; }
.battle-crowd-bubble { background: linear-gradient(145deg, rgba(41, 35, 30, .46), rgba(23, 24, 32, .42)); box-shadow: 0 4px 12px rgba(0, 0, 0, .48), 0 0 12px rgba(230, 189, 89, .18); }
.battle-crowd-bubble:after { background: rgba(28, 27, 32, .46); }
.battle-crowd-bubble.heckle { background: linear-gradient(145deg, rgba(51, 32, 31, .46), rgba(23, 24, 32, .42)); }
.battle-crowd-bubble.shock { background: linear-gradient(145deg, rgba(56, 48, 28, .46), rgba(23, 24, 32, .42)); }
.battle-crowd-bubble.shock:after { background: rgba(40, 35, 28, .46); }
.battle-crowd-bubble.data { background: linear-gradient(145deg, rgba(22, 43, 45, .46), rgba(23, 24, 32, .42)); box-shadow: 0 4px 11px rgba(0, 0, 0, .42), 0 0 11px rgba(96, 212, 208, .2); }
.status-help-dialog { width: min(100%, 400px); max-height: min(72dvh, 500px); overflow: auto; padding: 21px 20px 18px; }
.status-help-dialog h2 { margin: 5px 0 12px; font-size: 21px; }
.status-help-dialog p { margin: 7px 0; font-size: 14px; line-height: 1.65; }
.status-help-dialog .status-help-rounds { color: #e0c27a; }
.status-help-dialog .tutorial-close.status-help-close { display: grid; width: 44px; height: 44px; place-items: center; }
.status-help-dialog > .button.status-help-close { width: 100%; min-height: 44px; margin-top: 12px; }

/* Arena and account guidance. */
.account-guest-notice { margin: 0 0 12px; }
.account-button { min-height: 44px; }
.account-button > span:last-child { min-width: 0; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.2; }
.account-button .account-status { display: block; max-width: none; margin-top: 1px; overflow: visible; color: #dfc479; font: 9px/1.25 var(--serif); letter-spacing: 0; white-space: nowrap; text-overflow: clip; }
.online-arena-actions { margin-top: 12px; }
.online-arena-actions > button { min-height: 44px; }
.arena-primary-challenge { margin-top: 10px; }
.arena-primary-challenge > button, .entry-empty > button { width: 100%; min-height: 48px; font-size: 14px; }
.entry-empty { display: grid; justify-items: start; gap: 8px; }
.entry-empty > p, .entry-empty > span { margin: 0; font-size: 14px; line-height: 1.55; }
.free-recommendation-section { margin: 20px 0 16px; }
.free-recommendation-section h3 { margin: 0 0 5px; font-size: 16px; }
.free-recommendation-section > p { margin: 0 0 10px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.free-recommendations-empty { display: grid; justify-items: start; gap: 8px; text-align: left; }
.free-recommendations { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.free-recommendation {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 13px;
  border: 1px solid #45463b;
  background: linear-gradient(135deg, #20221e, #17191a);
  overflow-wrap: anywhere;
}
.free-recommendation-reason { color: #c9bd9f; font-size: 13px; line-height: 1.55; }
.free-recommendation .button, .free-recommendation button { min-height: 44px; }
.arena-growth-details { padding: 0; }

@media (max-width: 650px) {
  .app-shell { padding-right: 14px; padding-left: 14px; padding-bottom: calc(116px + var(--ux-safe-bottom)); }
  .page { padding-bottom: 24px; }
  .bottom-nav { padding-bottom: max(8px, var(--ux-safe-bottom)); }
  .bottom-nav button { min-width: 58px; min-height: 44px; font-size: 11px; }
  .bottom-nav button span { font-size: 18px; }
  .account-button { max-width: 150px; min-width: 126px; padding-right: 8px; padding-left: 8px; }
  .first-play-guide, .account-guest-notice { padding: 10px 11px; }
  .battle-page { gap: 4px; padding-top: 2px; }
  .battle-page .battle-result-head { min-height: 24px; }
  .battle-page .battle-result-head h2 { font-size: 15px; }
  .battle-mode-label { font-size: 12px; }
  .battle-result-summary { grid-template-columns: auto minmax(0, 1fr); gap: 4px 7px; padding: 4px 6px; }
  .battle-result-title { padding-right: 6px; font-size: 10px; }
  .battle-result-items { gap: 3px 8px; font-size: 10px; }
  .battle-page .battle-head { grid-template-columns: minmax(0,1fr) 20px minmax(0,1fr); gap: 4px; }
  .battle-page .fighter { height: auto; min-height: 0; padding: 5px 6px; }
  .battle-page .fighter-topline { min-height: 12px; margin-bottom: 2px; gap: 3px; }
  .battle-page .fighter-side { margin: 0; font-size: 8px; }
  .battle-page .fighter-identity { height: 42px; min-height: 0; align-items: center; gap: 4px; margin: 0 0 2px; }
  .battle-page .fighter-avatar { width: 38px; height: 38px; flex: 0 0 38px; }
  .battle-page .fighter-copy .name { min-height: 0; font-size: 13px; line-height: 1.2; }
  .battle-page .fighter-copy .epithet,
  .battle-page .fighter-copy .fighter-species,
  .battle-page .fighter-copy .fighter-owner,
  .battle-page .fighter-copy .fighter-strategy { display: none !important; }
  .battle-page .fighter .hp-label { margin-top: 3px; font-size: 10px; }
  .battle-page .fighter .hp-value, .battle-page .fighter .mp-value { font-size: 12px; }
  .battle-page .fighter .bar { height: 5px; margin-top: 1px; }
  .battle-page .fighter .mp-label { margin-top: 3px; }
  .battle-page .fighter .status-list { height: auto; min-height: 52px; max-height: none; margin-top: 2px; align-content: flex-start; align-items: flex-start; flex-wrap: wrap; overflow: visible; touch-action: auto; }
  .battle-page .battle-crowd-stage { position: relative; order: 1; z-index: 20; flex: 0 0 0; height: 0; min-height: 0; margin: 0; overflow: visible; pointer-events: none; }
  .battle-page .battle-crowd-bubble { top: -54px; width: min(340px, 90vw); min-height: 48px; pointer-events: none; }
  .battle-page.playing .playback-controls { order: 2; display: flex; flex-direction: row; justify-content: flex-end; margin: 0; padding: 0; border: 0; background: transparent; }
  .battle-page.playing .playback-state { display: none; }
  .battle-page.playing .playback-actions { display: flex; width: 100%; justify-content: space-between; flex-wrap: nowrap; gap: 4px; }
  .battle-page.playing .playback-actions > * { flex: 0 0 auto; width: auto; min-width: 44px; height: 32px; min-height: 32px; padding: 0 4px; line-height: 1.2; white-space: nowrap; }
  .battle-page.playing .compare-details { order: 4; }
  .battle-page.playing .log { order: 3; }
  .battle-page:not(.playing) .playback-controls { display: flex; justify-content: flex-end; margin: 0; padding: 0; }
  .battle-page:not(.playing) .log { order: 3; }
  .battle-page:not(.playing) .compare-details { order: 4; }
  .battle-page:not(.playing) .battle-next-actions { display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)); align-items: stretch; gap: 8px; }
  .battle-page:not(.playing) .battle-next-actions > button,
  .battle-page:not(.playing) .battle-next-actions > a,
  .battle-page:not(.playing) .battle-next-actions > .button { width: 100%; min-width: 0; min-height: 48px; padding: 9px 10px; white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
  .battle-page:not(.playing) .battle-next-actions > :first-child { grid-column: 1 / -1; }
  .free-recommendations { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .app-shell { padding-right: 11px; padding-left: 11px; }
  .battle-page .battle-head { gap: 4px; }
  .battle-page .fighter { padding-right: 6px; padding-left: 6px; }
  .battle-page .fighter .name { font-size: 13px; }
  .battle-page .fighter .status-pill, .battle-page .fighter .status-chip { min-width: 44px; min-height: 44px; padding: 6px 7px; font-size: 12px; }
}

@media (max-width: 650px) {
  .battle-page .fighter .status-pill, .battle-page .fighter .status-chip { flex: 0 0 auto; min-width: 28px; min-height: 24px; padding: 2px 4px; font-size: 9px; line-height: 1.2; }
}

@media (min-width: 900px) {
  .bottom-nav { gap: 12px; }
  .bottom-nav button { flex: 0 0 auto; min-width: 88px; padding-right: 6px; padding-left: 6px; white-space: nowrap; }
  .battle-result-summary { max-width: 760px; }
}

/* Shared seven-stat comparison for the entry overlay and the expandable match details. */
.battle-page .compare-details[open] { max-height: none !important; overflow: visible !important; }
.compare-content { min-width: 0; }
.compare-profiles { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; margin: 8px 0 10px; }
.compare-profile { display: flex; min-width: 0; align-items: center; gap: 8px; }
.compare-profile-b { flex-direction: row-reverse; text-align: right; }
.compare-portrait { width: 52px; height: 52px; flex: 0 0 52px; overflow: hidden; border: 1px solid #75694d; border-radius: 4px; }
.compare-portrait .portrait-art { width: 100%; height: 100%; }
.compare-profile-copy { display: grid; min-width: 0; gap: 2px; }
.compare-profile-copy > b { color: #f0e7d2; font-size: 13px; overflow-wrap: anywhere; }
.compare-profile-copy > span { color: #d6c28f; font-size: 10px; overflow-wrap: anywhere; }
.compare-profile-copy > small { color: #a9a395; font-size: 9px; overflow-wrap: anywhere; }
.compare-list { display: grid; grid-template-columns: minmax(0,1fr); gap: 4px; padding: 2px 0 8px; }
.compare-stat { display: grid; grid-template-columns: 42px minmax(0,1fr) 48px minmax(0,1fr) 42px; align-items: center; gap: 7px; min-height: 18px; font: 10px/1.2 var(--mono); }
.compare-label { grid-column: 3; grid-row: 1; color: #ded7c4; font: 10px/1.2 var(--serif); text-align: center; white-space: nowrap; }
.compare-content .compare-stat .compare-label { grid-row: 1; }
.compare-value { color: #e8e0cf; font-variant-numeric: tabular-nums; }
.compare-value-a { grid-column: 1; text-align: right; }
.compare-value-b { grid-column: 5; text-align: left; }
.compare-bar { display: block; height: 9px; overflow: hidden; border: 1px solid #565349; border-radius: 2px; background: #151719; }
.compare-bar-a { grid-column: 2; grid-row: 1; display: flex; justify-content: flex-end; }
.compare-bar-b { grid-column: 4; grid-row: 1; }
.compare-bar > i { display: block; height: 100%; background: var(--compare-color); box-shadow: 0 0 7px color-mix(in srgb, var(--compare-color) 45%, transparent); }
.compare-bar.over-cap { position: relative; overflow: visible; border-color: #d6bd81; }
.compare-bar.over-cap:before, .compare-bar.over-cap:after { position: absolute; top: 50%; width: 5px; height: 5px; border: 1px solid #211f1a; border-radius: 50%; background: #ead293; box-shadow: 0 0 4px rgba(234, 210, 147, .5); content: ""; transform: translateY(-50%); }
.compare-bar-a.over-cap:after, .compare-bar-b.over-cap:before { content: none; }
.compare-bar-a.over-cap:before { left: -4px; }
.compare-bar-b.over-cap:after { right: -4px; }
.compare-details .compare-content { padding-bottom: 5px; }
.battle-entry-overlay { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); background: rgba(7, 9, 13, .84); backdrop-filter: blur(5px); }
.battle-entry-overlay[hidden] { display: none !important; }
.battle-entry-dialog { width: min(760px, 100%); max-height: calc(100dvh - 24px); overflow-y: auto; padding: clamp(13px, 3vw, 24px); border: 1px solid #8f7545; border-radius: 8px; background: linear-gradient(145deg, #25251f, #15171b 76%); box-shadow: 0 22px 70px #000a, inset 0 1px #f3d27b22; }
.battle-entry-head { text-align: center; }
.battle-entry-head .eyebrow { color: #d3b96f; }
.battle-entry-head h2 { margin: 3px 0; color: #f2e4c0; font-size: 22px; }
.battle-entry-head p { margin: 0; color: #bdb5a4; font-size: 12px; }
.battle-entry-dialog .compare-profiles { margin-top: 12px; }
.battle-entry-dialog .compare-portrait { width: 66px; height: 66px; flex-basis: 66px; }
.battle-entry-dialog .compare-profile-copy > b { font-size: 16px; }
.battle-entry-dialog .compare-profile-copy > span { font-size: 12px; }
.battle-entry-dialog .compare-profile-copy > small { font-size: 11px; }
.battle-entry-dialog .compare-list { gap: 6px; }
.battle-entry-dialog .compare-stat { grid-template-columns: 52px minmax(0,1fr) 68px minmax(0,1fr) 52px; min-height: 24px; font-size: 12px; }
.battle-entry-dialog .compare-label { font-size: 12px; }
.battle-entry-dialog .compare-bar { height: 13px; }
.battle-entry-dialog .compare-profile-a { animation: battle-entry-left .52s cubic-bezier(.2,.75,.25,1) both; }
.battle-entry-dialog .compare-profile-b { animation: battle-entry-right .52s cubic-bezier(.2,.75,.25,1) both; }
.battle-entry-dialog .compare-bar-a > i { transform: scaleX(0); transform-origin: right center; animation: battle-entry-bar .72s .12s cubic-bezier(.2,.75,.25,1) both; }
.battle-entry-dialog .compare-bar-b > i { transform: scaleX(0); transform-origin: left center; animation: battle-entry-bar .72s .12s cubic-bezier(.2,.75,.25,1) both; }
@keyframes battle-entry-left { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: translateX(0); } }
@keyframes battle-entry-right { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: translateX(0); } }
@keyframes battle-entry-bar { to { transform: scaleX(1); } }
.battle-entry-actions { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
.battle-entry-countdown { color: #c8beaa; font-size: 12px; }
.battle-entry-actions .button { min-height: 44px; padding: 8px 20px; }
.battle-page.battle-entry-active .battle-head,
.battle-page.battle-entry-active .battle-result-head,
.battle-page.battle-entry-active .battle-result-summary,
.battle-page.battle-entry-active .battle-result-highlight,
.battle-page.battle-entry-active .battle-crowd-stage,
.battle-page.battle-entry-active .compare-details,
.battle-page.battle-entry-active .playback-controls,
.battle-page.battle-entry-active .log { pointer-events: none; }
.battle-page .fighter button.status-chip.status-positive[data-status-key] { border-color: #538b66; background: #1d3828; color: #b9e7bf; }
.battle-page .fighter button.status-chip.status-negative[data-status-key] { border-color: #a55e50; background: #432924; color: #ffd0b8; }
.battle-page .fighter button.status-chip.status-mixed[data-status-key] { border-color: #a38748; background: #3a341f; color: #f0dc91; }
.battle-page .fighter button.status-chip.status-unknown[data-status-key] { border-color: #777568; background: #292a28; color: #ddd9ca; }
@media (prefers-reduced-motion: reduce) {
  .battle-entry-dialog .compare-profile-a, .battle-entry-dialog .compare-profile-b,
  .battle-entry-dialog .compare-bar-a > i, .battle-entry-dialog .compare-bar-b > i { animation: none; transform: none; }
}
@media (max-width: 650px) {
  .compare-profiles { gap: 6px; }
  .compare-portrait { width: 40px; height: 40px; flex-basis: 40px; }
  .compare-profile { gap: 5px; }
  .compare-profile-copy > b { font-size: 11px; }
  .compare-profile-copy > span { font-size: 10px; }
  .compare-profile-copy > small { font-size: 10px; }
  .compare-stat { grid-template-columns: 34px minmax(0,1fr) 42px minmax(0,1fr) 34px; gap: 4px; font-size: 9px; }
  .compare-label { font-size: 9px; }
  .battle-entry-dialog { padding: 12px 9px; }
  .battle-entry-dialog .compare-portrait { width: 48px; height: 48px; flex-basis: 48px; }
  .battle-entry-dialog .compare-profile-copy > b { font-size: 12px; }
  .battle-entry-dialog .compare-profile-copy > span { font-size: 10px; }
  .battle-entry-dialog .compare-profile-copy > small { font-size: 10px; }
  .battle-entry-dialog .compare-stat { grid-template-columns: 31px minmax(0,1fr) 40px minmax(0,1fr) 31px; gap: 3px; min-height: 20px; font-size: 9px; }
  .battle-entry-dialog .compare-label { font-size: 9px; }
  .battle-entry-dialog .compare-bar { height: 10px; }
}
.battle-launch-effect { position: absolute; z-index: 2; inset: 0; display: none; place-items: center; overflow: hidden; pointer-events: none; }
.battle-entry-overlay.launching .battle-launch-effect { display: grid; animation: battle-launch-flare .65s ease-out both; }
.battle-entry-overlay.launching .battle-entry-dialog { filter: brightness(.72); transform: scale(.985); transition: filter .32s ease, transform .32s ease; }
.battle-launch-core { position: relative; display: grid; width: clamp(230px, 32vw, 300px); height: clamp(230px, 32vw, 300px); place-items: center; }
.battle-launch-core:before { position: absolute; inset: -24px; border-radius: 50%; background: radial-gradient(circle, rgba(237, 207, 135, .22), rgba(197, 161, 90, .08) 38%, transparent 70%); content: ""; animation: battle-launch-glow .65s ease-out both; }
.battle-launch-core:after { position: absolute; inset: -34px; border-radius: 50%; background: conic-gradient(from 20deg, transparent 0deg, rgba(240, 217, 164, .62) 32deg, transparent 66deg, transparent 170deg, rgba(196, 162, 95, .42) 210deg, transparent 245deg); mask: radial-gradient(circle, transparent 58%, #000 60%, #000 63%, transparent 65%); content: ""; animation: battle-launch-orbit .65s cubic-bezier(.2,.7,.25,1) both; }
.battle-launch-core img { position: relative; z-index: 1; width: clamp(190px, 26vw, 230px); height: clamp(190px, 26vw, 230px); object-fit: contain; filter: drop-shadow(0 0 5px rgba(255, 225, 150, .7)) drop-shadow(0 0 12px rgba(205, 166, 89, .42)); animation: battle-launch-emblem .65s cubic-bezier(.2,.7,.25,1) both; }
.battle-launch-core b { position: absolute; z-index: 2; bottom: -4px; padding: 3px 12px; border: 1px solid #b89b62; border-radius: 999px; background: rgba(23, 22, 18, .92); color: #f5dfa7; font: 700 12px/1.4 var(--serif); letter-spacing: .22em; text-shadow: 0 0 9px rgba(255, 218, 134, .7); animation: battle-launch-word .65s ease-out both; }
.battle-launch-ring { position: absolute; inset: 0; border: 1px solid rgba(220, 191, 126, .75); border-radius: 50%; box-shadow: 0 0 16px rgba(205, 166, 89, .25), inset 0 0 12px rgba(205, 166, 89, .16); }
.battle-launch-ring.ring-a { animation: battle-launch-ring-a .65s cubic-bezier(.18,.7,.25,1) both; }
.battle-launch-ring.ring-b { inset: 14px; border-color: rgba(236, 219, 176, .65); animation: battle-launch-ring-b .65s cubic-bezier(.18,.7,.25,1) both; }
@keyframes battle-launch-flare { 0% { opacity: 0; } 18% { opacity: 1; } 76% { opacity: 1; } 100% { opacity: 0; } }
@keyframes battle-launch-glow { 0% { opacity: 0; transform: scale(.55); } 35% { opacity: 1; transform: scale(1.05); } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes battle-launch-orbit { from { opacity: 0; transform: rotate(-50deg) scale(.6); } 30% { opacity: 1; } to { opacity: 0; transform: rotate(85deg) scale(1.12); } }
@keyframes battle-launch-emblem { 0% { opacity: 0; transform: scale(.82) rotate(-7deg); } 28% { opacity: 1; transform: scale(1.025) rotate(1deg); } 42%,100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes battle-launch-ring-a { from { opacity: 0; transform: scale(.35); } 40% { opacity: 1; } to { opacity: 0; transform: scale(1.3); } }
@keyframes battle-launch-ring-b { from { opacity: 0; transform: scale(1.35); } 35% { opacity: .85; } to { opacity: 0; transform: scale(.68); } }
@keyframes battle-launch-word { 0%,35% { opacity: 0; transform: translateY(8px); } 58% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-5px); } }
@media (max-width: 650px) { .battle-launch-core { width: clamp(210px, 60vw, 250px); height: clamp(210px, 60vw, 250px); } .battle-launch-core img { width: clamp(170px, 48vw, 190px); height: clamp(170px, 48vw, 190px); } }
@media (prefers-reduced-motion: reduce) {
  .battle-entry-overlay.launching .battle-launch-effect,
  .battle-launch-core:before, .battle-launch-core:after,
  .battle-launch-core img, .battle-launch-core b,
  .battle-launch-ring.ring-a, .battle-launch-ring.ring-b {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
  }
  .battle-entry-overlay.launching .battle-entry-dialog { transition: none !important; transform: none !important; filter: none !important; }
}

/* Home summon: one centered column with a clear path from identity to action. */
.home-page { padding-top: 20px; }
.home-page.home-detail-page { padding-top: 36px; }
.home-hero { width: min(100%, 600px); margin: 8px auto 20px; padding: 0 12px 8px; }
.home-hero .hero-brand-logo { width: min(58vw, 230px); margin: 0 auto 10px; }
.home-hero .sigil { width: 98px; height: 98px; margin: 12px auto 15px; }
.home-hero h1 { margin: 0 0 10px; font-size: clamp(29px, 5vw, 42px); line-height: 1.42; letter-spacing: .08em; }
.home-hero .summon-intro-copy { max-width: 440px; margin: 0 auto; color: #bdbab2; font-size: 14px; line-height: 1.7; }
.home-page .home-summon-form { width: min(100%, 520px); margin: 22px auto 0; display: grid; gap: 12px; align-items: stretch; text-align: left; }
.home-page .home-summon-form .summon-input-wrap { display: block; width: 100%; min-width: 0; }
.home-summon-label { display: block; margin: 0 0 7px 2px; color: #d4c8a8; font-size: 12px; letter-spacing: .08em; }
.home-summon-field { position: relative; }
.home-summon-field .input-mark { position: absolute; top: 50%; left: 15px; color: var(--gold); font-size: 19px; transform: translateY(-50%); pointer-events: none; }
.home-page .home-summon-field input { display: block; width: 100%; min-height: 58px; box-sizing: border-box; padding: 13px 15px 13px 43px; border-radius: 6px; font-size: 17px; }
.home-summon-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 7px 2px 0; }
.home-page .home-summon-form .input-hint { margin: 0; color: #94939a; font: 11px/1.5 var(--serif); }
.home-page .home-summon-form .name-suggestion { width: auto; min-width: 0; height: 32px; min-height: 32px; flex: none; margin: 0; padding: 4px 9px; border: 0; color: #c7b47f; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; box-shadow: none; transform: none; }
.home-page .home-summon-form .name-suggestion:before { display: none; }
.home-page .home-summon-form .name-suggestion:hover { background: #b89b6212; color: #f0d99a; box-shadow: none; transform: none; }
.home-page .home-summon-form .summon-button { width: 100%; min-height: 54px; border-radius: 6px; font-size: 15px; letter-spacing: .06em; }
.home-page .home-summon-form .inline-error { min-height: 0; margin: 2px 2px 0; }
.home-hero .first-play-note { max-width: 520px; margin: 16px auto 0; padding: 10px 12px; }
.home-hero .first-play-note p { font-size: 11px; }
.home-page .home-share { width: min(100%, 520px); margin: 20px auto 0; justify-content: center; }
@media (max-width: 650px) {
  .home-page { padding: 16px 0 32px; }
  .home-page.home-detail-page { padding-top: 25px; }
  .home-hero { margin: 0 auto 14px; padding: 0 4px 4px; }
  .home-hero .hero-brand-logo { width: min(58vw, 205px); margin-bottom: 8px; }
  .home-hero .sigil { width: 86px; height: 86px; margin: 8px auto 11px; }
  .home-hero h1 { margin-bottom: 8px; font-size: clamp(26px, 7vw, 32px); line-height: 1.4; }
  .home-hero .summon-intro-copy { max-width: 340px; font-size: 13px; }
  .home-page .home-summon-form { width: 100%; margin-top: 17px; gap: 10px; }
  .home-page .home-summon-form .summon-button { min-height: 52px; }
  .home-summon-meta { align-items: flex-start; }
  .home-page .home-summon-form .input-hint { max-width: 245px; }
  .home-hero .first-play-note { margin-top: 12px; }
  .home-page .home-share { margin-top: 14px; }
}

/* Returning-player summary: a single, dismissible snapshot after operator notices. */
.away-report-backdrop { position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: max(16px, env(safe-area-inset-top)) 14px max(16px, env(safe-area-inset-bottom)); background: rgba(7, 8, 10, .82); backdrop-filter: blur(5px); }
.away-report-dialog { width: min(100%, 500px); max-height: min(88dvh, 760px); overflow-y: auto; padding: 24px; border: 1px solid #8c7444; border-radius: 10px; background: linear-gradient(155deg, #25231e, #141518 72%); box-shadow: 0 20px 70px #000b, inset 0 1px #f1d58a20; color: #e8e1d1; }
.away-report-dialog > .eyebrow { color: #bda76e; font-size: 10px; letter-spacing: .18em; }
.away-report-dialog h2 { margin: 5px 0 4px; color: #f0d58b; font: 600 25px/1.35 var(--serif); }
.away-report-intro { margin: 0 0 16px; color: #c2beb4; font-size: 13px; }
.away-report-mode { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; margin: 9px 0; padding: 12px 13px; border: 1px solid #66573a; border-radius: 7px; background: #b89b620c; }
.away-report-mode > b { color: #eddbac; font-size: 14px; }
.away-report-rating { color: #b9b4a7; font-size: 12px; }
.away-report-rating strong { color: #f0d58b; font: 700 16px var(--mono); }
.away-report-growth { grid-column: 1 / -1; color: #b9d1aa; font-size: 12px; }
.away-report-mode > small { grid-column: 1 / -1; color: #a8a49c; font-size: 11px; }
.away-report-details { grid-column: 1 / -1; border-top: 1px solid #76674755; padding-top: 8px; }
.away-report-details summary { color: #d5c18e; cursor: pointer; font-size: 12px; }
.away-report-details ul { display: grid; gap: 7px; margin: 9px 0 0; padding: 0; list-style: none; }
.away-report-details li { display: grid; gap: 2px; color: #cbc4b5; font-size: 12px; overflow-wrap: anywhere; }
.away-report-details li b { color: #efe5ce; }
.away-report-error { margin: 10px 0 4px; padding: 9px 10px; border: 1px solid #a64e48; border-radius: 5px; background: #5a242633; color: #ffd0c8; font-size: 12px; line-height: 1.5; }
.away-report-history, .away-report-close { width: 100%; min-height: 44px; margin-top: 10px; }
.away-report-close { margin-top: 6px; }
@media (max-width: 480px) {
  .away-report-backdrop { padding-right: 10px; padding-left: 10px; }
  .away-report-dialog { max-height: 90dvh; padding: 18px 15px; }
  .away-report-mode { gap: 6px 8px; padding: 10px; }
}
