* { box-sizing: border-box; }
:root {
  --ui: "Fredoka", "Jua", sans-serif;
  --font: var(--ui);
  --logo: "Fredoka", var(--ui);
  --ink: #23262e;
  --red: #ff3c28; --red-d: #c41f0e;
  --blue: #0ab9e6; --blue-d: #0782a3;
  --yellow: #ffd23f; --yellow-d: #d9a400;
  --sky1: #5fd3ff; --sky2: #2a86f0;
  --card-sh: 0 4px 0 #0b4f9a40, 0 10px 18px #00306030;
}
html:lang(ko) { --ui: "Jua", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; }
html:lang(ja) { --ui: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", sans-serif; }
html:lang(zh-TW) { --ui: "Noto Sans TC", "PingFang TC", sans-serif; }
html:lang(ru) { --ui: "Nunito", "Fredoka", sans-serif; }
html:lang(en), html:lang(fr), html:lang(es), html:lang(es-MX), html:lang(it), html:lang(de) { --ui: "Fredoka", "Jua", sans-serif; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: #000; color: #fff;
  font-family: var(--font);
  user-select: none; -webkit-user-select: none;
}
/* 줄간격: 메뉴/모달/광고는 넉넉하게, HUD는 카드가 커지지 않게 약간만 */
.screen.nin, .modal, #ad { line-height: 2; }
#hud, #standings, #order { line-height: 1.8; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: none; touch-action: none; }
#trail { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ── 인게임 HUD: 닌텐도풍 (흰 둥근 카드, 알약, 굵은 외곽선 숫자) ── */
#hud { position: fixed; inset: 0; pointer-events: none; font-family: var(--ui); color: var(--ink); text-shadow: none; }
#top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; column-gap: 12px; padding: 14px 18px; }
#stage-info { justify-self: start; background: #fff; border-radius: 18px; padding: 8px 16px; box-shadow: var(--card-sh); max-width: 34vw; }
#stage-name { font-size: 20px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
/* 화면 중앙 최상단: 단계 + 남은 시간 */
#clock { background: #fff; border-radius: 22px; padding: 8px 24px 12px; box-shadow: var(--card-sh); text-align: center; min-width: 200px; }
#stage-label { font-family: var(--logo); font-weight: 700; font-size: 14px; line-height: 1.3; letter-spacing: 2px; color: var(--red); }
#time-left { font-family: var(--logo); font-weight: 700; font-size: 44px; line-height: 1.1; margin-top: 2px; color: var(--ink); font-variant-numeric: tabular-nums; }
#time-left.rounds { font-size: 28px; line-height: 1.3; margin-top: 6px; letter-spacing: 1px; }
#time-left.urgent { color: var(--red); animation: pop .5s infinite alternate; }
/* 남은 시간 바 */
#timer { width: 200px; height: 14px; background: #e3e9f2; border-radius: 999px; margin: 8px auto 0; overflow: hidden; }
#timer i { display: block; height: 100%; width: 100%; border-radius: 999px; background: linear-gradient(#5fe0ff, var(--blue)); box-shadow: inset 0 -3px 0 var(--blue-d); }
#score-box { justify-self: end; text-align: right; }
#score {
  font-family: var(--logo); font-weight: 700; font-size: 46px; line-height: 1.1; color: #fff;
  -webkit-text-stroke: 9px var(--blue-d); paint-order: stroke fill; text-shadow: 0 5px 0 #0a5f80;
  font-variant-numeric: tabular-nums;
}
#combo {
  display: inline-block; margin-top: 8px; font-family: var(--logo); font-weight: 700; font-size: 17px; color: var(--ink);
  background: var(--yellow); border-radius: 999px; padding: 3px 14px; box-shadow: 0 4px 0 var(--yellow-d);
}
#combo:empty { display: none; }
#combo.pop { animation: pop .22s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes pop { from { transform: scale(1.4); } to { transform: scale(1); } }

#prompt {
  position: absolute; left: 50%; top: 140px; transform: translateX(-50%) scale(.8);
  background: #fff; color: var(--ink); border-radius: 26px; padding: 14px 28px 16px; box-shadow: var(--card-sh);
  text-align: center; opacity: 0; transition: opacity .12s, transform .18s cubic-bezier(.3, 1.6, .5, 1);
}
#prompt.show { opacity: 1; transform: translateX(-50%) scale(1); }
#prompt .ptext { font-size: 30px; line-height: 1.35; white-space: nowrap; }
body.versus #prompt { top: 190px; }
#prompt .ptext b { font-weight: normal; -webkit-text-stroke: 5px #fff; paint-order: stroke fill; text-shadow: 0 2px 0 #00000030; }
#prompt .ptimer { height: 12px; background: #e3e9f2; border-radius: 999px; margin-top: 12px; overflow: hidden; }
#prompt .ptimer i { display: block; height: 100%; width: 100%; border-radius: 999px; background: #3fbf4a; box-shadow: inset 0 -3px 0 #2a8a33; }

