/* Playtest refinement: no changes to the portrait-phone book layout. */
#selection .fighter-name-group{
 display:inline-flex!important;align-items:center!important;flex:0 1 auto!important;
 gap:clamp(4px,.55vw,8px)!important;min-width:0!important;white-space:nowrap
}
#selection .fighter-name-group #fighterName{flex:0 1 auto!important;min-width:0!important}
/* Both underline rules begin/end at the same book coordinates on desktop.
   Compact landscape and the single-scroll portrait layout are excluded. */
@media (min-width:1000px) and (min-height:700px){
 #selection .im-book-page--detail .fighter-identity,
 #selection .im-book-page--roster > .im-page-heading{
  box-sizing:border-box!important;
  flex:0 0 clamp(52px,6.4dvh,65px)!important;
  height:clamp(52px,6.4dvh,65px)!important;
  min-height:clamp(52px,6.4dvh,65px)!important;
  max-height:clamp(52px,6.4dvh,65px)!important;
  padding-top:0!important;padding-bottom:8px!important;margin:0!important;
  border-bottom:1px solid var(--to-engrave)!important;
  box-shadow:0 1px var(--to-engrave-hi)!important
 }
 #selection .im-book-page--detail .fighter-identity{display:flex!important;align-items:center!important;justify-content:flex-start!important}
 #selection .im-book-page--roster > .im-page-heading{display:flex!important;align-items:center!important}
}
/* Preserve the HOME/name grid and portrait scrollbar dimensions. */
@media (orientation:portrait) and (max-width:700px){
 #selection .fighter-name-group{gap:6px!important}
}
#fighter-insight[hidden]{display:none!important}
#fighter-insight{
 box-sizing:border-box!important;position:fixed!important;inset:0!important;z-index:12000!important;
 display:flex!important;align-items:center!important;justify-content:center!important;
 width:100vw!important;height:100dvh!important;margin:0!important;
 padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right))
  max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))!important;
 background:rgba(22,15,24,.78)!important;backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)
}
#fighter-insight .fighter-insight-paper{
 box-sizing:border-box!important;display:flex!important;flex-direction:column!important;gap:12px!important;
 width:min(100%,560px)!important;max-height:min(90dvh,680px)!important;min-width:0!important;
 padding:clamp(14px,3vw,25px)!important;border:5px solid #705241!important;border-radius:0!important;
 background:#f1e6cd!important;color:#342c2d!important;
 box-shadow:inset 0 0 0 3px #fff7e4,5px 7px 0 #1e1620!important;
 font-family:"Galmuri11",monospace!important
}
#fighter-insight .fighter-insight-head{
 box-sizing:border-box!important;display:flex!important;flex:0 0 auto!important;
 align-items:flex-start!important;justify-content:space-between!important;gap:10px!important;
 margin:0!important;padding:0 0 11px!important;border-bottom:2px solid #b9a88a!important;
 background:transparent!important;box-shadow:none!important
}
#fighter-insight .fighter-insight-head small{display:block;color:#8a685a;font:700 11px/1.3 "Galmuri11",monospace}
#fighter-insight .fighter-insight-head h2{margin:4px 0 0!important;color:#392c32;font:700 clamp(20px,4.3vw,29px)/1.3 "Galmuri11",monospace!important}
#fighter-insight #fighter-insight-close{
 flex:0 0 auto!important;min-height:35px!important;padding:6px 9px!important;
 border:1px solid #a48f76!important;border-radius:0!important;background:#fff7e2!important;
 color:#4c3c38!important;font:700 12px/1.3 "Galmuri11",monospace!important;cursor:pointer
}
#fighter-insight #fighter-insight-close:focus-visible{outline:2px solid #9c526b;outline-offset:2px}
#fighter-insight .fighter-insight-intro{flex:0 0 auto;margin:0!important;color:#796c61;font:600 12px/1.5 "Galmuri11",monospace!important}
#fighter-insight .fighter-insight-body{
 display:flex!important;flex-direction:column!important;gap:10px!important;min-height:0!important;
 overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch
}
#fighter-insight .fighter-insight-move{
 padding:12px 13px!important;border:1px solid #c4b292!important;
 background:#fff7e5!important;box-shadow:inset 2px 2px #fffef2!important
}
#fighter-insight .fighter-insight-move-head{display:flex;align-items:center;gap:10px}
#fighter-insight .fighter-insight-move kbd{
 display:grid;place-items:center;flex:0 0 33px;width:33px;height:33px;
 border:2px solid #674e45;border-radius:0;background:#a35266;color:#fff5dc;
 font:700 16px/1 "Galmuri11",monospace
}
#fighter-insight .fighter-insight-move h3{margin:0;color:#493439;font:700 clamp(14px,3vw,18px)/1.4 "Galmuri11",monospace}
#fighter-insight .fighter-insight-damage{display:block;margin-top:8px;color:#a14557;font:700 clamp(16px,3.5vw,21px)/1.35 "Galmuri11",monospace}
#fighter-insight .fighter-insight-type{margin:5px 0!important;color:#685b51;font:700 12px/1.4 "Galmuri11",monospace}
#fighter-insight .fighter-insight-description{margin:6px 0 0!important;color:#54473f;font:500 12px/1.65 "Galmuri11",monospace;word-break:keep-all}
#fighter-insight .fighter-insight-tip{margin:0!important;padding:8px 10px!important;border-left:3px solid #a75e6c;background:#e8d9b9;color:#59473d;font:600 12px/1.6 "Galmuri11",monospace;word-break:keep-all}
#fighter-insight .fighter-insight-foot{margin:0!important;color:#706457;font:500 11px/1.6 "Galmuri11",monospace;word-break:keep-all}
#rotate-start-confirm:not([hidden]){
 box-sizing:border-box;display:block;width:100%;min-height:41px;margin:12px 0 0;
 border:2px solid #ad8d65;border-radius:0;background:#f8df98;color:#342a29;
 font:700 13px/1.3 "Galmuri11",monospace;box-shadow:inset 0 2px #fff7db,inset 0 -2px #bea26c;cursor:pointer
}
@media (orientation:landscape) and (max-height:460px){
 #fighter-insight .fighter-insight-paper{max-height:calc(100dvh - 12px)!important;gap:7px!important;padding:10px!important}
 #fighter-insight .fighter-insight-move{padding:8px 10px!important}
}

