/* Naruto Arena screen geometry with JoJo artwork and game controls. */
.papyrus{
  background:#fff4d6 url('/assets/jojo/arena-paper.svg') left top/96px 96px repeat;
  border:11px solid #b92b16;
  box-shadow:inset 0 0 0 4px #e9c388,0 3px 0 #4e120d,0 12px 26px #0008;
  color:#171411;
}
.topbar:has(~ .selection-screen),.topbar:has(~ .battle-screen){
  height:50px;
  justify-content:space-between;
  background:#17151dbd;
  padding:0 2.5%;
}
.topbar:has(~ .selection-screen) .brand,.topbar:has(~ .battle-screen) .brand{
  font-size:17px;
  text-shadow:0 2px 4px #000;
  color:#fff3d8;
}
.topbar:has(~ .selection-screen) nav,.topbar:has(~ .battle-screen) nav{
  position:static;
}
.selection-screen{
  position:relative;
  height:calc(100vh - 50px);
  min-height:720px;
  padding:0 3.2% 2.2%;
  gap:19px;
  justify-content:flex-end;
}
.mode-buttons{gap:2.7%}
.mode-buttons button{
  position:relative;
  flex:1;
  width:auto;
  height:61px;
  min-height:61px;
  padding:0 43px 0 12px;
  border:4px solid #482119;
  border-radius:23px;
  background:linear-gradient(#fff7d5,#e7bc75);
  color:#211a14;
  box-shadow:inset 0 0 0 2px #b65c40,0 4px 7px #0008;
  font-family:"Arial Narrow",Arial,sans-serif;
  font-weight:1000;
  text-shadow:0 1px #fff;
}
.mode-buttons button::after{
  content:"";
  position:absolute;
  width:65px;
  height:65px;
  right:-19px;
  top:-6px;
  border:3px solid #282223;
  border-radius:50%;
  background:linear-gradient(#b71318 0 46%,#171717 46% 53%,#fff 53%);
  box-shadow:0 0 0 3px #d8d9d8,0 3px 4px #0008;
}
.mode-buttons button:hover{background:#fff4c8}
.selection-scroll{
  position:relative;
  height:clamp(390px,38vh,475px);
  min-height:0;
  display:grid;
  grid-template-columns:67% 33%;
  padding:20px 28px 24px 8.3vw;
  gap:8px;
}
.selection-scroll::before{
  content:"";
  position:absolute;
  z-index:1;
  left:-17px;
  top:-17px;
  bottom:-17px;
  width:6.3vw;
  max-width:96px;
  min-width:68px;
  border:4px solid #40191b;
  border-radius:28px;
  background:linear-gradient(90deg,#073a1c,#1d7931 38%,#0b4e22 72%,#042f18);
  box-shadow:inset 5px 0 9px #0008,4px 3px 5px #0006;
}
.selection-scroll::after{
  content:"";
  position:absolute;
  z-index:2;
  left:-19px;
  top:-17px;
  width:calc(min(6.3vw,96px) + 4px);
  min-width:72px;
  height:42px;
  border:4px solid #451615;
  border-radius:26px 26px 8px 8px;
  background:linear-gradient(#cf2a19,#6d0909);
  box-shadow:0 calc(clamp(390px,38vh,475px) - 21px) 0 -2px #9f180f;
  pointer-events:none;
}
.character-side{min-width:0}
.selection-title{font-size:16px;color:#262019;letter-spacing:.01em}
.selection-title span{color:#8d251d}
.character-grid{
  grid-template-columns:repeat(7,6vw);
  grid-auto-rows:6vw;
  gap:1.05vw;
  padding-top:15px;
  min-height:0;
}
.portrait-button,.roster-placeholder{
  width:6vw;
  height:6vw;
  aspect-ratio:1;
  border:3px solid #121312;
  background:#fbf1d4;
}
.portrait-button.picked{
  border-color:#161413;
  box-shadow:0 0 0 3px #b72016;
}
.roster-placeholder{
  opacity:.25;
  background:radial-gradient(circle at 50% 45%,#e4d2a5 0 12%,transparent 13%),#f8efda;
}
.selection-tools{
  margin:0 0 0;
  gap:22%;
  position:absolute;
  bottom:12px;
}
.selection-tools button{
  min-width:132px;
  border:1px solid #ba7562;
  border-radius:20px;
  background:#f5e9c7;
  padding:4px 15px;
  font-size:14px;
}
.filter-input{position:absolute;left:8.3vw;bottom:52px;width:38vw}
.selected-side{
  min-width:0;
  border-left:0;
  padding:6px 10px 8px 12px;
  justify-content:space-between;
}
.player-card{gap:16px}
.player-card>img{
  width:8.5vw;
  height:8.5vw;
  max-width:165px;
  max-height:165px;
  border:7px ridge #6a1a87;
  box-shadow:0 0 0 3px #231329;
}
.player-card h2{font-size:23px;color:#171515}
.player-card p{font-size:17px;margin:5px 0}
.selected-team{justify-content:center;gap:1vw}
.selected-team>*{width:6.6vw;max-width:130px}
.ready-label{font-size:16px;white-space:nowrap;margin:0;padding:0 0 3px}
.preview-scroll{
  position:absolute;
  z-index:5;
  top:10px;
  left:50%;
  transform:translateX(-50%);
  width:70vw;
  max-width:none;
  height:clamp(370px,38vh,445px);
  min-height:0;
  margin:0;
  padding:18px 7vw 20px 30px;
}
.preview-scroll::after{
  content:"";
  position:absolute;
  right:-17px;
  top:-18px;
  bottom:-18px;
  width:6vw;
  max-width:88px;
  border:4px solid #3d1c1b;
  border-radius:26px;
  background:linear-gradient(90deg,#063819,#258044 38%,#0a4c25 75%,#043319);
  box-shadow:inset 6px 0 8px #0006,3px 4px 5px #0006;
}
.preview-scroll h2{font-size:24px;margin:0 0 10px}
.preview-top{gap:3vw;justify-content:space-between}
.preview-top>img,.preview-skill-icons img{
  width:9.5vw;
  height:9.5vw;
  max-width:150px;
  max-height:150px;
  object-fit:cover;
}
.preview-skill-icons{gap:1.7vw}
.preview-skill-icons button{height:fit-content}
.preview-description{margin-top:20px;gap:25px}
.preview-description h3{font-size:22px}
.preview-description p{font-size:18px;font-weight:700;text-transform:uppercase}
.preview-description small{font-size:13px}
.preview-description>img{width:9.5vw;height:9.5vw;max-width:150px;max-height:150px}
.preview-close{z-index:6;right:12px;top:10px}
.preview-scroll>.small-button{position:absolute;bottom:12px;left:30px}
.battle-screen{height:calc(100vh - 50px);background:var(--battle-bg) center/cover}
.battle-top{
  height:155px;
  flex:none;
  grid-template-columns:1fr 1.35fr 1fr;
  padding:10px 13vw;
  gap:20px;
  background:linear-gradient(#57d9e8ef,#b7f3e3df);
  border-bottom:5px solid #8d1d16;
}
.battle-player img{width:85px;height:85px}
.battle-player b{font-family:"Arial Narrow",Arial,sans-serif;font-size:27px}
.battle-player small{font-size:18px}
.battle-center{align-self:center;padding:0}
.ready-button{
  display:block;
  width:100%;
  background:none;
  border:0;
  color:#101416;
  font-size:26px;
  text-align:center;
}
.ready-button::after{
  content:"";
  display:block;
  width:100%;
  height:24px;
  margin:2px 0 6px;
  background:linear-gradient(90deg,#cc1d23 0 82%,#fff 82%);
  border:3px solid #141515;
}
.energy-bar{margin:2px 0;gap:8px}
.energy-bar button{flex-basis:100%;font-size:16px}
.energy-symbol{width:19px;height:19px}
.battle-center>small{font-size:14px}
.queued-actions{min-height:22px}
.battle-field{padding:6px 3.2% 4px}
.my-fighters{width:59vw;max-width:none}
.fighter-row{height:31%;position:relative}
.battle-portrait,.enemy-fighters .battle-portrait{
  width:9.5vw;
  min-width:105px;
  max-width:none;
}
.battle-portrait{border:3px solid #121515}
.hp{font-size:18px}
.skill-strip{
  height:74%;
  margin-left:-4px;
  padding:8px 14px 8px 36px;
  border:8px solid #a41f16;
  box-shadow:inset 0 0 0 3px #e8c389,0 5px 9px #0006;
}
.battle-skill{width:7.2vw;max-width:none;min-width:82px;border:3px solid #111}
.enemy-fighters{width:12vw;padding:0}
.battle-footer{height:214px;grid-template-columns:31vw 1fr}
.battle-tools{gap:9px}
.battle-tools button{
  width:65%;
  height:50px;
  border:8px solid #9b2318;
  background:#fff3d5 url('/assets/jojo/arena-paper.svg') left top/96px 96px repeat;
  box-shadow:inset 0 0 0 2px #e3bd7b,0 3px 5px #0006;
  font-size:19px;
  font-weight:600;
}
.details-scroll{
  border:9px solid #ae2117;
  box-shadow:inset 0 0 0 3px #e1bc7d;
  padding:18px 22px;
}
.details-art{width:140px;height:140px}
.details-copy h2{font-size:26px}
.details-copy p{font-size:18px;font-weight:700;text-transform:uppercase}
.details-meta{font-size:15px;justify-content:space-between}
.battle-opponent-summary{display:flex;align-items:center;gap:20px;width:100%}
.battle-opponent-summary>img{width:140px;height:140px;object-fit:cover;border:3px solid #211}
.battle-opponent-summary h2{color:#b51916;margin:0}
.battle-opponent-summary p{margin:4px 0}
.battle-opponent-team{display:flex;gap:12px;margin-left:auto}
.battle-opponent-team img{width:110px;height:110px;object-fit:cover;border:3px solid #111}
body:has(.selection-screen){background-position:right center}
.mode-buttons button{font-size:18px;white-space:nowrap}
.scroll-arrow{position:absolute;z-index:4;left:29px;top:20px;color:#fff;font-size:81px;line-height:1;text-shadow:2px 3px 2px #2a241a;transform:rotate(-12deg);pointer-events:none}
.preview-scroll>.small-button{top:14px;right:110px;bottom:auto;left:auto;padding:5px 9px;font-size:12px}
.battle-status{width:7.2vw;max-width:none;min-width:82px;aspect-ratio:1;background:#363636;color:#888;border:3px solid #121212;font-size:clamp(45px,5vw,78px);font-weight:1000;line-height:1}
.battle-status:hover{border-color:#f1d069;color:#ddd}
@media(max-width:1000px){
  .selection-screen{min-height:650px}
  .selection-scroll{padding-left:8vw}
  .selection-scroll::before{min-width:45px}
  .selection-scroll::after{min-width:49px}
  .character-grid{grid-template-columns:repeat(4,9vw);grid-auto-rows:9vw}
  .portrait-button,.roster-placeholder{width:9vw;height:9vw}
  .roster-placeholder:nth-child(n+9){display:none}
  .player-card p{font-size:12px}
  .player-card h2{font-size:18px}
  .preview-top>img,.preview-skill-icons img{width:8vw;height:8vw}
  .preview-description p{font-size:14px}
  .my-fighters{width:70vw}
  .battle-portrait,.enemy-fighters .battle-portrait{width:10vw;min-width:75px}
  .battle-skill{min-width:0;width:9vw}
  .battle-status{min-width:0;width:9vw}
  .battle-top{padding:10px 5vw}
  .battle-footer{grid-template-columns:25vw 1fr}
}
@media(max-width:650px){
  .topbar:has(~ .selection-screen),.topbar:has(~ .battle-screen){height:70px}
  .selection-screen{height:auto;min-height:calc(100vh - 70px)}
  .mode-buttons button{width:48%;flex:none;padding-right:20px}
  .mode-buttons button::after{display:none}
  .selection-scroll{height:auto;min-height:390px;grid-template-columns:1fr;padding-left:70px}
  .selection-scroll::after{box-shadow:none}
  .character-grid{grid-template-columns:repeat(4,13vw);grid-auto-rows:13vw}
  .portrait-button,.roster-placeholder{width:13vw;height:13vw}
  .selected-side{border-top:1px solid #b89c74}
  .player-card>img{width:75px;height:75px}
  .selected-team>*{width:58px}
  .selection-tools{position:static;margin-top:10px}
  .preview-scroll{position:relative;width:96%;left:auto;top:auto;transform:none;height:auto;margin:10px auto;padding:15px 45px 55px 15px}
  .preview-scroll::after{width:40px}
  .preview-skill-icons{flex-wrap:wrap}
  .preview-top>img,.preview-skill-icons img{width:55px;height:55px}
  .preview-description>img{display:none}
  .battle-screen{height:auto}
  .battle-top{height:175px;padding:6px}
  .my-fighters{width:78vw}
  .battle-field{min-height:540px}
  .battle-portrait,.enemy-fighters .battle-portrait{width:72px;min-width:72px}
  .battle-skill{width:13vw}
  .battle-status{width:13vw;font-size:32px}
  .battle-footer{grid-template-columns:1fr}
  .battle-tools button{width:33%}
  .battle-opponent-team img{width:50px;height:50px}
}

/* Keep the three roster rows within the parchment at desktop sizes. */
@media (min-width:1001px){
  .selection-screen{height:calc(100dvh - 50px);min-height:0;overflow:hidden}
  .selection-scroll{--roster-tile:min(5.5vw,calc((clamp(390px,38dvh,475px) - 112px)/3));overflow:visible}
  .character-grid{grid-template-columns:repeat(7,var(--roster-tile));grid-auto-rows:var(--roster-tile);gap:min(1vw,12px);padding-top:12px;min-height:0}
  .portrait-button,.roster-placeholder{width:var(--roster-tile);height:var(--roster-tile)}
  .selected-side{padding-bottom:7px}
  .selected-team>*{width:min(6.6vw,110px)}
}
.preview-description p,.details-copy p{white-space:pre-line;text-transform:none}
.preview-description{min-height:0;overflow-y:auto;max-height:calc(100% - 180px)}

/* R239 turn review: ordered actions and a shared Random energy pool. */
.review-overlay{z-index:30;background:#000b}
.turn-review{width:min(860px,92vw);max-height:90dvh;display:flex;flex-direction:column;padding:20px 24px;overflow:hidden}
.turn-review h2{margin:0;color:#a71915;font-size:27px}
.turn-review>p{margin:7px 0;font-weight:bold}
.review-list{overflow-y:auto;min-height:0;flex:1;border-block:2px solid #b88b59}
.review-row{display:flex;align-items:center;gap:16px;padding:12px 5px;border-bottom:1px solid #c6a779}
.review-row>img{width:76px;height:76px;object-fit:cover;border:3px solid #1a1412;flex:none}
.review-info{flex:1;min-width:0}.review-info>b,.review-info>small{display:block}.review-info>b{color:#a71e18;font-size:18px}.review-info>small{margin:4px 0}
.review-energy{display:flex;gap:12px;flex-wrap:wrap;margin-top:6px}.review-energy>span{white-space:nowrap}
.review-energy button,.review-order button{border:1px solid #a35435;background:#f5dda5;padding:2px 7px;font-weight:bold}
.review-energy button:disabled,.review-order button:disabled{opacity:.4}
.review-order{display:flex;flex-direction:column;gap:4px}
.review-pool{display:flex;justify-content:space-around;gap:12px;flex-wrap:wrap;padding:12px 0;font-weight:bold}
.review-actions{display:flex;justify-content:flex-end;gap:12px}.review-actions button{border:2px solid #63221b;background:#e9c589;padding:8px 16px;font-weight:900}.review-actions button:last-child{background:#b21d18;color:#fff}