#popups { position: absolute; inset: 0; overflow: hidden; }
.popup {
  line-height: 1.25; position: absolute; transform: translate(-50%, -50%); font-family: var(--logo); font-weight: 700; font-size: 24px; white-space: nowrap;
  color: var(--blue-d); -webkit-text-stroke: 7px #fff; paint-order: stroke fill; text-shadow: 0 3px 0 #00000040;
}
.popup.good { color: #0a9ccc; }
.popup.great { color: var(--yellow); -webkit-text-stroke: 8px var(--red-d); font-size: 30px; text-shadow: 0 4px 0 #00000050; }
.popup.bad { color: var(--red); font-size: 27px; }
.popup.opp { color: var(--c, #fff); -webkit-text-stroke: 6px var(--ink); font-size: 18px; opacity: .92; }
.popup.p0 { color: #0ab9e6; } .popup.p1 { color: #ff3c28; } .popup.p2 { color: #2fb83a; } .popup.p3 { color: #f0a800; }

/* + 조준선 */
#crosshair { position: absolute; left: 0; top: 0; width: 22px; height: 22px; margin: -11px 0 0 -11px; mix-blend-mode: difference; }
#crosshair::before, #crosshair::after { content: ""; position: absolute; background: #fff; border-radius: 3px; }
#crosshair::before { left: 9px; top: 0; width: 4px; height: 22px; }
#crosshair::after { left: 0; top: 9px; width: 22px; height: 4px; }
#crosshair.ch-mg { transform-origin: center; width: 34px; height: 34px; margin: -17px 0 0 -17px; }
#crosshair.ch-mg::before { left: 15px; height: 34px; }
#crosshair.ch-mg::after { top: 15px; width: 34px; }
#crosshair.ch-saber, #crosshair.ch-beam, #crosshair.ch-wand { mix-blend-mode: normal; }
#crosshair.ch-saber::before, #crosshair.ch-saber::after, #crosshair.ch-beam::before, #crosshair.ch-beam::after { background: var(--blue); box-shadow: 0 0 0 2px #fff, 0 0 8px #3fd0ff; }
#crosshair.ch-wand::before, #crosshair.ch-wand::after { background: #ff7ad9; box-shadow: 0 0 0 2px #fff, 0 0 8px #ff55ff; }

#charge { position: absolute; left: 0; top: 0; width: 76px; height: 14px; margin: 22px 0 0 -38px; background: #e3e9f2; border: 3px solid #fff; border-radius: 999px; box-shadow: 0 3px 0 #0b4f9a40; overflow: hidden; display: none; }
#charge i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 999px; }
#charge.full i { background: var(--yellow); }

#hint {
  position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%); font-size: 16px; line-height: 1.4; white-space: nowrap;
  background: #fff; color: var(--ink); border-radius: 999px; padding: 7px 18px; box-shadow: var(--card-sh);
}
#hint:empty { display: none; }

/* 무기 트레이 */
#weapons {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; gap: 6px; pointer-events: auto; background: #fff; border-radius: 26px; padding: 7px; box-shadow: var(--card-sh);
}
.slot {
  appearance: none; background: #eef1f6; color: var(--ink); font: inherit;
  width: 84px; height: 64px; padding: 4px; cursor: pointer; position: relative; margin: 0;
  border: 3px solid transparent; border-radius: 19px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: transform .1s cubic-bezier(.3, 1.6, .5, 1), background .1s;
}
.slot:hover { background: #dfe7f2; }
.slot .k { position: absolute; left: 8px; top: 3px; font-size: 11px; color: #8a93a3; }
.slot .ic { font-size: 24px; line-height: 1; }
.slot .nm { font-size: 10px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.slot.active { background: var(--yellow); border-color: var(--ink); transform: translateY(-4px); z-index: 1; }
.slot.active .k { color: var(--ink); }

#flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; }
#fade { position: fixed; inset: 0; background: #000; pointer-events: none; opacity: 0; transition: opacity .4s; }
#fade.on { opacity: 1; }

/* 화면 중앙 타이틀 */
#banner {
  position: fixed; left: 0; right: 0; top: 50%; transform: translateY(-60%); text-align: center;
  pointer-events: none; opacity: 0; transition: opacity .3s; font-family: var(--ui);
}
#banner.show { opacity: 1; }
#banner .b1 {
  display: inline-block; font-family: var(--logo); font-weight: 700; font-size: 20px; line-height: 1.3; letter-spacing: 4px; color: #fff;
  background: var(--red); border: 4px solid #fff; border-radius: 999px; padding: 4px 22px; box-shadow: 0 5px 0 var(--red-d);
}
#banner .b2 {
  font-family: var(--logo); font-weight: 700; font-size: 62px; line-height: 1.2; margin: 14px 0 12px; color: #fff;
  -webkit-text-stroke: 12px var(--blue-d); paint-order: stroke fill; text-shadow: 0 8px 0 #0a5f80, 0 14px 16px #00305a55;
}
#banner .b3 { font-size: 20px; line-height: 1.5; color: #fff; -webkit-text-stroke: 5px #0d5aa8; paint-order: stroke fill; text-shadow: 0 3px 0 #0d5aa8; }
#banner.show .b2 { animation: slam .5s cubic-bezier(.3, 1.6, .5, 1); }
#banner.show .b1 { animation: slam .4s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes slam { from { transform: scale(1.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#banner .b-weapon {
  display: inline-block; margin-top: 14px; line-height: 1.3; font-size: 22px; color: var(--ink); background: var(--yellow);
  border: 4px solid #fff; border-radius: 999px; padding: 5px 20px; box-shadow: 0 5px 0 var(--yellow-d);
}

@media (max-width: 640px) {
  .slot { width: 50px; height: 52px; border-radius: 15px; }
  .slot .nm { display: none; }
  #weapons { border-radius: 22px; padding: 5px; gap: 4px; }
  #top { padding: 10px 10px; column-gap: 8px; }
  #stage-info { padding: 6px 10px; border-radius: 14px; max-width: 28vw; }
  #stage-name { font-size: 13px; }
  #clock { padding: 6px 14px 9px; border-radius: 18px; min-width: 128px; }
  #stage-label { font-size: 11px; letter-spacing: 1px; }
  #time-left { font-size: 30px; }
  #time-left.rounds { font-size: 18px; }
  #score { font-size: 32px; -webkit-text-stroke-width: 7px; }
  #timer { width: 112px; height: 10px; margin-top: 6px; }
  #prompt .ptext { font-size: 20px; }
  #banner .b2 { font-size: 36px; -webkit-text-stroke-width: 9px; }
  #hint { bottom: 84px; font-size: 12px; padding: 5px 12px; white-space: normal; max-width: 92vw; border-radius: 18px; text-align: center; }
  .popup { font-size: 18px; -webkit-text-stroke-width: 5px; }
  .popup.great { font-size: 22px; -webkit-text-stroke-width: 6px; }
  .popup.bad { font-size: 20px; }
  .popup.opp { font-size: 14px; -webkit-text-stroke-width: 4px; }
}

/* ── 1:1 대전 ─────────────────────────────── */
#vs {
  display: none; justify-content: center; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 18px; margin-top: -2px; font-size: 17px;
}
#vs span { line-height: 1.3; }
#vs b { font-weight: normal; font-family: var(--logo); font-variant-numeric: tabular-nums; }
#vs span {
  background: var(--c); color: var(--ink); border: 3px solid #fff; border-radius: 999px; padding: 5px 14px;
  box-shadow: 0 4px 0 #00000030; white-space: nowrap;
}
#vs .me { border-color: var(--ink); }

