/* =====================================================================
   Type Arena — a turn-based battle simulator
   wepayuncheeze.com  ·  Apple Liquid-Glass system, reuses --hud-* / --apple-*
   Self-contained surface. Same token vocabulary as Pokedex OS so the two
   feel like one app. Honors light/dark (tb_theme) + prefers-reduced-motion.
   ===================================================================== */

:root {
  /* Type palette — identical to Pokedex OS so the surfaces agree */
  --t-Normal:#9099a1;  --t-Fire:#ff7b3c;    --t-Water:#3692ff;
  --t-Electric:#f7cf2e;--t-Grass:#5fc23c;   --t-Ice:#62d0e0;
  --t-Fighting:#e0392b;--t-Poison:#a866c9;  --t-Ground:#dcae53;
  --t-Flying:#8aa8ff;  --t-Psychic:#ff5d8a; --t-Bug:#9bc024;
  --t-Rock:#c7b257;    --t-Ghost:#6f5b9e;   --t-Dragon:#6056e6;
  --t-Dark:#5a5366;    --t-Steel:#7f9bab;   --t-Fairy:#ef8fe0;
}

/* ---- Page shell: this surface SCROLLS (override the game's body lock) -- */
html.type-arena, html.type-arena body {
  position: static !important; width: auto !important; height: auto !important;
  overflow: visible !important; touch-action: auto !important; overscroll-behavior: auto !important;
}
html.type-arena body {
  background: var(--apple-bg); color: var(--apple-fg);
  font-family: var(--apple-stack);
  -webkit-font-smoothing: antialiased; min-height: 100vh; cursor: auto;
}

/* Soft aurora backdrop */
.ar-aurora {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(60vw 50vh at 10% -8%, color-mix(in srgb, var(--apple-accent) 22%, transparent), transparent 60%),
    radial-gradient(55vw 45vh at 100% 6%, color-mix(in srgb, var(--apple-accent-purple) 26%, transparent), transparent 62%),
    radial-gradient(70vw 60vh at 50% 120%, color-mix(in srgb, var(--apple-accent-brand) 18%, transparent), transparent 64%);
  filter: saturate(120%); opacity: .9;
}
[data-theme="dark"] .ar-aurora,
:root:not([data-theme="light"]) .ar-aurora { opacity: .55; }

/* ---- Top nav (mirrors pokedex pk-topnav) --------------------------- */
.ar-topnav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; gap: 16px; height: 52px; padding: 0 18px;
  background: var(--hud-glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hud-hairline);
}
.ar-topnav a.brand { font-weight: 600; font-size: 14px; letter-spacing: -.02em; color: var(--apple-fg); text-decoration: none; display: flex; align-items: center; gap: 8px; }
.ar-topnav a.brand .al-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--apple-accent-brand); display: inline-block; }
.ar-topnav .links { margin-left: auto; display: flex; gap: 20px; font-size: 13px; }
.ar-topnav .links a { color: var(--apple-fg); opacity: .82; text-decoration: none; transition: opacity .2s; }
.ar-topnav .links a:hover { opacity: 1; }
.ar-topnav .links a.cta { background: var(--apple-accent); color: #fff; padding: 6px 14px; border-radius: 999px; opacity: 1; }
@media (max-width: 700px) { .ar-topnav .links a:not(.cta) { display: none; } }

.ar-app {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto;
  padding: calc(60px + env(safe-area-inset-top,0px)) 20px 120px;
}

/* ---- Glass primitive (matches pokedex) ----------------------------- */
.glass {
  background: var(--hud-glass);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid var(--hud-hairline); border-radius: var(--hud-radius);
  box-shadow: var(--hud-shadow-soft); position: relative;
}
.glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.30), rgba(255,255,255,0) 38%);
  opacity: .7; mix-blend-mode: screen;
}
[data-theme="dark"] .glass::before,
:root:not([data-theme="light"]) .glass::before { opacity: .18; }

