.arena-page {
  --arena-gold: #efc67e;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 15%, #28232b, transparent 65%), #0d0c16;
  color: #f8f6fa;
  font-family: "DM Sans", sans-serif;
}
.arena-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.arena-header { margin: auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.arena-header img { display: block; object-fit: contain; }
.arena-header select { font: 500 12px "DM Sans", sans-serif; color: #eee8f2; background: #211d29; border: 1px solid #ffffff25; border-radius: 24px; padding: 10px 32px 10px 15px; cursor: pointer; max-width: 100%; }
.arena-main { margin: auto; padding: 0 12px 20px; }
.arena-matchup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; position: relative; isolation: isolate; perspective: 1200px; }
.arena-versus { position: absolute; left: 50%; top: 225px; transform: translate(-50%, -50%); display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #121018; border: 1px solid #6f5a3a; box-shadow: 0 0 0 5px #121018; font: italic 20px "Barlow Condensed", sans-serif; color: var(--arena-gold); z-index: 2; pointer-events: none; }
.arena-card { --arena-team: #747889; display: flex; flex-direction: column; min-width: 0; position: relative; background: #191721; border: 1px solid #ffffff24; border-radius: 12px; padding-bottom: 14px; transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .4s, box-shadow .4s, border-color .4s; }
.arena-portrait-choice { position: relative; display: block; width: 100%; padding: 0; border: 0; color: inherit; background: transparent; border-radius: 11px 11px 0 0; overflow: hidden; cursor: pointer; font: inherit; }
.arena-card-top { position: absolute; inset: 16px 18px auto; display: flex; justify-content: space-between; align-items: start; z-index: 3; pointer-events: none; }
.arena-latest { font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; background: #10101999; border: 1px solid #ffffff20; border-radius: 4px; padding: 5px 7px; letter-spacing: .04em; }
.arena-age { font: 27px/.9 "Barlow Condensed", sans-serif; text-align: right; text-shadow: 0 1px 10px #000; }
.arena-age small { display: block; font: 8px "DM Sans", sans-serif; text-transform: uppercase; letter-spacing: .1em; margin-top: 5px; }
.arena-portrait-scene { display: block; position: relative; height: 275px; background: radial-gradient(ellipse at 52% 42%, color-mix(in srgb, var(--arena-team) 56%, #28212b), #191721 85%); }
.arena-portrait-scene:after { content: ""; position: absolute; inset: 85% 0 0; background: linear-gradient(transparent, #191721); pointer-events: none; z-index: 1; }
.arena-watermark { position: absolute; width: 245px; height: 245px; object-fit: contain; top: 0; left: 44%; transform: translateX(-50%) rotate(-12deg); opacity: .13; }
.arena-portrait, .arena-portrait-fallback { position: absolute; bottom: 0; left: 57%; transform: translateX(-50%); transform-origin: center bottom; height: 264px; width: 85%; object-fit: contain; object-position: bottom; z-index: 1; filter: drop-shadow(0 10px 15px #0005); transition: transform .65s cubic-bezier(.2,.8,.2,1); }
.arena-portrait-scene:has(.arena-portrait:not(.arena-image-failed)) .arena-portrait-fallback { opacity: 0; }
.arena-current-crests { position: absolute; left: 20px; bottom: 30px; z-index: 2; display: flex; flex-direction: column; gap: 8px; }
.arena-current-crest { display: grid; place-items: center; width: 68px; height: 68px; filter: drop-shadow(0 3px 8px #0009); }
.arena-current-crest img { width: 100%; height: 100%; object-fit: contain; }
.arena-crest-fallback { display: grid; place-items: center; width: 100%; height: 100%; color: #eee5d3; background: #302c3b; border: 1px solid #ffffff29; border-radius: 8px; font: 16px "Barlow Condensed", sans-serif; }
.arena-name { font: 700 30px/1 "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .01em; margin: 4px 20px 12px; min-height: 60px; overflow-wrap: anywhere; }
.arena-name a { color: inherit; text-decoration: none; }
.arena-name a:hover { color: var(--arena-gold); }
.arena-history { margin: 0 12px 16px; }
.arena-league { padding: 9px 0 3px; border-top: 1px solid #ffffff10; }
.arena-league h3 { margin: 0 0 8px; font: 14px/1.05 "Barlow Condensed", sans-serif; text-transform: uppercase; color: #e0d6e6; }
.arena-seasons { display: flex; flex-wrap: wrap; gap: 9px; margin: 0; padding: 0 2px 7px; list-style: none; }
.arena-season { flex: 0 0 58px; text-align: center; }
.arena-season-crest { position: relative; display: block; width: 42px; height: 42px; margin: 0 auto 5px; }
.arena-season-crest img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 2px 4px #0005); }
.arena-season-crest .arena-crest-fallback { font-size: 11px; }
.arena-standing { position: absolute; right: -6px; bottom: -2px; display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 3px; border-radius: 6px; border: 2px solid #191721; background: var(--arena-gold); color: #231c12; font: 17px/1 "Barlow Condensed", sans-serif; box-sizing: border-box; }
.arena-standing.is-unknown { background: #4c4357; color: #e6deef; }
.arena-season-label { color: #c1b5cc; font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.arena-choice { margin: auto 14px 0; padding: 13px 17px; border: 1px solid #f5d59e; border-radius: 7px; background: var(--arena-gold); color: #241b0d; display: flex; align-items: center; justify-content: space-between; font: 700 13px "DM Sans", sans-serif; cursor: pointer; transition: background .2s; }
.arena-choice>span:last-child { font-size: 20px; line-height: 1; }
.arena-choice:hover:not(:disabled) { background: #ffddaa; }
.arena-page button:disabled { cursor: default; }
.arena-page :is(button,select,a):focus-visible { outline: 2px solid #9ee0db; outline-offset: 3px; }
.arena-portrait-choice:focus-visible { outline-offset: -4px; }
.arena-card.is-winner { z-index: 4; transform: translateY(-4px) scale(1.035); border-color: var(--arena-gold); box-shadow: 0 18px 50px #0009, 0 0 0 1px #efc67e33; }
.arena-card.is-winner .arena-portrait { transform: translateX(-50%) scale(1.16); }
.arena-card.is-other { opacity: .35; transform: scale(.97); }
.arena-actions { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 16px auto 0; min-height: 42px; }
.arena-actions button { padding: 10px 23px; border: 1px solid #ffffff20; border-radius: 24px; background: #1c1824; color: #e7dced; cursor: pointer; font: 12px "DM Sans", sans-serif; }
.arena-actions button:hover:not(:disabled) { border-color: #efc67e88; color: var(--arena-gold); }
.arena-actions button:disabled { opacity: .3; }
.arena-actions.is-pending { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 10; width: 290px; max-width: calc(100% - 32px); margin: 0; padding: 7px 8px 7px 18px; border: 1px solid #efc67e55; border-radius: 10px; background: #211b2a; box-shadow: 0 8px 32px #0009; justify-content: space-between; overflow: hidden; }
.arena-confirmation { font-size: 12px; color: #f1d3a1; }
.arena-countdown { position: absolute; bottom: 0; left: 0; height: 2px; background: var(--arena-gold); width: 100%; transform-origin: left; animation: arena-countdown 2s linear forwards; }
.arena-notice { border: 1px solid #efc67e40; background: #30281f; color: #f1d7a9; padding: 9px 12px; font-size: 12px; border-radius: 5px; margin: 0 0 12px; }
.arena-notice[hidden] { display: none; }
.arena-image-failed { visibility: hidden; }
.arena-empty { text-align: center; border: 1px dashed #ffffff26; border-radius: 10px; padding: 70px 20px; color: #b9adc8; }
.arena-empty h2 { font: 32px "Barlow Condensed", sans-serif; color: #eee6f4; }
.arena-empty p { font-size: 13px; }
@keyframes arena-countdown { to { transform: scaleX(0); } }
@media (max-width: 600px) {
  .arena-header { padding: 10px 14px; gap: 12px; }
  .arena-header img { width: 110px; height: 38px; }
  .arena-header select { font-size: 11px; padding: 9px 25px 9px 12px; }
  .arena-main { padding: 0 6px 16px; }
  .arena-matchup { gap: 8px; }
  .arena-card { border-radius: 9px; padding-bottom: 10px; }
  .arena-portrait-choice { border-radius: 8px 8px 0 0; }
  .arena-card-top { inset: 12px 10px auto; }
  .arena-latest { font-size: 8px; padding: 4px 5px; }
  .arena-age { font-size: 23px; }
  .arena-age small { font-size: 6px; }
  .arena-portrait-scene { height: 210px; }
  .arena-portrait, .arena-portrait-fallback { height: 197px; width: 94%; left: 54%; }
  .arena-watermark { width: 160px; height: 160px; top: 23px; }
  .arena-current-crests { left: 9px; bottom: 15px; gap: 4px; }
  .arena-current-crest { width: 43px; height: 43px; }
  .arena-name { font-size: 23px; min-height: 69px; margin: 3px 11px 9px; }
  .arena-history { margin: 0 8px 12px; }
  .arena-league { padding-top: 7px; }
  .arena-league h3 { font-size: 12px; margin-bottom: 6px; }
  .arena-seasons { gap: 6px; }
  .arena-season { flex-basis: 48px; }
  .arena-season-crest { width: 34px; height: 37px; }
  .arena-standing { min-width: 18px; height: 19px; font-size: 15px; right: -4px; }
  .arena-season-label { font-size: 8px; }
  .arena-choice { margin: auto 9px 0; padding: 12px; font-size: 12px; }
  .arena-versus { top: 173px; width: 26px; height: 26px; font-size: 14px; box-shadow: 0 0 0 4px #121018; }
  .arena-actions { margin-top: 14px; }
  .arena-card.is-winner { transform: translateY(-3px) scale(1.025); }
}
@media (prefers-reduced-motion: reduce) {
  .arena-card, .arena-portrait, .arena-choice { transition: none; }
  .arena-card.is-winner, .arena-card.is-other { transform: none; }
  .arena-card.is-winner .arena-portrait { transform: translateX(-50%); }
  .arena-countdown { animation: none; display: none; }
}

.arena-usage-key { display: flex; justify-content: center; gap: 16px; margin: 0 0 10px; color: #aca1b8; font-size: 9px; }
.arena-usage { display: flex; justify-content: center; gap: 7px; margin-top: 5px; color: #d7cddd; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.arena-usage>span { display: inline-flex; gap: 3px; align-items: center; }
.arena-usage>span>span { color: #a99bb8; font-size: 11px; }
.arena-usage>span:last-child>span { color: var(--arena-gold); font-size: 9px; }
.arena-season-label { display: block; }
@media(max-width:600px) { .arena-usage-key { font-size: 8px; gap: 8px; } .arena-usage { font-size: 9px; gap: 5px; } .arena-usage>span { gap: 2px; } }
