/* 조스 오브 파이터즈 — 화면 */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden; background: #0b0d14; color: #eef1f8;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', sans-serif;
  -webkit-text-size-adjust: 100%; user-select: none;
}
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#hudBtns { position: fixed; right: 12px; bottom: 12px; z-index: 6; display: none; gap: 8px; }
body.fighting #hudBtns { display: flex; }
.iconbtn {
  width: 42px; height: 42px; border-radius: 11px; font-size: 17px; cursor: pointer;
  background: rgba(12,16,28,.8); border: 1px solid rgba(255,255,255,.18); color: #eef1f8;
}
.iconbtn:hover { background: rgba(40,50,80,.92); }

/* 화면 공통 */
.screen {
  position: fixed; inset: 0; z-index: 10; display: none;
  flex-direction: column; align-items: center; justify-content: flex-start;
  background: radial-gradient(130% 100% at 50% 0%, #1c2236 0%, #0b0d14 70%);
  padding: 20px 16px; overflow-y: auto; text-align: center;
}
/* ⚠️가운데 정렬만 하면 내용이 길 때 제목이 잘리고 스크롤도 안 된다 */
.screen::before, .screen::after { content: ''; display: block; flex: 1 0 6px; }
h1.logo {
  font-size: clamp(1.9rem, 6vw, 3.6rem); margin: 0; font-weight: 900; letter-spacing: -.03em;
  background: linear-gradient(180deg, #ffe9a8, #e8a13a 60%, #b76a1e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 4px 18px rgba(232,161,58,.25);
}
h1.logo span { display: block; font-size: 12px; letter-spacing: .42em; color: #8ea0c8;
  font-weight: 700; margin-top: 8px; -webkit-text-fill-color: #8ea0c8; }
.lead { color: #9fb0d4; font-size: 13.5px; margin: 12px 0 16px; max-width: 640px; line-height: 1.7; }
.lead b { color: #ffd88a; }

.btnrow { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin: 6px 0; }
.bigbtn, .graybtn {
  border: 0; border-radius: 12px; padding: 13px 26px; font-size: 16px; font-weight: 800; cursor: pointer;
}
.bigbtn { background: linear-gradient(180deg, #ffd06a, #d9922f); color: #1b1206; }
.graybtn { background: rgba(255,255,255,.08); color: #dce4f5; border: 1px solid rgba(255,255,255,.16); }
.graybtn:hover { background: rgba(255,255,255,.16); }

/* 캐릭터 선택 */
#selTitle { font-size: 18px; font-weight: 800; margin-bottom: 12px; color: #ffd88a; }
.grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: min(760px, 96vw); }
.charbtn {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px 8px; border-radius: 12px; cursor: pointer;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); color: #eef1f8;
}
.charbtn:hover { background: rgba(255,208,106,.18); border-color: rgba(255,208,106,.6); transform: translateY(-2px); }
.charbtn canvas { width: 100%; height: auto; display: block; }
.cname { font-weight: 800; font-size: 14px; line-height: 1.15; }
.cname i { display: block; font-style: normal; font-size: 10.5px; color: #93a4c8; font-weight: 600; }
.charbtn.done::after {
  content: '★'; position: absolute; top: 4px; right: 6px; color: #ffd06a; font-size: 13px;
}

/* 캐릭터 설명 */
/* 캐릭터 설명 — 그린 초상을 왼쪽에 세운다(글만 있으면 누구를 고르는지 감이 안 온다) */
#pf { width: min(760px, 96vw); text-align: left; margin-top: 12px; position: relative;
  background: rgba(12,16,28,.7); border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  padding: 12px 14px 12px 150px; min-height: 210px; }
#pfArt { position: absolute; left: 10px; top: 10px; width: 128px; height: 190px;
  object-fit: cover; object-position: top center; border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.04);
  box-shadow: 0 6px 18px rgba(0,0,0,.35); }
@media (max-width: 620px) {
  #pf { padding-left: 108px; min-height: 168px; }
  #pfArt { width: 92px; height: 148px; }
}
#pfName { font-size: 18px; font-weight: 900; }
#pfName span { font-size: 12px; color: #93a4c8; margin-left: 6px; font-weight: 700; }
#pfTag { color: #ffd88a; font-size: 12.5px; margin: 3px 0 6px; }
#pfDesc { color: #b7c4de; font-size: 13px; line-height: 1.6; }
#pfStat { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 9px 0; }
.st span { font-size: 10.5px; color: #8ea0c8; }
.st em { display: block; height: 6px; background: rgba(255,255,255,.10); border-radius: 4px; overflow: hidden; }
.st em i { display: block; height: 100%; background: linear-gradient(90deg, #ffd06a, #e0653c); }
#pfMoves { display: grid; gap: 5px; }
.mv { display: grid; grid-template-columns: 130px 116px 1fr; gap: 8px; align-items: center;
  font-size: 12.5px; padding: 5px 8px; background: rgba(255,255,255,.04); border-radius: 8px; }
.mv b { color: #ffd88a; }
.mv code { color: #9fd8ff; font-size: 12px; }
.mv i { font-style: normal; color: #93a4c8; }
.mv.super { background: rgba(255,208,106,.13); }
@media (max-width: 620px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .mv { grid-template-columns: 1fr; gap: 2px; }
  #pfStat { grid-template-columns: repeat(2, 1fr); }
}

/* 무대 선택 */
.stagegrid { display: none; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; width: min(780px, 96vw); }
.stagebtn { padding: 6px; border-radius: 12px; cursor: pointer; color: #eef1f8;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); }
.stagebtn:hover { border-color: rgba(255,208,106,.6); }
.stagebtn canvas { width: 100%; height: auto; border-radius: 8px; display: block; }
.stagebtn span { display: block; font-weight: 800; font-size: 14px; margin-top: 6px; }
.stagebtn i { display: block; font-style: normal; font-size: 11px; color: #93a4c8; }

/* 기술표 · 조작법 */
#howBody { width: min(860px, 96vw); text-align: left; max-height: 74vh; overflow-y: auto;
  background: rgba(12,16,28,.75); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 14px 16px; }
#howBody h3, #mlBody h3, #pMoves h3 { margin: 14px 0 6px; color: #ffd88a; font-size: 16px; }
#howBody h4, #mlBody h4, #pMoves h4 { margin: 12px 0 4px; color: #9fd8ff; font-size: 13px; }
#howBody table, #pMoves table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#howBody th, #pMoves th { text-align: left; color: #8ea0c8; font-weight: 700; padding: 4px 6px;
  border-bottom: 1px solid rgba(255,255,255,.12); }
#howBody td, #pMoves td { padding: 4px 6px; border-bottom: 1px solid rgba(255,255,255,.05); color: #cfd8ee; }
#howBody code, #pMoves code { color: #9fd8ff; }
#howBody td i, #mlBody td i, #pMoves td i { font-style: normal; color: #7d8db1; font-size: 11px; margin-left: 4px; }
.hint { color: #9fb0d4; font-size: 12.5px; line-height: 1.7; margin: 4px 0 10px; }
.hint b { color: #ffd88a; }
ul.tips { margin: 4px 0 6px; padding-left: 18px; color: #b7c4de; font-size: 12.5px; line-height: 1.85; }
ul.tips b { color: #ffd88a; }
ul.tips code { color: #9fd8ff; }
.ctlbox h3 { margin-top: 0 !important; }

#mlBody { width: min(860px, 96vw); text-align: left; max-height: 74vh; overflow-y: auto;
  background: rgba(12,16,28,.75); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 14px 16px; }
#mlBody h3 { margin: 14px 0 6px; color: #ffd88a; font-size: 16px; }
#mlBody h4 { margin: 10px 0 4px; color: #9fd8ff; font-size: 13px; }
#mlBody table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#mlBody th { text-align: left; color: #8ea0c8; font-weight: 700; padding: 3px 6px; border-bottom: 1px solid rgba(255,255,255,.12); }
#mlBody td { padding: 3px 6px; border-bottom: 1px solid rgba(255,255,255,.05); color: #cfd8ee; }
#mlBody td.nt { color: #93a4c8; }
#mlBody tr.sup td { color: #ffd88a; }
#mlBody code { color: #9fd8ff; }
#mlBody hr { border: 0; border-top: 1px solid rgba(255,255,255,.1); margin: 16px 0; }

/* 결과 — 이긴 사람을 크게 보여 준다(승리 화면이 글자만 있으면 게임이 끝난 것 같지 않다) */
#rArt { width: min(520px, 92vw); height: auto; margin-bottom: 6px; }
#rTitle { font-size: clamp(1.8rem, 6vw, 3rem); font-weight: 900; color: #ffd06a; margin: 0 0 6px; }
#rSub { color: #b7c4de; font-size: 14px; margin-bottom: 16px; }

/* 손가락 조작 */
#pad { position: fixed; inset: auto 0 0 0; z-index: 7; display: none; pointer-events: none; height: 190px; }
body.pad.fighting #pad { display: block; }
.tbtn {
  position: absolute; display: flex; align-items: center; justify-content: center;
  background: rgba(20,26,42,.5); border: 2px solid rgba(255,255,255,.22); color: #fff;
  border-radius: 14px; font-size: 20px; font-weight: 800; pointer-events: auto; touch-action: none;
}
.tbtn.on { background: rgba(255,208,106,.4); }
#tL { left: 12px; bottom: 18px; width: 62px; height: 62px; }
#tR { left: 86px; bottom: 18px; width: 62px; height: 62px; }
#tU { left: 49px; bottom: 92px; width: 62px; height: 62px; }
#tD { left: 49px; bottom: -46px; width: 62px; height: 62px; }
#tLP { right: 96px; bottom: 92px; width: 62px; height: 62px; }
#tHP { right: 22px; bottom: 92px; width: 62px; height: 62px; }
#tLK { right: 96px; bottom: 18px; width: 62px; height: 62px; }
#tHK { right: 22px; bottom: 18px; width: 62px; height: 62px; }
#tD { bottom: 18px; left: 160px; }
.credit { color: #5d6c8e; font-size: 11px; margin-top: 14px; line-height: 1.7; }
.keys { color: #8ea0c8; font-size: 12px; line-height: 1.9; margin-top: 10px; }
.keys b { color: #ffd88a; }

/* ---------- 인물 소개 ----------
   왼쪽 목록에서 고르면 오른쪽에 그림과 서사가 뜬다. 좁은 화면에서는 위아래로 쌓인다. */
h2.ttl { margin: 0 0 12px; font-size: 22px; font-weight: 900; color: #ffd88a; }
h2.ttl span { display: block; font-size: 12px; color: #8ea0c8; font-weight: 700; margin-top: 4px; }
#introWrap { display: grid; grid-template-columns: 190px 1fr; gap: 12px;
  width: min(900px, 96vw); max-height: 70vh; }
#introList { overflow-y: auto; display: grid; gap: 6px; align-content: start;
  padding-right: 4px; }
.introItem { display: flex; align-items: center; gap: 8px; padding: 5px 8px; cursor: pointer;
  border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.10);
  color: #eef1f8; text-align: left; }
.introItem:hover { background: rgba(255,208,106,.16); border-color: rgba(255,208,106,.5); }
.introItem.on { background: rgba(255,208,106,.22); border-color: rgba(255,208,106,.75); }
.introItem img { width: 34px; height: 44px; object-fit: cover; object-position: top center;
  border-radius: 6px; background: rgba(255,255,255,.06); }
.introItem b { font-size: 14px; display: block; }
.introItem i { font-style: normal; font-size: 10.5px; color: #93a4c8; }
#introBody { overflow-y: auto; text-align: left; background: rgba(12,16,28,.72);
  border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 14px 16px; }
#introBody .top { display: grid; grid-template-columns: 168px 1fr; gap: 14px; }
#introBody .top img { width: 168px; height: 240px; object-fit: cover; object-position: top center;
  border-radius: 12px; border: 1px solid rgba(255,255,255,.18); box-shadow: 0 8px 22px rgba(0,0,0,.4); }
#introBody h3 { margin: 0 0 2px; font-size: 22px; color: #fff; font-weight: 900; }
#introBody .job { color: #ffd88a; font-size: 13px; font-weight: 700; }
#introBody .cry { color: #9fd8ff; font-size: 13px; margin: 8px 0; }
#introBody .story { color: #c6d2e8; font-size: 13.5px; line-height: 1.85; margin: 10px 0 0; }
#introBody .story b { color: #ffd88a; }
#introBody .bond { margin-top: 10px; font-size: 12px; color: #8ea0c8;
  border-top: 1px solid rgba(255,255,255,.10); padding-top: 8px; }
#introBody .skills { margin-top: 10px; display: grid; gap: 4px; }
#introBody .skills div { font-size: 12.5px; color: #b7c4de; }
#introBody .skills code { color: #9fd8ff; }
@media (max-width: 700px) {
  #introWrap { grid-template-columns: 1fr; max-height: 74vh; }
  #introList { grid-auto-flow: column; grid-auto-columns: 132px; overflow-x: auto; overflow-y: hidden; }
  #introBody .top { grid-template-columns: 116px 1fr; }
  #introBody .top img { width: 116px; height: 166px; }
}