/* User test 2: a selected mobile-landscape portrait must keep the same
   physical scroll shape and image crop. Selection uses a small inset highlight
   instead of changing the frame/rods or adding an outside badge. */
@media (orientation:landscape) and (pointer:coarse) and (max-height:700px){
 #selection .mobile-cpu-chooser .cpu-option--fighter .cpu-small-label{
  display:none!important;
 }
 #selection .fighter-card-wrap > button.fighter-card,
 #selection .fighter-card-wrap > button.fighter-card:hover,
 #selection .fighter-card-wrap > button.fighter-card:active{
  transform:none!important;
 }
 #selection .fighter-card-wrap button[aria-pressed="true"] .px-portrait-scroll,
 #selection .fighter-card-wrap button:is(:hover,:focus-visible) .px-portrait-scroll{
  --bracket:transparent!important;
  --slot-bg:#eee7d4!important;
 }
 #selection .fighter-card-wrap button[aria-pressed="true"] .px-mini-rod,
 #selection .fighter-card-wrap button:is(:hover,:focus-visible) .px-mini-rod{
  box-shadow:inset 0 2px #9b8c76,inset 4px 0 #b3a18b,inset -4px 0 #b3a18b!important;
 }
 #selection .fighter-card-wrap button[aria-pressed="true"] .px-portrait-scroll__frame{
  outline:2px solid var(--member)!important;
  outline-offset:-2px!important;
 }
 #selection .fighter-card-wrap button[aria-pressed="true"] .px-portrait-scroll__tag{
  top:6px!important;
  border:0!important;
  box-shadow:none!important;
 }
}
/* Consistent optically-centered lowercase i inside a real square, both in
   the fighter name and in each Q/R technique row. */
