* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #07050c; color: #f3ecff; font-family: "Trebuchet MS", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; overflow: hidden; }
#stage { position: relative; width: min(100vw, calc(100vh * 16 / 9)); aspect-ratio: 16 / 9; margin: 0 auto; top: 50%; transform: translateY(-50%); container-type: inline-size; background: #000; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: auto; }
button, select, input { font-family: inherit; }
.screen { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 1.2cqw; padding: 3cqw; }
.screen.on { display: flex; }
#scr-menu { background: linear-gradient(90deg, rgba(7,5,12,.92) 0, rgba(7,5,12,.55) 45%, rgba(7,5,12,0) 70%); align-items: flex-start; padding-left: 7cqw; }
.logo { font-family: "Arial Black", Impact, system-ui, sans-serif; line-height: .9; letter-spacing: .02em; text-shadow: 0 .4cqw 0 #000; }
.logo span { display: block; font-size: 4cqw; color: #e8c26a; letter-spacing: .35em; }
.logo b { display: block; font-size: 9cqw; color: #fff; }
.logo.small span { font-size: 22px; } .logo.small b { font-size: 54px; }
.tag { margin: 0 0 1.5cqw; font-size: 1.6cqw; color: #c9bfe0; }
.menu { display: flex; flex-direction: column; gap: .9cqw; min-width: 24cqw; }
.screen button { font-size: 1.7cqw; font-weight: 800; padding: .9cqw 1.6cqw; border-radius: .8cqw; border: .2cqw solid #e8c26a; background: linear-gradient(180deg, #2a1f40, #1a1329); color: #fff; cursor: pointer; text-align: left; letter-spacing: .02em; }
.screen button:hover:not(:disabled) { background: linear-gradient(180deg, #3a2b58, #241a38); box-shadow: 0 0 0 .3cqw rgba(232,194,106,.25); }
.screen button:focus-visible, select:focus-visible, input:focus-visible { outline: .3cqw solid #7fe3ff; outline-offset: .2cqw; }
.screen button.big, .screen button.big:hover:not(:disabled) { background: linear-gradient(180deg, #f2d27e, #d9a93f); color: #1a1208; }
.screen button.big:hover:not(:disabled) { filter: brightness(1.08); }
.screen button.ghost { background: rgba(10,8,16,.6); border-color: rgba(232,194,106,.5); }
.screen button:disabled { opacity: .45; cursor: not-allowed; }
.panel { background: rgba(7,5,12,.82); backdrop-filter: blur(2px); }
.panel > * { width: min(70cqw, 100%); }
.panel.small > * { width: auto; }
.panel h2 { margin: 0; font-family: "Arial Black", Impact, sans-serif; font-size: 3.6cqw; letter-spacing: .02em; }
.panel h2 small { font-family: inherit; font-size: 1.4cqw; color: #c9bfe0; font-weight: 600; margin-left: 1cqw; }
.kicker { font-size: 1.4cqw; letter-spacing: .3em; color: #7fe3ff; font-weight: 800; }
.opp { font-size: 1.8cqw; color: #e8c26a; font-weight: 700; }
.panel p { font-size: 1.5cqw; line-height: 1.45; margin: .3cqw 0; color: #ddd4f0; }
.goal { display: flex; gap: 1cqw; align-items: center; background: rgba(232,194,106,.12); border-left: .4cqw solid #e8c26a; padding: .8cqw 1.2cqw; font-size: 1.6cqw; }
.goal span { font-weight: 900; color: #e8c26a; letter-spacing: .15em; font-size: 1.2cqw; }
.tips { margin: 0; padding-left: 2cqw; font-size: 1.4cqw; line-height: 1.5; color: #d6cdea; }
.row { display: flex; gap: 1cqw; justify-content: flex-end; }
.row.wrap { flex-wrap: wrap; }
.mlist { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2cqw; }
.mcard { display: flex !important; flex-direction: column; gap: .5cqw; min-height: 15cqw; text-align: left; }
.mcard .mnum { font-size: 1.1cqw; letter-spacing: .25em; color: #7fe3ff; }
.mcard .mtitle { font-size: 2cqw; font-family: "Arial Black", Impact, sans-serif; }
.mcard .mopp { font-size: 1.3cqw; color: #e8c26a; font-weight: 600; }
.mcard .mstat { margin-top: auto; font-size: 1.2cqw; color: #c9bfe0; font-weight: 600; }
.mcard.cleared { border-color: #5dff9a !important; }
.mcard.boss { border-color: #ff7a6a !important; }
.mcard.locked { filter: grayscale(.7); }
label { display: flex; flex-direction: column; gap: .4cqw; font-size: 1.5cqw; font-weight: 700; }
label.chk { flex-direction: row; align-items: center; gap: 1cqw; font-weight: 600; }
label.chk input { width: 1.8cqw; height: 1.8cqw; }
select { font-size: 1.5cqw; padding: .6cqw; border-radius: .6cqw; background: #1a1329; color: #fff; border: .15cqw solid #e8c26a; }
.note { color: #b8aed0 !important; } .note.small { font-size: 1.2cqw !important; }
.keys { border-collapse: collapse; font-size: 1.45cqw; }
.keys td, .keys th { padding: .45cqw 1cqw; border-bottom: 1px solid rgba(255,255,255,.1); text-align: left; }
.keys th { color: #e8c26a; }
#resTitle { font-size: 5cqw; } #resTitle.win { color: #ffd35a; } #resTitle.loss { color: #ff7a6a; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8cqw; }
.stats div { background: rgba(255,255,255,.06); border-radius: .6cqw; padding: .8cqw 1cqw; display: flex; justify-content: space-between; font-size: 1.5cqw; }
.stats b { color: #ffd35a; }
/* touch controls */
#touchpad { position: absolute; inset: 0; pointer-events: none; }
body:not(.touch) #touchpad { display: none; }
#touchpad button { pointer-events: auto; touch-action: none; user-select: none; width: 9cqw; height: 9cqw; border-radius: 50%; border: .3cqw solid rgba(232,194,106,.8); background: rgba(20,14,32,.55); color: #fff; font-weight: 900; font-size: 2cqw; }
#touchpad button.on { background: rgba(232,194,106,.6); }
.tleft { position: absolute; left: 2cqw; bottom: 3cqw; display: flex; gap: 1cqw; align-items: flex-end; }
.tleft [data-touch=up] { margin-bottom: 6cqw; }
.tright { position: absolute; right: 2cqw; bottom: 3cqw; display: grid; grid-template-columns: repeat(2, 9cqw); gap: 1cqw; }
.tpause { position: absolute; top: 9.5cqw; left: 2cqw; width: 6cqw !important; height: 6cqw !important; }
/* login */
.loginbody { display: grid; place-items: center; background: radial-gradient(900px 600px at 50% 0, #2d1d45, #07050c); }
.loginform { width: min(420px, 92vw); background: rgba(15,10,24,.9); border: 2px solid #e8c26a; border-radius: 18px; padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.loginform label { font-size: 16px; margin-top: 14px; }
.loginform input { font-size: 18px; padding: 12px; border-radius: 10px; border: 2px solid rgba(232,194,106,.5); background: #0d0916; color: #fff; }
.loginform button { margin-top: 14px; font-size: 18px; font-weight: 800; padding: 12px; border-radius: 10px; border: 2px solid #e8c26a; background: linear-gradient(180deg, #f2d27e, #d9a93f); color: #1a1208; cursor: pointer; }
.err { color: #ff7a6a; min-height: 1.2em; font-weight: 700; }

/* character select */
.flist { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1cqw; width: min(86cqw, 100%) !important; }
.fcard { display: flex !important; flex-direction: column; align-items: center !important; gap: .3cqw; padding: .8cqw !important; text-align: center !important; }
.fcard canvas { width: 100%; aspect-ratio: 26 / 30; background: radial-gradient(circle at 50% 70%, rgba(232,194,106,.18), rgba(0,0,0,0) 60%); border-radius: .6cqw; }
.fcard .fname { font-family: "Arial Black", Impact, sans-serif; font-size: 1.8cqw; }
.fcard .ftitle { font-size: 1.1cqw; color: #e8c26a; font-weight: 700; }
.fcard .fstats { display: grid; grid-template-columns: 1fr 1fr; gap: .2cqw .8cqw; width: 100%; margin-top: .3cqw; }
.fcard .st { display: flex; align-items: center; gap: .4cqw; font-size: .95cqw; }
.fcard .st i { font-style: normal; width: 4.4cqw; text-align: left; color: #c9bfe0; text-transform: capitalize; }
.fcard .st b { flex: 1; height: .6cqw; border-radius: .3cqw; background: linear-gradient(90deg, #ffd35a calc(var(--v) * 20%), rgba(255,255,255,.12) 0); }
.fcard .fsig { font-size: 1cqw; color: #d6cdea; font-weight: 600; min-height: 3.6cqw; }
.fcard.picked { box-shadow: 0 0 0 .35cqw #7fe3ff; }
.fcard.locked .fname { color: #8a80a0; }
.mcard .mswap { font-size: 1.05cqw; color: #7fe3ff; font-weight: 700; }
.unlock { background: linear-gradient(90deg, rgba(230,160,255,.25), rgba(230,160,255,.05)); border-left: .4cqw solid #e6a0ff; padding: .8cqw 1.2cqw; font-size: 1.5cqw; font-weight: 700; }
.unlock b { color: #f0c8ff; }