/* ---- Hero ---------------------------------------------------------- */
.ar-hero { margin: 26px 0 22px; }
.ar-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--apple-accent); font-weight: 600; margin-bottom: 10px;
}
.ar-eyebrow .glyph { width: 15px; height: 15px; fill: currentColor; }
.ar-hero h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.02; letter-spacing: -.03em; font-weight: 680; margin: 0; }
.ar-hero h1 em { font-style: normal; color: var(--apple-accent); }
.ar-hero p { margin: 10px 0 0; color: var(--apple-fg-soft); max-width: 62ch; font-size: 15px; line-height: 1.5; }
.ar-status { margin-top: 8px; font-size: 13px; color: var(--apple-fg-mute); min-height: 16px; }

.hidden { display: none !important; }

/* ================================================================== */
/*  TEAM BUILDER                                                       */
/* ================================================================== */
.ar-builder { display: grid; grid-template-columns: 1fr; gap: 16px; }

.ar-panel { padding: 16px 16px 18px; }
.ar-sec-title {
  display: flex; align-items: center; gap: 8px; font-weight: 640;
  font-size: 14px; letter-spacing: -.01em; margin: 0 0 12px;
}
.ar-sec-title .glyph { width: 15px; height: 15px; fill: var(--apple-accent); }
.ar-sec-title small { font-weight: 500; color: var(--apple-fg-mute); margin-left: auto; font-size: 12px; }

/* search + region */
.ar-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ar-search {
  flex: 1 1 220px; display: flex; align-items: center; gap: 9px;
  background: var(--hud-tile-bg); border: 1px solid var(--hud-hairline);
  border-radius: var(--hud-radius-pill); padding: 9px 14px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.ar-search:focus-within { border-color: color-mix(in srgb, var(--apple-accent) 55%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--apple-accent) 14%, transparent); }
.ar-search .glyph { width: 16px; height: 16px; fill: var(--apple-fg-mute); }
.ar-search input { flex: 1; border: 0; background: transparent; color: var(--apple-fg); font: inherit; font-size: 14px; outline: none; }
.ar-search kbd { font: 600 11px var(--apple-mono); border: 1px solid var(--hud-hairline); border-radius: 6px; padding: 1px 6px; color: var(--apple-fg-mute); }
.ar-count { font-size: 12px; color: var(--apple-fg-mute); font-variant-numeric: tabular-nums; }

/* type chips */
.ar-types { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.ar-chip {
  border: 1px solid var(--hud-hairline); background: var(--hud-tile-bg);
  color: var(--apple-fg-soft); font: 600 12px var(--apple-stack);
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  transition: transform .15s var(--hud-ease), background .2s, color .2s, border-color .2s;
}
.ar-chip:hover { transform: translateY(-1px); }
.ar-chip.on { background: color-mix(in srgb, var(--c) 88%, transparent); border-color: transparent; color: #fff; box-shadow: 0 3px 12px color-mix(in srgb, var(--c) 40%, transparent); }

/* roster grid */
.ar-roster {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 12px; max-height: 56vh; overflow-y: auto; padding: 4px;
  scrollbar-width: thin;
}
.ar-mon {
  position: relative; border: 1px solid var(--hud-hairline);
  background: var(--hud-tile-bg); border-radius: 16px; padding: 10px 8px 9px;
  cursor: pointer; text-align: center; overflow: hidden;
  transition: transform .18s var(--hud-ease), box-shadow .2s, border-color .2s;
}
.ar-mon::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: .14; pointer-events: none;
  background: linear-gradient(150deg, var(--g1), var(--g2));
}
.ar-mon:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 24px rgba(0,0,0,.16); }
.ar-mon.picked { border-color: color-mix(in srgb, var(--apple-accent) 70%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--apple-accent) 55%, transparent); }
.ar-mon.picked::after { content: "✓"; position: absolute; top: 6px; right: 8px; font-size: 11px; font-weight: 800; color: #fff; background: var(--apple-accent); width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; }
.ar-mon-spr { position: relative; height: 64px; display: grid; place-items: center; }
.ar-mon-spr img { width: 64px; height: 64px; image-rendering: pixelated; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0,0,0,.22)); }
.ar-mon-no { font: 600 10px var(--apple-mono); color: var(--apple-fg-mute); }
.ar-mon-name { font-size: 12px; font-weight: 600; letter-spacing: -.01em; margin: 1px 0 4px; }
.ar-mon-types { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; }
.ar-tt { font: 700 9px var(--apple-stack); text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--c); padding: 2px 6px; border-radius: 999px; }

