:root {
  --bg: #0d1119;
  --panel: rgba(12, 16, 24, 0.8);
  --panel-solid: #151b27;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f3f1ea;
  --muted: #a7adb8;
  --red: #ff3b30;
  --red-deep: #b3140c;
  --gold: #f2c14e;
  --blue: #5aa8ff;
  --green: #5fd47a;
  --font-title: 'Anton', 'Black Han Sans', sans-serif;
  --font-body: 'Archivo', 'S-Core Dream', system-ui, sans-serif;
  --font-mono: 'Space Mono', 'S-Core Dream', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  overflow: hidden;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; touch-action: none; }
#overlay { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }

/* 버튼 */
.btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn.primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-family: 'Black Han Sans', sans-serif;
  font-weight: 400;
  font-size: 20px;
  padding: 12px 28px;
  letter-spacing: 0.02em;
}
.btn.primary:hover { background: #ff5247; }
.btn.primary:disabled { background: #5a2a28; border-color: #5a2a28; color: #b9a09e; cursor: not-allowed; }
.btn.icon { padding: 8px 12px; }
.btn.sm { padding: 7px 12px; font-size: 13px; }

/* 참가자 고르기: 화면을 꽉 채우고 뒤로 섬이 보인다 */
.screen { position: fixed; inset: 0; overflow-y: auto; background: var(--bg); }
#setup {
  background: linear-gradient(90deg, rgba(8, 11, 18, 0.92) 0%, rgba(8, 11, 18, 0.72) 30%, rgba(8, 11, 18, 0.25) 62%, rgba(8, 11, 18, 0.55) 100%);
  display: grid; grid-template-columns: minmax(330px, 30vw) 1fr;
  overflow: hidden;
}
.menu-side { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(28px, 5vh, 64px) clamp(24px, 3vw, 56px); min-height: 0; }
.hero { animation: slideIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.kicker { font-family: var(--font-title); letter-spacing: 0.18em; color: var(--red); margin: 0 0 8px; font-size: 15px; }
.hero h1 {
  font-family: 'Black Han Sans', sans-serif; font-weight: 400;
  font-size: clamp(52px, 6.4vw, 118px); line-height: 0.98; margin: 0;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
}
.hero .sub { color: #c9ced8; max-width: 440px; line-height: 1.65; margin: 18px 0 0; font-size: clamp(15px, 1.05vw, 17px); }
.menu-controls { display: flex; flex-direction: column; gap: 12px; animation: slideIn 0.6s 0.12s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.menu-controls .count { display: flex; align-items: baseline; gap: 6px; }
.menu-controls .count b { font-family: var(--font-title); font-size: 56px; font-weight: 400; color: var(--red); line-height: 1; display: inline-block; }
.menu-controls #startBtn { font-size: 26px; padding: 16px 28px; width: 100%; }
.group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rand input {
  width: 58px; padding: 9px 8px; border-radius: 6px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06);
  font-family: var(--font-mono); text-align: center;
}
.rand span { color: var(--muted); font-size: 14px; }
.menu-cards { min-height: 0; overflow-y: auto; padding: clamp(20px, 4vh, 48px) clamp(20px, 3vw, 48px) clamp(20px, 4vh, 48px) 8px; display: flex; align-items: flex-end; }
.cards {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(80px, 6.4vw, 128px), 1fr));
  max-width: min(100%, 1100px);
  margin-left: auto;
  gap: clamp(8px, 0.8vw, 14px);
}
.card {
  position: relative;
  border: 2px solid transparent;
  background: rgba(21, 27, 39, 0.78);
  border-radius: 10px;
  padding: 6px 6px 8px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.14s cubic-bezier(0.3, 1.6, 0.5, 1), border-color 0.12s, opacity 0.12s, box-shadow 0.14s;
  user-select: none;
  animation: cardIn 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; background: #222a38; }
.card .nm { display: block; margin-top: 6px; font-size: clamp(11px, 0.8vw, 14px); font-weight: 600; line-height: 1.3; }
.card .no { position: absolute; top: 12px; left: 12px; font-family: var(--font-mono); font-size: 11px; background: rgba(0, 0, 0, 0.55); padding: 1px 5px; border-radius: 3px; }
.card.on { border-color: var(--red); }
.card.on::after {
  content: ''; position: absolute; top: 10px; right: 10px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.4);
}
.card:not(.on) { opacity: 0.45; }
.card:not(.on) img { filter: grayscale(1); }
.card:hover { transform: translateY(-4px) scale(1.03); opacity: 1; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); }
.card:active { transform: scale(0.95); }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(0.92); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-24px); } }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button { display: block; padding: 9px 12px; font-size: 14px; border: 0; background: transparent; cursor: pointer; }
.seg button.on { background: var(--text); color: var(--bg); font-weight: 600; }
.seg.small button { padding: 7px 11px; font-size: 13px; }

