#screen-pvz:has(.arena-departure) .pvz-shell { width: 100%; max-width: none; }
.arena-departure {
  --arena-accent: #38e5ff;
  position: relative; isolation: isolate; display: grid; justify-items: center; align-content: center;
  min-height: min(720px, 86svh); padding: clamp(14px, 3vw, 40px); gap: 10px;
  color: #f5f8ff; font-family: var(--m6-font);
  background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--arena-accent) 26%, transparent), transparent 66%),
    linear-gradient(#080d1722, #080d17cc), url('../../../assets/pvz/stage-poster.jpg') center / cover;
}
.arena-hard { --arena-accent: #b366ff; }
.arena-hell { --arena-accent: #ff665f; }
.arena-frame {
  width: min(720px, 100%); min-height: clamp(190px, 32vw, 330px); position: relative;
  display: grid; place-content: center; justify-items: center; text-align: center; padding: clamp(54px, 8vw, 76px) 14% clamp(36px, 5vw, 52px);
  background: radial-gradient(ellipse, #08101aeb 5%, #08101a85 51%, transparent 72%);
}
.arena-frame > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.arena-frame > :not(img) { z-index: 1; }
.arena-frame > small { color: var(--arena-accent); padding: 4px 12px; background: #0c1826ed; border: 1px solid #38e5ff68; border-radius: 999px; overflow-wrap: anywhere; max-width: 100%; }
.arena-frame h2 { font-family: var(--m6-font); font-size: clamp(19px, 4vw, 45px); font-weight: 800; line-height: 1.1; margin: 4px 0 8px; }
.arena-agent { display: flex; align-items: center; justify-content: center; gap: 6px 10px; width: fit-content; max-width: 100%; margin-inline: auto; padding: 6px 14px; border-radius: 8px; color: #effbff; border: 1px solid #38e5ff66; background: #11263de8; }
.arena-agent > img { object-fit: contain; width: clamp(52px, 7.5vw, 78px); height: clamp(56px, 8vw, 84px); }
.arena-agent > strong, .arena-agent-change { white-space: nowrap; }
#screen-pvz .arena-agent-change { min-height: 38px; padding: 7px 16px; border-radius: 4px; color: var(--arena-accent); background: #1b2c40; border: 1px solid currentColor; }
.arena-dialog { width: min(490px, calc(100vw - 24px)); max-height: 82dvh; overflow: auto; overscroll-behavior: contain; color: #f5f8ff; background: #101b2a; border: 1px solid #80b3d0; font-family: var(--m6-font); }
.arena-dialog::backdrop { background: #07101bce; backdrop-filter: blur(5px); }
.arena-dialog-body { display: grid; gap: 14px; }
.arena-dialog-body button { min-height: 44px; font-family: inherit; }
.arena-dialog-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.arena-dialog-choices img { display: block; width: 100%; height: 72px; object-fit: contain; }
.arena-selector { display: grid; grid-template-columns: 46px minmax(132px, 1fr) 46px; align-items: center; text-align: center; }
.arena-selector strong { padding: 10px 12px; color: var(--arena-accent); background: #111827eb; }
#screen-pvz .arena-selector button { min-height: 44px; border: 1px solid var(--arena-accent); border-radius: 2px; background: linear-gradient(#354155, #111727); color: var(--arena-accent); font-family: var(--m6-font); font-size: 25px; font-weight: 800; }
.arena-steps { display: flex; gap: 5px; }
.arena-steps i { width: 34px; height: 5px; transform: skewX(-21deg); background: #647089; }
.arena-steps .arena-lit { background: var(--arena-accent); box-shadow: 0 0 10px var(--arena-accent); }
.arena-brief { width: min(480px, 100%); text-align: center; padding: 9px 16px; border: 1px solid #9cc1db72; background: linear-gradient(110deg, #263a4de6, #122032eb 60%, #293a4eec); box-shadow: inset 0 1px #ffffff44; backdrop-filter: blur(6px); }
#screen-pvz :is(.arena-plan-button, .arena-launch) { width: min(480px, 100%); min-height: 46px; font-family: var(--m6-font); font-weight: 800; }
#screen-pvz .arena-plan-button { color: #e2f6ff; background: linear-gradient(110deg, #263a4de6, #122032eb 60%, #293a4eec); border: 1px solid var(--arena-accent); backdrop-filter: blur(6px); }
#screen-pvz .arena-launch { min-height: 56px; border: 0; border-radius: 0; background: linear-gradient(170deg, #e9ff8a, #a7eb32 63%, #679d20 64%, #b8f844 73%); color: #17220d; clip-path: polygon(4% 0, 100% 0, 100% 72%, 96% 100%, 0 100%, 0 28%); font-size: 1.28rem; }
.arena-launch:focus-visible { outline-offset: -5px; }
.arena-brief p { margin: 0; line-height: 1.45; }
.arena-brief p + p { color: #c1ccdb; }
.arena-layer { position: absolute; inset: 0; z-index: 24; pointer-events: none; color: #f5f8ff; font-family: var(--m6-font); }
.arena-layer[hidden] { display: none; }
#pvz-board.pvz-arena-live #pvz-grid { display: none; }
.arena-target { position: absolute; inset: 6px 58px auto; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 3px 6px; text-align: center; }
.arena-target > strong { display: inline-block; padding: 2px 12px; background: #09131dea; font-family: var(--m6-font); font-size: clamp(16px, 3vw, 33px); font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
.arena-target button { pointer-events: auto; font-family: inherit; min-height: 44px; }
.arena-mastery .arena-active { outline: 1px solid #38e5ff; box-shadow: 0 0 10px #38e5ff80; }
.arena-bounty { display: inline-flex; min-width: 0; align-items: baseline; gap: 6px; padding: 3px 8px; border: 1px solid #74dccc; background: #081722f5; box-shadow: 0 3px 12px #0009; font-family: var(--m6-font); }
.arena-bounty-caption { color: #b9e6e9; font-size: clamp(11px, 1.4vw, 15px); font-weight: 700; }
.arena-bounty-word { color: #e6fdff; font-size: clamp(18px, 3vw, 34px); font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; text-shadow: 0 0 12px #38e5ff70; }
.arena-mastery { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); width: min(500px, calc(100% - 200px)); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; font-size: 12px; }
.arena-mastery > div { display: grid; min-width: 0; justify-items: center; padding: 2px; background: #101d2cec; border: 1px solid #355169; border-radius: 5px; text-align: center; }
.arena-mastery > div > span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arena-mastery img { display: none; }
.arena-target > .arena-gates-open { color: #ffedab; border: 1px solid #dfc271; }
.arena-mastery small { color: #c7dcec; }
.arena-mastery .arena-tier-2 { border-color: #ffd54f; }
.arena-mastery-meter { display: flex; gap: 3px; width: 85%; margin: 2px 0; }
.arena-mastery-meter i { flex: 1; height: 3px; background: #405165; }
.arena-mastery-meter .charged { background: #ffd54f; box-shadow: 0 0 5px #ffd54f; }
.arena-skill { position: absolute; bottom: 5%; right: 4%; min-height: 48px; padding: 0 14px; pointer-events: auto; font-family: var(--m6-font); }
.arena-tier-1 { color: #38e5ff; }
.arena-tier-2 { color: #ffd54f; }
.arena-combat-notice { align-self: center; padding: 4px 12px; border-inline-start: 2px solid currentColor; background: #0b1629ef; color: #ffd54f; font-family: var(--m6-font); font-size: clamp(11px, 2vw, 16px); font-weight: 700; }
.arena-target .arena-evolved { color: #ffd54f; border-bottom: 2px solid #ff665f; }
.arena-pause-card { display: grid; gap: 10px; padding: 22px; min-width: min(220px, 80%); text-align: center; color: #f5f8ff; background: #101c2ce8; border: 1px solid #38e5ff75; font-family: var(--m6-font); }
.arena-pause-card button { min-height: 44px; font-family: inherit; }
.arena-field-label {
  position: absolute; transform: translate(-50%, -50%); width: max-content; max-width: 23%;
  padding: 2px 5px; border: 1px solid #38e5ff79; background: #090f1bed; border-radius: 4px;
  pointer-events: auto; cursor: pointer; min-height: 32px; color: #f4fbff; font-family: var(--m6-font);
  text-align: center; line-height: 1.1; font-size: clamp(12px, 2vw, 20px); font-weight: 700; overflow-wrap: anywhere;
}
.arena-field-label span:first-child { color: #38e5ff; }
.arena-field-label span + span { margin-left: 3px; color: #c8ff00; }
.arena-direction { position: absolute; transform: translate(-50%, -50%); padding: 3px 7px; background: #142337ee; color: #b3f5ff; font-weight: 700; white-space: nowrap; }
.arena-boss-direction { color: #ffb0b8; margin-top: 18px; }
.arena-chip-modal { pointer-events: auto; position: absolute; z-index: 3; inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(440px, 92%); max-height: 92%; overflow: auto; display: grid; gap: 6px; padding: 10px 16px; border: 1px solid #dfc271; background: #101927ee; box-shadow: 0 10px 45px #050913; }
#screen-pvz :is(.arena-dialog, .arena-pause-card, .arena-chip-modal) { padding: 18px; box-sizing: border-box; color: #edf9ff; font-family: var(--m6-font); border: 1px solid #5c859f; border-top: 2px solid #38e5ff; background: linear-gradient(150deg, #182d43fa, #0b1321f7 75%); box-shadow: 0 14px 44px #020509aa; }
#screen-pvz .arena-chip-modal { border-top-color: #ffd54f; }
.arena-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; }
.arena-dialog-header h3 { margin: 0; color: #99f0ff; font-size: 1.05rem; font-weight: 800; }
.arena-chip-modal h3 { color: #ffe692; }
#screen-pvz .arena-dialog-header .arena-dialog-close { flex: 0 0 36px; width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 4px; border: 1px solid #81b6d077; color: #effaff; background: #101f2e; font-size: 22px; line-height: 1; }
.arena-segments { min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 5px 0; border: 0; }
.arena-segments legend { color: #a9c4d9; font-weight: 700; }
#screen-pvz .arena-segments button { flex: 1 1 auto; border: 1px solid #57778e; border-radius: 6px; background: #101d2e; color: #e4f4ff; padding: 4px 8px; }
#screen-pvz .arena-segments button[aria-pressed='true'] { border-color: #38e5ff; color: #adf6ff; background: #134354; }
#screen-pvz .arena-plan-save { position: sticky; bottom: 0; background: #c8ff00; color: #17220d; border: 0; font-weight: 800; }
#screen-pvz .arena-chip-choice { display: grid; text-align: left; gap: 2px; min-height: 50px; padding: 7px 10px; background: #112639; color: #d8ecf8; border: 1px solid #597588; border-radius: 4px; font-family: var(--m6-font); }
.arena-chip-choice strong { color: #ffe299; font-size: 1rem; }
.arena-chip-choice span { font-size: .82rem; }
#screen-pvz .arena-chip-choice:is(:hover, :focus-visible) { border-color: #ffd54f; box-shadow: inset 0 0 12px #ffd54f33; }
#screen-pvz .arena-field-correct { color: #fff1ae; border-color: #ffd54f; box-shadow: 0 0 12px #ffd54faa; }
.arena-target > .arena-wrong { color: #ff9ea8; }
#screen-pvz .arena-result-card :is(.pvz-result-actions button, .pvz-selftest-btn) { height: 44px; min-height: 44px; border-radius: 6px; border: 1px solid #7296aeb3; font-family: var(--m6-font); font-weight: 700; }
@media (max-width: 600px) {
  .arena-layer { inset: 50% 0 auto; aspect-ratio: 16 / 9; transform: translateY(-50%); }
  .arena-target { inset: auto 0 calc(100% + 6px); }
  .arena-mastery { top: calc(100% + 4px); bottom: auto; width: calc(100% - 12px); }
  .arena-skill { bottom: 4px; right: 6px; }
  .arena-frame { padding-inline: 8%; }
  .arena-chip-modal { inset: 50% auto auto 50%; transform: translate(-50%, -50%); max-height: min(75dvh, 270px); }
}