#selection .move-info-button{
 box-sizing:border-box!important;
 display:grid!important;
 place-items:center!important;
 flex:0 0 24px!important;
 width:24px!important;
 height:24px!important;
 min-width:24px!important;
 min-height:24px!important;
 max-width:24px!important;
 max-height:24px!important;
 padding:0!important;
 margin:0!important;
 border:1px solid #a58e6f!important;
 border-radius:0!important;
 background:#f3e5c7!important;
 color:#5c4634!important;
 box-shadow:inset 0 1px #fffae7,inset 0 -2px #cabb99!important;
 font:700 15px/1 "Galmuri11",monospace!important;
 line-height:1!important;
 text-shadow:none!important;
 text-align:center!important;
 cursor:pointer;
}
#selection .move-info-button > span{
 display:block!important;
 width:100%!important;
 margin:0!important;
 padding:0!important;
 line-height:1!important;
 text-align:center!important;
 transform:translateY(-.5px);
}
#selection .move-info-button:hover{background:#f9edca!important}
#selection .move-info-button:focus-visible{
 outline:2px solid #95536b!important;outline-offset:2px!important
}
#selection #skillSlots .move-title-line{
 display:flex!important;
 flex-flow:row nowrap!important;
 align-items:center!important;
 justify-content:flex-start!important;
 gap:clamp(5px,.65vw,8px)!important;
 min-width:0!important;
 width:100%!important;
}
#selection #skillSlots .move-title-line > .move-name{
 display:block!important;
 flex:0 1 auto!important;
 min-width:0!important;
 margin:0!important;
 line-height:1.4!important;
 overflow-wrap:break-word;
}
#selection #skillSlots .move-info-button{flex-shrink:0!important}
#selection #skillSlots .move-copy{min-width:0!important}
@media (orientation:portrait) and (max-width:700px){
 /* Existing portrait name/HOME book dimensions are unchanged. */
 #selection .move-info-button{
  flex-basis:23px!important;
  width:23px!important;height:23px!important;
  min-width:23px!important;min-height:23px!important;
  max-width:23px!important;max-height:23px!important;
  font-size:14px!important;
 }
 #selection #skillSlots .move-title-line{gap:5px!important}
}
@media (orientation:landscape) and (pointer:coarse) and (max-height:500px){
 #selection .move-info-button{
  flex-basis:21px!important;
  width:21px!important;height:21px!important;
  min-width:21px!important;min-height:21px!important;
  max-width:21px!important;max-height:21px!important;
  font-size:13px!important;
 }
 #selection #skillSlots .move-title-line{gap:4px!important}
}


/* Playtest: a 50/50 split INSIDE the old, bounded skill footprint.
   Never increase the selection book page, preview or its flex allocation. */
