/* =========================================================
   ExamMVP — pets, pet shop and the arena
   Loaded only on /pets, /pets/shop and /arena pages.
   ========================================================= */

.pet-page { --pet-gold: #f2b53a; --pet-gold-2: #cc8616; --pet-ink: #1b2330; --pet-fire: #e8590c; --pet-water: #1c7ed6; --pet-earth: #8d6e3f; --pet-wind: #2f9e44; }
.pet-page .h4 { font-size: 1rem; font-weight: 600; }
.pet-page .ml-auto { margin-left: auto; }
.btn-arena { --b: #d9480f; --bt: #fff; background: linear-gradient(180deg, #f76707, #c92a2a); box-shadow: 0 6px 16px -6px rgba(201, 42, 42, .6); }
.btn-arena:hover { filter: brightness(1.06); }
.btn-glass { --b: rgba(255, 255, 255, .22); --bt: #fff; backdrop-filter: blur(6px); min-height: 40px; padding: 8px 12px; }
.input-lg { min-height: 52px; font-size: 1.05rem; }
.text-red { color: var(--red); }

/* ---------- Tabs ---------- */
.pet-topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pet-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; padding: 2px; }
.pet-tabs::-webkit-scrollbar { display: none; }
.pet-tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; min-height: 44px; border-radius: 999px; white-space: nowrap; font-weight: 600; font-size: .92rem;
  color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); text-decoration: none; transition: background .2s, color .2s; }