.remote-cross { position: absolute; left: 0; top: 0; width: 16px; height: 16px; margin: -8px 0 0 -8px; opacity: .9; }
.remote-cross::before, .remote-cross::after { content: ""; position: absolute; background: var(--c); border-radius: 2px; box-shadow: 0 0 0 2px #fff; }
.remote-cross::before { left: 6px; top: 0; width: 4px; height: 16px; }
.remote-cross::after { left: 0; top: 6px; width: 16px; height: 4px; }
.remote-cross span {
  position: absolute; left: 16px; top: 12px; font-size: 12px; color: var(--ink); white-space: nowrap;
  background: var(--c); border: 2px solid #fff; border-radius: 999px; padding: 0 8px;
}

/* 데스크톱: 점수 칩을 왼쪽 스테이지 이름 카드 아래로 세로 정렬 (중앙 표적 가리지 않게) */
@media (min-width: 641px) {
  #vs { position: absolute; left: 18px; top: 66px; flex-direction: column; flex-wrap: nowrap; align-items: flex-start; gap: 6px; padding: 0; margin: 0; font-size: 15px; }
  #vs span { padding: 3px 12px; }
  body.versus #prompt { top: 140px; }
}
@media (max-width: 640px) {
  #vs { font-size: 13px; gap: 5px; padding: 0 10px; }
  #vs span { padding: 3px 9px; }
  #prompt { top: 112px; }
  body.versus #prompt { top: 186px; }
}

/* ── 스테이지 사이 중간 순위 ─────────────────── */
#standings {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #0a1c3a99; pointer-events: none; opacity: 0; transition: opacity .3s; text-align: center;
  font-family: var(--ui); color: #fff; padding: 16px; z-index: 5;
}
#standings.show { opacity: 1; }
#standings .s-label {
  font-size: 18px; line-height: 1.3; letter-spacing: 2px; color: var(--ink); background: #fff; border-radius: 999px; padding: 5px 20px; box-shadow: var(--card-sh);
}
#standings .s-first {
  font-family: var(--logo); font-weight: 700; font-size: 52px; line-height: 1.2; margin-top: 22px; color: #fff;
  -webkit-text-stroke: 10px var(--blue-d); paint-order: stroke fill; text-shadow: 0 7px 0 #0a5f80;
}
#standings .s-first b { font-weight: 700; }
#standings.show .s-first { animation: slam .55s cubic-bezier(.3, 1.6, .5, 1); }
#standings .s-first-score {
  font-family: var(--logo); font-weight: 700; font-size: 32px; color: var(--ink); background: var(--yellow); border: 4px solid #fff;
  border-radius: 999px; padding: 2px 26px; line-height: 1.3; margin: 14px 0 28px; box-shadow: 0 5px 0 var(--yellow-d);
}
#standings .s-rest { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-bottom: 28px; }
#standings .s-card {
  min-width: 140px; padding: 10px 16px 12px; background: #fff; color: var(--ink); border-radius: 22px;
  border-top: 8px solid var(--c); box-shadow: var(--card-sh);
}
#standings .s-card .rk { font-size: 14px; line-height: 1.3; color: #6b7280; }
#standings .s-card .nm { font-size: 22px; color: var(--ink); margin: 4px 0; line-height: 1.25; }
#standings .s-card .sc { font-family: var(--logo); font-weight: 700; font-size: 22px; line-height: 1.2; margin-top: 2px; color: var(--blue-d); }
#standings .s-next { font-size: 22px; line-height: 1.4; color: #fff; text-shadow: 0 2px 0 #0d5aa8; }
#standings .s-next b { font-weight: normal; color: var(--yellow); }
#standings .s-wait { font-size: 28px; line-height: 1.3; background: #fff; color: var(--ink); border-radius: 26px; padding: 18px 30px; box-shadow: var(--card-sh); }
#standings .s-wait small { display: block; font-size: 16px; color: #6b7280; margin-top: 10px; line-height: 1.4; }
@media (max-width: 640px) {
  #standings .s-first { font-size: 30px; -webkit-text-stroke-width: 7px; }
  #standings .s-first-score { font-size: 22px; }
  #standings .s-card { min-width: 100px; }
}

