/* LUMI RUSH — page + DOM screens. `--u` (set by game.js resize()) = 1 logical canvas pixel in CSS px, so `1em` inside #screens = 16 logical px. */
:root { --u: 1px; --st: 0px; --sr: 0px; --bg: #070a1f; --ink: #eaf4ff; --dim: #a9c2ea; --accent: #46e6ff; --accent2: #ff6bd6; --gold: #ffd36b;
  --panel: rgba(9, 13, 42, .92); --line: rgba(120, 190, 255, .38); color-scheme: dark; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: none;
  font-family: "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", "Segoe UI", system-ui, sans-serif; }
body { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#stage { position: relative; background: #000; overflow: hidden; container-type: size; box-shadow: 0 0 60px rgba(70, 230, 255, .12); }
#c { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#screens { position: absolute; inset: 0; font-size: calc(var(--u) * 16); pointer-events: none; }
.scr { position: absolute; inset: 0; display: none; pointer-events: none; }
.scr.on { display: block; }
.scr.on > * { pointer-events: auto; }
button { touch-action: manipulation; }
/* focus rings only while the keyboard is in use (input.js sets body[data-kbd]); mouse/touch users never see a stuck ring */
body[data-kbd="1"] :focus-visible { outline: .2em solid var(--gold); outline-offset: .2em; }
:focus-visible { outline: none; }
body[data-kbd="1"] .panel :focus-visible, body[data-kbd="1"] .menu :focus-visible { outline-offset: .15em; }

.center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2em; background: radial-gradient(circle at 50% 40%, #16215a, #070a1f 70%); }
.logo { font-weight: 900; font-size: 6em; line-height: .95; text-align: center; letter-spacing: .02em; color: #fff; text-shadow: 0 0 .4em var(--accent), .06em .06em 0 #ff6bd6; }
.bar { width: 22em; height: .9em; border-radius: 1em; background: #10163a; border: 2px solid var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .15s; }
.dim { color: var(--dim); }
.center .dim { font-size: max(1em, 11px); margin: 0; }
.center .dim b { color: var(--gold); font-variant-numeric: tabular-nums; }
.center .slow { font-size: max(.85em, 11px); opacity: 0; animation: showslow .01s 6s forwards; }     /* only appears if loading is still going after 6 s */
@keyframes showslow { to { opacity: 1; } }

/* buttons */
.btn { font: inherit; font-weight: 800; font-size: max(1.35em, 13px); color: var(--ink); background: linear-gradient(180deg, rgba(36, 52, 130, .94), rgba(18, 26, 78, .94)); border: .12em solid var(--line); border-radius: .7em;
  padding: .55em 1.1em; min-height: 40px; cursor: pointer; text-align: left; box-shadow: 0 .25em 0 rgba(0, 0, 0, .35); transition: transform .08s, filter .12s, border-color .12s; }
.btn:hover { transform: translateY(-.08em) scale(1.02); border-color: var(--accent); filter: brightness(1.15); }
body[data-kbd="1"] .btn:focus-visible { transform: translateY(-.08em) scale(1.02); border-color: var(--accent); filter: brightness(1.15); }
.btn:active { transform: translateY(.06em); box-shadow: none; }
.btn[disabled] { opacity: .55; pointer-events: none; filter: saturate(.5); }
.btn.primary { background: linear-gradient(180deg, #2fd8ff, #1e86ff); border-color: #bff3ff; color: #04112e; text-shadow: 0 1px 0 rgba(255, 255, 255, .4); }
.btn.big { font-size: max(1.8em, 15px); padding: .6em 1.2em; }
.btn.ghost { background: rgba(9, 13, 42, .72); font-size: max(1.05em, 13px); }
.btn.armed { background: linear-gradient(180deg, #b8741c, #6a3a08); border-color: var(--gold); color: #fff; }

/* ---------- title ---------- */
#scr-title .menu { position: absolute; left: 4.4em; bottom: 2.3em; display: flex; flex-direction: column; gap: .55em; width: max(18em, 250px); }
#scr-title .meta { display: flex; gap: .4em; margin-bottom: .15em; }
.chip { display: inline-flex; align-items: center; gap: .3em; padding: .26em .6em; border-radius: 2em; background: rgba(8, 12, 40, .78); border: .1em solid var(--line); font-weight: 800; font-size: max(.88em, 11px); color: var(--dim); white-space: nowrap; }
.chip b { color: var(--gold); font-size: 1.15em; letter-spacing: .02em; }
.chip i { font-style: normal; }
.chip .mini { display: inline-block; width: 2em; height: .45em; border-radius: .3em; background: rgba(255, 255, 255, .16); overflow: hidden; }
.chip .mini em { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.row2 { display: flex; gap: .5em; }
.row2 > .btn { flex: 1 1 0; min-width: 0; padding-left: .6em; padding-right: .6em; font-size: max(1.12em, 13px); text-align: center; white-space: nowrap; }
.row2.small > .btn { font-size: max(.98em, 12px); }
#scr-title .credit { position: absolute; left: 0; right: 0; bottom: .55em; text-align: center; font-size: max(.78em, 10px); color: rgba(200, 222, 255, .72); text-shadow: 0 1px 2px #000; padding: 0 1em; }
.hint-touch { display: none; } body[data-touch="1"] .hint-touch { display: inline; } body[data-touch="1"] .hint-kb { display: none; }

/* ---------- panels ---------- */
.panel { position: absolute; font-size: max(1em, 12px); background: var(--panel); border: .14em solid var(--line); border-radius: 1.1em; --pp: 1.6em; padding: var(--pp) 2em; box-shadow: 0 1em 3em rgba(0, 0, 0, .55); backdrop-filter: blur(4px); touch-action: pan-y; }
.panel h2 { margin: 0 0 .6em; font-size: 2.3em; font-weight: 900; letter-spacing: .02em; }
.panel h3 { margin: 1em 0 .35em; color: var(--accent); font-size: 1.15em; }
.panel.wide { left: 5%; right: 5%; top: 5%; bottom: 5%; overflow: auto; }
.panel.full { left: 3.5%; right: 3.5%; top: 4%; bottom: 4%; overflow: auto; }
.panel.narrow { left: 50%; top: 50%; transform: translate(-50%, -50%); width: 25em; max-width: 96%; max-height: 96%; overflow: auto; display: flex; flex-direction: column; gap: .8em; text-align: center; }
.panel.narrow .btn { text-align: center; }
.panel.narrow h2 { margin-bottom: .2em; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4em; }
.keys td { padding: .22em .7em .22em 0; vertical-align: top; } .keys td:first-child { white-space: nowrap; }
body[data-touch="1"] .keys .tc { display: table-header-group; }      /* touch players see their own controls first */
body[data-touch="1"] .keys .tc td { padding-bottom: .5em; }
.morecue { display: none; position: absolute; pointer-events: none; text-align: center; font-weight: 800; font-size: max(.85em, 11px); color: var(--gold); padding-top: 2.4em; height: 4.4em;
  border-radius: 0 0 1em 1em; background: linear-gradient(rgba(9, 13, 42, 0), rgba(9, 13, 42, .96) 75%); }
#scr-how .morecue { left: 5%; right: 5%; bottom: 5%; } #scr-col .morecue { left: 3.5%; right: 3.5%; bottom: 4%; }
.scr.on[data-more="1"] .morecue { display: block; }
.scr.on > .morecue { pointer-events: none; }
.panel.wide .head, .panel.full .head { position: sticky; top: calc(var(--pp) * -1); z-index: 3; margin-top: calc(var(--pp) * -1); padding: var(--pp) 0 .4em; background: rgba(9, 13, 42, .97); }
.panel.wide .head { margin-bottom: .2em; } .panel.wide h3:first-of-type { margin-top: .5em; }
kbd { background: #1c2a6c; border: 1px solid #5aa0ff; border-bottom-width: 3px; border-radius: .35em; padding: .05em .45em; font: 800 .9em/1.4 inherit; }
ul { margin: .2em 0; padding-left: 1.2em; } li { margin: .3em 0; line-height: 1.45; }
p { line-height: 1.55; margin: .4em 0; }
.ico { height: 1.5em; vertical-align: middle; image-rendering: auto; }
.row { margin-top: 1.4em; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 1em; } .head h2 { margin: 0; } .head small { color: var(--gold); font-size: .55em; margin-left: .6em; }
.grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: .9em; margin-top: 1em; }
.card { font: inherit; color: var(--ink); background: linear-gradient(180deg, rgba(30, 44, 112, .85), rgba(14, 20, 62, .9)); border: .12em solid var(--line); border-radius: .9em; padding: .5em .4em .7em; cursor: pointer; text-align: center; transition: transform .1s, border-color .1s; }
.card:hover, body[data-kbd="1"] .card:focus-visible { transform: translateY(-.15em) scale(1.03); border-color: var(--gold); }
.card canvas { width: 100%; aspect-ratio: 200 / 230; display: block; }
.card .nm { font-weight: 900; font-size: 1.15em; } .card .sk { font-size: max(.8em, 11px); color: var(--dim); min-height: 2.4em; line-height: 1.25; }
.card .ar { margin-top: .3em; display: inline-block; padding: .1em .6em; border-radius: 1em; font-size: max(.78em, 11px); font-weight: 800; background: rgba(0, 0, 0, .35); border: .1em solid var(--c, #fff); }
.card .ar i { font-style: normal; opacity: .7; }
.card.locked { cursor: default; filter: saturate(.3); } .card.locked:hover { transform: none; border-color: var(--line); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: .5em .9em; }
.stats div { background: rgba(0, 0, 0, .3); border-radius: .6em; padding: .4em .6em; display: flex; justify-content: space-between; gap: .6em; }
.stats span { color: var(--dim); font-size: .8em; align-self: center; } .stats b { font-size: 1.3em; color: #fff; white-space: nowrap; }
#over-title { color: #fff; text-shadow: 0 0 .5em #ff4d7a; } #over-title.best { color: var(--gold); text-shadow: 0 0 .6em var(--gold); animation: pop .6s ease-out; }
.over-body, .over-info, .over-btns { display: flex; flex-direction: column; gap: .8em; }
@keyframes pop { from { transform: scale(.6); } 60% { transform: scale(1.15); } to { transform: scale(1); } }

/* settings */
.settings { width: 30em; }
.tgl-list { display: flex; flex-direction: column; gap: .5em; }
.tog { font: inherit; color: var(--ink); display: flex; align-items: center; justify-content: space-between; gap: 1em; text-align: left; width: 100%; padding: .5em .9em; min-height: 40px; cursor: pointer;
  background: linear-gradient(180deg, rgba(30, 44, 112, .85), rgba(14, 20, 62, .9)); border: .12em solid var(--line); border-radius: .8em; }
.tog:hover, body[data-kbd="1"] .tog:focus-visible { border-color: var(--accent); filter: brightness(1.12); }
.tog .lb { font-weight: 800; font-size: 1.15em; display: flex; flex-direction: column; } .tog .lb small { font-weight: 600; font-size: max(.72em, 11px); color: var(--dim); margin-top: .1em; }
.tog .pill { flex: none; min-width: 4.6em; text-align: center; font-weight: 900; font-size: 1em; padding: .25em .8em; border-radius: 2em; background: #2a2f5a; color: #9aa4d8; border: .1em solid rgba(255, 255, 255, .18); }
.tog .pill::after { content: '꺼짐'; }
.tog[aria-checked="true"] .pill { background: linear-gradient(180deg, #2fd8ff, #1e86ff); color: #04112e; border-color: #bff3ff; }
.tog[aria-checked="true"] .pill::after { content: '켜짐'; }
.note { font-size: max(.85em, 11px); min-height: 1.2em; text-align: left; margin: .1em 0 0; }

#scr-settings.on { background: rgba(4, 6, 28, .55); }

/* short stages (phone landscape, 800x450...) : tighter, two-column game-over */
@container (max-height: 480px) {
  .panel { --pp: .9em; padding: var(--pp) 1.4em; border-radius: .9em; }
  .panel h2 { font-size: 1.9em; margin-bottom: .3em; }
  .panel h3 { margin: .6em 0 .25em; }
  .panel.narrow { gap: .45em; }
  .panel.narrow .btn { padding: .3em .9em; }
  .panel.narrow .btn.big { padding: .4em 1em; }
  li { margin: .15em 0; line-height: 1.35; } p { line-height: 1.4; }
  .tog { padding: .3em .8em; } .tgl-list { gap: .35em; }
  .stats { gap: .35em .6em; } .stats div { padding: .25em .5em; }
  #scr-over .panel.narrow { width: 38em; }
  .over-body { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1em; align-items: center; }
  .over-info, .over-btns { gap: .45em; }
  .over-info p { text-align: left; margin: 0; }
  .settings { width: 34em; }
}
@container (max-width: 960px) { .grid { grid-template-columns: repeat(4, 1fr); } .cols { gap: 1.4em; } }
@container (max-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } .cols { grid-template-columns: 1fr; } }

/* ---------- touch controls (fixed over the whole viewport so thumbs can sit in the letterbox bars) ---------- */
#touch { position: fixed; inset: 0; display: none; pointer-events: none; z-index: 5; font-size: calc(var(--u) * 16);
  --tb: clamp(56px, 17vh, 92px); --gap: 12px; --pad: 14px;
  --sl: calc(env(safe-area-inset-left, 0px) + var(--pad)); --sr2: calc(env(safe-area-inset-right, 0px) + var(--pad)); --sb: calc(env(safe-area-inset-bottom, 0px) + var(--pad)); }
body[data-touch="1"][data-scene="play"] #touch { display: block; }
#touch button { pointer-events: auto; position: absolute; font: 900 1.4em/1 inherit; font-size: clamp(16px, 4.6vh, 26px); color: #fff; background: rgba(20, 34, 100, .5); border: 3px solid rgba(150, 210, 255, .55);
  border-radius: 22%; width: var(--tb); height: var(--tb); padding: 0; touch-action: none; user-select: none; -webkit-user-select: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  backdrop-filter: blur(2px); transition: background .06s, transform .06s; }
#touch button small { font-size: .42em; letter-spacing: .06em; opacity: .85; font-weight: 800; } #touch button i { font-style: normal; }
#touch button.down { background: rgba(70, 230, 255, .6); border-color: #d6f8ff; transform: scale(.94); }
/* the left pad sits above the canvas HUD's GUEST CALL gauge (bottom 104 logical px of the stage) */
#touch .pad.left button { bottom: calc(var(--st) + var(--u) * 104 + 8px); }
#touch .pad.left button:nth-child(1) { left: var(--sl); }
#touch .pad.left button:nth-child(2) { left: calc(var(--sl) + var(--tb) + var(--gap)); }
#touch .pad.right button[data-act=jump] { right: var(--sr2); bottom: var(--sb); width: calc(var(--tb) * 1.3); height: calc(var(--tb) * 1.3); border-radius: 50%; background: rgba(40, 120, 255, .55); font-size: clamp(14px, 4vh, 22px); }
#touch .pad.right button[data-act=jump].down { background: rgba(100, 200, 255, .75); }
#touch .pad.right button[data-act=slide] { right: calc(var(--sr2) + var(--tb) * 1.3 + var(--gap)); bottom: var(--sb); }
#touch .ult { right: var(--sr2); bottom: calc(var(--sb) + var(--tb) * 1.3 + var(--gap)); width: calc(var(--tb) * 1.3); height: calc(var(--tb) * .72); border-radius: 1.2em; font-size: clamp(12px, 3.3vh, 18px);
  --g: 0%; background: linear-gradient(90deg, rgba(255, 190, 40, .7) var(--g), rgba(20, 34, 100, .5) var(--g)); }
body[data-ult="1"] #touch .ult { background: rgba(255, 190, 40, .92); color: #2a1800; border-color: #fff3c4; animation: glow .6s infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 1.2em #ffd36b; } }
#touch .pausebtn { right: calc(env(safe-area-inset-right, 0px) + var(--sr) + 1em); top: calc(var(--st) + 6.4em); width: max(3em, 46px); height: max(3em, 46px); font-size: clamp(14px, 3.6vh, 20px); border-radius: 30%; }
/* where the game must not be covered at all: keep the left pad off the x range Lumi runs in */

/* ---------- portrait: rotate your phone ---------- */
#rotate { position: fixed; inset: 0; z-index: 99; display: none; flex-direction: column; align-items: center; justify-content: center; gap: .6em; text-align: center; padding: 2em; background: radial-gradient(circle at 50% 35%, #1a2766, #070a1f 72%); }
body[data-portrait="1"] #rotate { display: flex; }
#rotate h2 { margin: .3em 0 0; font-size: 1.6em; font-weight: 900; text-shadow: 0 0 .6em var(--accent); }
#rotate p { margin: 0; color: var(--dim); font-size: 1em; }
#rotate .phone { width: 54px; height: 92px; border: 4px solid var(--accent); border-radius: 12px; position: relative; animation: tilt 2.4s ease-in-out infinite; box-shadow: 0 0 18px rgba(70, 230, 255, .45); }
#rotate .phone i { position: absolute; left: 50%; bottom: 6px; width: 16px; height: 4px; margin-left: -8px; border-radius: 3px; background: var(--accent); }
@keyframes tilt { 0%, 20% { transform: rotate(0); } 55%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  #rotate .phone { animation: none; transform: rotate(-90deg); }
}
body[data-calm="1"] * { animation-duration: .001s !important; animation-iteration-count: 1 !important; }
[hidden]{display:none!important}