#selection .im-book-profile .technique-section{
 box-sizing:border-box!important;display:grid!important;
 grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
 grid-template-rows:minmax(0,1fr)!important;
 gap:clamp(3px,.55vw,6px)!important;
 width:100%!important;height:clamp(72px,10dvh,92px)!important;
 min-height:0!important;max-height:clamp(72px,10dvh,92px)!important;
 margin:0!important;padding:0!important;
 flex:0 0 clamp(72px,10dvh,92px)!important;overflow:hidden!important;
}
#selection #fighter-stat-mini{
 box-sizing:border-box!important;display:flex!important;flex-direction:column!important;
 width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;
 margin:0!important;padding:clamp(3px,.55vw,6px)!important;
 border:1px solid #c6b995!important;background:#ede5d0!important;
 box-shadow:inset 2px 2px #faf4e5!important;overflow:hidden!important;
}
#selection .fighter-stat-mini-head{
 display:flex!important;align-items:center!important;justify-content:space-between!important;
 flex:0 0 auto!important;min-width:0!important;gap:2px!important;
 color:var(--to-ink)!important;font:700 clamp(8px,.8vw,11px)/1.1 var(--to-font)!important;
}
#selection .fighter-stat-mini-head strong{font:inherit!important}
#selection .fighter-stat-mini-head span{
 white-space:nowrap!important;color:#776950!important;
 font:600 clamp(7px,.72vw,9px)/1.1 var(--to-font)!important;
}
#selection #fighter-stat-mini-rows{
 display:grid!important;grid-template-rows:repeat(3,minmax(0,1fr))!important;
 flex:1 1 0!important;min-width:0!important;min-height:0!important;
 width:100%!important;gap:1px!important;margin:2px 0 0!important;
}
#selection .fighter-stat-mini-row{
 display:flex!important;flex-direction:column!important;justify-content:center!important;
 min-height:0!important;min-width:0!important;gap:1px!important;
}
#selection .fighter-stat-mini-labels{
 display:flex!important;align-items:center!important;justify-content:space-between!important;
 min-width:0!important;gap:2px!important;
 color:#4e433b!important;font:600 clamp(8px,.73vw,10px)/1.05 var(--to-font)!important;
}
#selection .fighter-stat-mini-labels b{
 flex:0 0 auto!important;color:#54463d!important;
 font:700 inherit!important;white-space:nowrap!important;
}
#selection .fighter-stat-mini-track{
 display:block!important;box-sizing:border-box!important;
 flex:0 0 4px!important;height:4px!important;min-height:4px!important;
 width:100%!important;border:1px solid #c7b99e!important;
 background:#d6cab0!important;overflow:hidden!important;
}
#selection .fighter-stat-mini-fill{display:block!important;height:100%!important;border:0!important;}
/* Exactly two right-hand slots. Their icons and info remain in bounds. */
#selection .technique-section > #skillSlots.px-window__list{
 box-sizing:border-box!important;display:flex!important;flex-direction:column!important;
 align-items:stretch!important;justify-content:stretch!important;
 width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;
 max-height:100%!important;margin:0!important;padding:0!important;overflow:hidden!important;
}
#selection .technique-section > #skillSlots > li.move-card{
 box-sizing:border-box!important;display:flex!important;align-items:center!important;
 flex:1 1 0!important;height:50%!important;min-height:0!important;max-height:50%!important;
 gap:clamp(3px,.38vw,5px)!important;
 margin:0!important;padding:2px clamp(3px,.45vw,6px)!important;
 overflow:hidden!important;
}
#selection .technique-section > #skillSlots .skill-pixel-icon{
 box-sizing:border-box!important;flex:0 0 clamp(18px,2.1vw,24px)!important;
 width:clamp(18px,2.1vw,24px)!important;height:clamp(18px,2.1vw,24px)!important;
 max-width:24px!important;margin:0!important;padding:1px!important;
}
#selection .technique-section > #skillSlots .move-copy{
 display:flex!important;flex-direction:column!important;justify-content:center!important;
 flex:1 1 0!important;width:auto!important;min-width:0!important;max-height:100%!important;
 gap:1px!important;overflow:hidden!important;
}
#selection .technique-section > #skillSlots .move-kind{
 display:block!important;font-size:clamp(8px,.73vw,10px)!important;
 line-height:1.05!important;margin:0!important;
}
#selection .technique-section > #skillSlots .move-title-line{
 display:flex!important;align-items:center!important;justify-content:space-between!important;
 gap:2px!important;min-width:0!important;width:100%!important;
}
#selection .technique-section > #skillSlots .move-title-line > .move-name{
 flex:1 1 0!important;min-width:0!important;margin:0!important;
 font-size:clamp(9px,.82vw,12px)!important;line-height:1.2!important;
 overflow-wrap:anywhere!important;word-break:keep-all!important;
}
#selection .technique-section > #skillSlots .move-info-button{
 box-sizing:border-box!important;display:grid!important;place-items:center!important;
 flex:0 0 18px!important;width:18px!important;height:18px!important;
 min-width:18px!important;min-height:18px!important;
 max-width:18px!important;max-height:18px!important;
 margin:0!important;padding:0!important;align-self:center!important;
 font:700 12px/1 "Galmuri11",monospace!important;text-align:center!important;
}
#selection .technique-section > #skillSlots .move-info-button > span{
 width:100%!important;line-height:1!important;
 text-align:center!important;transform:translateY(-.5px)!important;
}
@media (orientation:landscape) and (max-height:500px){
 #selection .im-book-profile .technique-section{
  height:72px!important;max-height:72px!important;flex-basis:72px!important;
 }
 #selection #fighter-stat-mini{padding:3px 4px!important}
 #selection .fighter-stat-mini-head{font-size:8px!important}
 #selection .fighter-stat-mini-head span{font-size:7px!important}
 #selection .fighter-stat-mini-labels{font-size:8px!important}
 #selection .fighter-stat-mini-track{flex-basis:3px!important;height:3px!important;min-height:3px!important}
 #selection .technique-section > #skillSlots .skill-pixel-icon{
  flex-basis:17px!important;width:17px!important;height:17px!important
 }
 #selection .technique-section > #skillSlots .move-title-line > .move-name{font-size:9px!important}
 #selection .technique-section > #skillSlots .move-info-button{
  flex-basis:16px!important;width:16px!important;height:16px!important;
  min-width:16px!important;min-height:16px!important;
  max-width:16px!important;max-height:16px!important;font-size:11px!important;
 }
}
/* Mobile portrait book is one uninterrupted sheet, including PWA mode.
   Old horizontal binding pseudo-elements may never overlay the second row. */