/* ── 요리 대결 주문 말풍선 ─────────────────── */
#order {
  position: fixed; left: 0; top: 0; pointer-events: none; display: none; max-width: 46vw;
  background: #fff; color: var(--ink); border-radius: 22px; padding: 10px 14px 12px; box-shadow: var(--card-sh);
  font-family: var(--ui); text-shadow: none;
}
#order.show { display: block; }
#order::before { content: ""; position: absolute; left: -14px; top: 16px; border: 7px solid transparent; border-right-color: #fff; border-left: 0; }
#order .o-title { font-size: 22px; line-height: 1.3; margin-bottom: 8px; }
#order .o-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; }
#order .o-steps i { font-style: normal; color: #9aa3b2; }
#order .chip { line-height: 1.3; padding: 2px 9px; border: 3px solid #e3e9f2; border-radius: 999px; background: #f7f9fc; white-space: nowrap; }
#order .chip.next { border-color: var(--yellow-d); background: var(--yellow); }
#order .chip.wrong { border-color: var(--red); background: #ffe3df; }
#order .o-warn { color: var(--red-d); font-size: 13px; line-height: 1.3; margin-top: 8px; }
#order .chip.done { border-color: #3fbf4a; background: #e4f8d8; color: #5f8a58; text-decoration: line-through; }
#order .o-timer { height: 8px; background: #e3e9f2; border-radius: 999px; margin-top: 10px; overflow: hidden; }
#order .o-timer b { display: block; height: 100%; width: 100%; background: #3fbf4a; border-radius: 999px; }
@media (max-width: 640px) { #order .o-title { font-size: 16px; } #order .o-steps { font-size: 12px; } }

#prompt.low, body.versus #prompt.low { top: auto; bottom: 150px; padding: 10px 22px; }
#prompt.low .ptext { font-size: 22px; }
#prompt.low .ptimer { display: none; }


/* ── 스테이지 무기 고정: 핫바에 고정된 무기만 ─────────── */
#weapons.locked .slot:not(.active) { display: none; }
#weapons.locked .slot.active::after { content: "🔒"; position: absolute; right: 5px; top: 2px; font-size: 11px; }

/* ══ 메뉴 화면: 닌텐도풍 (밝은 하늘색, 둥근 알약 버튼, 흰 카드) ══ */
.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: safe center;
  overflow-y: auto; text-align: center; padding: 20px 16px;
}
.screen.hidden, .modal.hidden, #ad.hidden { display: none; }
.screen.nin, .modal, #ad {
  font-family: var(--ui); text-shadow: none; color: #fff; user-select: none;
}
.screen.nin {
  background:
    radial-gradient(circle, #ffffff2e 18%, transparent 19%) 0 0 / 46px 46px,
    radial-gradient(circle, #ffffff1a 18%, transparent 19%) 23px 23px / 46px 46px,
    linear-gradient(170deg, var(--sky1), var(--sky2));
  animation: dots 6s linear infinite;
}
@keyframes dots { to { background-position: 46px 46px, 69px 69px, 0 0; } }

/* 로고 */
.logo-wrap { position: relative; margin: 4px 0 6px; }
.logo {
  font-family: var(--logo); font-weight: 700; font-size: 128px; line-height: 1; letter-spacing: 2px; color: #fff;
  -webkit-text-stroke: 14px var(--red); paint-order: stroke fill;
  text-shadow: 0 10px 0 var(--red-d), 0 18px 18px #00305a55;
  transform: rotate(-4deg); animation: bob 2.4s ease-in-out infinite;
}
@keyframes bob { 50% { transform: rotate(-4deg) translateY(-8px); } }
.tagline { font-size: 21px; margin: 18px 0 20px; text-shadow: 0 2px 0 #0d5aa8; }
.tagline b { font-weight: normal; color: var(--yellow); }

/* 흰 카드 */
.nin .card, .modal .card {
  background: #fff; color: var(--ink); border-radius: 28px; padding: 20px;
  box-shadow: 0 8px 0 #0b4f9a40, 0 18px 30px #00306030;
  display: flex; flex-direction: column; align-items: center; width: 400px; max-width: 100%;
}
.card-title { font-size: 24px; margin-bottom: 14px; }
.desc { font-size: 16px; margin: 0 0 14px; opacity: .85; }
.modal .desc { color: #555b66; }

.nin-input {
  font: inherit; font-size: 22px; color: var(--ink); background: #f2f5fa; text-align: center;
  border: 3px solid #d9e0ea; border-radius: 18px; outline: none; width: 100%; padding: 12px 16px; margin-bottom: 12px;
}
.nin-input:focus { border-color: var(--blue); background: #fff; }

/* 알약 버튼: 아래 그림자가 눌리면서 들어간다 */
.pill {
  font: inherit; font-size: 20px; color: #fff; cursor: pointer; border: 0; border-radius: 999px;
  padding: 12px 28px; margin: 6px 0; background: var(--bg, var(--red)); box-shadow: 0 6px 0 var(--sh, var(--red-d));
  transition: transform .08s, box-shadow .08s, filter .12s;
}
.pill:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: 0 8px 0 var(--sh, var(--red-d)); }
.pill:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--sh, var(--red-d)); }
.pill:disabled { filter: grayscale(1) opacity(.6); cursor: default; transform: none; }
.pill.big { font-size: 26px; padding: 14px 0; width: 100%; max-width: 340px; }
.pill.small { font-size: 16px; padding: 9px 18px; }
.pill.red { --bg: var(--red); --sh: var(--red-d); }
.pill.blue { --bg: var(--blue); --sh: var(--blue-d); }
.pill.yellow { --bg: var(--yellow); --sh: var(--yellow-d); color: var(--ink); }
.pill.white { --bg: #fff; --sh: #b9c6d8; color: var(--ink); }
.screen > .pill.big { width: 340px; }
/* 뒤로/취소/닫기 버튼: 파란 화면에선 반투명 흰 알약, 흰 카드/모달 안에선 회색 알약 */
.link {
  font: inherit; font-size: 21px; line-height: 1.4; cursor: pointer; border: 3px solid #ffffff90;
  border-radius: 999px; padding: 11px 30px; min-height: 50px; margin-top: 16px;
  color: #fff; background: #ffffff28; box-shadow: 0 5px 0 #0b4f9a40;
  transition: transform .08s, box-shadow .08s, background .12s;
}
.link:hover { background: #ffffff45; text-decoration: none; transform: translateY(-2px); box-shadow: 0 7px 0 #0b4f9a40; }
.link:active { transform: translateY(4px); box-shadow: 0 1px 0 #0b4f9a40; }
.card .link, .modal .link { color: var(--ink); background: #eef1f6; border-color: #d9e0ea; box-shadow: 0 5px 0 #b9c6d8; }
.card .link:hover, .modal .link:hover { background: #dfe7f2; }
@media (max-width: 640px) { .link { font-size: 18px; padding: 10px 24px; min-height: 46px; } }
.msg { min-height: 22px; margin-top: 8px; color: #ffe1dc; font-size: 17px; }
.card .msg { color: var(--red); }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 24px 0 10px; max-width: 640px; }
.chips span { background: #ffffff30; border: 2px solid #ffffff70; border-radius: 999px; padding: 5px 12px; font-size: 15px; }
.controls { font-size: 15px; opacity: .9; }
.controls b { font-weight: normal; color: var(--yellow); }

/* 모드 선택 타일 */
.hello { font-size: 34px; margin-bottom: 22px; text-shadow: 0 3px 0 #0d5aa8; }
.hello b { font-weight: normal; color: var(--yellow); }
.tiles { display: flex; gap: 22px; margin-bottom: 22px; flex-wrap: wrap; justify-content: center; }
.tile {
  font: inherit; color: #fff; cursor: pointer; border: 6px solid #fff; border-radius: 34px;
  width: 260px; height: 230px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: var(--bg); box-shadow: 0 10px 0 var(--sh), 0 20px 30px #00306040; transition: transform .1s, box-shadow .1s;
}
.tile.red { --bg: var(--red); --sh: var(--red-d); }
.tile.blue { --bg: var(--blue); --sh: var(--blue-d); }
.tile:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 14px 0 var(--sh), 0 26px 34px #00306040; }
.tile:active { transform: translateY(6px); box-shadow: 0 3px 0 var(--sh); }
.t-ic { font-size: 70px; line-height: 1; filter: drop-shadow(0 4px 0 #00000030); }
.t-name { font-size: 32px; }
.t-sub { font-size: 16px; opacity: .9; }
.sub-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }

.nin h2 {
  font-family: var(--logo); font-weight: 700; font-size: 44px; margin: 0 0 14px; color: #fff;
  -webkit-text-stroke: 8px var(--blue-d); paint-order: stroke fill; text-shadow: 0 6px 0 #0a5f80;
}

/* 스테이지별 무기 */
.nin .card.loadout { gap: 2px; width: 640px; padding: 12px 18px; margin-bottom: 8px; }
.lo-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 3px 0; border-bottom: 2px dashed #eef1f6; }
.lo-row:last-child { border-bottom: 0; }
.lo-stage { text-align: left; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lo-stage b { font-weight: normal; display: inline-block; width: 26px; height: 26px; line-height: 26px; text-align: center; border-radius: 50%; background: var(--blue); color: #fff; font-size: 14px; margin-right: 6px; }
.lo-opts { display: flex; gap: 4px; flex-shrink: 0; }
.lo-opt {
  font: inherit; font-size: 19px; width: 38px; height: 38px; border-radius: 12px; border: 3px solid transparent;
  background: #eef1f6; cursor: pointer; padding: 0; line-height: 1;
}
.lo-opt:hover { background: #dfe7f2; }
.lo-opt.on { background: var(--yellow); border-color: var(--ink); }
.lo-fixed { font-size: 17px; background: #eef1f6; border-radius: 999px; padding: 4px 12px; white-space: nowrap; }
.lo-head { font-size: 20px; margin: 16px 0 8px; text-shadow: 0 2px 0 #0d5aa8; }
.lo-head span { font-size: 15px; opacity: .85; }

/* 방 목록 */
#room-list { width: 520px; max-height: 46vh; overflow-y: auto; gap: 8px; padding: 14px; margin-bottom: 16px; }
#room-list .empty { color: #6b7280; padding: 26px 0; font-size: 18px; }
#room-list button.room {
  font: inherit; color: var(--ink); cursor: pointer; width: 100%; display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center;
  text-align: left; font-size: 19px; padding: 12px 16px; border: 3px solid #e3e9f2; border-radius: 18px; background: #f7f9fc;
  box-shadow: 0 4px 0 #d3dcea; transition: transform .08s;
}
#room-list button.room:hover { border-color: var(--blue); transform: translateY(-2px); }
#room-list button.room.full { opacity: .5; cursor: default; transform: none; }
#room-list .rname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#room-list .rhost { font-size: 15px; color: #6b7280; }
#room-list .rcount { font-size: 16px; color: #fff; background: var(--blue); border-radius: 999px; padding: 3px 10px; text-align: center; }
.check { display: flex; align-items: center; gap: 8px; margin: 2px 0 12px; font-size: 19px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--blue); }

/* 로비 */
.room-title { font-size: 28px; margin-bottom: 6px; }
.lobby-hint { font-size: 15px; opacity: .9; }
.invite { display: flex; gap: 12px; margin: 12px 0 18px; width: 640px; max-width: 100%; }
.inv-code, .inv-link {
  font: inherit; color: var(--ink); cursor: pointer; border: 4px solid #fff; border-radius: 22px; background: #fff;
  box-shadow: 0 6px 0 #0b4f9a40; padding: 10px 16px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform .08s, box-shadow .08s;
}
.inv-code:hover, .inv-link:hover { transform: translateY(-2px); box-shadow: 0 8px 0 #0b4f9a40; border-color: var(--yellow); }
.inv-code:active, .inv-link:active { transform: translateY(4px); box-shadow: 0 2px 0 #0b4f9a40; }
.inv-label { font-size: 14px; color: #6b7280; }
.inv-code b { font-family: var(--logo); font-weight: 700; font-size: 46px; letter-spacing: 8px; line-height: 1.1; color: var(--red); }
.inv-link { flex: 1; min-width: 0; }
#lobby-link-text { font-size: 20px; color: var(--blue-d); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-copy { font-size: 15px; color: #fff; background: var(--blue); border-radius: 999px; padding: 3px 14px; margin-top: 4px; }
.copied .inv-copy, .inv-code.copied .inv-label { background: #3fbf4a; color: #fff; border-radius: 999px; padding: 3px 14px; }
@media (max-width: 640px) {
  .invite { flex-direction: column; }
  .inv-code b { font-size: 38px; }
  #lobby-link-text { font-size: 15px; }
}
#lobby-players { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 460px; max-width: 100%; }
#lobby-players .pl { font-size: 20px; padding: 10px 14px; border-radius: 18px; background: var(--c); color: var(--ink); box-shadow: 0 5px 0 #00000030; border: 4px solid #fff; }
#lobby-players .pl.empty { background: #ffffff25; color: #ffffffb0; border: 4px dashed #ffffff80; box-shadow: none; }
#lobby-status { margin: 10px 0 6px; font-size: 18px; }

/* 결과 */
.res-title { font-family: var(--logo); font-weight: 700; font-size: 34px; letter-spacing: 6px; text-shadow: 0 3px 0 #0d5aa8; }
#grade {
  font-family: var(--logo); font-weight: 700; font-size: 96px; line-height: 1; color: var(--ink);
  min-width: 200px; padding: 26px 34px; margin: 10px 0 18px; border-radius: 999px; background: var(--yellow);
  border: 7px solid #fff; box-shadow: 0 10px 0 var(--yellow-d); transform: rotate(-3deg); white-space: nowrap;
}
#results:not(.hidden) #grade { animation: popin .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes popin { from { transform: rotate(-3deg) scale(.3); opacity: 0; } }
.stats { display: grid !important; grid-template-columns: 1fr 1fr; gap: 12px 30px; line-height: 1.3; margin-bottom: 18px; font-size: 19px; width: 520px !important; }
.stats div { display: flex; justify-content: space-between; gap: 16px; }
.stats span { color: #6b7280; }
.stats b { font-weight: normal; }

/* 모달 */
.modal { position: fixed; inset: 0; display: flex; background: #0a1c3a99; padding: 16px; z-index: 20; overflow-y: auto; }
.modal .card { margin: auto; /* 가운데 정렬하되 카드가 더 크면 위에서부터 스크롤 */ animation: popin2 .25s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes popin2 { from { transform: scale(.7); opacity: 0; } }
#shop-dev { margin-top: 6px; }
#donate-links { display: flex; flex-direction: column; gap: 4px; width: 100%; align-items: center; }
#donate-links .pill { width: 100%; max-width: 320px; text-decoration: none; display: block; }
#donate-links .none { color: #6b7280; font-size: 15px; margin-bottom: 8px; }
/* 후원: 토스페이먼츠 결제창 (금액 고르기 + 결제 버튼) */
#donate-toss { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 10px; padding-top: 12px; border-top: 2px dashed #e3e8f0; }
#donate-toss.hidden { display: none; }
#donate-toss .dt-title { font-size: 18px; color: var(--ink); }
#donate-amounts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
#donate-amounts .pill { margin: 0; }
#donate-amounts .pill.sel { --bg: var(--blue); --sh: var(--blue-d); color: #fff; }
#donate-pay { width: 100%; max-width: 320px; }
#donate-toss .dt-note { color: #6b7280; font-size: 13px; line-height: 1.5; }
#donate-msg:empty, #donate-links:empty { display: none; }
#donate-msg.ok { color: var(--blue-d); }
/* 개인정보처리방침: 작은 글자 링크 (타이틀은 화면 오른쪽 아래 구석, 모달은 닫기 위) */
.legal-links .ll { display: inline-block; white-space: nowrap; }
.legal-links { display: block; text-align: center; margin-top: 10px; font-size: 13px; line-height: 1.5; color: #6b7280; }
.legal-links .privacy-link { margin-top: 0; }
.privacy-link { font-size: 13px; line-height: 1.5; color: #6b7280; text-decoration: underline; margin-top: 10px; }
.privacy-link:hover { color: var(--ink); }
#title .legal-links { text-align: right; position: absolute; right: 14px; bottom: 10px; margin: 0; color: #ffffffc0; font-size: 13px; line-height: 1.5; }
#title .privacy-link { margin: 0; color: #ffffffc0; }
#title .privacy-link:hover { color: #fff; }
@media (max-width: 640px) { #title .legal-links { text-align: center; position: static; margin-top: 4px; font-size: 12px; } #title .privacy-link { font-size: 12px; } }

/* 스테이지 사이 광고 */
#ad { position: fixed; inset: 0; z-index: 30; background: #10131c; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 16px; }
.ad-top { position: absolute; left: 18px; top: 16px; font-size: 18px; }
.ad-tag { background: var(--yellow); color: var(--ink); border-radius: 6px; padding: 1px 8px; margin-right: 4px; }
.ad-box { width: 640px; max-width: 100%; aspect-ratio: 16 / 9; border-radius: 20px; background: #1d2333; border: 3px dashed #3b4560; display: flex; align-items: center; justify-content: center; }
.ad-slot { font-size: 28px; color: #8590ab; }
.ad-slot small { font-size: 15px; }
.ad-actions { display: flex; gap: 12px; }


@media (max-width: 640px) {
  .logo { font-size: 76px; -webkit-text-stroke-width: 9px; }
  .tagline { font-size: 17px; }
  .tiles { gap: 14px; }
  .tile { width: 100%; max-width: 340px; height: 140px; flex-direction: row; gap: 14px; }
  .tile .t-ic { font-size: 50px; }
  .tile .t-name { font-size: 26px; }
  .tile .t-sub { display: none; }
  .screen > .pill.big { width: 100%; }
  .nin .card.loadout { width: 100%; }
  .lo-row { flex-wrap: wrap; }
  .lo-stage { font-size: 14px; white-space: normal; }
  .lo-opt { width: 30px; height: 32px; font-size: 15px; border-radius: 9px; }
  .stats { width: 100% !important; grid-template-columns: 1fr; }
  #grade { font-size: 64px; }
  .nin h2 { font-size: 32px; }
  #room-list button.room { font-size: 15px; }
}

/* 언어 / 국가 선택 */
.corner { position: absolute; top: 14px; right: 14px; margin: 0; z-index: 3; }
/* 계정 버튼 (포털 아래에서만 보인다): 왼쪽 위 구석 */
.corner-l { position: absolute; top: 14px; left: 14px; margin: 0; z-index: 3; max-width: calc(50% - 30px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill.hidden { display: none; }
@media (max-width: 640px) {
  .corner, .corner-l { font-size: 13px; padding: 7px 12px; }
  .corner { top: 10px; right: 10px; }
  .corner-l { top: 10px; left: 10px; }
  #title .logo-wrap { margin-top: 56px; }
}
select.nin-input {
  appearance: none; -webkit-appearance: none; cursor: pointer; text-align-last: center; padding-right: 40px;
  background: #f2f5fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M2 2l6 6 6-6' fill='none' stroke='%2323262e' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 16px center / 16px 10px;
}
select.nin-input:focus { background-color: #fff; }
#lang-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 6px; }
#lang-list .pill { margin: 0; }
.lang-opt.on { --bg: var(--yellow); --sh: var(--yellow-d); color: var(--ink); }

/* ── 혼자 하기: 게임 고르기 ─────────────────── */
#sc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; max-width: 980px; margin: 4px 0 14px; }
/* 낮은 화면(1280×720 등): 긴 번역(de/ja)도 스크롤 없이 */
@media (max-width: 900px) { #sc-grid { grid-template-columns: repeat(2, 1fr); max-width: 600px; } }
.sc-card {
  font: inherit; color: var(--ink); text-align: left; cursor: pointer; position: relative; margin: 0;
  display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 14px 12px;
  background: #fff; border: 4px solid #fff; border-radius: 24px; box-shadow: 0 6px 0 #0b4f9a40, 0 12px 20px #00306030;
  transition: transform .1s cubic-bezier(.3, 1.6, .5, 1), box-shadow .1s, border-color .1s;
}
.sc-card:hover { transform: translateY(-3px); border-color: var(--yellow); box-shadow: 0 9px 0 #0b4f9a40, 0 16px 24px #00306030; }
.sc-card:active { transform: translateY(4px); box-shadow: 0 2px 0 #0b4f9a40; }
.sc-ic { flex-shrink: 0; width: 56px; height: 56px; border-radius: 18px; background: #e6f6fd; display: flex; align-items: center; justify-content: center; font-size: 34px; line-height: 1; }
.sc-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.sc-name { font-size: 19px; line-height: 1.25; }
.sc-desc { font-size: 13px; line-height: 1.35; color: #6b7280; }
.sc-best { display: inline-block; align-self: flex-start; margin-top: auto !important; font-size: 13px; line-height: 1.3; color: var(--blue-d); background: #e6f6fd; border-radius: 999px; padding: 2px 10px; margin-top: 4px; }
.sc-top { font-size: 13px; line-height: 1.3; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-top:empty { display: none; }
.sc-top b { font-weight: normal; color: var(--ink); }
.sc-rank {
  position: absolute; right: 10px; top: 10px; width: 38px; height: 38px; border-radius: 50%; font-size: 16px;
  display: flex; align-items: center; justify-content: center; background: var(--yellow); box-shadow: 0 3px 0 var(--yellow-d); transition: transform .08s;
}
.sc-rank:hover { transform: translateY(-2px) scale(1.08); }
.sc-card.full { border-color: var(--yellow); background: #fffbe8; }
.sc-card.full .sc-ic { background: var(--yellow); }
#select-rank-btn { margin-top: 4px; }

/* ── 랭킹 ─────────────────────────────── */
.rk-tabs { display: flex; gap: 10px; margin-bottom: 12px; }
.rk-tab {
  font: inherit; font-size: 18px; color: var(--ink); cursor: pointer; border: 0; border-radius: 999px; padding: 8px 24px;
  background: #fff; box-shadow: 0 5px 0 #b9c6d8; transition: transform .08s;
}
.rk-tab:hover { transform: translateY(-2px); }
.rk-tab.on { background: var(--yellow); box-shadow: 0 5px 0 var(--yellow-d); }
.rk-modes {
  display: flex; gap: 8px; overflow-x: auto; width: 760px; max-width: 100%; padding: 2px 14px 10px; scrollbar-width: none; flex-shrink: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
}
.rk-modes::-webkit-scrollbar { display: none; }
.rk-mode:first-child { margin-left: auto; }
.rk-mode:last-child { margin-right: auto; }
.rk-mode {
  flex-shrink: 0; font: inherit; font-size: 15px; color: #fff; cursor: pointer; white-space: nowrap;
  background: #ffffff30; border: 2px solid #ffffff90; border-radius: 999px; padding: 5px 14px;
}
.rk-mode:hover { background: #ffffff50; }
.rk-mode.on { background: #fff; color: var(--ink); border-color: #fff; box-shadow: 0 4px 0 #0b4f9a40; }
.nin #rank-list { width: 560px; max-height: 50vh; overflow-y: auto; align-items: stretch; gap: 2px; padding: 10px 12px; margin: 4px 0 14px; flex-shrink: 0; }
.rk-row { display: grid; grid-template-columns: 36px 1fr 28px auto; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 14px; font-size: 18px; line-height: 1.3; text-align: left; }
.rk-row:nth-child(even) { background: #f5f8fc; }
.rk-row.me { background: var(--yellow); box-shadow: inset 0 0 0 3px var(--ink); }
.rk-no { text-align: center; font-family: var(--logo); font-weight: 700; color: var(--blue-d); }
.rk-row.top1 .rk-no, .rk-row.top2 .rk-no, .rk-row.top3 .rk-no { font-size: 22px; }
.rk-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-date { font-size: 12px; color: #8a93a3; margin-left: 8px; }
.rk-row.me .rk-date { color: #6b5a10; }
.rk-wp { text-align: center; font-size: 18px; }
.rk-score { font-family: var(--logo); font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; min-width: 60px; }
.rk-msg { color: #6b7280; padding: 34px 10px; font-size: 18px; text-align: center; }
.rk-msg.err { color: var(--red); }
#rank-me { font-size: 19px; line-height: 1.3; color: var(--ink); background: #fff; border-radius: 999px; padding: 6px 20px; box-shadow: var(--card-sh); }
#rank-me:empty { display: none; }
#rank-me.has { background: var(--yellow); box-shadow: 0 5px 0 var(--yellow-d); }
#rank-note { font-size: 14px; opacity: .9; margin-top: 12px; text-shadow: 0 2px 0 #0d5aa8; }

/* 혼자 하기 게임 하나: 무기 고르기 한 줄을 크게 */
#loadout.one .card.loadout { width: 520px; padding: 16px 20px; }
#loadout.one .lo-row { flex-direction: column; gap: 12px; }
#loadout.one .lo-stage { font-size: 20px; }
#loadout.one .lo-opts { gap: 8px; flex-wrap: wrap; justify-content: center; }
#loadout.one .lo-opt { width: 52px; height: 52px; font-size: 26px; border-radius: 16px; }

/* 결과: 모드 이름, 랭킹 줄, 버튼 줄 */
#res-mode { font-size: 19px; line-height: 1.3; color: var(--ink); background: #fff; border-radius: 999px; padding: 4px 18px; margin-top: 8px; box-shadow: var(--card-sh); }
#res-mode:empty { display: none; }
.rank-line { flex-shrink: 0; font-size: 18px; line-height: 1.4; min-height: 25px; margin: -6px 0 12px; padding: 3px 18px; border-radius: 999px; background: #0b4f9a40; text-shadow: 0 2px 0 #0d5aa8; }
.rank-line:empty { background: none; }
.rank-line b { font-weight: normal; color: var(--yellow); }
.rank-line.fail { color: #ffe1dc; }
.res-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 4px 0; }
.res-row .pill { font-size: 18px; padding: 10px 22px; }

@media (max-width: 640px) {
  #sc-grid { grid-template-columns: 1fr; gap: 10px; }
  .sc-card { flex-direction: row; padding: 10px 52px 10px 10px; border-radius: 20px; gap: 10px; align-items: center; }
  .sc-rank { top: 50%; margin-top: -19px; }
  .sc-ic { width: 46px; height: 46px; font-size: 28px; border-radius: 15px; }
  .sc-name { font-size: 17px; }
  .sc-desc { display: none; }
  .sc-card.full .sc-desc { display: block; }
  .nin #rank-list { width: 100%; max-height: 52vh; padding: 8px; }
  .rk-row { font-size: 14px; grid-template-columns: 28px 1fr 22px auto; gap: 6px; padding: 6px 8px; }
  .rk-wp { font-size: 15px; }
  .rk-row.top1 .rk-no, .rk-row.top2 .rk-no, .rk-row.top3 .rk-no { font-size: 18px; }
  .rk-tab { font-size: 16px; padding: 7px 18px; }
  .rk-mode { font-size: 13px; padding: 4px 11px; }
  #rank-me { font-size: 16px; }
  #rank-note { font-size: 12px; }
  #loadout.one .card.loadout { width: 100%; }
  #loadout.one .lo-opt { width: 44px; height: 44px; font-size: 22px; }
  .res-row .pill { font-size: 15px; padding: 9px 16px; }
  #results #grade { font-size: 56px; padding: 14px 30px; margin: 8px 0 14px; min-width: 160px; }
  #results .res-title { font-size: 28px; }
  .rank-line { font-size: 15px; }
  .rank-line b { display: block; }
  .rank-line { margin-bottom: 16px; border-radius: 18px; }
}
@media (max-width: 400px) { .rk-date { display: none; } }

/* ── 줄간격 2배 ───────────────────────────────
   본문은 행간 1.7~1.8, 위아래로 쌓인 항목 사이 간격은 약 2배.
   큰 숫자/타이틀(로고, 점수, 시간, 배너 b2, 등급 등)은 1.0~1.2 유지해서 HUD가 플레이 영역을 먹지 않게 한다. */

/* 메뉴: 큰 글자는 촘촘하게 */
.logo, .t-ic, .lo-opt, .sc-ic, #grade { line-height: 1; }
.nin h2 { line-height: 1.15; margin: 0 0 28px; }
.res-title, .rk-no { line-height: 1.2; }
.inv-code b { line-height: 1.1; }
/* 메뉴: 여러 줄 본문 */
.tagline, .desc, .controls, .lobby-hint, #rank-note, .rank-line, .sc-desc, #room-list .rhost, .ad-slot small { line-height: 2; }
/* 메뉴: 한 줄짜리 알약/칩 */
.pill, .chips span, .rk-tab, .rk-mode, #vs span, .lo-fixed, .lo-stage b, .sc-best, .sc-top, .inv-copy, .ad-tag, #room-list .rcount, #res-mode, #rank-me { line-height: 1.5; }
/* 메뉴: 간격 */
.tagline { margin: 40px 0 40px; }
.card-title { margin-bottom: 10px; }
.desc { margin: 0 0 34px; }
.nin-input { margin-bottom: 10px; }
.pill { margin: 14px 0; }
.msg { margin-top: 20px; }
/* 닉네임 안내: 메시지가 있을 때만 보인다 */
#name-msg { margin-top: 10px; }
#name-msg:empty { display: none; }
.chips { margin: 50px 0 26px; gap: 16px; }
.hello { margin-bottom: 44px; font-size: 50px; }
.tiles { margin-bottom: 24px; }
.t-sub { margin-top: 6px; }
.sub-row { margin: 20px 0; }
.lo-row { padding: 12px 0; }
.nin .card.loadout { gap: 9px; }
.lo-head { margin: 34px 0 20px; }
#room-list { gap: 20px; }
.check { margin: 8px 0 28px; }
.room-title { margin-bottom: 18px; }
.invite { margin: 28px 0 40px; }
.inv-code, .inv-link { gap: 9px; }
#lobby-players { gap: 20px; }
#lobby-status { margin: 26px 0 18px; }
.stats { gap: 26px 30px; line-height: 1.8; margin-bottom: 38px; }
.rank-line { margin: 0 0 28px; }
.res-row { margin: 12px 0; }
#res-mode { margin-top: 18px; }
#rank-note { margin-top: 26px; }
.rk-row { padding: 14px 12px; line-height: 1.7; }
.nin #rank-list { gap: 6px; }
.rk-tabs { margin-bottom: 26px; }
#donate-links { gap: 12px; }
#donate-amounts { gap: 12px; }
#ad { gap: 40px; }
.sc-card { gap: 16px; }
.sc-body { gap: 9px; }
#sc-grid { gap: 20px; }
/* 방 목록/랭킹 줄/방 버튼은 위 간격과 충돌하지 않게 */
#lang-list { gap: 16px; }

/* HUD */
#stage-name { line-height: 1.5; }
#stage-label { line-height: 1.1; }
#time-left { line-height: 1.1; }
#time-left.rounds { line-height: 1.3; }
#score { line-height: 1.1; }
#combo { line-height: 1.5; margin-top: 12px; }
#prompt .ptext { line-height: 1.7; }
#prompt .ptimer { margin-top: 20px; }
#hint { line-height: 1.8; }
#banner .b1 { line-height: 1.4; }
#banner .b2 { line-height: 1.15; margin: 30px 0 28px; }
#banner .b3 { line-height: 2; }
#banner .b-weapon { line-height: 1.5; margin-top: 30px; }
#standings .s-label { line-height: 1.5; }
#standings .s-first { line-height: 1.15; margin-top: 40px; }
#standings .s-first-score { line-height: 1.3; margin: 28px 0 48px; }
#standings .s-rest { gap: 28px; margin-bottom: 48px; }
#standings .s-card .rk { line-height: 1.8; }
#standings .s-card .nm { line-height: 1.6; margin: 12px 0; }
#standings .s-card .sc { line-height: 1.3; margin-top: 8px; }
#standings .s-next { line-height: 2; }
#standings .s-wait { line-height: 1.7; }
#standings .s-wait small { line-height: 2; margin-top: 22px; }
#order .o-title { line-height: 1.5; margin-bottom: 16px; }
#order .o-steps { gap: 12px; }
#order .chip { line-height: 1.5; }
#order .o-warn { line-height: 1.8; margin-top: 16px; }
#order .o-timer { margin-top: 18px; }
#vs { gap: 10px; }
#vs span { line-height: 1.5; }
@media (max-width: 640px) { #vs { gap: 8px; } #combo { margin-top: 8px; } }
.slot .nm { line-height: 1.2; }

/* 결과 버튼 한 줄: 메뉴로 · 다시 하기 · 랭킹 */
.res-main { flex-wrap: nowrap; gap: 12px; }
.res-main .pill { margin: 0; font-size: 20px; padding: 14px 26px; }
.res-main #retry-btn { font-size: 24px; padding: 16px 38px; }
@media (max-width: 640px) { .res-main { gap: 7px; } .res-main .pill, .res-main #retry-btn { font-size: 14px; padding: 11px 11px; } .res-main #retry-btn { font-size: 16px; padding: 12px 14px; } }

/* 뒤에 선언해야 위의 간격 규칙을 이긴다 */
@media (max-width: 640px) { .sc-card { gap: 10px; } #sc-grid { gap: 10px; } .rk-row { padding: 8px 8px; } .nin #rank-list { gap: 2px; } }
/* 낮은 화면(1280×720 등): 긴 번역(de/ja)도 스크롤 없이 */
@media (min-width: 901px) and (max-height: 759px) { .sc-card { gap: 6px; padding: 8px 14px 10px; } .sc-desc { font-size: 12px; line-height: 1.5; } .sc-body { gap: 3px; } .sc-name { line-height: 1.3; } #sc-grid { gap: 10px; margin: 0 0 6px; } #select-rank-btn { margin-top: 0; } #select-back { margin-top: 8px; } #stage-select { padding-top: 12px; padding-bottom: 12px; } #stage-select h2 { margin-bottom: 10px; } #stage-select .desc { margin-bottom: 12px; } .sc-desc { margin-bottom: 4px; } #results .stats { gap: 14px 30px; margin-bottom: 20px; } #results #grade { padding: 16px 34px; margin: 6px 0 12px; } #results .rank-line { margin-bottom: 16px; } .nin #rank-list { max-height: 42vh; } .rk-tabs { margin-bottom: 14px; } .rk-row { padding: 9px 12px; } #rank-note { margin-top: 12px; } #loadout .lo-row { padding: 2px 0; } #loadout .lo-opt { width: 36px; height: 34px; } #loadout .card.loadout { gap: 2px; } #loadout h2 { margin-bottom: 10px; } #loadout .desc { margin-bottom: 14px; } #loadout .pill { margin: 8px 0; }
  /* 타이틀: 번역이 길어도(ko/ja/de) 720px 안에 */
  #title { line-height: 1.5; } #title .tagline { margin: 10px 0 14px; } #title .chips { margin: 12px 0 6px; } #title .card { padding: 14px 20px; } #title .pill { margin: 8px 0; } #name-msg { line-height: 1.4; } #title .nin-input { margin-bottom: 8px; }
  /* 로비: 초대 칸과 참가자 줄을 조금 줄임 */
  .invite { margin: 14px 0 18px; } #lobby-players { gap: 10px; } #lobby .lobby-hint { line-height: 1.6; } #lobby .lo-row { padding: 3px 0; } #lobby .lo-opt { width: 34px; height: 32px; } #lobby-status { margin: 12px 0 8px; } #lobby .lo-head { margin: 12px 0 6px; } }

/* ── 혼자 하기 타임어택: 시계 아이템 ─────────── */
.popup.time { color: #3fdc6e; -webkit-text-stroke: 7px #0b4f2a; font-size: 34px; text-shadow: 0 4px 0 #00000050; }
#clock.bonus { animation: tbonus .6s cubic-bezier(.3, 1.6, .5, 1); }
#clock.bonus #time-left { color: #1fb85a; }
@keyframes tbonus { from { transform: scale(1.18); box-shadow: 0 0 0 6px #3fdc6e, var(--card-sh); } }
#banner .b-time {
  display: inline-block; margin-top: 14px; line-height: 1.5; font-size: 19px; color: #fff; background: #2fbf5e;
  -webkit-text-stroke: 0; text-shadow: 0 2px 0 #0b4f2a; border: 4px solid #fff; border-radius: 999px; padding: 4px 18px; box-shadow: 0 5px 0 #1a7f3c;
}
.sc-ta { display: inline-block; align-self: flex-start; font-size: 12px; line-height: 1.5; color: #137a3a; background: #e3f9e9; border-radius: 10px; padding: 1px 9px; }
@media (max-width: 640px) {
  .popup.time { font-size: 24px; -webkit-text-stroke-width: 5px; }
  #banner .b-time { font-size: 14px; padding: 3px 12px; max-width: 92vw; }
  .sc-ta { font-size: 11px; }
}

/* 작은 화면 결과: 랭킹 줄이 두 줄이어도 버튼 줄이 화면 안에 (뒤쪽 전역 간격 규칙을 이기도록 맨 끝) */
@media (max-width: 640px) { #results .stats { gap: 10px 24px; line-height: 1.5; margin-bottom: 20px; } #results #grade { margin: 4px 0 10px; } #results .rank-line { margin-bottom: 16px; } #results .res-row { margin: 8px 0; } }