.pet-tab svg { width: 18px; height: 18px; }
.pet-tab:hover { color: var(--text); }
.pet-tab.is-active { background: var(--pet-ink); color: #fff; border-color: var(--pet-ink); }
:root[data-theme="dark"] .pet-tab.is-active { background: var(--pet-gold); color: #231a05; border-color: var(--pet-gold); }
.pet-wallet { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; font-weight: 700; background: var(--tint-yellow); color: var(--ink-yellow); white-space: nowrap; text-decoration: none; }
.pet-wallet .coin-ico { width: 22px; height: 22px; }

/* ---------- Hero banners ---------- */
.pet-hero, .arena-hero { position: relative; overflow: hidden; border-radius: var(--radius-xl); min-height: 200px; display: flex; align-items: flex-end; gap: 16px; padding: 22px; margin-bottom: 18px; color: #fff; isolation: isolate; background: #1b2330; }
.pet-hero.is-slim, .arena-hero.is-slim { min-height: 150px; }
.pet-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.pet-hero::after, .arena-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(10, 14, 22, .86) 0%, rgba(10, 14, 22, .55) 55%, rgba(10, 14, 22, .15) 100%); }
.pet-hero-text { max-width: 640px; }
.pet-hero h1, .arena-hero h1 { font-size: clamp(1.4rem, 3.4vw, 2.2rem); line-height: 1.2; margin: 4px 0 6px; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.pet-hero p, .arena-hero p { margin: 0; color: rgba(255, 255, 255, .88); font-size: .95rem; }
.pet-eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; color: #ffd98a; text-transform: uppercase; }
.pet-hero-pet, .arena-me { margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 18px; color: #fff; text-decoration: none;
  background: rgba(10, 14, 22, .55); border: 1px solid rgba(255, 255, 255, .18); backdrop-filter: blur(8px); flex-shrink: 0; }
.pet-hero-pet img, .arena-me img { width: 72px; height: 72px; object-fit: contain; }
.pet-hero-pet span, .arena-me-info { display: flex; flex-direction: column; font-weight: 700; line-height: 1.3; }
.pet-hero-pet small, .arena-me-info small { font-weight: 500; font-size: .78rem; color: rgba(255, 255, 255, .8); }
@media (max-width: 720px) {
  .pet-hero, .arena-hero { flex-direction: column; align-items: stretch; padding: 18px; min-height: 0; }
  .pet-hero::after, .arena-hero::after { background: linear-gradient(180deg, rgba(10, 14, 22, .45) 0%, rgba(10, 14, 22, .88) 100%); }
  .pet-hero-pet, .arena-me { margin-left: 0; }
}

/* ---------- Element chips ---------- */
.el-chip, .role-chip, .rank-chip, .adv-chip, .buff-chip { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.el-chip { color: #fff; background: var(--pet-fire); }
.el-chip.el-water { background: var(--pet-water); } .el-chip.el-earth { background: var(--pet-earth); } .el-chip.el-wind { background: var(--pet-wind); }
.role-chip { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.rank-chip { background: rgba(10, 14, 22, .6); color: #ffd98a; backdrop-filter: blur(6px); }
.adv-chip.is-good { background: var(--tint-green); color: var(--ink-green); } .adv-chip.is-bad { background: var(--tint-red); color: var(--ink-red); }
.buff-chip { background: var(--tint-yellow); color: var(--ink-yellow); }

/* ---------- Adoption ---------- */
.species-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 18px; }
.species-card { position: relative; display: flex; flex-direction: column; border-radius: var(--radius-lg); border: 2px solid var(--border); background: var(--surface-solid); overflow: hidden; cursor: pointer;
  transition: transform .2s var(--bounce), border-color .2s, box-shadow .2s; }
.species-card input { position: absolute; opacity: 0; pointer-events: none; }
.species-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.species-card:has(input:checked) { border-color: var(--pet-gold); box-shadow: 0 0 0 4px rgba(242, 181, 58, .3), var(--shadow); }
.species-card:has(input:focus-visible) { outline: 3px solid var(--ring); outline-offset: 2px; }
.species-card::after { content: '✓'; position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800;
  background: var(--pet-gold); color: #231a05; transform: scale(0); transition: transform .25s var(--bounce); }
.species-card:has(input:checked)::after { transform: scale(1); }
.species-art { display: block; aspect-ratio: 4 / 3; background: radial-gradient(circle at 50% 70%, #fff6df 0%, #f4e2bb 55%, #e6c993 100%); }
.species-card.el-water .species-art { background: radial-gradient(circle at 50% 70%, #eef7ff 0%, #cfe6fb 55%, #a8cdf0 100%); }
.species-card.el-earth .species-art { background: radial-gradient(circle at 50% 70%, #f5f1e6 0%, #e2d6b8 55%, #c9b78d 100%); }
.species-card.el-wind .species-art { background: radial-gradient(circle at 50% 70%, #effaf0 0%, #d0edd3 55%, #a7d8ae 100%); }
.species-art img { width: 100%; height: 100%; object-fit: contain; padding: 8px 8px 0; transition: transform .35s var(--bounce); }
.species-card:has(input:checked) .species-art img { transform: scale(1.06) translateY(-3px); animation: pet-bob 2.4s ease-in-out infinite; }
.species-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.species-body strong { font-size: 1.05rem; }
.species-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.species-special { color: var(--ink-red); font-weight: 600; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin-top: 2px; }
.mini-stat { display: grid; grid-template-columns: 34px 1fr 30px; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; color: var(--muted); }
.mini-stat i { height: 6px; border-radius: 3px; background: var(--surface-2); position: relative; overflow: hidden; }
.mini-stat i::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--v); border-radius: 3px; background: linear-gradient(90deg, #f2b53a, #e8590c); }
.mini-stat b { text-align: right; color: var(--text); }
.adopt-name { max-width: 720px; margin: 0 auto; }
.adopt-row { display: flex; gap: 10px; margin-bottom: 8px; }
.adopt-row .input { flex: 1; min-width: 0; }
@media (max-width: 520px) { .adopt-row { flex-direction: column; } .species-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .species-body .tiny.muted, .species-special { display: none; } .mini-stats { grid-template-columns: 1fr; } }

/* ---------- Alerts and pet switcher ---------- */
.pet-alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); margin-bottom: 12px; background: var(--tint-red); color: var(--ink-red); text-decoration: none; font-weight: 500; }
.pet-alert.is-warn { background: var(--tint-yellow); color: var(--ink-yellow); }
.pet-switch { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 8px; scrollbar-width: thin; }
.pet-switch-item { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 16px; background: var(--surface-solid); border: 2px solid var(--border); color: var(--text); text-decoration: none; flex-shrink: 0; min-height: 56px; }
.pet-switch-item img { width: 44px; height: 44px; object-fit: contain; }
.pet-switch-item span { display: flex; flex-direction: column; font-weight: 700; font-size: .9rem; line-height: 1.25; }
.pet-switch-item small { font-weight: 500; font-size: .72rem; color: var(--muted); }
.pet-switch-item.is-current { border-color: var(--pet-gold); background: var(--tint-yellow); }
.pet-switch-item.is-add { border-style: dashed; padding-left: 12px; }
.pet-switch-item.is-add button { all: unset; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.add-ico { font-size: 1.5rem; width: 32px; text-align: center; }
.add-ico img { width: 36px; height: 36px; object-fit: contain; }
.pet-switch-item .coin-ico, .pet-page small .coin-ico { width: 16px; height: 16px; vertical-align: -3px; }
.pshop-buy .coin-ico, .pshop-card .btn .coin-ico { width: 20px; height: 20px; }

/* ---------- Pet dashboard ---------- */
.pet-main { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; margin-bottom: 18px; }
@media (max-width: 860px) { .pet-main { grid-template-columns: 1fr; } }
.pet-showcase { position: relative; overflow: hidden; border-radius: var(--radius-xl); min-height: 380px; display: flex; flex-direction: column; isolation: isolate; color: #fff; background: #1b2330; }
.pet-showcase-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.pet-showcase::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 14, 22, .25) 0%, rgba(10, 14, 22, 0) 35%, rgba(10, 14, 22, .78) 100%); }
.pet-showcase-top { display: flex; justify-content: space-between; gap: 8px; padding: 14px; flex-wrap: wrap; }
.pet-figure { position: relative; flex: 1; display: flex; align-items: flex-end; justify-content: center; min-height: 230px; }
.pet-figure img { position: relative; width: min(78%, 360px); aspect-ratio: 1; object-fit: contain; object-position: bottom; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .45)); animation: pet-bob 2.6s ease-in-out infinite; transform-origin: 50% 100%; cursor: pointer; }
.pet-figure.is-happy img { animation: pet-hop .7s var(--bounce); }
.pet-shadow { position: absolute; bottom: 4px; left: 50%; width: 46%; height: 22px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, .5), transparent 70%); animation: pet-shadow 2.6s ease-in-out infinite; }
.pet-mood-bubble { position: absolute; top: 6%; right: 16%; font-size: 1.8rem; background: #fff; border-radius: 50% 50% 50% 8px; width: 50px; height: 50px; display: grid; place-items: center; box-shadow: var(--shadow); animation: pet-bubble 3s ease-in-out infinite; }
.pet-nameplate { display: flex; align-items: center; gap: 12px; padding: 14px 16px 16px; position: relative; }
.lv-badge { flex-shrink: 0; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; font-weight: 800; font-size: 1rem; color: #231a05;
  background: linear-gradient(160deg, #ffe08a, #f2b53a 55%, #cc8616); box-shadow: 0 4px 0 #9a6410; }
.pet-name { font-size: clamp(1.3rem, 3vw, 1.8rem); margin: 0; color: #fff; line-height: 1.2; word-break: break-word; }
.rename { position: relative; }
.rename summary { list-style: none; }
.rename summary::-webkit-details-marker { display: none; }
.rename-form { position: absolute; right: 0; bottom: calc(100% + 8px); display: flex; gap: 6px; padding: 10px; width: min(300px, 80vw); border-radius: var(--radius); background: var(--surface-solid); box-shadow: var(--shadow-lg); z-index: 5; }
.rename-form .input { flex: 1; min-width: 0; }

@keyframes pet-bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-8px) scale(1.01, .99); } }
@keyframes pet-shadow { 0%, 100% { transform: translateX(-50%) scale(1); opacity: .9; } 50% { transform: translateX(-50%) scale(.85); opacity: .6; } }
@keyframes pet-hop { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-36px) scale(.96, 1.06) rotate(-4deg); } 60% { transform: translateY(0) scale(1.08, .92); } 100% { transform: translateY(0) scale(1); } }
@keyframes pet-bubble { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(4deg); } }

.pet-panel { display: flex; flex-direction: column; gap: 14px; }
.pet-bars { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--radius-lg); background: var(--surface-solid); border: 1px solid var(--border); }
.pbar-head { display: flex; justify-content: space-between; gap: 10px; font-size: .88rem; font-weight: 600; margin-bottom: 5px; }
.pbar-track { height: 14px; border-radius: 7px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .15); }
.pbar-track i { display: block; height: 100%; border-radius: 7px; transition: width .6s var(--ease); background: linear-gradient(90deg, #ffd43b, #f59f00); }
.pbar-track.energy i { background: linear-gradient(90deg, #3bc9db, #1c7ed6); }
.pbar-track.mood i { background: linear-gradient(90deg, #ffa8a8, #f06595); }
.pet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pet-actions > :first-child { grid-column: 1 / -1; }
.pet-actions .btn { width: 100%; min-height: 54px; }
.pet-record { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pet-record div { text-align: center; padding: 10px 6px; border-radius: var(--radius); background: var(--surface-2); }
.pet-record strong { display: block; font-size: 1.25rem; }
.pet-record span { font-size: .75rem; color: var(--muted); }
.buff-list { display: flex; flex-wrap: wrap; gap: 6px; }

.pet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 860px) { .pet-grid { grid-template-columns: 1fr; } }
.pet-grid .card-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.stat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.stat-list li { display: grid; grid-template-columns: 28px minmax(92px, auto) 1fr 64px; align-items: center; gap: 8px; }
.stat-ico { font-size: 1.1rem; text-align: center; }
.stat-name { font-weight: 600; font-size: .9rem; }
.stat-name small { color: var(--muted); font-weight: 700; font-size: .68rem; }
.stat-bar { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.stat-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #f2b53a, #e8590c); }
.stat-list b { text-align: right; font-variant-numeric: tabular-nums; }
.point-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
@media (max-width: 520px) { .point-grid { grid-template-columns: 1fr; } }
.point-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); }
.point-row form { display: flex; gap: 4px; }
.point-val { display: inline-block; min-width: 26px; padding: 0 6px; border-radius: 6px; text-align: center; background: var(--surface-solid); }
.point-btn { min-width: 44px; min-height: 40px; padding: 6px 10px; }

.gear-slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.gear-slot { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 10px 8px; border-radius: var(--radius-lg); border: 2px solid var(--border); background: var(--surface-2); }
.gear-slot img { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .2)); }
.gear-slot strong { font-size: .85rem; line-height: 1.25; }
.gear-slot.is-empty { border-style: dashed; }
.gear-slot-label { font-size: .72rem; font-weight: 700; color: var(--muted); }
.gear-empty { font-size: 2rem; opacity: .35; height: 72px; display: grid; place-items: center; filter: grayscale(1); }
.gear-slot.r-rare, .bag-list li.r-rare, .pshop-card.r-rare { border-color: #74a7f0; }
.gear-slot.r-epic, .bag-list li.r-epic, .pshop-card.r-epic { border-color: #f2b53a; }
.gear-slot.r-legendary, .bag-list li.r-legendary, .pshop-card.r-legendary { border-color: #f76707; }
.gear-slot.r-mythic, .bag-list li.r-mythic, .pshop-card.r-mythic { border-color: #e03131; box-shadow: 0 0 0 3px rgba(224, 49, 49, .15); }
@media (max-width: 420px) { .gear-slots { gap: 6px; } .gear-slot img { width: 56px; height: 56px; } }

.bag-list, .battle-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bag-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface-2); }
.bag-list img { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.bag-list .grow { min-width: 0; }
.bag-list .btn { min-height: 40px; }
.qty { display: inline-block; padding: 0 8px; border-radius: 999px; background: var(--pet-ink); color: #fff; font-size: .75rem; }
.battle-log li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); background: var(--surface-2); border-left: 4px solid var(--border-strong); }
.battle-log img { width: 40px; height: 40px; object-fit: contain; }
.battle-log .res-won { border-left-color: #2f9e44; } .battle-log .res-lost { border-left-color: #e03131; } .battle-log .res-draw { border-left-color: #f59f00; } .battle-log .res-def { border-left-color: #1c7ed6; }
.def-ico { width: 40px; text-align: center; font-size: 1.4rem; }

/* ---------- Pet shop ---------- */
.pet-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.pet-chips .chip { white-space: nowrap; min-height: 40px; }
.pshop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
@media (max-width: 520px) { .pshop-grid { grid-template-columns: 1fr 1fr; gap: 10px; } }
.pshop-card { display: flex; flex-direction: column; border-radius: var(--radius-lg); border: 2px solid var(--border); background: var(--surface-solid); overflow: hidden; transition: transform .2s var(--bounce), box-shadow .2s; }
.pshop-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.pshop-art { position: relative; aspect-ratio: 1.25; display: grid; place-items: center; background: radial-gradient(circle at 50% 60%, var(--surface-solid) 0%, var(--surface-2) 75%); }
.pshop-card.r-epic .pshop-art { background: radial-gradient(circle at 50% 60%, #fff8e1 0%, #fde8b0 80%); }
.pshop-card.r-legendary .pshop-art { background: radial-gradient(circle at 50% 60%, #fff4e6 0%, #ffd8a8 80%); }
.pshop-card.r-mythic .pshop-art { background: radial-gradient(circle at 50% 60%, #fff5f5 0%, #ffc9c9 80%); }
:root[data-theme="dark"] .pshop-card .pshop-art { background: radial-gradient(circle at 50% 60%, #3a3b3f 0%, #2a2b2e 80%); }
.pshop-art img { width: 72%; height: 86%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .2)); transition: transform .3s var(--bounce); }
.pshop-card:hover .pshop-art img { transform: scale(1.08) rotate(-3deg); }
.have-chip { position: absolute; top: 8px; right: 8px; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--tint-green); color: var(--ink-green); }
.pshop-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; flex: 1; }
.pshop-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pshop-name { font-size: .98rem; line-height: 1.3; }
.pshop-stats { font-size: .78rem; font-weight: 700; color: var(--ink-red); }
.pshop-buy { display: flex; gap: 6px; padding: 0 12px 12px; }
.pshop-buy select { width: 72px; flex-shrink: 0; min-height: 44px; }
.pshop-buy .btn, .pshop-card > .btn { min-height: 44px; }
.pshop-card > .btn { margin: 0 12px 12px; width: auto; }

/* ---------- Arena lobby ---------- */
.arena-cta { padding: 28px 18px; }
.arena-cta-pets { display: flex; justify-content: center; margin-bottom: 8px; }
.arena-cta-pets img { width: 96px; height: 96px; object-fit: contain; margin: 0 -10px; }
.stage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .stage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stage-card { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; cursor: pointer; border: 3px solid transparent; isolation: isolate; transition: transform .2s var(--bounce), border-color .2s; }
.stage-card input { position: absolute; opacity: 0; pointer-events: none; }
.stage-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .5s var(--ease); }
.stage-card::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 35%, rgba(10, 14, 22, .85)); }
.stage-card:hover img { transform: scale(1.06); }
.stage-card:has(input:checked) { border-color: var(--pet-gold); transform: translateY(-2px); box-shadow: 0 0 0 4px rgba(242, 181, 58, .3); }
.stage-card:has(input:focus-visible) { outline: 3px solid var(--ring); }
.stage-info { position: absolute; left: 10px; right: 10px; bottom: 8px; color: #fff; display: flex; flex-direction: column; line-height: 1.3; }
.stage-info strong { font-size: .95rem; }
.stage-info small { font-size: .72rem; opacity: .85; }
.stage-check { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--pet-gold); color: #231a05; transform: scale(0); transition: transform .25s var(--bounce); }
.stage-check svg { width: 18px; height: 18px; }
.stage-card:has(input:checked) .stage-check { transform: scale(1); }
@media (max-width: 520px) { .stage-info small { display: none; } }

.bot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 720px) { .bot-grid { grid-template-columns: 1fr; } }
.bot-card { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; min-height: 68px; border-radius: var(--radius-lg); cursor: pointer; font: inherit; color: var(--text);
  border: 2px solid var(--border); background: var(--surface-solid); transition: transform .2s var(--bounce), border-color .2s, box-shadow .2s; }
.bot-card:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--pet-gold); box-shadow: var(--shadow); }
.bot-card:disabled { opacity: .5; cursor: not-allowed; }
.bot-card strong { display: block; }
.bot-card small { color: var(--muted); font-size: .78rem; }
.bot-ico { font-size: 1.8rem; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--tint-green); flex-shrink: 0; }
.tier-normal .bot-ico { background: var(--tint-yellow); } .tier-hard .bot-ico { background: var(--tint-red); }
.bot-go { font-weight: 800; padding: 8px 14px; border-radius: 999px; background: var(--pet-ink); color: #fff; }
.opp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 10px; }
.opp-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--surface-solid); }
.opp-art { width: 64px; height: 64px; object-fit: contain; flex-shrink: 0; transform: scaleX(-1); }
.opp-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.opp-info strong small { color: var(--muted); font-weight: 600; }
.opp-info .adv-chip { align-self: flex-start; }
.opp-card .btn { min-height: 44px; flex-shrink: 0; }
.arena-howto summary { cursor: pointer; padding: 4px 0; }
.arena-howto ul { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Ranking ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rank-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: var(--radius); background: var(--surface-2); }
.rank-list li.top-1 { background: linear-gradient(90deg, #fff3bf, var(--surface-2)); } .rank-list li.top-2 { background: linear-gradient(90deg, #e9ecef, var(--surface-2)); } .rank-list li.top-3 { background: linear-gradient(90deg, #ffe8cc, var(--surface-2)); }
:root[data-theme="dark"] .rank-list li.top-1, :root[data-theme="dark"] .rank-list li.top-2, :root[data-theme="dark"] .rank-list li.top-3 { background: var(--surface-2); }
.rank-list li.is-me { outline: 2px solid var(--pet-gold); }
.rank-no { width: 34px; text-align: center; font-weight: 800; font-size: 1.05rem; flex-shrink: 0; }
.rank-list img { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; }
.rank-who { display: flex; flex-direction: column; min-width: 0; }
.rank-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-score { display: flex; flex-direction: column; align-items: flex-end; text-align: right; white-space: nowrap; }
.rank-score small { color: var(--muted); font-size: .72rem; }
.rank-list.is-compact img { width: 36px; height: 36px; }
.rank-tiers { display: flex; flex-wrap: wrap; gap: 8px; }
.rank-tier { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: .85rem; font-weight: 600; }
.rank-tier small { color: var(--muted); }

/* =========================================================
   Battle screen
   ========================================================= */
.page-arena .site-footer, .page-arena .bottom-nav, .page-arena .announce, .page-arena .hof { display: none; }
.page-arena #main { padding-bottom: 0; }
.battle-wrap { max-width: 1180px; margin: 0 auto; padding: 10px 12px 16px; }
.arena { --hp: #ffd43b; position: relative; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.arena-stage { position: relative; overflow: hidden; border-radius: 20px; aspect-ratio: 16 / 9; max-height: calc(100vh - 230px); min-height: 300px; width: 100%; background: #0b0f17; isolation: isolate; }
.arena-bg { position: absolute; inset: -4%; width: 108%; height: 108%; max-width: none; object-fit: cover; z-index: -3; transition: transform .25s ease-out; }
.arena-stage::before { content: ''; position: absolute; inset: 0; z-index: -2; background: linear-gradient(180deg, rgba(5, 8, 14, .55) 0%, rgba(5, 8, 14, 0) 26%, rgba(5, 8, 14, 0) 70%, rgba(5, 8, 14, .55) 100%); }
.arena.is-shake .arena-stage { animation: arena-shake .32s linear; }
.arena.is-flash .arena-stage::after { content: ''; position: absolute; inset: 0; background: #fff; z-index: 6; animation: arena-flash .35s ease-out forwards; pointer-events: none; }
.arena.is-super .arena-bg { filter: brightness(.45) saturate(1.4); transition: filter .2s; }

/* HUD */
.hud { position: absolute; top: 0; left: 0; right: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 10px; padding: 12px 14px; z-index: 4; }
.hud-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hud-side.is-right { align-items: flex-end; }
.hud-name { display: flex; align-items: center; gap: 8px; color: #fff; font-weight: 800; font-size: clamp(.8rem, 1.8vw, 1.05rem); text-shadow: 0 2px 4px rgba(0, 0, 0, .8); max-width: 100%; }
.hud-side.is-right .hud-name { flex-direction: row-reverse; }
.hud-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-name small { font-weight: 700; color: #ffd98a; font-size: .8em; flex-shrink: 0; }
.hud-face { width: clamp(34px, 5vw, 52px); height: clamp(34px, 5vw, 52px); border-radius: 10px; object-fit: contain; background: rgba(255, 255, 255, .15); border: 2px solid rgba(255, 255, 255, .7); flex-shrink: 0; }
.hud-side.is-right .hud-face { transform: scaleX(-1); }
.hp-bar { position: relative; width: 100%; height: clamp(14px, 2.6vw, 24px); border-radius: 4px; background: #3a0d0d; border: 2px solid #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, .6), 0 4px 10px rgba(0, 0, 0, .4); overflow: hidden; transform: skewX(-14deg); }
.hud-side.is-right .hp-bar { transform: skewX(14deg); }
.hp-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; transition: width .25s ease-out; }
.hp-bar .hp-lag { background: #e03131; transition: width .8s .35s ease-in; }
.hp-bar .hp-now { background: linear-gradient(180deg, #fff3bf 0%, #ffd43b 40%, #f59f00 100%); }
.hp-bar.is-low .hp-now { background: linear-gradient(180deg, #ffc9c9 0%, #ff6b6b 40%, #c92a2a 100%); animation: hp-pulse .6s ease-in-out infinite alternate; }
.hud-side.is-right .hp-bar i { left: auto; right: 0; }
.hp-num { color: #fff; font-size: .72rem; font-weight: 700; text-shadow: 0 1px 3px #000; font-variant-numeric: tabular-nums; }
.round-pips { display: flex; gap: 5px; }
.round-pips span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; background: rgba(0, 0, 0, .4); box-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.round-pips span.is-won { background: radial-gradient(circle at 35% 35%, #fff3bf, #f2b53a 60%, #cc8616); }
.hud-timer { display: flex; flex-direction: column; align-items: center; min-width: clamp(56px, 9vw, 90px); }
.hud-timer b { font-size: clamp(1.8rem, 5vw, 3.2rem); font-weight: 900; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -.02em;
  text-shadow: 0 3px 0 #cc8616, 0 0 18px rgba(242, 181, 58, .6), 0 2px 6px #000; font-family: 'Roboto', var(--font-head); }
.hud-timer.is-low b { color: #ff8787; text-shadow: 0 3px 0 #a51111, 0 0 18px rgba(255, 80, 80, .6); animation: hp-pulse .5s ease-in-out infinite alternate; }
.hud-timer small { color: #ffd98a; font-weight: 800; font-size: .68rem; letter-spacing: .1em; text-shadow: 0 1px 3px #000; }

/* Fighters */
.fighters { position: absolute; left: 0; right: 0; bottom: 9%; height: 66%; z-index: 2; }
.fighter { position: absolute; bottom: 0; width: 36%; max-width: 380px; aspect-ratio: 1; transition: transform .18s cubic-bezier(.3, .7, .4, 1.3), left .18s, right .18s; }
.fighter.is-left { left: 8%; }
.fighter.is-right { right: 8%; }
.fighter-body { position: absolute; inset: 0; transform-origin: 50% 100%; animation: fighter-idle 1.2s ease-in-out infinite; }
.fighter.is-right .fighter-body { animation-name: fighter-idle-r; }
.fighter img { width: 100%; height: 100%; object-fit: contain; object-position: bottom; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .55)); pointer-events: none; }
.fighter.is-right img { transform: scaleX(-1); }
.fighter-shadow { position: absolute; left: 18%; right: 18%; bottom: -4%; height: 9%; border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, .55), transparent 70%); }
.fighter.is-lunge.is-left { transform: translateX(62%); }
.fighter.is-lunge.is-right { transform: translateX(-62%); }
.fighter.is-heavy.is-left { transform: translateX(72%) translateY(-8%) rotate(8deg); }
.fighter.is-heavy.is-right { transform: translateX(-72%) translateY(-8%) rotate(-8deg); }
.fighter.is-hit .fighter-body { animation: fighter-hit .35s ease-out; }
.fighter.is-hit img { filter: brightness(2.2) saturate(.4) drop-shadow(0 8px 10px rgba(0, 0, 0, .55)); }
.fighter.is-guard::after { content: ''; position: absolute; inset: 6% 4% 0; border-radius: 50% 50% 46% 46%; border: 4px solid rgba(116, 192, 252, .9);
  background: radial-gradient(circle, rgba(116, 192, 252, .05) 40%, rgba(116, 192, 252, .35) 100%); box-shadow: 0 0 24px rgba(116, 192, 252, .8); animation: guard-in .25s var(--bounce); }
.fighter.is-dodge.is-left { transform: translateX(-22%) translateY(-6%); opacity: .55; }
.fighter.is-dodge.is-right { transform: translateX(22%) translateY(-6%); opacity: .55; }
.fighter.is-ko .fighter-body { animation: fighter-ko .9s ease-in forwards; }
.fighter.is-win .fighter-body { animation: fighter-win .7s var(--bounce) infinite alternate; }
.fighter.is-charge .fighter-body::before { content: ''; position: absolute; inset: -10% -6% 0; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle at 50% 70%, rgba(255, 212, 59, .9), rgba(247, 103, 7, .5) 45%, transparent 70%); animation: charge .5s ease-in-out infinite alternate; }

@keyframes fighter-idle { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-3%) scale(1.02, .98); } }
@keyframes fighter-idle-r { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-3%) scale(1.02, .98); } }
@keyframes fighter-hit { 0% { transform: translateX(0); } 25% { transform: translateX(-10%) rotate(-6deg); } 60% { transform: translateX(6%) rotate(3deg); } 100% { transform: translateX(0); } }
.fighter.is-right.is-hit .fighter-body { animation-name: fighter-hit-r; }
@keyframes fighter-hit-r { 0% { transform: translateX(0); } 25% { transform: translateX(10%) rotate(6deg); } 60% { transform: translateX(-6%) rotate(-3deg); } 100% { transform: translateX(0); } }
@keyframes fighter-ko { 0% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-18%) rotate(-12deg); } 100% { transform: translateY(14%) rotate(-82deg) scale(.92); opacity: .85; } }
.fighter.is-right.is-ko .fighter-body { animation-name: fighter-ko-r; }
@keyframes fighter-ko-r { 0% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-18%) rotate(12deg); } 100% { transform: translateY(14%) rotate(82deg) scale(.92); opacity: .85; } }
@keyframes fighter-win { from { transform: translateY(0); } to { transform: translateY(-9%) scale(1.04); } }
@keyframes guard-in { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes charge { from { opacity: .55; transform: scale(.95); } to { opacity: 1; transform: scale(1.08); } }
@keyframes arena-shake { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-7px, 3px); } 40% { transform: translate(6px, -4px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -1px); } }
@keyframes arena-flash { from { opacity: .75; } to { opacity: 0; } }
@keyframes hp-pulse { from { filter: brightness(1); } to { filter: brightness(1.4); } }

/* Effects */
.fx-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.fx-spark { position: absolute; width: 130px; height: 130px; margin: -65px 0 0 -65px; border-radius: 50%; animation: spark .45s ease-out forwards;
  background: radial-gradient(circle, #fff 0%, #fff3bf 18%, #ffd43b 32%, rgba(247, 103, 7, .7) 50%, transparent 68%); mix-blend-mode: screen; }
.fx-spark::before, .fx-spark::after { content: ''; position: absolute; inset: 44% -30%; background: linear-gradient(90deg, transparent, #fff 50%, transparent); border-radius: 50%; transform: rotate(35deg); }
.fx-spark::after { transform: rotate(-35deg); }
.fx-spark.is-crit { width: 190px; height: 190px; margin: -95px 0 0 -95px; }
.fx-spark.is-block { background: radial-gradient(circle, #fff 0%, #d0ebff 25%, rgba(116, 192, 252, .7) 48%, transparent 68%); }
.fx-spark.is-special { width: 260px; height: 260px; margin: -130px 0 0 -130px; background: radial-gradient(circle, #fff 0%, #ffe066 20%, #ff922b 40%, rgba(224, 49, 49, .6) 58%, transparent 72%); }
.fx-spark.el-water.is-special { background: radial-gradient(circle, #fff 0%, #a5d8ff 20%, #339af0 42%, rgba(24, 100, 171, .6) 58%, transparent 72%); }
.fx-spark.el-earth.is-special { background: radial-gradient(circle, #fff 0%, #ffec99 20%, #c9a227 42%, rgba(116, 85, 40, .6) 58%, transparent 72%); }
.fx-spark.el-wind.is-special { background: radial-gradient(circle, #fff 0%, #d3f9d8 20%, #51cf66 42%, rgba(43, 138, 62, .6) 58%, transparent 72%); }
@keyframes spark { 0% { transform: scale(.2); opacity: 1; } 60% { opacity: 1; } 100% { transform: scale(1.35); opacity: 0; } }
.fx-dmg { position: absolute; font-weight: 900; font-size: clamp(1.4rem, 4vw, 2.6rem); color: #fff; font-family: 'Roboto', var(--font-head); white-space: nowrap;
  -webkit-text-stroke: 2px #7a1c00; paint-order: stroke fill; text-shadow: 0 3px 0 #7a1c00, 0 6px 12px rgba(0, 0, 0, .6); animation: dmg-pop 1s ease-out forwards; transform: translate(-50%, -50%); }
.fx-dmg.is-crit { color: #ffe066; font-size: clamp(1.8rem, 5.4vw, 3.4rem); }
.fx-dmg.is-small { color: #d0ebff; -webkit-text-stroke-color: #0b3d6b; text-shadow: 0 3px 0 #0b3d6b; font-size: clamp(1rem, 3vw, 1.8rem); }
.fx-dmg.is-word { font-size: clamp(.95rem, 2.6vw, 1.5rem); color: #ffe066; }
@keyframes dmg-pop { 0% { transform: translate(-50%, -20%) scale(.4); opacity: 0; } 18% { transform: translate(-50%, -70%) scale(1.25); opacity: 1; } 35% { transform: translate(-50%, -80%) scale(1); } 100% { transform: translate(-50%, -170%) scale(1); opacity: 0; } }

/* Announcer */
.announcer { position: absolute; inset: 0; z-index: 7; display: grid; place-items: center; pointer-events: none; }
.announcer span { display: block; text-align: center; font-weight: 900; font-style: italic; letter-spacing: .02em; line-height: 1.05; color: #fff; padding: 0 12px;
  font-size: clamp(2.4rem, 10vw, 6.4rem); font-family: 'Roboto', var(--font-head); -webkit-text-stroke: 3px #7a1c00; paint-order: stroke fill;
  text-shadow: 0 6px 0 #c92a2a, 0 10px 0 #7a1c00, 0 0 40px rgba(255, 146, 43, .8); animation: announce 1.3s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.announcer span small { display: block; font-size: .34em; font-style: normal; -webkit-text-stroke: 1px #7a1c00; letter-spacing: 0; margin-top: 6px; text-shadow: 0 3px 0 #7a1c00; }
.announcer span.is-ko { color: #ffe066; font-size: clamp(3.4rem, 15vw, 9rem); }
.announcer span.is-special { font-size: clamp(1.5rem, 5.4vw, 3.4rem); color: #ffe066; animation-duration: 1.1s; }
.announcer span.is-blue { -webkit-text-stroke-color: #0b3d6b; text-shadow: 0 6px 0 #1864ab, 0 10px 0 #0b3d6b, 0 0 40px rgba(116, 192, 252, .8); }
.announcer span.is-stay { animation: announce-in .6s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes announce { 0% { transform: scale(2.6); opacity: 0; } 16% { transform: scale(.92); opacity: 1; } 24% { transform: scale(1.04); } 30%, 78% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.2); opacity: 0; } }
@keyframes announce-in { 0% { transform: scale(2.6); opacity: 0; } 60% { transform: scale(.94); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* Super meters */
.meters { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; gap: 18px; padding: 10px 14px; z-index: 4; }
.meter { width: min(38%, 320px); display: flex; flex-direction: column; gap: 3px; }
.meter.is-right { align-items: flex-end; }
.meter-label { color: #fff; font-weight: 800; font-size: .7rem; letter-spacing: .08em; text-shadow: 0 1px 3px #000; }
.meter-track { width: 100%; height: 12px; border-radius: 3px; background: rgba(0, 0, 0, .55); border: 2px solid rgba(255, 255, 255, .8); overflow: hidden; transform: skewX(-14deg); position: relative; }
.meter.is-right .meter-track { transform: skewX(14deg); }
.meter-track i { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: linear-gradient(90deg, #1c7ed6, #3bc9db); transition: width .35s ease-out; }
.meter.is-right .meter-track i { left: auto; right: 0; }
.meter.is-full .meter-track i { background: linear-gradient(90deg, #f59f00, #ffe066, #f59f00); background-size: 200% 100%; animation: meter-full .8s linear infinite; }
.meter.is-full .meter-label { color: #ffe066; }
@keyframes meter-full { to { background-position: -200% 0; } }

/* Controls */
.arena-controls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.move-btn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 78px; padding: 8px 6px; border-radius: 18px; border: 0; cursor: pointer;
  font: inherit; color: #fff; text-align: center; touch-action: manipulation; transition: transform .1s, filter .15s, opacity .2s; box-shadow: 0 6px 0 var(--mb-s), 0 10px 18px -8px rgba(0, 0, 0, .5);
  background: linear-gradient(180deg, var(--mb-1), var(--mb-2)); }
.move-btn .mv-ico { font-size: 1.7rem; line-height: 1; }
.move-btn strong { font-size: 1rem; }
.move-btn small { font-size: .7rem; opacity: .9; line-height: 1.2; }
.move-btn kbd { position: absolute; top: 6px; right: 8px; font-size: .62rem; padding: 0 5px; border-radius: 4px; background: rgba(0, 0, 0, .25); font-family: inherit; }
.move-btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--mb-s); }
.move-btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.5); }
.move-btn.mv-quick { --mb-1: #4dabf7; --mb-2: #1971c2; --mb-s: #0b4f8f; }
.move-btn.mv-heavy { --mb-1: #ff922b; --mb-2: #d9480f; --mb-s: #9c2f07; }
.move-btn.mv-guard { --mb-1: #69db7c; --mb-2: #2b8a3e; --mb-s: #1b5e28; }
.move-btn.mv-special { --mb-1: #ffd43b; --mb-2: #e67700; --mb-s: #9a5200; color: #2b1700; }
.move-btn.mv-special.is-ready:not(:disabled) { animation: special-ready .7s ease-in-out infinite alternate; }
@keyframes special-ready { from { box-shadow: 0 6px 0 var(--mb-s), 0 0 0 0 rgba(255, 212, 59, .7); } to { box-shadow: 0 6px 0 var(--mb-s), 0 0 0 8px rgba(255, 212, 59, 0), 0 0 26px rgba(255, 212, 59, .9); } }
.arena-sub { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.arena-sub .tiny { color: var(--muted); }
.arena-sub-btns { display: flex; gap: 8px; }
.arena-sub .btn { min-height: 40px; }
.arena-tip { text-align: center; font-size: .82rem; color: var(--muted); margin-top: 8px; min-height: 1.3em; }

/* Result */
.arena-result { position: absolute; inset: 0; z-index: 9; display: grid; place-items: center; padding: 12px; background: rgba(5, 8, 14, .72); backdrop-filter: blur(4px); border-radius: 20px; animation: fade-in .4s ease-out; }
.arena-result[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.result-card { width: min(440px, 100%); max-height: 100%; overflow: auto; text-align: center; padding: 22px 20px; border-radius: 22px; color: var(--text); background: var(--surface-solid); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); animation: result-pop .5s var(--bounce); }
@keyframes result-pop { from { transform: scale(.7) translateY(30px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.result-title { font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 900; font-style: italic; margin: 0; line-height: 1.1; }
.result-card.is-won .result-title { color: #e67700; } .result-card.is-lost .result-title { color: #c92a2a; } .result-card.is-draw .result-title { color: #1971c2; }
.result-pet { width: 140px; height: 140px; object-fit: contain; margin: 4px auto; display: block; }
.result-card.is-won .result-pet { animation: fighter-win .7s var(--bounce) infinite alternate; }
.result-rewards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.result-rewards div { padding: 10px 4px; border-radius: 14px; background: var(--surface-2); }
.result-rewards b { display: block; font-size: 1.2rem; }
.result-rewards span { font-size: .72rem; color: var(--muted); }
.result-xp { height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; margin: 6px 0 4px; }
.result-xp i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd43b, #f59f00); transition: width 1.2s .3s var(--ease); }
.result-levelup { margin: 10px 0; padding: 10px; border-radius: 14px; background: var(--tint-yellow); color: var(--ink-yellow); font-weight: 700; animation: result-pop .6s .4s var(--bounce) both; }
.result-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.result-btns .btn { min-height: 50px; }

/* Phones: portrait gets a taller stage and 2×2 buttons; landscape puts the buttons beside the stage. */
@media (max-width: 720px) {
  .battle-wrap { padding: 6px 8px 12px; }
  .arena-stage { aspect-ratio: auto; height: min(54vh, 480px); min-height: 320px; max-height: none; border-radius: 16px; }
  .fighters { bottom: 12%; height: 52%; }
  .fighter { width: 46%; }
  .fighter.is-left { left: 2%; }
  .fighter.is-right { right: 2%; }
  .fighter.is-lunge.is-left { transform: translateX(42%); } .fighter.is-lunge.is-right { transform: translateX(-42%); }
  .fighter.is-heavy.is-left { transform: translateX(50%) translateY(-8%) rotate(8deg); } .fighter.is-heavy.is-right { transform: translateX(-50%) translateY(-8%) rotate(-8deg); }
  .hud { padding: 10px 8px; gap: 6px; }
  .round-pips span { width: 11px; height: 11px; }
  .arena-controls { grid-template-columns: 1fr 1fr; gap: 8px; }
  .move-btn { min-height: 70px; flex-direction: row; gap: 8px; justify-content: flex-start; padding: 8px 12px; text-align: left; }
  .move-btn .mv-txt { display: flex; flex-direction: column; }
  .move-btn kbd { display: none; }
  .meters { padding: 8px; }
  .meter-label { font-size: .6rem; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .page-arena .site-header { display: none; }
  .battle-wrap { max-width: none; padding: 6px; }
  .arena { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 10px; }
  .arena-stage { aspect-ratio: auto; height: calc(100vh - 12px); min-height: 0; max-height: none; }
  .arena-side { display: flex; flex-direction: column; }
  .arena-controls { grid-template-columns: 1fr; margin-top: 0; flex: 1; gap: 6px; }
  .move-btn { min-height: 0; flex-direction: row; gap: 8px; justify-content: flex-start; padding: 6px 10px; }
  .move-btn small, .move-btn kbd, .arena-tip { display: none; }
  .arena-sub { margin-top: 6px; }
  .arena-sub .tiny { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fighter-body, .pet-figure img, .pet-shadow, .pet-mood-bubble { animation: none !important; }
  .arena.is-shake .arena-stage { animation: none; }
}

/* ---------- HUD: armour gauge, combat power, rage, combos ---------- */
.hp-bar .bar-txt, .ar-bar .bar-txt { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; padding: 0 10px; gap: 4px; color: #fff; font-size: clamp(.6rem, 1.4vw, .78rem); font-weight: 800;
  text-shadow: 0 1px 2px #000, 0 0 3px #000; font-variant-numeric: tabular-nums; white-space: nowrap; transform: skewX(14deg); }
.hud-side.is-right .bar-txt { justify-content: flex-end; transform: skewX(-14deg); }
.hp-bar .bar-txt b { color: #ffe066; }
.ar-bar { position: relative; width: 92%; height: clamp(10px, 1.8vw, 15px); border-radius: 3px; background: rgba(5, 15, 30, .7); border: 2px solid rgba(255, 255, 255, .85); overflow: hidden; transform: skewX(-14deg); box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); }
.hud-side.is-right .ar-bar { transform: skewX(14deg); }
.ar-bar i { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; background: linear-gradient(180deg, #d0ebff 0%, #4dabf7 45%, #1864ab 100%); transition: width .3s ease-out; }
.hud-side.is-right .ar-bar i { left: auto; right: 0; }
.ar-bar.is-broken { border-color: #ff8787; animation: hp-pulse .5s ease-in-out infinite alternate; }
.ar-bar.is-broken .bar-txt::after { content: ' แตก!'; color: #ff8787; }
.hud-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hud-side.is-right .hud-foot { justify-content: flex-end; }
.cp-chip, .rage-chip { font-size: clamp(.6rem, 1.4vw, .74rem); font-weight: 800; padding: 1px 8px; border-radius: 999px; color: #ffe066; background: rgba(5, 8, 14, .65); border: 1px solid rgba(255, 224, 102, .5); white-space: nowrap; }
.rage-chip { color: #fff; background: linear-gradient(90deg, #e03131, #f76707); border-color: #ffa94d; animation: hp-pulse .45s ease-in-out infinite alternate; }
.rage-chip[hidden] { display: none; }
.fighter.is-rage .fighter-body::after { content: ''; position: absolute; inset: 4% 8% -2%; z-index: -1; border-radius: 50%; background: radial-gradient(circle at 50% 75%, rgba(255, 107, 107, .75), rgba(247, 103, 7, .35) 45%, transparent 70%); animation: charge .4s ease-in-out infinite alternate; }
.combo-count { position: absolute; top: 30%; z-index: 6; pointer-events: none; font-family: 'Roboto', var(--font-head); font-weight: 900; font-style: italic; line-height: .95; color: #fff;
  -webkit-text-stroke: 2px #7a1c00; paint-order: stroke fill; text-shadow: 0 4px 0 #c92a2a, 0 0 18px rgba(255, 146, 43, .7); opacity: 0; transition: opacity .3s; }
.combo-count.is-left { left: 3%; } .combo-count.is-right { right: 3%; text-align: right; }
.combo-count b { display: block; font-size: clamp(2rem, 6vw, 3.6rem); color: #ffe066; }
.combo-count small { display: block; font-size: clamp(.8rem, 2vw, 1.15rem); letter-spacing: .06em; }
.combo-count.is-show { opacity: 1; animation: combo-pop .35s var(--bounce); }
@keyframes combo-pop { from { transform: scale(1.6); } to { transform: scale(1); } }
.fx-shard { position: absolute; width: 14px; height: 14px; background: linear-gradient(135deg, #e7f5ff, #4dabf7); clip-path: polygon(50% 0, 100% 60%, 40% 100%, 0 40%); animation: shard .8s ease-out forwards; }
@keyframes shard { to { transform: translate(var(--dx), var(--dy)) rotate(260deg); opacity: 0; } }
@media (max-width: 720px) {
  .hud-name small { display: none; }
  .ar-bar { width: 100%; }
  .combo-count { top: 36%; }
}
.cp-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: #231a05; background: linear-gradient(160deg, #ffe08a, #f2b53a); box-shadow: 0 2px 0 #9a6410; }
.cp-badge b { font-size: .95rem; }
.pet-showcase-top { align-items: center; }
.pbar-track.hp i { background: linear-gradient(90deg, #8ce99a, #2f9e44); }
.pbar-track.armor i { background: linear-gradient(90deg, #a5d8ff, #1971c2); }
.pet-record .is-cp { background: var(--tint-yellow); color: var(--ink-yellow); }
@media (max-width: 520px) {
  .pet-tab { padding: 8px 12px; font-size: .85rem; gap: 4px; }
  .pet-wallet { padding: 6px 10px; }
}

/* ---------- Pet loot box ---------- */
.pbox-card { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: var(--radius-lg); background: linear-gradient(120deg, var(--tint-yellow), var(--surface-solid) 70%); border: 2px solid #f2b53a; }
.pbox-art { width: 110px; height: 110px; flex-shrink: 0; display: grid; place-items: center; animation: pet-bob 2.6s ease-in-out infinite; }
.pbox-art img, .pbox-art .box-img { width: 100%; height: 100%; object-fit: contain; }
.pbox-art .emoji-icon { font-size: 4rem; }
.pbox-body { flex: 1; min-width: 0; }
.pbox-odds { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 0; padding: 0; font-size: .85rem; }
.pbox-buy { display: flex; flex-direction: column; gap: 4px; align-items: stretch; min-width: 160px; text-align: center; }
.pbox-buy .btn { min-height: 50px; }
.pbox-buy .coin-ico { width: 22px; height: 22px; }
@media (max-width: 640px) { .pbox-card { flex-direction: column; text-align: center; } .pbox-odds { justify-content: center; } .pbox-buy { width: 100%; } }

/* ---------- Tap a pet: hop and hearts ---------- */
[data-pet-voice] { cursor: pointer; }
[data-pet-voice].is-happy:not(.pet-figure):not(.fighter-body) { animation: pet-hop .7s var(--bounce); }
.fighter-body.is-happy img { animation: pet-hop .7s var(--bounce); }
.pet-heart { position: fixed; z-index: 9999; pointer-events: none; font-size: 1.6rem; animation: heart-rise 1.4s ease-out forwards; }
@keyframes heart-rise { 0% { transform: translate(0, 0) scale(.4); opacity: 0; } 15% { opacity: 1; transform: translate(0, -10px) scale(1.15); } 100% { transform: translate(var(--dx), -120px) scale(.9); opacity: 0; } }
.arena-sub .is-off { opacity: .5; }

/* ---------- Classroom page: shortcuts ---------- */
.dash-menu { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.dash-menu-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; min-height: 84px; border-radius: var(--radius-lg); background: var(--surface-solid); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-weight: 600; font-size: .88rem; text-align: center; transition: transform .2s var(--bounce), box-shadow .2s; }
.dash-menu-item:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.dash-menu-ico { width: 40px; height: 40px; display: grid; place-items: center; }
.dash-menu-ico img { width: 40px; height: 40px; object-fit: contain; }
@media (max-width: 720px) { .dash-menu { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } }


/* ---------- Paid species, outfits and pet legends ---------- */
.species-art { position: relative; }
.species-price { position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-weight: 800; font-size: .85rem; background: rgba(10, 14, 22, .75); color: #ffe08a; }
.species-price .coin-ico { width: 18px; height: 18px; }
.species-tier { position: absolute; left: 8px; top: 8px; }
.species-card.tier-legendary { border-color: #f2b53a; }
.species-card.tier-legendary .species-art::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%); background-size: 250% 100%; animation: legend-shine 3.5s linear infinite; }
@keyframes legend-shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.gear-slots { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 520px) { .gear-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.legend-chip { display: inline-block; font-size: .68rem; font-weight: 800; padding: 1px 7px; border-radius: 999px; color: #5c3b00; background: linear-gradient(160deg, #ffe08a, #f2b53a); vertical-align: 1px; white-space: nowrap; }
.plegend-box { padding: 16px; border-radius: var(--radius-lg); border: 2px solid #f2b53a; background: linear-gradient(160deg, #fff8e1, var(--surface-solid) 60%); }
:root[data-theme="dark"] .plegend-box { background: linear-gradient(160deg, #3a3020, var(--surface-solid) 60%); }
.plegend-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.plegend-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 860px) { .plegend-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px) { .plegend-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.plegend-card { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 3px; padding: 10px 8px; border-radius: var(--radius); background: var(--surface-solid); border: 1px solid var(--border); }
.plegend-card img { width: 72px; height: 72px; object-fit: contain; filter: grayscale(.85) brightness(.9); opacity: .75; }
.plegend-card.is-owned img { filter: drop-shadow(0 0 10px rgba(242, 181, 58, .8)); opacity: 1; }
.plegend-card strong { font-size: .85rem; line-height: 1.25; }
.plegend-no { position: absolute; top: 6px; left: 6px; font-size: .65rem; font-weight: 800; color: #b06000; }

/* ---------- Auto battle: replay controls, callouts, status, feed, report ---------- */
.replay-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.replay-btn { min-height: 42px; }
.replay-btn.is-active { background: var(--pet-ink, #1b2330); color: #fff; }
:root[data-theme="dark"] .replay-btn.is-active { background: #f2b53a; color: #231a05; }
.move-call { position: absolute; left: 50%; top: -6%; transform: translate(-50%, 10px) scale(.8); z-index: 3; white-space: nowrap; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: clamp(.7rem, 1.6vw, .95rem);
  background: rgba(10, 14, 22, .78); color: #fff; border: 2px solid rgba(255, 255, 255, .6); opacity: 0; pointer-events: none; }
.move-call.is-show { animation: call-pop 1.1s ease-out forwards; }
.move-call.mv-quick { border-color: #4dabf7; } .move-call.mv-heavy { border-color: #ff922b; } .move-call.mv-guard { border-color: #69db7c; } .move-call.mv-special { border-color: #ffd43b; color: #ffe066; } .move-call.mv-stunned { border-color: #adb5bd; color: #dee2e6; }
@keyframes call-pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.8); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 70% { opacity: 1; transform: translate(-50%, -4px) scale(1); } 100% { opacity: 0; transform: translate(-50%, -14px) scale(1); } }
.fighter.is-right .move-call { transform: translate(-50%, 10px) scale(.8); }
.status-row { display: inline-flex; gap: 2px; }
.status-ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: .8rem; background: rgba(5, 8, 14, .7); border: 1px solid rgba(255, 255, 255, .5); animation: guard-in .25s var(--bounce); }
.fighter.is-stunned .fighter-body { filter: grayscale(.6) brightness(.8); animation: stunned .9s ease-in-out; }
@keyframes stunned { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.fx-dmg.is-heal { color: #b2f2bb; -webkit-text-stroke-color: #2b8a3e; text-shadow: 0 3px 0 #2b8a3e; font-size: clamp(1rem, 3vw, 1.8rem); }
.arena-stage.is-super .arena-bg { filter: brightness(.45) saturate(1.4); }
.battle-feed { list-style: none; margin: 10px 0 0; padding: 8px 10px; max-height: 132px; overflow-y: auto; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); font-size: .82rem; display: flex; flex-direction: column; gap: 3px; }
.battle-feed li { line-height: 1.4; animation: fade-in .3s ease-out; }
.battle-feed li.is-sys { font-weight: 700; color: var(--ink-yellow); }
.battle-feed li.is-hot { color: var(--ink-red); }
.battle-feed li.is-dim { color: var(--muted); }
.battle-feed .feed-me { color: var(--primary); } .battle-feed .feed-opp { color: var(--ink-red); }
.plan-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.bplan-card { padding: 10px 12px; border-radius: var(--radius); background: var(--surface-solid); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; font-size: .88rem; }
.plan-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.plan-chip { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
@media (max-width: 640px) { .plan-vs { grid-template-columns: 1fr; } .replay-bar .btn { padding: 6px 10px; } }
.report-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: .82rem; }
.report-table th, .report-table td { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: center; }
.report-table td:first-child { text-align: left; color: var(--muted); }
.report-table th { font-size: .75rem; max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-table td.is-best { font-weight: 800; color: var(--ink-green); }
.result-tip { margin: 8px 0 0; padding: 8px 10px; border-radius: 12px; background: var(--tint-cyan); color: var(--ink-cyan); font-size: .85rem; text-align: left; }
@media (max-height: 520px) and (orientation: landscape) { .battle-feed { max-height: 90px; } .plan-vs { display: none; } }

/* ---------- Battle planner ---------- */
.planner { border: 2px solid #f2b53a; }
.planner-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.planner-skill { display: flex; align-items: center; gap: 10px; padding: 8px 12px; margin-bottom: 12px; border-radius: var(--radius); background: var(--tint-yellow); color: var(--ink-yellow); }
.planner-skill img { width: 52px; height: 52px; object-fit: contain; }
.planner-skill span { display: flex; flex-direction: column; }
.planner-skill small { color: var(--text-2); }
.style-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 860px) { .style-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.plan-opt { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 12px; min-height: 110px; border-radius: var(--radius-lg); border: 2px solid var(--border); background: var(--surface-solid); cursor: pointer; transition: border-color .2s, transform .2s var(--bounce); }
.plan-opt input, .open-pill input, .plan-line input { position: absolute; opacity: 0; pointer-events: none; }
.plan-opt:has(input:checked) { border-color: #f2b53a; background: var(--tint-yellow); transform: translateY(-2px); }
.plan-opt:has(input:focus-visible), .open-pill:has(input:focus-visible), .plan-line:has(input:focus-visible) { outline: 3px solid var(--ring); }
.plan-ico { font-size: 1.6rem; }
.plan-opt small { color: var(--muted); font-size: .74rem; line-height: 1.35; }
.open-rows { display: flex; flex-direction: column; gap: 6px; }
.open-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.open-no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--pet-ink, #1b2330); color: #fff; flex-shrink: 0; }
.open-pill { position: relative; cursor: pointer; }
.open-pill span { display: inline-flex; align-items: center; gap: 4px; padding: 8px 14px; min-height: 42px; border-radius: 999px; border: 2px solid var(--border); background: var(--surface-solid); font-weight: 600; font-size: .88rem; }
.open-pill.mv-quick:has(input:checked) span { border-color: #4dabf7; background: #e7f5ff; color: #1864ab; }
.open-pill.mv-heavy:has(input:checked) span { border-color: #ff922b; background: #fff4e6; color: #d9480f; }
.open-pill.mv-guard:has(input:checked) span { border-color: #69db7c; background: #ebfbee; color: #2b8a3e; }
:root[data-theme="dark"] .open-pill:has(input:checked) span { background: var(--surface-2); }
.plan-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 720px) { .plan-two { grid-template-columns: 1fr; } }
.plan-list { display: flex; flex-direction: column; gap: 6px; }
.plan-line { position: relative; cursor: pointer; }
.plan-line > span { display: block; padding: 8px 12px; border-radius: var(--radius); border: 2px solid var(--border); background: var(--surface-solid); }
.plan-line small { display: block; color: var(--muted); font-size: .74rem; }
.plan-line:has(input:checked) > span { border-color: #f2b53a; background: var(--tint-yellow); }
.opp-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.opp-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px; min-height: 64px; border-radius: var(--radius-lg); border: 2px solid var(--border); background: var(--surface-solid); color: var(--text); font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; }
.opp-tab small { font-weight: 500; font-size: .74rem; color: var(--muted); }
.opp-tab.is-active { border-color: var(--pet-ink, #1b2330); background: var(--pet-ink, #1b2330); color: #fff; }
.opp-tab.is-active small { color: rgba(255, 255, 255, .8); }
:root[data-theme="dark"] .opp-tab.is-active { background: #f2b53a; border-color: #f2b53a; color: #231a05; }
.howto-steps { margin: 10px 0 6px; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }

.pet-switch-item > button { all: unset; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.pet-switch-item > button:focus-visible { outline: 3px solid var(--ring); border-radius: 12px; }
.fighter-pick { display: flex; flex-direction: column; gap: 6px; }

/* ---------- Small pet chip in the classroom level card ---------- */
.pet-mini { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; color: #fff; text-decoration: none; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); transition: background .2s; max-width: 220px; }
.pet-mini:hover { background: rgba(255, 255, 255, .26); }
.pet-mini img { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
.pet-mini-ico { width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.3rem; }
.pet-mini-txt { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.pet-mini-txt strong { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pet-mini-txt strong small { opacity: .85; font-weight: 600; }
.pet-mini-txt > small { font-size: .72rem; opacity: .9; white-space: nowrap; }

/* ---------- Arena console (compact, game-style pre-battle screen) ---------- */
.arena-console { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 860px) { .arena-console { grid-template-columns: 1fr; } }
.con-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.con-panel { padding: 12px; border-radius: 16px; color: #e9eef7; background: linear-gradient(180deg, #1d2636, #141b27); border: 1px solid #2c3a52; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 8px 20px -12px rgba(0, 0, 0, .6); }
.con-head { display: flex; align-items: center; gap: 10px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid #2c3a52; }
.con-head img { width: 40px; height: 40px; object-fit: contain; }
.con-head span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.con-head strong { font-size: .95rem; color: #ffd98a; letter-spacing: .02em; }
.con-head small { font-size: .74rem; color: #a9b6cc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.con-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 8px; margin: 6px 0; }
.con-label { font-size: .72rem; font-weight: 700; color: #8fa1bd; text-transform: uppercase; letter-spacing: .04em; }
.seg { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: #0d131d; border: 1px solid #263349; }
.seg-btn { position: relative; flex: 1; min-width: 0; cursor: pointer; }
.seg-btn input { position: absolute; opacity: 0; pointer-events: none; }
.seg-btn span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 44px; padding: 4px 2px; border-radius: 9px; font-size: .72rem; font-weight: 700; color: #a9b6cc; transition: background .15s, color .15s, transform .15s; white-space: nowrap; }
.seg-btn i { font-style: normal; font-size: 1.05rem; line-height: 1; }
.seg-btn:hover span { color: #fff; }
.seg-btn:has(input:checked) span { background: linear-gradient(180deg, #ffd666, #f0a92c); color: #2b1a00; box-shadow: 0 2px 0 #a86a07; }
.seg-btn:has(input:focus-visible) span { outline: 2px solid #74c0fc; }
.open-slots { display: flex; gap: 6px; }
.open-slot { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 44px; border-radius: 10px; border: 1px solid #2c3a52; background: #0d131d; color: #e9eef7; font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; transition: transform .12s; }
.open-slot:active { transform: scale(.95); }
.open-slot i { font-style: normal; font-size: 1.05rem; }
.open-slot small { position: absolute; top: 2px; left: 5px; font-size: .58rem; color: #6f819e; }
.open-slot.mv-quick { border-color: #4dabf7; box-shadow: inset 0 0 0 1px rgba(77, 171, 247, .35); }
.open-slot.mv-heavy { border-color: #ff922b; box-shadow: inset 0 0 0 1px rgba(255, 146, 43, .35); }
.open-slot.mv-guard { border-color: #69db7c; box-shadow: inset 0 0 0 1px rgba(105, 219, 124, .35); }
.con-hint { margin: 8px 0 0; padding: 6px 10px; border-radius: 10px; background: #0d131d; font-size: .74rem; color: #c5d0e2; min-height: 2.6em; line-height: 1.4; }
.con-save { margin-top: 8px; width: 100%; min-height: 38px; border-radius: 10px; border: 1px dashed #3b4d6b; background: transparent; color: #a9b6cc; font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.con-save:hover { color: #fff; border-color: #74c0fc; }
.con-sub { font-size: .72rem; font-weight: 700; color: #8fa1bd; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.stage-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.stage-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; cursor: pointer; border: 2px solid transparent; }
.stage-thumb input { position: absolute; opacity: 0; pointer-events: none; }
.stage-thumb img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.7) saturate(.9); transition: filter .2s; }
.stage-thumb span { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 6px; font-size: .64rem; font-weight: 700; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .8)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-thumb:has(input:checked) { border-color: #ffd666; box-shadow: 0 0 0 2px rgba(255, 214, 102, .3); }
.stage-thumb:has(input:checked) img, .stage-thumb:hover img { filter: none; }
.arena-console .opp-switch { margin-bottom: 8px; gap: 4px; padding: 3px; border-radius: 12px; background: #0d131d; border: 1px solid #263349; }
.arena-console .opp-tab { min-height: 40px; padding: 6px; border: 0; border-radius: 9px; background: transparent; color: #a9b6cc; font-size: .85rem; flex-direction: row; justify-content: center; gap: 6px; }
.arena-console .opp-tab b { font-size: .7rem; padding: 0 6px; border-radius: 999px; background: #2c3a52; color: #fff; }
.arena-console .opp-tab.is-active { background: linear-gradient(180deg, #ffd666, #f0a92c); color: #2b1a00; }
.opp-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.opp-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 6px 8px; border-radius: 12px; border: 1px solid #2c3a52; background: #18212f; color: #e9eef7; font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; }
.opp-row:hover:not(:disabled) { border-color: #ffd666; transform: translateX(2px); }
.opp-row:disabled { opacity: .45; cursor: not-allowed; }
.opp-row img { width: 44px; height: 44px; object-fit: contain; transform: scaleX(-1); flex-shrink: 0; }
.opp-row-ico { width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.4rem; border-radius: 10px; background: #0d131d; flex-shrink: 0; }
.opp-row-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.opp-row-txt strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-row-txt strong small { color: #ffd98a; font-weight: 600; }
.opp-row-txt > small { font-size: .7rem; color: #a9b6cc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-row-txt em { font-style: normal; } .opp-row-txt em.is-good { color: #8ce99a; } .opp-row-txt em.is-bad { color: #ff8787; }
.opp-row-go { padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: .8rem; color: #fff; background: linear-gradient(180deg, #f76707, #c92a2a); flex-shrink: 0; }
.tier-normal .opp-row-ico { background: #2a2614; } .tier-hard .opp-row-ico { background: #2a1616; }
.arena-hero { min-height: 0; padding: 14px 18px; }
.arena-hero h1 { font-size: clamp(1.1rem, 2.6vw, 1.5rem); margin: 2px 0; }
.arena-hero p { font-size: .82rem; }
.arena-me img { width: 52px; height: 52px; }

/* ---------- Fight choreography effects ---------- */
.fighter { transition: none; will-change: transform; }
.fighter.is-down { filter: saturate(.6) brightness(.85); }
.fighter-body img { transition: none; }
.fx-ghost { position: absolute; z-index: 1; object-fit: contain; object-position: bottom; opacity: .45; filter: blur(1px) brightness(1.4) saturate(.5); pointer-events: none; animation: ghost-fade .4s ease-out forwards; }
.fx-ghost.is-flip { transform: scaleX(-1); }
@keyframes ghost-fade { to { opacity: 0; } }
.fx-dust { position: absolute; width: 90px; height: 34px; margin: -26px 0 0 -45px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(235, 225, 205, .85), rgba(235, 225, 205, 0) 70%); animation: dust .6s ease-out forwards; }
.fx-dust.is-big { width: 170px; height: 54px; margin: -40px 0 0 -85px; }
@keyframes dust { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(1.6, 1.2) translateY(-8px); opacity: 0; } }
.fx-ring { position: absolute; width: 60px; height: 20px; margin: -10px 0 0 -30px; border-radius: 50%; border: 4px solid rgba(255, 236, 179, .9); pointer-events: none; animation: ring .65s ease-out forwards; }
.fx-ring.is-ground { border-color: rgba(255, 214, 102, .95); box-shadow: 0 0 18px rgba(255, 170, 60, .8); }
@keyframes ring { 0% { transform: scale(.3); opacity: 1; } 100% { transform: scale(5, 3.5); opacity: 0; } }
.fx-burst { position: absolute; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%; pointer-events: none; mix-blend-mode: screen;
  background: repeating-conic-gradient(rgba(255, 255, 255, .95) 0deg 3deg, transparent 3deg 18deg); -webkit-mask: radial-gradient(circle, transparent 22%, #000 30%, transparent 70%); mask: radial-gradient(circle, transparent 22%, #000 30%, transparent 70%); animation: burst .38s ease-out forwards; }
.fx-burst.is-crit { width: 320px; height: 320px; margin: -160px 0 0 -160px; background: repeating-conic-gradient(rgba(255, 230, 120, .95) 0deg 4deg, transparent 4deg 16deg); }
@keyframes burst { 0% { transform: scale(.4) rotate(0deg); opacity: 1; } 100% { transform: scale(1.4) rotate(25deg); opacity: 0; } }
.fx-orb { position: absolute; width: 70px; height: 70px; border-radius: 50%; pointer-events: none; z-index: 6; transform: translate(-50%, -50%);
  background: radial-gradient(circle, #fff 0%, #ffe066 25%, #ff922b 55%, rgba(224, 49, 49, 0) 72%); box-shadow: 0 0 30px 12px rgba(255, 146, 43, .7); }
.fx-orb.el-water { background: radial-gradient(circle, #fff 0%, #a5d8ff 25%, #339af0 55%, rgba(24, 100, 171, 0) 72%); box-shadow: 0 0 30px 12px rgba(51, 154, 240, .7); }
.fx-orb.el-earth { background: radial-gradient(circle, #fff 0%, #ffec99 25%, #c9a227 55%, rgba(116, 85, 40, 0) 72%); box-shadow: 0 0 30px 12px rgba(201, 162, 39, .7); }
.fx-orb.el-wind { background: radial-gradient(circle, #fff 0%, #d3f9d8 25%, #51cf66 55%, rgba(43, 138, 62, 0) 72%); box-shadow: 0 0 30px 12px rgba(81, 207, 102, .7); }
.fx-heal { position: absolute; width: 120px; height: 140px; margin: -90px 0 0 -60px; pointer-events: none; background: radial-gradient(circle at 30% 70%, #b2f2bb 0 4px, transparent 5px), radial-gradient(circle at 60% 40%, #8ce99a 0 5px, transparent 6px), radial-gradient(circle at 75% 80%, #d3f9d8 0 3px, transparent 4px), radial-gradient(circle at 45% 20%, #b2f2bb 0 4px, transparent 5px); animation: heal-rise .9s ease-out forwards; }
@keyframes heal-rise { from { transform: translateY(20px); opacity: 1; } to { transform: translateY(-50px); opacity: 0; } }
.fx-confetti { position: absolute; width: 0; height: 0; pointer-events: none; }
.fx-confetti i { position: absolute; width: 8px; height: 14px; border-radius: 2px; background: #ffd43b; animation: confetti 1.3s ease-out forwards; }
.fx-confetti i:nth-child(2n) { background: #ff8787; } .fx-confetti i:nth-child(3n) { background: #74c0fc; } .fx-confetti i:nth-child(4n) { background: #8ce99a; }
.fx-confetti i:nth-child(1) { --dx: -90px; --dy: -60px; } .fx-confetti i:nth-child(2) { --dx: -50px; --dy: -110px; } .fx-confetti i:nth-child(3) { --dx: -10px; --dy: -130px; } .fx-confetti i:nth-child(4) { --dx: 30px; --dy: -120px; }
.fx-confetti i:nth-child(5) { --dx: 70px; --dy: -90px; } .fx-confetti i:nth-child(6) { --dx: 100px; --dy: -40px; } .fx-confetti i:nth-child(7) { --dx: -110px; --dy: -20px; } .fx-confetti i:nth-child(8) { --dx: 120px; --dy: -10px; }
@keyframes confetti { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), calc(var(--dy) + 120px)) rotate(540deg); opacity: 0; } }
/* Super-art cut-in */
.cutin { position: absolute; inset: 0; z-index: 8; display: grid; align-items: center; pointer-events: none; background: rgba(5, 8, 14, .45); animation: fade-in .15s ease-out; }
.cutin-band { display: flex; align-items: center; gap: 14px; height: 34%; padding: 0 6%; overflow: hidden; transform: skewY(-4deg);
  background: linear-gradient(90deg, rgba(232, 89, 12, .95), rgba(255, 146, 43, .9) 55%, rgba(255, 212, 59, .85)); box-shadow: 0 0 0 3px #fff, 0 10px 40px rgba(0, 0, 0, .5); animation: cutin-in 1s cubic-bezier(.2, .9, .3, 1) forwards; }
.cutin.el-water .cutin-band { background: linear-gradient(90deg, rgba(24, 100, 171, .95), rgba(51, 154, 240, .9) 55%, rgba(165, 216, 255, .85)); }
.cutin.el-earth .cutin-band { background: linear-gradient(90deg, rgba(116, 85, 40, .95), rgba(201, 162, 39, .9) 55%, rgba(255, 236, 153, .85)); }
.cutin.el-wind .cutin-band { background: linear-gradient(90deg, rgba(43, 138, 62, .95), rgba(81, 207, 102, .9) 55%, rgba(211, 249, 216, .85)); }
.cutin-band img { height: 150%; max-width: none; object-fit: contain; transform: skewY(4deg) translateY(6%); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.cutin-band span { display: flex; flex-direction: column; transform: skewY(4deg); color: #fff; }
.cutin-band b { font-size: clamp(1.3rem, 4.4vw, 2.8rem); font-weight: 900; font-style: italic; line-height: 1.05; -webkit-text-stroke: 2px rgba(0, 0, 0, .35); paint-order: stroke fill; text-shadow: 0 4px 0 rgba(0, 0, 0, .3); }
.cutin-band small { font-size: clamp(.75rem, 1.8vw, 1rem); font-weight: 700; opacity: .95; }
.cutin.is-right .cutin-band { flex-direction: row-reverse; text-align: right; transform: skewY(4deg); animation-name: cutin-in-r; }
.cutin.is-right .cutin-band img { transform: skewY(-4deg) translateY(6%) scaleX(-1); }
.cutin.is-right .cutin-band span { transform: skewY(-4deg); }
@keyframes cutin-in { 0% { transform: skewY(-4deg) translateX(-110%); } 22%, 78% { transform: skewY(-4deg) translateX(0); } 100% { transform: skewY(-4deg) translateX(110%); } }
@keyframes cutin-in-r { 0% { transform: skewY(4deg) translateX(110%); } 22%, 78% { transform: skewY(4deg) translateX(0); } 100% { transform: skewY(4deg) translateX(-110%); } }
/* VS intro */
.vs-intro { position: absolute; inset: 0; z-index: 9; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: linear-gradient(100deg, rgba(201, 42, 42, .88) 0 49.6%, #fff 49.6% 50.4%, rgba(24, 100, 171, .88) 50.4%); animation: fade-in .25s ease-out; }
.vs-intro.is-out { animation: fade-out .3s ease-in forwards; }
@keyframes fade-out { to { opacity: 0; } }
.vs-side { display: flex; flex-direction: column; align-items: center; color: #fff; text-align: center; padding: 0 4%; }
.vs-side img { width: min(70%, 260px); aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .45)); }
.vs-side.is-left { animation: vs-l .5s cubic-bezier(.2, .9, .3, 1.2); } .vs-side.is-right { animation: vs-r .5s cubic-bezier(.2, .9, .3, 1.2); }
.vs-side.is-right img { transform: scaleX(-1); }
.vs-side b { font-size: clamp(.95rem, 2.6vw, 1.6rem); font-weight: 900; text-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.vs-side small { font-weight: 700; color: #ffe066; }
.vs-mark { font-size: clamp(2.4rem, 9vw, 5.5rem); font-weight: 900; font-style: italic; color: #ffe066; -webkit-text-stroke: 3px #7a1c00; paint-order: stroke fill; text-shadow: 0 6px 0 #7a1c00; animation: announce .9s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes vs-l { from { transform: translateX(-60%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes vs-r { from { transform: translateX(60%); opacity: 0; } to { transform: none; opacity: 1; } }
/* Status overlays while a status lasts, and one-shot skill effects */
.fighter.st-burn .fighter-body::after, .fighter.fx-burn .fighter-body::after { content: ''; position: absolute; inset: 20% 15% 0; border-radius: 50% 50% 40% 40%; pointer-events: none; mix-blend-mode: screen;
  background: radial-gradient(ellipse at 50% 90%, rgba(255, 120, 30, .55), transparent 65%); animation: flicker .25s steps(2) infinite; }
.fighter.st-stun .fighter-body::before { content: '💫 ⭐ 💫'; position: absolute; top: 2%; left: 50%; transform: translateX(-50%); font-size: clamp(.9rem, 2vw, 1.4rem); white-space: nowrap; animation: stun-spin 1s linear infinite; }
.fighter.st-shield .fighter-body::after { content: ''; position: absolute; inset: 4% 2% -2%; border-radius: 50%; border: 3px solid rgba(165, 216, 255, .9); background: radial-gradient(circle, rgba(165, 216, 255, 0) 55%, rgba(165, 216, 255, .35)); pointer-events: none; }
.fighter.st-weaken img { filter: saturate(.5) hue-rotate(170deg) drop-shadow(0 8px 10px rgba(0, 0, 0, .55)); }
.fighter.st-thorns .fighter-body::after { content: ''; position: absolute; inset: 6% 4% -2%; border-radius: 50%; border: 3px dashed rgba(140, 233, 154, .85); pointer-events: none; animation: spin 4s linear infinite; }
.fighter.fx-freeze img, .fighter.fx-stun img { filter: brightness(1.3) saturate(.3) hue-rotate(160deg) drop-shadow(0 0 12px rgba(165, 216, 255, .9)); }
.fighter.fx-weaken img { filter: hue-rotate(180deg) saturate(.6); }
.fighter.fx-shield img, .fighter.fx-evade img { filter: drop-shadow(0 0 14px rgba(165, 216, 255, .95)); }
.fighter.fx-heal img { filter: drop-shadow(0 0 16px rgba(140, 233, 154, .95)); }
@keyframes flicker { 0% { opacity: .6; } 100% { opacity: 1; } }
@keyframes stun-spin { 0% { transform: translateX(-50%) rotate(-8deg); } 50% { transform: translateX(-50%) rotate(8deg); } 100% { transform: translateX(-50%) rotate(-8deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
/* Compact side panel under the stage */
.battle-feed { max-height: 96px; font-size: .78rem; }
.bplan-card { padding: 8px 10px; font-size: .8rem; gap: 4px; }
.replay-bar .btn { min-height: 38px; padding: 6px 12px; font-size: .82rem; }

/* ---------- Battle loot: a chest shakes, bursts, and the dropped item pops out ---------- */
.loot-drop { --rar: #80868b; position: relative; display: grid; place-items: center; min-height: 92px; margin: 10px 0 4px; padding: 10px; border-radius: 16px; overflow: hidden;
  background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--rar) 22%, transparent), transparent 70%), var(--surface-2); border: 2px solid color-mix(in srgb, var(--rar) 45%, transparent); }
.loot-drop.rar-rare { --rar: #1a73e8; } .loot-drop.rar-epic { --rar: #9334e6; } .loot-drop.rar-legendary { --rar: #e37400; } .loot-drop.rar-mythic { --rar: #d93025; }
.loot-drop.is-legend { --rar: #f0a500; background: radial-gradient(circle at 50% 60%, rgba(255, 214, 102, .55), transparent 70%), linear-gradient(180deg, #2b2110, #3a2a0c); color: #fff3cf; }
.loot-chest, .loot-item { grid-area: 1 / 1; }
.loot-chest { position: relative; width: 74px; height: 74px; transition: transform .25s, opacity .25s; }
.loot-chest img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .3)); }
.loot-chest i { position: absolute; inset: -30%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--rar) 70%, #fff) 0, transparent 60%); opacity: 0; }
.loot-item { display: flex; align-items: center; gap: 12px; text-align: left; opacity: 0; transform: scale(.4) translateY(14px); }
.loot-item img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--rar) 80%, transparent)); }
.loot-item span { display: grid; gap: 1px; min-width: 0; }
.loot-item small { font-size: .72rem; font-weight: 700; color: var(--rar); }
.loot-drop.is-legend .loot-item small { color: #ffd666; }
.loot-item b { font-size: 1rem; line-height: 1.25; }
.loot-item em { font-style: normal; font-size: .72rem; opacity: .75; }
.loot-drop.is-shake .loot-chest { animation: loot-shake .16s linear infinite; }
.loot-drop.is-open .loot-chest { transform: scale(1.5); opacity: 0; }
.loot-drop.is-open .loot-chest i { animation: loot-flash .5s ease-out; }
.loot-drop.is-open .loot-item { opacity: 1; transform: none; transition: opacity .35s .12s, transform .5s .12s cubic-bezier(.3, 1.6, .5, 1); }
.loot-drop.is-legend.is-open::before { content: ''; position: absolute; inset: -60%; background: repeating-conic-gradient(from 0deg, rgba(255, 214, 102, .35) 0 10deg, transparent 10deg 24deg); animation: loot-rays 6s linear infinite; pointer-events: none; }
.loot-drop.is-legend .loot-item { position: relative; z-index: 1; }
.loot-none { margin: 8px 0 0; }
@keyframes loot-shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg) translateY(-2px); } 75% { transform: rotate(9deg) translateY(-2px); } }
@keyframes loot-flash { from { opacity: 1; transform: scale(.6); } to { opacity: 0; transform: scale(1.6); } }
@keyframes loot-rays { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .loot-drop.is-shake .loot-chest, .loot-drop.is-legend.is-open::before { animation: none; } }
@media (max-width: 480px) {
  .replay-bar { flex-wrap: nowrap; gap: 5px; }
  .replay-bar .btn { min-height: 36px; padding: 5px 8px; font-size: .76rem; white-space: nowrap; }
  .replay-bar [data-skip] { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .replay-bar .grow { display: none; }
}
@media (max-width: 480px) { .result-card { padding: 14px 12px; } .result-card .result-pet { width: 96px; height: 96px; } .result-rewards div { padding: 7px 4px; } }

/* ---------- Result: one screen, no scrolling (fixed overlay, compact rows) ---------- */
.arena-result { position: fixed; inset: 0; z-index: 1000; border-radius: 0; padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)); }
html.has-result { overflow: hidden; }
.result-card { width: min(460px, 100%); max-height: calc(100dvh - 20px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; text-align: left; }
.result-top { display: flex; align-items: center; gap: 12px; }
.result-card .result-pet { width: 84px; height: 84px; margin: 0; flex: none; }
.result-head { flex: 1; min-width: 0; }
.result-head strong { font-size: .98rem; }
.result-card .result-title { font-size: clamp(1.45rem, 5vw, 1.9rem); }
.result-perfect { display: inline-block; font-size: .68rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--tint-yellow); color: var(--ink-yellow); white-space: nowrap; vertical-align: 2px; }
.result-card .result-xp { margin: 4px 0 2px; height: 9px; }
.result-card .result-rewards { margin: 0; gap: 6px; }
.result-card .result-rewards div { padding: 6px 4px; text-align: center; border-radius: 12px; }
.result-card .result-rewards b { font-size: 1.05rem; line-height: 1.2; }
.result-card .result-rewards span { font-size: .68rem; }
.result-card .loot-drop { margin: 0; min-height: 66px; padding: 8px; }
.result-card .loot-chest { width: 54px; height: 54px; }
.result-card .loot-item img { width: 50px; height: 50px; }
.result-card .loot-none { margin: 0; padding: 6px 10px; border-radius: 10px; background: var(--surface-2); font-size: .76rem; color: var(--muted); text-align: center; }
.rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; font-size: .78rem; }
.rep-head { grid-column: 1 / -1; margin: 0 0 2px; font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-head b { color: var(--text); }
.rep-cell { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: baseline; gap: 3px; padding: 3px 0; border-bottom: 1px solid var(--border); }
.rep-cell span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-cell b { font-weight: 600; min-width: 1.8em; text-align: center; font-variant-numeric: tabular-nums; }
.rep-cell b.is-best { color: var(--ink-green); font-weight: 800; }
.rep-cell i { font-style: normal; color: var(--muted); }
.result-card .result-tip { margin: 0; padding: 6px 10px; font-size: .78rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.result-card .result-btns { grid-template-columns: 1.3fr 1fr 1fr; margin: 0; gap: 6px; }
.result-card .result-btns .btn { min-height: 44px; padding: 6px 8px; font-size: .84rem; white-space: nowrap; justify-content: center; }
@media (max-height: 680px) { .result-card { gap: 6px; padding: 10px 12px; } .result-card .result-pet { width: 64px; height: 64px; } .result-card .result-tip { -webkit-line-clamp: 1; } .rep-cell { padding: 1px 0; } .result-card .result-btns .btn { min-height: 40px; } }
@media (max-height: 520px) { .result-card .result-tip, .result-card .loot-none { display: none; } .rep-grid { grid-template-columns: repeat(3, 1fr); } }
.result-main, .result-side { display: flex; flex-direction: column; gap: inherit; min-width: 0; }
/* Phones on their side: the two halves sit next to each other. */
@media (max-height: 520px) and (min-width: 620px) {
  .result-card { width: min(780px, 100%); flex-direction: row; align-items: stretch; gap: 14px; }
  .result-main, .result-side { flex: 1 1 0; gap: 6px; }
  .result-side { justify-content: space-between; }
  .result-card .result-tip { display: -webkit-box; }
  .rep-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- Arena rooms (members tab): my room, open rooms, suggested pets ---------- */
.con-sub b { color: #ffd666; } .con-sub small { font-weight: 500; text-transform: none; letter-spacing: 0; color: #6f819e; margin-left: 4px; }
.opp-list .con-sub { margin: 10px 0 4px; }
.room-mine, .room-open { display: grid; gap: 6px; padding: 10px; border-radius: 12px; border: 1px solid #5c4a1e; background: linear-gradient(180deg, #2a2414, #1b1a16); color: #f3ead2; }
.room-open > small { font-size: .74rem; color: #cfc3a3; line-height: 1.4; }
.room-open-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.room-open-row input, .room-open-row select { min-height: 38px; padding: 6px 10px; border-radius: 10px; border: 1px solid #5c4a1e; background: #12110d; color: #fff; font: inherit; font-size: .82rem; min-width: 0; }
.room-open-row select { max-width: 150px; }
.room-open-btn { min-height: 40px; border: 0; border-radius: 10px; background: linear-gradient(180deg, #ffd666, #f0a500); color: #2b1d00; font: inherit; font-weight: 800; cursor: pointer; }
.room-open-btn:hover { filter: brightness(1.05); }
.room-mine-head { display: flex; align-items: center; gap: 10px; }
.room-mine-head img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.room-mine-head span { display: grid; flex: 1; min-width: 0; }
.room-mine-head strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-mine-head small { font-size: .72rem; color: #cfc3a3; }
.room-rec { flex: none; padding: 4px 8px; border-radius: 999px; background: #12110d; color: #ffd666; font-size: .78rem; }
.room-fights { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.room-fights a { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; background: #12110d; color: #e9e2cf; font-size: .76rem; text-decoration: none; }
.room-fights a:hover { background: #221e14; }
.room-fights .is-good { color: #8ce99a; font-weight: 700; } .room-fights .is-bad { color: #ff8787; font-weight: 700; }
.room-fights .grow { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-fights em { font-style: normal; color: #ffd666; font-weight: 700; }
.room-close { justify-self: end; min-height: 32px; padding: 4px 12px; border-radius: 8px; border: 1px solid #5c4a1e; background: transparent; color: #cfc3a3; font: inherit; font-size: .74rem; cursor: pointer; }
.room-close:hover { color: #fff; border-color: #ff8787; }
.room-row { border-color: #4b3e1d; }
.room-row .opp-row-txt strong { color: #ffe8a3; }
.opp-row:disabled .opp-row-go { font-size: .66rem; white-space: nowrap; }