/* team strip */
.ar-team { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.ar-slot {
  position: relative; border: 1px dashed var(--hud-hairline); border-radius: 16px;
  min-height: 96px; display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: var(--hud-tile-bg);
}
.ar-slot.filled { border-style: solid; }
.ar-slot.filled::before { content: ""; position: absolute; inset: 0; border-radius: inherit; opacity: .12; background: linear-gradient(150deg, var(--g1), transparent); pointer-events: none; }
.ar-slot-empty { color: var(--apple-fg-mute); font-size: 13px; margin: auto; }
.ar-slot-spr { width: 56px; height: 56px; image-rendering: pixelated; filter: drop-shadow(0 3px 5px rgba(0,0,0,.22)); }
.ar-slot-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ar-slot-meta strong { font-size: 14px; letter-spacing: -.01em; }
.ar-lvl { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--apple-fg-mute); }
.ar-lvl input[type=range] { width: 84px; accent-color: var(--apple-accent); }
.ar-lvl b { font-variant-numeric: tabular-nums; color: var(--apple-fg); min-width: 22px; }
.ar-slot-x { position: absolute; top: 6px; right: 8px; border: 0; background: transparent; color: var(--apple-fg-mute); font-size: 18px; line-height: 1; cursor: pointer; }
.ar-slot-x:hover { color: var(--t-Fire); }
@media (max-width: 620px) { .ar-team { grid-template-columns: 1fr; } }

/* opponent + start */
.ar-foe-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.ar-seg { display: inline-flex; gap: 2px; background: var(--hud-tile-bg); border: 1px solid var(--hud-hairline); border-radius: 999px; padding: 3px; }
.ar-seg button { border: 0; background: transparent; color: var(--apple-fg-soft); font: 600 12px var(--apple-stack); padding: 6px 14px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.ar-seg button.is-on { background: var(--apple-accent); color: #fff; }
.ar-foe-pick label { font-size: 12px; color: var(--apple-fg-mute); display: block; margin-bottom: 4px; }
.ar-sel { font: inherit; font-size: 13px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--hud-hairline); background: var(--hud-tile-bg); color: var(--apple-fg); min-width: 230px; }

.ar-start {
  width: 100%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--apple-accent), var(--apple-accent-purple));
  color: #fff; font: 700 16px var(--apple-stack); letter-spacing: -.01em;
  padding: 16px; border-radius: 16px; box-shadow: 0 8px 26px color-mix(in srgb, var(--apple-accent) 40%, transparent);
  transition: transform .16s var(--hud-ease), box-shadow .2s, opacity .2s;
}
.ar-start:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 32px color-mix(in srgb, var(--apple-accent) 50%, transparent); }
.ar-start:active:not(:disabled) { transform: translateY(0) scale(.99); }
.ar-start:disabled { opacity: .5; cursor: default; }

/* ================================================================== */
/*  BATTLE STAGE                                                       */
/* ================================================================== */
.ar-stage { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 960px) { .ar-stage { grid-template-columns: 1.7fr 1fr; align-items: start; } }

.ar-scene {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--hud-radius);
  overflow: hidden; border: 1px solid var(--hud-hairline);
  background:
    radial-gradient(120% 90% at 50% -10%, color-mix(in srgb, var(--apple-accent) 16%, transparent), transparent 55%),
    linear-gradient(180deg, color-mix(in srgb, var(--apple-accent-brand) 12%, var(--apple-bg)) , var(--apple-bg));
  box-shadow: var(--hud-shadow-soft);
}
.ar-arena-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 40% at 28% 78%, color-mix(in srgb, var(--apple-accent-brand) 20%, transparent), transparent 70%),
    radial-gradient(50% 36% at 74% 30%, color-mix(in srgb, var(--apple-accent-purple) 18%, transparent), transparent 72%);
  opacity: .9;
}