@media (orientation:portrait) and (max-width:700px){
 body[data-screen="selection"] #selection:not([hidden]) .select-main.im-dossier-book::before,
 body[data-screen="selection"] #selection:not([hidden]) .select-main.im-dossier-book::after{
  content:none!important;display:none!important;visibility:hidden!important;
  opacity:0!important;width:0!important;height:0!important;border:0!important;
  background:none!important;box-shadow:none!important;pointer-events:none!important;
 }
 #selection .im-book-profile .technique-section{
  height:84px!important;max-height:84px!important;flex-basis:84px!important;gap:4px!important;
 }
 #selection #fighter-stat-mini{padding:4px!important}
 #selection .fighter-stat-mini-head{font-size:9px!important}
 #selection .fighter-stat-mini-head span{font-size:8px!important}
 #selection .fighter-stat-mini-labels{font-size:9px!important}
 #selection .technique-section > #skillSlots .skill-pixel-icon{
  flex-basis:19px!important;width:19px!important;height:19px!important
 }
 #selection .technique-section > #skillSlots .move-title-line > .move-name{font-size:10px!important}
 #selection .technique-section > #skillSlots .move-info-button{
  flex-basis:17px!important;width:17px!important;height:17px!important;
  min-width:17px!important;min-height:17px!important;
  max-width:17px!important;max-height:17px!important;font-size:11px!important;
 }
}
/* Closer title-to-book spacing across PC, landscape, portrait and PWA,
   using grid row gap instead of risky negative margins. */
body[data-screen="selection"] #selection:not([hidden]){
 row-gap:clamp(7px,.85dvh,9px)!important;
}
body[data-screen="selection"] #selection:not([hidden]) > .select-head{
 min-height:clamp(27px,3.9dvh,50px)!important;
}
@media (orientation:portrait) and (max-width:700px){
 body[data-screen="selection"] #selection:not([hidden]) > .select-head{min-height:26px!important}
}
/* An accessible button visually styled as an underlined back link. */
#rotate-gate[data-context="start"] #rotate-cancel:not([hidden]){
 display:block!important;box-sizing:border-box!important;
 align-self:center!important;width:auto!important;height:auto!important;
 min-width:0!important;min-height:0!important;max-width:100%!important;
 margin:10px auto 0!important;padding:3px 5px!important;
 border:0!important;border-radius:0!important;background:transparent!important;
 color:#635348!important;box-shadow:none!important;
 text-decoration:underline!important;text-decoration-thickness:1px!important;
 text-underline-offset:4px!important;
 font:600 clamp(11px,2.8vw,13px)/1.45 "Galmuri11",monospace!important;
 cursor:pointer;
}
#rotate-gate[data-context="start"] #rotate-cancel:not([hidden]):hover{
 color:#342c2d!important;background:transparent!important;
}