/* 버튼 누름 반응, 숫자 튀기, 장면 전환 */
.btn { transition: background 0.15s, border-color 0.15s, transform 0.1s; }
.btn:active:not(:disabled), .seg button:active { transform: scale(0.95); }
.btn.primary:not(:disabled):hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(255, 59, 48, 0.35); }
.bump { animation: bump 0.35s cubic-bezier(0.3, 1.8, 0.5, 1); }
@keyframes bump { 40% { transform: scale(1.35); } }
.fade { position: fixed; inset: 0; background: #06080d; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; z-index: 40; }
.fade.on { opacity: 1; pointer-events: auto; }
body.rotating #stage { cursor: grabbing; }

/* 이름표와 떠오르는 숫자 */
.label {
  position: absolute; left: 0; top: 0;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transform-origin: 50% 100%;
  white-space: nowrap;
}
.label .lname {
  font-family: 'S-Core Dream', sans-serif; font-weight: 600; font-size: 13px;
  padding: 2px 7px; border-radius: 4px;
  background: rgba(10, 12, 18, 0.72);
  color: #fff;
}
.label .lbar { position: relative; width: 58px; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.6); overflow: hidden; }
.label .hp { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: var(--green); transition: width 0.15s; }
.label .ar { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--blue); }
.label.low .hp { background: var(--red); }
.label .lwep { font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px #000; min-height: 0; }
.label .lwep:empty { display: none; }
.label .lwep[data-w="sword"], .label .lwep[data-w="crossbow"] { color: #d9a8ff; }
.label .lwep[data-w="spear"] { color: #8fbaff; }
.label .lwep[data-w="dagger"], .label .lwep[data-w="bow"] { color: #8fe39f; }
.label.focus .lname { background: var(--gold); color: #1b1405; }
.label.dead { opacity: 0.5; }
.label.dead .lname { text-decoration: line-through; }

.pop {
  position: absolute; left: 0; top: 0;
  font-family: var(--font-title); font-size: 22px; color: #fff;
  text-shadow: 0 2px 0 #000, 0 0 6px rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}
.pop.crit { color: var(--gold); font-size: 30px; }
.pop.miss { font-family: 'S-Core Dream', sans-serif; font-weight: 600; font-size: 13px; color: #cfd3da; }
.pop.heal { color: var(--green); font-family: 'S-Core Dream', sans-serif; font-weight: 700; font-size: 15px; }
.pop.item { color: #9fd0ff; font-family: 'S-Core Dream', sans-serif; font-weight: 700; font-size: 15px; }
.pop.toy { color: #ff8fc8; font-family: 'Black Han Sans', sans-serif; font-size: 26px; }
.pop.zone { color: #8ec5ff; font-family: 'S-Core Dream', sans-serif; font-weight: 700; font-size: 15px; }

/* 경기 화면 */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
/* 경기 화면 위 요소는 기본적으로 클릭을 통과시키고, 누를 것만 받는다 */
#hud > * { pointer-events: none; }
#hud > .controls, #hud > .roster, #hud > .info, #hud > #minimap { pointer-events: auto; }
#hud > #minimap { cursor: pointer; }
.hud-top {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 18px;
}
.alive { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.alive .lab { font-size: 13px; color: var(--muted); }
.alive b { font-family: var(--font-title); font-weight: 400; font-size: 38px; line-height: 1; color: #fff; }
.alive .of { color: var(--muted); font-family: var(--font-mono); font-size: 14px; }
.alive .of i { font-style: normal; }
.zone { display: flex; flex-direction: column; gap: 5px; min-width: 190px; }
.zone span:first-child { font-size: 14px; font-weight: 600; }
.zone.danger span:first-child { color: #8ec5ff; }
.zone.farm span:first-child { color: var(--gold); }
.zone.farm .zbar i { background: var(--gold); }
.zbar { display: block; height: 4px; background: rgba(255, 255, 255, 0.12); border-radius: 2px; overflow: hidden; }
.zbar i { display: block; height: 100%; width: 0; background: var(--blue); }

.roster {
  position: absolute; left: 14px; top: 58px; bottom: 80px;
  width: 132px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; align-content: start;
  overflow-y: auto; scrollbar-width: none;
}
.roster button {
  position: relative; padding: 0; border: 2px solid transparent; border-radius: 6px; overflow: hidden;
  background: #1a2130; cursor: pointer; aspect-ratio: 1;
}
.roster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.roster button.focus { border-color: var(--gold); }
.roster button.dead img { filter: grayscale(1) brightness(0.45); }
.roster button .pl {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  font-family: var(--font-title); font-size: 17px; color: #fff; text-shadow: 0 1px 3px #000;
}
.roster button.dead .pl { display: flex; }
.roster button .k {
  position: absolute; right: 2px; bottom: 2px; font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  background: var(--red); color: #fff; border-radius: 3px; padding: 0 3px; line-height: 14px;
}
.roster button .k:empty { display: none; }

.feed { position: absolute; right: 14px; top: 58px; width: 330px; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; pointer-events: none; }
.kf {
  display: flex; align-items: center; gap: 7px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 9px 4px 4px; font-size: 13px;
  animation: kfIn 0.25s ease-out;
  transition: opacity 0.5s;
}
.kf img { width: 26px; height: 26px; border-radius: 4px; object-fit: cover; }
.kf b { font-weight: 700; }
.kf .w { font-size: 11px; color: var(--muted); padding: 1px 6px; border: 1px solid var(--line); border-radius: 3px; }
.kf .victim { color: #ff8f88; }
.kf.zone .w { color: #8ec5ff; border-color: rgba(90, 168, 255, 0.4); }
.kf.fade { opacity: 0; }
@keyframes kfIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

#minimap {
  position: absolute; right: 14px; bottom: 70px;
  width: 172px; height: auto; aspect-ratio: 146 / 206;
  border-radius: 8px; border: 2px solid rgba(255, 255, 255, 0.25);
  background: #246896; pointer-events: none;
}
.controls {
  position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%);
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px;
}
.controls .seg { border-color: transparent; background: rgba(255, 255, 255, 0.06); }

.countdown {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-title); font-size: min(34vw, 300px); color: #fff; pointer-events: none;
  text-shadow: 0 6px 0 var(--red-deep), 0 0 40px rgba(0, 0, 0, 0.5);
}
.countdown.go { font-family: 'Black Han Sans', sans-serif; color: var(--red); text-shadow: 0 6px 0 #000; font-size: min(20vw, 180px); }
.countdown .pulse { animation: cdPulse 1s ease-out; }
@keyframes cdPulse { from { transform: scale(1.5); opacity: 0; } 25% { opacity: 1; } to { transform: scale(0.9); opacity: 0.2; } }
.banner {
  position: absolute; top: 24%; left: 50%; transform: translateX(-50%);
  font-family: 'Black Han Sans', sans-serif; font-size: clamp(26px, 4.4vw, 54px);
  color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.7);
  pointer-events: none; opacity: 0; white-space: nowrap; transition: opacity 0.35s;
}
.banner.show { opacity: 1; }
.banner.blue { color: #a9d3ff; }
.banner.red { color: var(--red); }

/* 결과 */
#result { z-index: 10; background: rgba(8, 10, 16, 0.86); animation: fadeIn 0.6s; padding-bottom: 110px; }
@keyframes fadeIn { from { opacity: 0; } }
.res-wrap { max-width: 1100px; margin: 0 auto; padding: 40px 24px; display: grid; grid-template-columns: 1fr 1.1fr; gap: 40px; align-items: start; }
.winner { text-align: center; }
.winner h2 { font-family: 'Black Han Sans', sans-serif; font-weight: 400; font-size: clamp(40px, 6vw, 72px); margin: 0; color: var(--gold); }
.winner img { height: min(52vh, 460px); max-width: 100%; object-fit: contain; margin: 14px auto 0; display: block; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.6)); animation: rise 0.9s cubic-bezier(0.2, 0.9, 0.2, 1.2); }
@keyframes rise { from { transform: translateY(40px) scale(0.9); opacity: 0; } }
.wname { font-family: 'S-Core Dream', sans-serif; font-weight: 800; font-size: 34px; margin: 10px 0 2px; }
.wstat { color: var(--muted); margin: 0; font-size: 15px; }
.ranking h3 { font-family: 'S-Core Dream', sans-serif; font-weight: 700; font-size: 18px; margin: 12px 0 12px; color: var(--muted); }
.ranking ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 62vh; overflow-y: auto; }
.ranking li { display: grid; grid-template-columns: 38px 32px 1fr auto; align-items: center; gap: 10px; padding: 5px 10px 5px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.04); font-size: 14px; }
.ranking li:first-child { background: rgba(242, 193, 78, 0.16); }
.ranking .pl { font-family: var(--font-title); font-size: 18px; text-align: center; color: var(--muted); }
.ranking li:first-child .pl { color: var(--gold); }
.ranking img { width: 32px; height: 32px; border-radius: 4px; object-fit: cover; }
.ranking .nm { font-weight: 700; }
.ranking .nm em { font-style: normal; font-weight: 600; font-size: 11px; color: var(--gold); margin-left: 6px; padding: 1px 5px; border: 1px solid rgba(242, 193, 78, 0.4); border-radius: 3px; }
.ranking .why { color: var(--muted); font-size: 12px; display: block; font-weight: 400; margin-top: 1px; }
.ranking .kc { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.res-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 16px 24px calc(16px + env(safe-area-inset-bottom)); background: rgba(8, 10, 16, 0.9); border-top: 1px solid var(--line); }

.loading, .error {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'S-Core Dream', sans-serif; font-weight: 600; font-size: 18px; background: rgba(13, 17, 25, 0.9); z-index: 50;
}
.error { color: #ffb4ae; padding: 24px; text-align: center; line-height: 1.6; }

/* 좁은 화면 */
@media (max-width: 820px) {
  .card .nm { font-size: 12px; }
  .roster {
    display: grid; left: 10px; right: 10px; top: 62px; bottom: auto; width: auto; height: 46px;
    grid-auto-flow: column; grid-auto-columns: 42px; grid-template-columns: none; grid-template-rows: 42px;
    overflow-x: auto; overflow-y: hidden; gap: 4px;
  }
  .feed { width: auto; align-items: flex-start; }
  .feed .kf:nth-child(n+4) { display: none; }
  .hud-top { padding: 6px 12px; gap: 12px; top: 10px; }
  .alive b { font-size: 28px; }
  .zone { min-width: 130px; }
  #minimap { width: 96px; bottom: 112px; right: 10px; }
  .controls { width: calc(100% - 20px); bottom: 10px; }
  .res-wrap { grid-template-columns: 1fr; gap: 16px; padding: 24px 16px; }
  .winner img { height: 34vh; }
  .ranking ol { max-height: none; }
}

/* 방송 화면 요소 */
.lb { position: fixed; left: 0; right: 0; height: 0; background: #000; z-index: 1; pointer-events: none; transition: height 0.35s ease; }
.lb.top { top: 0; }
.lb.bot { bottom: 0; }
body.letterbox .lb { height: 9vh; }
@media (max-width: 820px) {
}

/* 체력: 깎인 만큼 잠깐 남는 막대, 맞으면 이름표가 살짝 튄다 */
.label .lag { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: #ffe7b0; }
.label .hp { z-index: 1; }
.label .ar { z-index: 2; }
.label.hit { animation: labelHit 0.25s ease-out; }
@keyframes labelHit { 30% { translate: 0 -3px; } }
.pop.rank { font-family: 'Black Han Sans', sans-serif; font-size: 30px; color: #fff; text-shadow: 0 3px 0 #b3140c, 0 0 10px rgba(0, 0, 0, 0.6); }
/* 결과: 순위가 차례로 들어온다 */
.ranking li { animation: rowIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }
@keyframes rowIn { from { opacity: 0; transform: translateX(24px); } }
.res-bar { animation: fadeIn 0.4s 0.8s both; }
#aliveN { display: inline-block; }

@media (max-width: 820px) {
  #setup { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow-y: auto; background: rgba(8, 11, 18, 0.78); }
  .menu-side { padding: 22px 16px 10px; gap: 16px; }
  .hero h1 { font-size: 46px; }
  .hero .sub { font-size: 14px; margin-top: 10px; }
  .menu-controls { gap: 8px; }
  .menu-controls .count b { font-size: 38px; }
  .menu-controls #startBtn { font-size: 20px; padding: 12px; position: sticky; bottom: 10px; }
  .menu-cards { padding: 6px 16px 90px; overflow: visible; display: block; }
  .cards { margin-left: 0; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
}

/* 순위 전광판: 체력 줄과 정렬 */
.roster button .rh { position: absolute; left: 3px; right: 3px; bottom: 2px; height: 3px; background: rgba(0, 0, 0, 0.6); border-radius: 2px; overflow: hidden; }
.roster button .rh b { display: block; height: 100%; width: 100%; background: var(--green); transition: width 0.25s; }
.roster button.dead .rh { display: none; }
.roster button .k { bottom: 7px; }
.roster button:hover { transform: scale(1.06); }
/* 캐릭터 정보 창 */
.info {
  position: absolute; left: 156px; top: 58px; width: 290px;
  background: rgba(12, 16, 24, 0.92); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 6px;
  padding: 14px 14px 12px; font-size: 13px;
}
.info.show { animation: infoIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes infoIn { from { opacity: 0; transform: translateX(-14px) scale(0.96); } }
.info .x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 4px; background: rgba(255, 255, 255, 0.08); cursor: pointer; }
.info .x:hover { background: rgba(255, 255, 255, 0.18); }
.info .ih { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.info .ih img { width: 58px; height: 58px; border-radius: 5px; object-fit: cover; }
.info .in { margin: 0; font-family: 'S-Core Dream', sans-serif; font-weight: 800; font-size: 18px; }
.info .it { margin: 3px 0 0; font-weight: 700; color: var(--gold); font-size: 13px; }
.info .it span { display: block; color: var(--muted); font-weight: 400; font-size: 12px; margin-top: 2px; }
.info .ibar { position: relative; height: 16px; background: rgba(0, 0, 0, 0.5); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.info .ibar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green); transition: width 0.25s; }
.info .ibar.ar { height: 10px; }
.info .ibar.ar i { background: var(--blue); }
.info .ibar em { position: relative; font-style: normal; font-size: 11px; font-weight: 700; padding-left: 6px; line-height: 16px; text-shadow: 0 1px 2px #000; }
.info .ibar.ar em { line-height: 10px; font-size: 9px; }
.info dl { display: grid; grid-template-columns: 52px 1fr; gap: 5px 8px; margin: 10px 0 8px; }
.info dt { color: var(--muted); }
.info dd { margin: 0; }
.info dd em { font-style: normal; color: var(--muted); font-family: var(--font-mono); font-size: 11px; }
.info .ok { color: var(--green); }
.info .out { color: #ff8f88; }
.info .ihint { margin: 0; color: var(--muted); font-size: 11px; }
@media (max-width: 820px) { .info { left: 10px; top: 110px; width: calc(100% - 20px); } }

.map-seg { width: 100%; }
.map-seg button { flex: 1; padding: 10px 6px; font-weight: 600; }

/* 좁은 화면: 순위 줄 아래로 카메라 표시와 처치 기록 */
@media (max-width: 820px) {
  .feed { top: 142px; left: 10px; right: auto; }
}

/* 화면 집중: 조작 막대는 쉬면 숨기고, 처치 기록은 작게 */
.controls { transition: opacity 0.4s, transform 0.4s; }
body.idle .controls { opacity: 0; transform: translate(-50%, 12px); }
body.idle #stage { cursor: none; }
.controls .btn.off { color: var(--muted); text-decoration: line-through; }
.kf { font-size: 12px; padding: 3px 8px 3px 3px; }
.kf img { width: 22px; height: 22px; }
.feed { width: auto; }

/* 결과 순위표: 기호로 장비·처치·피해를 한눈에, 1~3위는 금·은·동 */
.ranking li.row, .ranking li.head { grid-template-columns: 38px 34px minmax(0, 1fr) auto 50px 64px; }
.ranking li.head { background: none; padding-top: 0; padding-bottom: 2px; font-size: 11px; color: var(--muted); font-weight: 600; animation: none; }
.ranking li.head .st, .ranking li.head .gh { text-align: right; }
.ranking li.head .gh { text-align: left; }
.ranking li:first-child { background: none; }
.ranking li.row { background: rgba(255, 255, 255, 0.045); }
.ranking .who { min-width: 0; }
.ranking .nm { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking .gear { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-start; }
.gc { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px 2px 5px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; background: rgba(255, 255, 255, 0.08); color: #e8e8ea; }
.gc svg { width: 13px; height: 13px; flex: none; }
.gc.melee svg { color: #ff9a76; }
.gc.gun svg { color: #8fc7ff; }
.gc.armor svg { color: #9fe3a6; }
.gc.armor.lv2 svg { color: #5fd3ff; }
.gc.none { color: var(--muted); background: rgba(255, 255, 255, 0.04); }
.gc.none svg { color: var(--muted); }
.ranking .st { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: #f1f1f3; }
.ranking .st svg { width: 14px; height: 14px; color: var(--muted); }
.ranking .kc svg { color: #ff6b6b; }
.ranking .dm svg { color: #ffb347; }
.ranking li.row .pl { font-size: 17px; }
.ranking li.p1, .ranking li.p2, .ranking li.p3 { color: #1b1408; }
.ranking li.p1 { background: linear-gradient(100deg, #ffe08a, #f2b634 55%, #d99a1b); box-shadow: 0 0 0 1px rgba(255, 230, 150, 0.6) inset, 0 4px 18px rgba(242, 182, 52, 0.25); }
.ranking li.p2 { background: linear-gradient(100deg, #f4f6f8, #c9d0d8 55%, #a9b2bc); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6) inset; }
.ranking li.p3 { background: linear-gradient(100deg, #f1c49a, #cd8a52 55%, #a9683a); box-shadow: 0 0 0 1px rgba(255, 215, 175, 0.5) inset; }
.ranking li.p1 .pl, .ranking li.p2 .pl, .ranking li.p3 .pl { color: #1b1408; font-size: 20px; }
.ranking li.p1 .why, .ranking li.p2 .why, .ranking li.p3 .why { color: rgba(27, 20, 8, 0.72); }
.ranking li.p1 .nm em, .ranking li.p2 .nm em, .ranking li.p3 .nm em { color: #1b1408; border-color: rgba(27, 20, 8, 0.35); }
.ranking li.p1 .st, .ranking li.p2 .st, .ranking li.p3 .st { color: #1b1408; }
.ranking li.p1 .st svg, .ranking li.p2 .st svg, .ranking li.p3 .st svg { color: rgba(27, 20, 8, 0.7); }
.ranking li.p1 .gc, .ranking li.p2 .gc, .ranking li.p3 .gc { background: rgba(255, 255, 255, 0.55); color: #1b1408; }
.ranking li.p1 .gc svg, .ranking li.p2 .gc svg, .ranking li.p3 .gc svg { color: #3a2a10; }
.ranking li.p1 img, .ranking li.p2 img, .ranking li.p3 img { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8); }
.wgear { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 8px 0 0; }
.wgear .gc { font-size: 13px; padding: 4px 10px 4px 7px; }
.wgear .gc svg { width: 15px; height: 15px; }
@media (max-width: 640px) {
  .ranking li.row, .ranking li.head { grid-template-columns: 30px 30px minmax(0, 1fr) 42px 54px; row-gap: 4px; }
  .ranking li.row .gear { grid-column: 3 / -1; grid-row: 2; }
  .ranking li.head .gh { display: none; }
  .ranking li.row .kc { grid-column: 4; grid-row: 1; }
  .ranking li.row .dm { grid-column: 5; grid-row: 1; }
}
.info .ifollow { width: 100%; margin-top: 10px; }
.ranking .why { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ranking .why .tr { font-style: normal; font-weight: 600; font-size: 10.5px; color: var(--gold); margin-right: 5px; padding: 0 4px; border: 1px solid rgba(242, 193, 78, 0.4); border-radius: 3px; }
.ranking li.p1 .why .tr, .ranking li.p2 .why .tr, .ranking li.p3 .why .tr { color: #1b1408; border-color: rgba(27, 20, 8, 0.35); }
/* 순위표 쪽을 넓게, 순위표가 좁으면(560px 아래) 장비를 이름 아래 줄로 */
@media (min-width: 821px) { .res-wrap { max-width: 1240px; grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.6fr); } }
.ranking { container-type: inline-size; min-width: 0; }
@container (max-width: 560px) {
  .ranking li.row, .ranking li.head { grid-template-columns: 30px 30px minmax(0, 1fr) 42px 54px; row-gap: 4px; }
  .ranking li.row .gear { grid-column: 3 / -1; grid-row: 2; }
  .ranking li.head .gh { display: none; }
  .ranking li.row .kc { grid-column: 4; grid-row: 1; }
  .ranking li.row .dm { grid-column: 5; grid-row: 1; }
}

/* ---------- 궁극기 컷인: 시간이 멈추고 캐릭터·이름·한 줄 설명이 박힌다 ---------- */
.ultcut { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; --uc: #ffd23a; --ug: #ffffff; }
.ultcut[hidden] { display: none; }
.uc-motif { position: absolute; inset: 0; width: 100%; height: 100%; }
.uc-dim { position: absolute; inset: 0; background: radial-gradient(ellipse at 60% 50%, rgba(0,0,0,0) 20%, rgba(0,0,0,0.72) 80%); animation: ucDim 3.8s ease both; }
.uc-band { position: absolute; left: -10%; right: -10%; top: 30%; height: 40%; transform: skewY(-7deg); overflow: hidden;
  background: linear-gradient(90deg, rgba(0,0,0,0.78) 0%, color-mix(in srgb, var(--uc) 60%, transparent) 40%, color-mix(in srgb, var(--uc) 75%, transparent) 72%, color-mix(in srgb, var(--ug) 55%, transparent) 100%);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ug) 80%, transparent), 0 0 60px var(--uc);
  animation: ucBand 3.8s cubic-bezier(.2,.9,.2,1) both; }
.uc-lines { position: absolute; inset: -50% 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,0) 0 38px, rgba(255,255,255,0.28) 38px 42px, rgba(255,255,255,0) 42px 90px);
  animation: ucLines 0.35s linear infinite; mix-blend-mode: overlay; }
.uc-img { position: absolute; right: 6%; bottom: 0; height: 92%; max-width: 48%; object-fit: contain; object-position: bottom;
  filter: drop-shadow(0 0 18px var(--uc)) drop-shadow(0 0 42px var(--ug)); animation: ucImg 3.8s cubic-bezier(.15,.9,.25,1) both; }
.uc-text { position: absolute; left: 6%; top: 50%; transform: translateY(-50%) skewY(-7deg); max-width: 52%; }
.uc-kicker { margin: 0 0 6px; font: 700 clamp(12px, 1.5vw, 18px) 'Space Mono', monospace; letter-spacing: 0.5em; color: var(--ug); text-shadow: 0 0 12px var(--uc); animation: ucFade 3.8s ease both; }
.uc-name { margin: 0; font-family: 'Black Han Sans', sans-serif; font-weight: 400; font-size: clamp(40px, 7.4vw, 118px); line-height: 1.02; color: #fff; word-break: keep-all;
  -webkit-text-stroke: 2px color-mix(in srgb, var(--uc) 70%, black); text-shadow: 0 6px 0 rgba(0,0,0,0.55), 0 0 26px var(--uc), 0 0 60px var(--uc); animation: ucName 3.8s cubic-bezier(.2,1.4,.3,1) both; }
.uc-desc { margin: 14px 0 0; font-size: clamp(15px, 1.75vw, 26px); font-weight: 800; color: #fff; word-break: keep-all; text-shadow: 0 2px 10px rgba(0,0,0,0.9); animation: ucDesc 3.8s ease both; }
.uc-who { margin: 10px 0 0; font-size: clamp(13px, 1.3vw, 18px); font-weight: 700; color: var(--ug); letter-spacing: 0.12em; text-shadow: 0 0 10px var(--uc); animation: ucDesc 3.8s ease both; }
.uc-flash { position: absolute; inset: 0; background: #fff; animation: ucFlash 3.8s ease-out both; mix-blend-mode: screen; }
@keyframes ucDim { 0% { opacity: 0 } 8% { opacity: 1 } 86% { opacity: 1 } 100% { opacity: 0 } }
@keyframes ucBand { 0% { clip-path: inset(0 100% 0 0); } 12% { clip-path: inset(0 0 0 0); } 84% { clip-path: inset(0 0 0 0); opacity: 1 } 100% { clip-path: inset(48% 0 48% 0); opacity: 0 } }
@keyframes ucLines { from { transform: translateX(0) } to { transform: translateX(-90px) } }
@keyframes ucImg { 0%, 5% { transform: translateX(60%) scale(1.25); opacity: 0 } 20% { transform: translateX(0) scale(1.04); opacity: 1 } 84% { transform: translateX(-3%) scale(1); opacity: 1 } 100% { transform: translateX(-12%) scale(1); opacity: 0 } }
@keyframes ucName { 0%, 11% { transform: scale(2.2); opacity: 0; filter: blur(8px) } 21% { transform: scale(0.96); opacity: 1; filter: blur(0) } 25% { transform: scale(1) } 84% { opacity: 1 } 100% { transform: scale(1.06); opacity: 0 } }
@keyframes ucDesc { 0%, 22% { transform: translateX(-24px); opacity: 0 } 32% { transform: translateX(0); opacity: 1 } 84% { opacity: 1 } 100% { opacity: 0 } }
@keyframes ucFade { 0%, 8% { opacity: 0 } 16% { opacity: 1 } 84% { opacity: 1 } 100% { opacity: 0 } }
@keyframes ucFlash { 0% { opacity: 0.95 } 7% { opacity: 0 } 100% { opacity: 0 } }
@media (max-width: 720px) {
  .uc-img { right: -4%; height: 70%; max-width: 70%; opacity: 0.9; }
  .uc-text { left: 5%; max-width: 88%; top: 56%; }
}
/* 궁극기 효과가 이어지는 동안 위쪽 이름표 */
.ultchip { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: 999px;
  background: rgba(10, 12, 18, 0.78); border: 1.5px solid var(--uc, #ffd23a); box-shadow: 0 0 18px var(--uc, #ffd23a); font-weight: 800; font-size: 13px; white-space: nowrap; animation: chipIn 0.4s cubic-bezier(.2,1.4,.3,1) both; }
.ultchip[hidden] { display: none; }
.ultchip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.ultchip em { font-style: normal; color: var(--uc, #ffd23a); font-family: 'Black Han Sans', sans-serif; font-weight: 400; font-size: 15px; letter-spacing: 0.02em; }
@keyframes chipIn { from { transform: translate(-50%, -10px) scale(0.8); opacity: 0 } to { transform: translate(-50%, 0) scale(1); opacity: 1 } }
.kf .w em.ult { font-style: normal; color: #ffd23a; font-weight: 800; }

/* 결과 순위: 눌러서 왼쪽 카드로 보기 */
.ranking li.row { cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
.ranking li.row:hover { transform: translateX(-3px); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35) inset; }
.ranking li.row:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.ranking li.row.sel { box-shadow: 0 0 0 2px #fff inset, 0 0 18px rgba(255, 255, 255, 0.25); }
.winner.lost .kicker { color: #c9ccd6; }
.winner.lost h2 { font-size: clamp(24px, 3.4vw, 40px); color: #e8e9ee; }
.winner.lost #winImg { filter: grayscale(0.35) drop-shadow(0 18px 24px rgba(0, 0, 0, 0.6)); }
.winner.swap #winImg { animation: cardSwap 0.45s cubic-bezier(.2,1.2,.3,1) both; }
.winner.swap .wname, .winner.swap h2 { animation: cardText 0.4s ease both; }
@keyframes cardSwap { from { transform: translateY(20px) scale(0.94); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes cardText { from { transform: translateY(6px); opacity: 0 } to { transform: none; opacity: 1 } }
.wult { display: inline-flex; align-items: center; gap: 8px; margin: 10px auto 0; padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--uc, #ffd23a); box-shadow: 0 0 14px var(--uc, #ffd23a); background: rgba(0, 0, 0, 0.35); }
.wult[hidden] { display: none; }
.wult span { font-size: 12px; color: #c9ccd6; font-weight: 700; }
.wult b { font-family: 'Black Han Sans', sans-serif; font-weight: 400; font-size: 17px; color: var(--uc, #ffd23a); }
.whint { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

/* 포션을 가진 캐릭터만 체력바 위에 포션 병 */
.label .lpot { display: flex; gap: 2px; justify-content: center; height: 14px; margin-bottom: 1px; }
.label .lpot:empty { display: none; }
.label .lpot .pot { width: 10px; height: 14px; display: block; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 14'%3E%3Crect x='3.3' y='0.5' width='3.4' height='3' rx='0.6' fill='%23c9a26a'/%3E%3Cpath d='M3.6 3.4h2.8v1.8l2.6 3.4a3.6 3.6 0 1 1-8 0l2.6-3.4z' fill='%23ff4d7a' stroke='%23fff' stroke-width='0.9'/%3E%3Ccircle cx='3.6' cy='9.6' r='0.9' fill='%23ffd0dc'/%3E%3C/svg%3E"); filter: drop-shadow(0 0 3px rgba(255, 77, 122, 0.8)); }

/* 도움말 말풍선 */
.tipbox { position: fixed; left: 0; top: 0; z-index: 60; max-width: 260px; padding: 10px 12px; border-radius: 10px; background: rgba(14, 16, 24, 0.96); border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); color: #eef0f4; font-size: 13px; line-height: 1.45; pointer-events: none; word-break: keep-all; }
.tipbox[hidden] { display: none; }
.tipbox b { display: block; font-size: 15px; }
.tipbox em { display: block; font-style: normal; font-size: 11.5px; color: #ffd23a; margin: 1px 0 6px; }
.tipbox p { margin: 4px 0 6px; color: #c9ccd6; }
.tipbox .tg { display: grid; grid-template-columns: auto auto; gap: 3px 14px; }
.tipbox .tk { color: #9aa0ad; }
.tipbox .tv { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.tag, [data-tip] { cursor: help; }
.info .it .tag, .ranking .why .tag { text-decoration: underline dotted rgba(255, 210, 58, 0.7); text-underline-offset: 3px; font-style: normal; }
.info .it .tag { color: var(--gold); font-weight: 700; margin-right: 6px; }
.info dd .tag { border-bottom: 1px dotted rgba(255, 255, 255, 0.45); }
/* 1) 자기장이 줄어들 때: 눈에 잘 띄는 주황빨강 */
.zone.danger span:first-child { color: #ff6a3a; font-weight: 800; text-shadow: 0 0 10px rgba(255, 90, 40, 0.7), 0 1px 0 rgba(0, 0, 0, 0.6); animation: zonePulse 0.9s ease-in-out infinite alternate; }
.zone.danger .zbar i { background: linear-gradient(90deg, #ff3a2a, #ffb03a) !important; box-shadow: 0 0 10px rgba(255, 80, 40, 0.8); }
@keyframes zonePulse { from { opacity: 0.8 } to { opacity: 1; } }
.banner.zone { color: #ff5a3a; -webkit-text-stroke: 1px rgba(60, 0, 0, 0.6); text-shadow: 0 0 18px rgba(255, 60, 40, 0.85), 0 3px 0 rgba(0, 0, 0, 0.55); }
/* 멀티동욱 클론 이름표 */
.label.clone .lname { color: #9fc8ff; font-size: 11px; }
.label.clone .lbar { width: 40px; height: 4px; }
.label.clone .hp { background: #6fa8ff; }
.uc-img.wide { max-width: 64%; right: 2%; }
/* 검은 깜빡임 방지: 킬 로그 줄이 두 개 이상 동시에 애니메이션되면, Intel UHD 에서 합성기가
   그 반투명 배경을 화면 전체에 잘못 칠해 화면이 한순간 어두워진다(tools/flicker-probe.mjs 로 재현·확인).
   킬 로그는 애니메이션 없이 바로 나타나고 바로 사라진다. */
.kf, .kf.fade { animation: none; transition: none; }
.tipbox .habit { margin: 4px 0 0; padding-left: 16px; }
.tipbox .habit li { margin: 3px 0; color: #e7e9ef; }

/* ===== 15차: 팀 방식·명예의 전당 ===== */
.team-seg button { font-size: 13px; }
.hof-open { width: 100%; margin-top: 8px; }
.hofbox { position: fixed; inset: 0; z-index: 55; background: rgba(6, 8, 13, 0.82); display: grid; place-items: center; padding: 16px; }
.hofbox[hidden] { display: none; }
.hof-in { width: min(760px, 100%); max-height: min(86vh, 900px); display: flex; flex-direction: column; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.hof-in header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.hof-in h2 { margin: 0; font-family: 'Black Han Sans', sans-serif; font-size: 26px; letter-spacing: 0.02em; }
.hof-in .x { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; }
#hofBody { overflow-y: auto; padding: 8px 20px 12px; }
.hof-in footer { padding: 10px 20px; border-top: 1px solid var(--line); text-align: right; }
.hof-sum { color: var(--muted); margin: 6px 0 10px; }
.hof-sum b { color: var(--text); }
.hof-empty { color: var(--muted); padding: 30px 0; text-align: center; word-break: keep-all; }
.hof-list { list-style: none; margin: 0; padding: 0; }
.hof-list li { display: grid; grid-template-columns: 28px 34px 1fr repeat(6, auto); align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; }
.hof-list li:nth-child(odd) { background: rgba(255, 255, 255, 0.03); }
.hof-list li.m1 { background: rgba(242, 193, 78, 0.16); }
.hof-list li.m2 { background: rgba(200, 208, 220, 0.12); }
.hof-list li.m3 { background: rgba(205, 127, 50, 0.13); }
.hof-list img { width: 34px; height: 34px; border-radius: 6px; object-fit: cover; }
.hof-list .hr { font-family: var(--font-mono); color: var(--muted); text-align: right; }
.hof-list .hn { font-weight: 700; }
.hof-list .hs { font-variant-numeric: tabular-nums; text-align: right; min-width: 44px; font-size: 14px; }
.hof-list .hs i { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); }
.hof-list .hs b { color: var(--gold); font-size: 16px; }
@media (max-width: 640px) { .hof-list li { grid-template-columns: 22px 30px 1fr auto auto; } .hof-list .hs:nth-of-type(n+3) { display: none; } }

/* ===== ESC 메뉴(열린 동안 경기가 멈춘다) ===== */
.pause { position: fixed; inset: 0; z-index: 58; background: rgba(6, 8, 13, 0.62); display: grid; place-items: center; padding: 16px; }
.pause[hidden] { display: none; }
.pz { width: min(420px, 100%); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 12px; padding: 22px 22px 18px; }
.pz .kicker { margin: 0; color: var(--gold); font-size: 12px; letter-spacing: 0.16em; font-weight: 700; }
.pz h2 { margin: 2px 0 16px; font-family: 'Black Han Sans', sans-serif; font-size: 30px; }
.prow { display: grid; grid-template-columns: 76px 1fr 36px; align-items: center; gap: 10px; margin: 12px 0; }
.prow > span { color: var(--muted); font-size: 14px; }
.prow input[type=range] { width: 100%; accent-color: var(--gold); }
.prow b { font-variant-numeric: tabular-nums; text-align: right; font-size: 14px; }
.prow .seg { grid-column: 2 / 4; justify-self: start; }
.prow.chk { grid-template-columns: 76px auto 1fr; }
.prow.chk input { width: 18px; height: 18px; accent-color: var(--gold); }
.prow.chk em { font-style: normal; color: var(--muted); font-size: 12.5px; word-break: keep-all; }
.pbtn { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.pbtn .btn.primary { flex: 1 1 100%; }
.pbtn .btn.ghost { flex: 1 1 0; }
kbd { font-family: var(--font-mono); font-size: 0.78em; padding: 0 5px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 4px; margin-left: 4px; opacity: 0.8; }

/* ===== 최후의 결투 카드 ===== */
.duel { position: absolute; top: 84px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; padding: 8px 14px; border-radius: 10px; background: var(--panel); border: 1px solid rgba(255, 90, 70, 0.45); pointer-events: none; }
.duel[hidden] { display: none; }
.duel .dk { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); margin: 0; font-size: 10px; font-weight: 800; letter-spacing: 0.2em; color: #fff; background: var(--red); padding: 1px 8px; border-radius: 3px; }
.duel .ds { display: grid; grid-auto-flow: column; align-items: center; gap: 4px; min-width: 150px; }
.duel .ds.r { justify-items: end; }
.duel .ds img { width: 36px; height: 36px; border-radius: 6px; object-fit: cover; grid-row: 1; }
.duel .ds img.dead { filter: grayscale(1) brightness(0.45); }
.duel .dn { grid-row: 2; grid-column: 1 / -1; font-weight: 800; font-size: 14px; white-space: nowrap; }
.duel .ds.r .dn { text-align: right; }
.duel .dh { grid-row: 3; grid-column: 1 / -1; width: 150px; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.6); overflow: hidden; }
.duel .dh i { display: block; height: 100%; width: 100%; background: var(--green); }
.duel .ds.r .dh i { margin-left: auto; }
.duel .vs { font-family: 'Black Han Sans', sans-serif; font-size: 26px; color: var(--red); text-shadow: 0 2px 0 #000; }
@media (max-width: 720px) { .duel { top: 110px; transform: translateX(-50%) scale(0.82); } }

/* ===== 안내 배너 ===== */
.banner.count { color: #fff; }
.banner.omen { color: #c8b0ff; text-shadow: 0 0 20px rgba(140, 90, 255, 0.85), 0 3px 0 rgba(0, 0, 0, 0.6); font-size: clamp(20px, 3vw, 38px); }
.banner.drop { color: #ff7a5a; }
.banner.gold { color: var(--gold); text-shadow: 0 0 18px rgba(255, 200, 60, 0.7), 0 3px 0 rgba(0, 0, 0, 0.6); }

/* ===== 이름표: 수류탄·팀 색 ===== */
.label .lpot .nade { width: 11px; height: 14px; display: block; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 11 14'%3E%3Crect x='3.6' y='0.6' width='3.8' height='2.4' rx='0.5' fill='%239aa0a8'/%3E%3Cpath d='M7.3 1.2c1.6 0 2.6.9 2.6 2.2' stroke='%23c9ced6' stroke-width='0.9' fill='none'/%3E%3Cellipse cx='5.5' cy='8.6' rx='4.4' ry='4.9' fill='%23556b3a' stroke='%23fff' stroke-width='0.9'/%3E%3Cpath d='M1.4 8.6h8.2M5.5 4v9.2' stroke='%23364523' stroke-width='0.8'/%3E%3C/svg%3E"); filter: drop-shadow(0 0 3px rgba(160, 210, 120, 0.8)); }
.label.team .lname { border-bottom: 2px solid var(--tc); padding-bottom: 1px; }
.label.team .lbar { box-shadow: 0 0 0 1px var(--tc); }

/* ===== 팀 색: 순위판·정보 창·결과 ===== */
.roster button.team { box-shadow: inset 0 -3px 0 var(--tc); }
.info .tb { display: inline-block; font-size: 11px; font-weight: 800; padding: 0 6px; border-radius: 3px; background: var(--tc); color: #111; vertical-align: 2px; }
.ranking li.row.team .pl { color: var(--tc); }

/* ===== 최고의 플레이 ===== */
.potg { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.potg[hidden] { display: none; }
.potg .pg-bar { position: absolute; left: 0; bottom: 9vh; padding: 14px 34px 14px 26px; background: linear-gradient(90deg, rgba(10, 12, 18, 0.9) 70%, rgba(10, 12, 18, 0)); border-left: 5px solid var(--gold); }
.potg .pg-k { margin: 0; font-size: 13px; font-weight: 800; letter-spacing: 0.22em; color: var(--gold); }
.potg .pg-n { margin: 2px 0 0; font-family: 'Black Han Sans', sans-serif; font-size: clamp(28px, 4vw, 52px); color: #fff; line-height: 1.05; }
.potg .pg-d { margin: 4px 0 0; color: #d6d9e0; font-size: 15px; }
.potg #potgSkip { position: absolute; right: 18px; bottom: 9vh; pointer-events: auto; }

/* 스페이스로 멈췄을 때: 배경 없이 작은 글자 하나 */
.pausetag { position: fixed; left: 50%; top: 44%; transform: translateX(-50%); z-index: 45; pointer-events: none; font-weight: 800; font-size: 15px; letter-spacing: 0.2em; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 0, 0, 0.5); }
.pausetag[hidden] { display: none; }

/* ===== 18차: 결과 화면을 창 전체로(참가자 목록만 스크롤) ===== */
#result { display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; padding-bottom: 0; }
#result .res-wrap { max-width: none; width: 100%; height: 100%; min-height: 0; margin: 0; padding: clamp(18px, 3.5vh, 44px) clamp(18px, 4vw, 72px) 12px; grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr); gap: clamp(20px, 3vw, 56px); align-items: stretch; }
#result .winner { display: flex; flex-direction: column; justify-content: safe center; align-items: center; min-height: 0; overflow: hidden; }
/* 세로가 모자라면 그림이 먼저 줄어든다(위 글자가 잘리지 않게) */
#result .winner img { height: min(50vh, 520px); flex: 0 1 auto; min-height: 0; }
#result .winner > :not(img) { flex: 0 0 auto; }
#result .ranking { display: flex; flex-direction: column; min-height: 0; }
#result .ranking ol { flex: 1 1 auto; max-height: none; min-height: 0; overflow-y: auto; padding-right: 4px; }
#result .res-bar { position: static; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 24px calc(14px + env(safe-area-inset-bottom)); }
.rb-main, .rb-sub { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.rb-main .btn { min-width: 170px; font-size: 16px; padding: 12px 22px; }
.rb-sub .btn { font-size: 13px; padding: 6px 14px; opacity: 0.85; }
/* 타이틀 메뉴: 새 판과 헷갈리지 않게 파란 계열 */
.btn.title { background: #1f4f8f; border: 1px solid #3f7fd0; color: #fff; font-weight: 700; }
.btn.title:hover { background: #2a62ad; }
@media (max-width: 820px) {
  #result .res-wrap { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); padding: 14px 14px 8px; gap: 10px; }
  #result .winner img { height: 22vh; }
  #result .winner h2 { font-size: 34px; }
  .rb-main .btn { min-width: 0; flex: 1 1 30%; font-size: 14px; padding: 10px 8px; }
}

/* 순위판: 킬 수는 빼고 등수만 */
.roster button .k { display: none; }

/* 무기 등급 색 */
.rar-e { color: #c58bff; }
.rar-l { color: #ffcf4a; }

/* ===== 첫 방문 가이드 ===== */
.guide-open { background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 2px 0; align-self: center; }
.guide { position: fixed; inset: 0; z-index: 70; background: rgba(6, 8, 13, 0.8); display: grid; place-items: center; padding: 16px; }
.guide[hidden] { display: none; }
.gd-in { position: relative; width: min(560px, 100%); min-height: 380px; display: flex; flex-direction: column; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; padding: 26px 28px 20px; }
.gd-in .x { position: absolute; top: 12px; right: 14px; background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; }
.gd-page { flex: 1; }
.gd-page[hidden] { display: none; }
.gd-k { margin: 0; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; }
.gd-page h2 { margin: 4px 0 12px; font-family: 'Black Han Sans', sans-serif; font-weight: 400; font-size: 30px; }
.gd-page p { color: #d6d9e0; line-height: 1.65; margin: 0 0 12px; word-break: keep-all; }
.gd-flow, .gd-list, .gd-traits { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.gd-flow { counter-reset: s; }
.gd-flow li, .gd-list li { background: rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 9px 12px; color: #d6d9e0; word-break: keep-all; line-height: 1.5; }
.gd-flow li b, .gd-list li b { color: #fff; margin-right: 6px; }
.gd-keys { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0; align-items: center; }
.gd-keys dt { text-align: right; color: #fff; font-weight: 700; white-space: nowrap; }
.gd-keys dd { margin: 0; color: #d6d9e0; }
.gd-keys kbd { margin-left: 0; }
.gd-traits { grid-template-columns: 1fr 1fr; gap: 6px; }
.gd-traits li { background: rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 7px 10px; font-size: 13px; color: #c9ccd6; word-break: keep-all; }
.gd-traits li b { display: block; color: var(--gold); font-size: 14px; }
.gd-nav { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.gd-dots { flex: 1; display: flex; gap: 6px; }
.gd-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, 0.25); }
.gd-dots i.on { background: var(--gold); }
.gd-nav .btn { font-size: 15px; padding: 9px 22px; min-width: 96px; }
.gd-credit { margin: 14px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; word-break: keep-all; }
.gd-credit a { color: inherit; }
@media (max-width: 520px) { .gd-traits { grid-template-columns: 1fr; } .gd-in { padding: 22px 18px 16px; } }
.pop.rar-e { color: #d7a8ff; text-shadow: 0 0 10px rgba(180, 92, 255, 0.9), 0 1px 2px #000; font-weight: 800; }
.pop.rar-l { color: #ffd766; text-shadow: 0 0 12px rgba(255, 190, 40, 0.95), 0 1px 2px #000; font-weight: 800; }
.gc.rar-e { color: #d7a8ff; border-color: rgba(180, 92, 255, 0.6); }
.gc.rar-l { color: #ffd766; border-color: rgba(255, 197, 58, 0.7); }
.tipbox b.rar-e { color: #d7a8ff; }
.tipbox b.rar-l { color: #ffd766; }