/* platforms */
.ar-side { position: absolute; width: 46%; }
.ar-side.foe { top: 6%; right: 4%; }
.ar-side.mine { bottom: 5%; left: 4%; }

.ar-card { padding: 9px 12px 10px; }
.ar-card-top { display: flex; align-items: baseline; gap: 8px; }
.ar-card-name { font-size: 15px; letter-spacing: -.01em; }
.ar-card-lvl { margin-left: auto; font: 600 11px var(--apple-mono); color: var(--apple-fg-mute); }
.ar-types-row { display: flex; gap: 4px; margin: 4px 0 7px; }
.ar-hpbar { height: 9px; border-radius: 999px; background: color-mix(in srgb, var(--apple-fg) 12%, transparent); overflow: hidden; }
.ar-hpfill { display: block; height: 100%; border-radius: 999px; transition: width .42s var(--hud-ease); background: #43d17a; }
.ar-hpfill.mid { background: #f6c544; }
.ar-hpfill.low { background: #ff5d52; animation: ar-hp-pulse 1s ease-in-out infinite; }
@keyframes ar-hp-pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.ar-hpnum { font: 600 11px var(--apple-mono); color: var(--apple-fg-mute); margin-top: 3px; }
.ar-hpnum .ar-hpcur { color: var(--apple-fg); }
.ar-dots { display: flex; gap: 4px; margin-top: 6px; }
.ar-dot { width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--apple-accent) 70%, transparent); border: 1px solid var(--hud-hairline); }
.ar-dot.dead { background: color-mix(in srgb, var(--apple-fg) 18%, transparent); }
.ar-dot.cur { box-shadow: 0 0 0 2px color-mix(in srgb, var(--apple-accent) 45%, transparent); }

.ar-plat { position: relative; margin-top: 6px; height: 96px; display: grid; place-items: center; }
.ar-side.foe .ar-plat { margin-top: 8px; }
.ar-shadow { position: absolute; bottom: 6px; width: 78px; height: 16px; border-radius: 50%; background: rgba(0,0,0,.28); filter: blur(5px); }
.ar-sprite { width: 104px; height: 104px; image-rendering: pixelated; object-fit: contain; filter: drop-shadow(0 6px 9px rgba(0,0,0,.32)); }
.ar-side.mine .ar-sprite { transform: scale(1.25); }
@media (max-width: 560px) { .ar-sprite { width: 80px; height: 80px; } .ar-side.mine .ar-sprite { transform: scale(1.15); } }

.ar-pop-layer { position: absolute; inset: 0; pointer-events: none; }
.ar-pop {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%);
  font: 800 22px var(--apple-stack); color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.5);
  animation: ar-pop-up 1.05s var(--hud-ease) forwards;
}
.ar-pop.eff-super { color: #ffe06a; font-size: 26px; }
.ar-pop.eff-weak { color: #b9c0c8; font-size: 18px; }
.ar-pop.eff-none { color: #9aa0a6; font-size: 16px; }
.ar-pop.crit { color: #ff7b3c; }
@keyframes ar-pop-up { 0% { opacity: 0; transform: translate(-50%, 6px) scale(.7); } 18% { opacity: 1; transform: translate(-50%, -6px) scale(1.12); } 100% { opacity: 0; transform: translate(-50%, -42px) scale(1); } }

/* hit / shake / lunge / faint anims */
.ar-shake { animation: ar-shake .34s ease; }
@keyframes ar-shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.ar-side.mine .ar-shake { animation: ar-shake-m .34s ease; }
@keyframes ar-shake-m { 0%,100% { transform: scale(1.25) translateX(0); } 20% { transform: scale(1.25) translateX(-6px); } 50% { transform: scale(1.25) translateX(5px); } 80% { transform: scale(1.25) translateX(-3px); } }
.ar-lunge { animation: ar-lunge .3s ease; }
@keyframes ar-lunge { 0%,100% { } 50% { transform: translateY(-6px); } }
.ar-side.mine .ar-lunge { animation: ar-lunge-m .3s ease; }
@keyframes ar-lunge-m { 0%,100% { transform: scale(1.25); } 50% { transform: scale(1.25) translateY(-7px); } }
.ar-faint { animation: ar-faint .45s ease forwards; }
@keyframes ar-faint { to { opacity: 0; transform: translateY(34px) scale(.6) rotate(8deg); } }

.ar-screenshake { animation: ar-screenshake .36s ease; }
@keyframes ar-screenshake { 0%,100% { transform: translate(0,0); } 25% { transform: translate(4px,-3px); } 50% { transform: translate(-5px,3px); } 75% { transform: translate(3px,2px); } }
.ar-chroma { animation: ar-chroma .36s ease; }
@keyframes ar-chroma { 0% { filter: hue-rotate(0) saturate(1); } 50% { filter: hue-rotate(35deg) saturate(1.8) brightness(1.15); } 100% { filter: none; } }

/* ---- turn log + tray (right column) -------------------------------- */
.ar-rail { display: flex; flex-direction: column; gap: 16px; }
.ar-log {
  padding: 12px 14px; height: 240px; overflow-y: auto; font-size: 13px; line-height: 1.5;
  scrollbar-width: thin;
}
.ar-log-line { padding: 3px 0; border-bottom: 1px solid var(--hud-hairline-soft); color: var(--apple-fg-soft); }
.ar-log-line:last-child { border-bottom: 0; }
.ar-log-line b { color: var(--apple-fg); }
.ar-log-line.sys { color: var(--apple-fg-mute); font-style: italic; }
.ar-log-line.player b { color: var(--apple-accent); }
.ar-log-line .se { color: var(--t-Fire); }
.ar-log-line .crit { color: var(--t-Electric); }
.ar-log-line.faint b { color: var(--t-Fighting); }
.ar-log-line.win { color: #43d17a; font-weight: 700; }
.ar-log-line.lose { color: var(--t-Fire); font-weight: 700; }
.ar-log-line .mv { font-weight: 700; color: var(--c); }

.ar-tray { padding: 14px; }
.ar-tray-msg { font-size: 13px; color: var(--apple-fg-soft); margin-bottom: 10px; }
.ar-tray-msg b { color: var(--apple-fg); }
.ar-moves { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ar-move {
  position: relative; text-align: left; cursor: pointer; overflow: hidden;
  border: 1px solid var(--hud-hairline); border-radius: 14px; padding: 10px 12px;
  background: var(--hud-tile-bg); color: var(--apple-fg);
  display: flex; flex-direction: column; gap: 3px;
  transition: transform .12s var(--hud-ease), box-shadow .2s, border-color .2s;
}
.ar-move::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.ar-move:hover:not(:disabled) { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 60%, transparent); box-shadow: 0 8px 20px color-mix(in srgb, var(--c) 28%, transparent); }
.ar-move:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.ar-move.spent { opacity: .42; cursor: default; }
.ar-move-name { font-weight: 650; font-size: 14px; letter-spacing: -.01em; }
.ar-move-meta { display: flex; gap: 8px; align-items: center; font-size: 11px; }
.ar-move-type { font: 700 9px var(--apple-stack); text-transform: uppercase; letter-spacing: .05em; color: #fff; background: var(--c); padding: 1px 7px; border-radius: 999px; }
.ar-move-pp { color: var(--apple-fg-mute); font-family: var(--apple-mono); }
.ar-move-pwr { font: 600 10px var(--apple-mono); color: var(--apple-fg-mute); }

.ar-switch-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.ar-switch-lbl { font-size: 12px; color: var(--apple-fg-mute); }
.ar-switch { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--hud-hairline); background: var(--hud-tile-bg); color: var(--apple-fg); border-radius: 999px; padding: 4px 12px 4px 5px; cursor: pointer; font-size: 12px; transition: transform .14s var(--hud-ease), border-color .2s; }
.ar-switch:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--apple-accent) 50%, transparent); }
.ar-switch img { width: 26px; height: 26px; image-rendering: pixelated; }

.ar-stage-foot { margin-top: 4px; }
.ar-btn {
  border: 1px solid var(--hud-hairline); background: var(--hud-tile-bg); color: var(--apple-fg);
  font: 600 13px var(--apple-stack); padding: 9px 16px; border-radius: 12px; cursor: pointer;
  transition: transform .14s var(--hud-ease), border-color .2s, background .2s;
}
.ar-btn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--apple-accent) 50%, transparent); }
.ar-btn.primary { background: var(--apple-accent); color: #fff; border-color: transparent; }
.ar-btn.ghost { background: transparent; }

/* ================================================================== */
/*  RECAP overlay                                                      */
/* ================================================================== */
.ar-recap {
  position: fixed; inset: 0; z-index: 80; display: none;
  align-items: center; justify-content: center; padding: 22px;
  background: color-mix(in srgb, var(--apple-bg) 55%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.ar-recap.on { display: flex; animation: ar-fade .25s ease; }
@keyframes ar-fade { from { opacity: 0; } to { opacity: 1; } }
.ar-recap-sheet {
  width: min(640px, 100%); max-height: 88vh; overflow-y: auto; padding: 22px;
  animation: ar-rise .3s var(--hud-ease);
}
@keyframes ar-rise { from { transform: translateY(18px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.ar-recap-banner { text-align: center; padding: 18px 0 14px; border-radius: 16px; margin-bottom: 18px; }
.ar-recap-banner.win { background: linear-gradient(135deg, color-mix(in srgb, #43d17a 28%, transparent), transparent); }
.ar-recap-banner.lose { background: linear-gradient(135deg, color-mix(in srgb, var(--t-Fire) 28%, transparent), transparent); }
.ar-recap-title { font-size: 30px; font-weight: 740; letter-spacing: -.02em; }
.ar-recap-banner.win .ar-recap-title { color: #43d17a; }
.ar-recap-banner.lose .ar-recap-title { color: var(--t-Fire); }
.ar-recap-sub { color: var(--apple-fg-soft); font-size: 14px; margin-top: 4px; }
.ar-recap-sub b { color: var(--apple-fg); }
.ar-recap-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 540px) { .ar-recap-cols { grid-template-columns: 1fr; } }
.ar-recap-col h4 { margin: 0 0 8px; font-size: 13px; color: var(--apple-fg-mute); font-weight: 600; }
.ar-recap-mon { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.ar-recap-mon img { width: 34px; height: 34px; image-rendering: pixelated; }
.ar-recap-mon.dead { opacity: .45; }
.ar-recap-mon.dead img { filter: grayscale(1); }
.ar-recap-mon .rn { font-size: 13px; font-weight: 600; }
.ar-recap-mon .rh { margin-left: auto; font: 600 11px var(--apple-mono); color: var(--apple-fg-mute); }
.ar-recap-seed { text-align: center; font-size: 12px; color: var(--apple-fg-mute); margin-bottom: 16px; }
.ar-recap-seed code { font-family: var(--apple-mono); color: var(--apple-fg); background: var(--hud-tile-bg); padding: 2px 7px; border-radius: 6px; }
.ar-recap-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* toast */
.ar-toast {
  position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom,0px)); transform: translateX(-50%) translateY(16px);
  z-index: 90; padding: 10px 18px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--hud-glass-strong); border: 1px solid var(--hud-hairline);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: var(--hud-shadow-soft); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s var(--hud-ease);
}
.ar-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ar-hpfill, .ar-mon, .ar-move, .ar-chip, .ar-switch, .ar-btn, .ar-start { transition: none !important; }
  .ar-pop, .ar-shake, .ar-shake-m, .ar-lunge, .ar-faint, .ar-screenshake, .ar-chroma,
  .ar-recap.on, .ar-recap-sheet, .ar-hpfill.low { animation: none !important; }
}