/* Show each kit's existing short combat style beside its fighter name. */
#selection .fighter-identity .identity-line .fighter-name-group{
 align-items:baseline!important; gap:clamp(7px,1vw,13px)!important;
 flex:0 1 auto!important; white-space:nowrap!important;
}
#selection .fighter-identity .fighter-name-group #styleName{
 display:inline-block!important; flex:0 1 auto!important;
 width:auto!important; min-width:0!important; max-width:none!important;
 margin:0!important; padding:0!important;
 color:#746958!important;
 font:500 clamp(10px,1.1vw,14px)/1.3 'Galmuri11',monospace!important;
 white-space:nowrap!important; word-break:keep-all!important;
 text-shadow:none!important;
}
@media (orientation:portrait) and (max-width:700px){
 #selection .fighter-identity .identity-line .fighter-name-group{gap:7px!important}
 #selection .fighter-identity .fighter-name-group #styleName{
  font-size:clamp(10px,2.7vw,12px)!important;
 }
}

/* Online 2P: show the remote selection as a quiet label, not another local flash. */
#selection .fighter-card-wrap.online-peer-selected > .fighter-label::after{
 content:"상대";
 display:inline-block;
 margin-left:4px;
 padding:1px 3px;
 border:1px solid #97836a;
 color:#5d483b;
 background:#e9dabf;
 font:700 8px/1.2 "Galmuri11",monospace;
 vertical-align:1px;
}
/* Mobile 2P and CPU: six direct-strength buttons, identical action mapping on both. */
@media (pointer:coarse){
 #play .touch-attacks{
  display:grid!important;
  grid-template-columns:repeat(3,clamp(43px,11dvh,54px))!important;
  grid-template-rows:repeat(2,clamp(43px,11dvh,50px)) minmax(35px,39px)!important;
  gap:clamp(4px,1.2dvh,7px)!important;
  flex:0 0 auto!important;
  touch-action:none;
 }
 #play .touch-attacks .pad-attack{
  grid-column:auto!important;
  grid-row:auto!important;
  border-radius:5px!important;
  padding:3px 2px!important;
  display:flex!important;
  flex-direction:column!important;
  align-items:center!important;
  justify-content:center!important;
  gap:1px!important;
  background:rgba(34,28,48,.40)!important;
  border:1px solid rgba(255,255,255,.68)!important;
  box-shadow:inset 0 2px rgba(255,255,255,.12),0 2px rgba(10,8,22,.15)!important;
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
 }
 #play .touch-attacks .pad-attack .attack-power{
  font:800 clamp(13px,3.6dvh,18px)/1 "Galmuri11",monospace!important;
  letter-spacing:0;
  color:#fff8e7;
 }
 #play .touch-attacks .pad-attack .attack-kind{
  font:600 clamp(8px,2.1dvh,10px)/1.1 "Galmuri11",monospace!important;
  color:#ebe6ea;
 }
 #play .touch-attacks .pad-attack--weak{border-color:rgba(255,255,255,.48)!important;}
 #play .touch-attacks .pad-attack--medium{border-color:rgba(255,234,191,.77)!important;}
 #play .touch-attacks .pad-attack--strong{border-color:rgba(255,194,134,.93)!important;}
 #play .touch-attacks .pad-attack--strong .attack-power{color:#ffcb9d!important;}
 #play .touch-attacks .pad-kick .attack-kind{color:#d9ddff!important;}
 #play .touch-attacks .pad-special,
 #play .touch-attacks .pad-super{
  grid-row:3!important;
  border-radius:5px!important;
  padding:2px!important;
  background:rgba(34,28,48,.45)!important;
  border:1px solid rgba(255,255,255,.70)!important;
  display:flex!important;
  flex-direction:row!important;
 }
 #play .touch-attacks .pad-special{grid-column:1 / 2!important;}
 #play .touch-attacks .pad-super{grid-column:2 / 4!important;}
 #play .touch-attacks .pad-special span,
 #play .touch-attacks .pad-super span{
  font:700 clamp(8px,2.3dvh,11px)/1.1 "Galmuri11",monospace!important;
  white-space:nowrap;
 }
 #play .touch-attacks button:active{
  background:rgba(245,230,198,.35)!important;
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.30)!important;
 }
}
