:root {
  --bg: #fffbe9;
  /* 브루탈리즘 밝은 크림 배경 */
  --panel: #ffffff;
  /* 화이트 패널 */
  --panel-2: #fff4d5;
  /* 노란빛 포인트 패널 */
  --line: #000000;
  /* 100% 두꺼운 검은 테두리 */
  --txt: #000000;
  /* 100% 다크 텍스트 */
  --muted: #7e7c7c;
  --cyan: #5ce1e6;
  /* 네오 비비드 민트/시안 */
  --magenta: #ff66c4;
  /* 네오 비비드 핑크 */
  --gold: #ffde59;
  /* 네오 옐로우 */
  --blue: #38b6ff;
  --red: #ff5757;

  --neo-border: 3px solid #000000;
  --neo-shadow: 4px 4px 0px #000000;
  --neo-shadow-lg: 6px 6px 0px #000000;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior-y: none;
  background: var(--bg);
  color: var(--txt);
  font-family: "Chakra Petch", "Noto Sans KR", sans-serif;
  font-weight: 600;
}

a {
  color: #000000;
  text-decoration: underline;
  font-weight: bold;
}

#app {
  position: fixed;
  inset: 0;
}

canvas {
  display: block;
}

/* ---------- shared ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  transition: opacity 0.3s ease;
}

.hidden {
  opacity: 0;
  pointer-events: none;
}

.display {
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.06em;
  font-weight: 900;
  text-shadow: 2px 2px 0px #000;
}

.btn {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  letter-spacing: 0.05em;
  border: var(--neo-border);
  background: #ffffff;
  color: #000000;
  padding: 14px 26px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  text-transform: uppercase;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--neo-shadow);
}

.btn:hover {
  background: var(--cyan);
  color: #000000;
  transform: translate(-2px, -2px);
  box-shadow: var(--neo-shadow-lg);
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px #000000;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #e0e0e0;
  transform: none;
  box-shadow: 2px 2px 0px #000000;
}

.btn.primary {
  background: var(--magenta);
  color: #000000;
  border: var(--neo-border);
}

.btn.primary:not(:disabled):hover {
  background: var(--gold);
  color: #000000;
}

.btn.gold {
  background: var(--gold);
  color: #000000;
  border: var(--neo-border);
}

.btn.gold:hover {
  background: var(--cyan);
  color: #000000;
}

/* ---------- backdrop grid ---------- */
.arena-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% -10%,
      rgba(47, 125, 255, 0.18),
      transparent 55%),
    radial-gradient(120% 90% at 50% 110%,
      rgba(255, 47, 158, 0.14),
      transparent 55%),
    linear-gradient(180deg, #090b16 0%, #06070e 100%);
  z-index: -1;
}

.arena-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(80, 110, 190, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 110, 190, 0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 75%);
}

/* ================= SELECT SCREEN ================= */
#select {
  padding: 0;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 34px;
  border-bottom: var(--neo-border);
  background: var(--panel);
  box-shadow: 0 4px 0px #000;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 12px;
  max-width: 150px;
}

.logo b {
  font-family: "Orbitron";
  font-weight: 900;
  font-size: 26px;
  letter-spacing: 0.12em;
  color: #000000;
  text-shadow: 2px 2px 0px var(--gold);
}

.logo span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.3em;
  font-family: "Orbitron";
  font-weight: 800;
}

.stage-tag {
  font-family: "Orbitron";
  font-size: 12px;
  font-weight: 800;
  color: #000;
  letter-spacing: 0.15em;
  border: var(--neo-border);
  background: var(--gold);
  padding: 8px 16px;
  border-radius: 6px;
  box-shadow: 3px 3px 0px #000;
}

.select-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 400px;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.roster-wrap {
  padding: 26px 34px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  min-height: 0;
}

.roster-title {
  font-family: "Orbitron";
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: #000;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.roster-title::after {
  content: "";
  flex: 1;
  height: 3px;
  background: #000;
}

.roster {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  width: 100%;
}

.card {
  position: relative;
  border: var(--neo-border);
  border-radius: 12px;
  cursor: pointer;
  background: #ffffff;
  overflow: hidden;
  height: 160px;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  touch-action: pan-y;
  box-shadow: var(--neo-shadow);
}

.card:hover {
  transform: translate(-3px, -3px);
  box-shadow: var(--neo-shadow-lg);
  background: var(--panel-2);
}

.card.selected {
  border: 3px solid #ffde59;
  background: var(--gold);
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0px #000000, 0 0 12px rgba(255, 222, 89, 0.6);
}

.card.random-fighter-card {
  border: 2.5px dashed #ffca3a;
  background: linear-gradient(180deg, rgba(255, 202, 58, 0.15), rgba(255, 106, 60, 0.1));
}

.card.random-fighter-card:hover {
  border-style: solid;
  box-shadow: 6px 6px 0px #000000, 0 0 16px rgba(255, 202, 58, 0.5);
}

.char-img-container {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #000;
  border-bottom: 2px solid var(--cc);
  display: flex;
  align-items: center;
  justify-content: center;
}

.char-roster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  transition: transform 0.35s ease;
  display: block;
}

.card:hover .char-roster-img,
.card.selected .char-roster-img {
  transform: scale(1.08);
}

.card .meta {
  position: relative;
  padding: 6px 8px 8px;
  background: rgba(10, 12, 22, 0.95);
  z-index: 2;
  text-align: center;
}

.card .meta h3 {
  font-family: "Orbitron", sans-serif;
  font-size: 13px;
  letter-spacing: 0.02em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ffffff;
}

.card .meta small {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  display: block;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .tick {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--cc);
  color: #08090f;
  display: grid;
  place-items: center;
  font-weight: 900;
  transform: scale(0);
  transition: 0.2s;
  font-size: 13px;
}

.card.selected .tick {
  transform: scale(1);
}

.detail {
  border-left: var(--neo-border);
  background: var(--panel);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: -4px 0px 0px #000;
}

.detail .empty {
  margin: auto;
  text-align: center;
  color: var(--muted);
}

.detail .empty b {
  display: block;
  font-family: "Orbitron";
  font-size: 15px;
  color: #5a6a99;
  letter-spacing: 0.2em;
  margin-bottom: 8px;
}

.d-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}

.d-head .badge {
  width: 46px;
  height: 46px;
  font-size: 20px;
}

.d-head h2 {
  font-family: "Orbitron";
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #000000;
}

.d-head p {
  color: #444444;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.d-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  margin: 8px -4px 0;
  padding: 0 4px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.skill-group {
  margin-top: 6px;
}

.skill-group>h4 {
  font-family: "Orbitron";
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #000000;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.skill-group>h4 .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #000;
  border: 1px solid #000;
}

.skill {
  border: 2px solid #000;
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #ffffff;
  box-shadow: 3px 3px 0px #000;
  color: #000000;
}

.skill.ult {
  border: 2px solid #000;
  background: var(--panel-2);
  box-shadow: 3px 3px 0px #000;
}

.skill.heal {
  border: 2px solid #000;
  background: #e6fcf5;
  box-shadow: 3px 3px 0px #000;
}

.skill.heal .kind {
  color: #000000;
  border: 1.5px solid #000;
  background: #b2f2bb;
  font-weight: 800;
}

.skill b {
  font-size: 13px;
  font-weight: 800;
  color: #000000;
  display: block;
  margin-bottom: 3px;
}

.skill span {
  font-size: 11.5px;
  color: #222222;
  font-weight: 600;
  line-height: 1.4;
}

.skill .kind {
  font-family: "Orbitron";
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #000000;
  background: var(--gold);
  border: 1.5px solid #000000;
  border-radius: 4px;
  padding: 2px 7px;
  float: right;
  margin-left: 8px;
  box-shadow: 1px 1px 0px #000;
}

.detail .actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-shrink: 0;
  position: relative;
  z-index: 100;
  pointer-events: auto;
}

.detail .actions .btn {
  flex: 1;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  z-index: 100;
}

.close-detail {
  width: auto;
  height: 32px;
  padding: 0 10px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  margin-left: auto;
  line-height: 1;
}

/* common actions strip */
.commons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.commons .chip {
  font-size: 11px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 5px 12px;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
}

.commons .chip kbd {
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  background: #ffffff;
  border: 1px solid #ffffff;
  border-bottom: 2px solid #cbd5e1;
  border-radius: 4px;
  padding: 1px 6px;
  color: #0f172a;
  margin-right: 5px;
  font-weight: 800;
}

.commons .chip.title-chip {
  background: rgba(34, 224, 255, 0.2);
  border-color: var(--cyan);
  color: #67e8f9;
  font-weight: bold;
}

.commons .chip.heal-chip {
  background: rgba(34, 197, 94, 0.2);
  border-color: #22c55e;
  color: #4ade80;
}

/* ================= 궁극기 전용 화면 오버레이 ================= */
.blood-overlay,
.shadow-overlay,
.wind-overlay,
.gold-overlay,
.vampire-overlay,
.gambler-overlay {
  position: absolute;
  inset: 0;
  z-index: 140;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* 바바리안 - 핏빛 분노 */
.blood-overlay {
  background: radial-gradient(circle at 50% 50%,
      transparent 40%,
      rgba(255, 0, 0, 0.6) 80%,
      rgba(150, 0, 0, 0.95) 100%);
  box-shadow: inset 0 0 80px rgba(255, 0, 0, 0.8);
}

.blood-overlay.active {
  opacity: 1;
  animation: ultPulse 0.8s infinite alternate;
}

/* 암살자 - 그림자 처형 (흑백 & 암전) */
.shadow-overlay {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: grayscale(100%) contrast(150%);
}

.shadow-overlay.active {
  opacity: 1;
}

/* 아처 - 바람의 영역 */
.wind-overlay {
  background: radial-gradient(circle at 50% 50%,
      transparent 50%,
      rgba(34, 197, 94, 0.4) 85%,
      rgba(16, 185, 129, 0.7) 100%);
}

.wind-overlay.active {
  opacity: 1;
}

/* 파이터 / 탱커 - 황금/신성 진동 */
.gold-overlay {
  background: radial-gradient(circle at 50% 50%,
      transparent 45%,
      rgba(255, 202, 58, 0.35) 80%,
      rgba(255, 150, 0, 0.6) 100%);
}

.gold-overlay.active {
  opacity: 1;
}

/* 뱀파이어 - 피의 제단 */
.vampire-overlay {
  background: radial-gradient(circle at 50% 50%,
      transparent 40%,
      rgba(255, 47, 158, 0.45) 80%,
      rgba(120, 10, 80, 0.85) 100%);
}

.vampire-overlay.active {
  opacity: 1;
}

/* 갬블러 - 잭팟 비주얼 */
.gambler-overlay {
  background:
    radial-gradient(circle at 50% 50%,
      rgba(255, 235, 59, 0.25),
      transparent 70%),
    linear-gradient(135deg, rgba(255, 0, 85, 0.2), rgba(0, 229, 255, 0.2));
}

.gambler-overlay.active {
  opacity: 1;
  animation: ultPulse 0.5s infinite alternate;
}

@keyframes ultPulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }

  100% {
    transform: scale(1.02);
    opacity: 1;
  }
}

/* ================= BRACKET OVERLAY ================= */
#bracket {
  background: rgba(5, 6, 12, 0.86);
  backdrop-filter: blur(10px);
  z-index: 40;
}

.bracket-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 34px;
  border-bottom: 1px solid var(--line);
}

.bracket-head h2 {
  font-family: "Orbitron";
  font-size: 20px;
  letter-spacing: 0.14em;
}

.bracket-head .sub {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.2em;
}

.bracket-scroll {
  flex: 1;
  overflow: auto;
  padding: 34px;
}

.tree {
  display: flex;
  gap: 60px;
  min-width: min-content;
  justify-content: center;
  align-items: stretch;
  height: 100%;
}

.round-col {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  min-width: 216px;
  position: relative;
}

.round-col>.rlabel {
  position: absolute;
  top: -24px;
  left: 0;
  font-family: "Orbitron";
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.match {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  margin: 14px 0;
}

.seat {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 12px;
  background: var(--panel);
  min-height: 46px;
  transition: 0.2s;
}

.seat .sb {
  width: 26px;
  height: 26px;
  flex: none;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  display: grid;
  place-items: center;
  font-family: "Orbitron";
  font-weight: 900;
  font-size: 12px;
  color: #0a0c14;
}

.seat .nm {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.seat .nm small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
}

.seat.you {
  border-color: var(--cyan);
  box-shadow: inset 0 0 20px -12px var(--cyan);
}

.seat.you .nm small {
  color: var(--cyan);
}

.seat.win {
  border-color: var(--gold);
}

.seat.tbd {
  opacity: 0.5;
  font-style: italic;
}

.seat.tbd .sb {
  background: #2a3350 !important;
  color: #6b76a0;
}

.seat.champ {
  border-color: var(--gold);
  box-shadow: 0 0 30px -6px var(--gold);
  background: linear-gradient(180deg, rgba(255, 202, 58, 0.14), var(--panel));
}

.vs {
  position: absolute;
  left: -30px;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Orbitron";
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* ================= GAME HUD ================= */
#game {
  z-index: 5;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-family: "Chakra Petch";
}

.topleft-actions {
  position: absolute;
  top: 6px;
  left: 12px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
  z-index: 25;
}

.topright-actions {
  position: absolute;
  top: 6px;
  right: 12px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
  z-index: 25;
}

.match-banner {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(8, 10, 18, 0.45);
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 3px 12px;
  pointer-events: none;
  z-index: 20;
}

.fighter-tag {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fighter-tag .sb {
  width: 26px;
  height: 26px;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  display: grid;
  place-items: center;
  font-family: "Orbitron";
  font-weight: 900;
  font-size: 11px;
  color: #0a0c14;
}

.fighter-tag .info b {
  font-family: "Orbitron";
  font-size: 11px;
  letter-spacing: 0.02em;
  display: block;
  white-space: nowrap;
}

.fighter-tag .info small {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.fighter-tag.right {
  flex-direction: row-reverse;
  text-align: right;
}

.vs-pill {
  font-family: "Orbitron";
  font-size: 11px;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: 0.1em;
  padding: 0 2px;
}

.round-pill {
  position: absolute;
  top: 38px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Orbitron";
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 8px;
  border-radius: 4px;
  pointer-events: none;
}

.hud-left {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: 135px;
}

.bar {
  margin-bottom: 6px;
}

.bar .lab {
  display: flex;
  justify-content: space-between;
  font-family: "Orbitron", sans-serif;
  font-size: 8.5px;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 3px;
}

.bar .track {
  height: 7px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #0b0e1a;
  overflow: hidden;
}

.bar .fill {
  height: 100%;
  width: 100%;
  border-radius: 20px;
  transition: width 0.08s linear;
}

.fill.stam {
  background: linear-gradient(90deg, #0f8, #0fd0ff);
}

.fill.stam.low {
  background: linear-gradient(90deg, #f60, #f22);
}

.fill.dash {
  background: linear-gradient(90deg, var(--magenta), var(--cyan));
}

.keyhint {
  position: absolute;
  right: 22px;
  top: 22px;
  text-align: right;
  font-size: 11px;
  color: var(--muted);
  z-index: 20;
  pointer-events: none;
}

.keyhint .row {
  margin-bottom: 5px;
}

.keyhint kbd {
  font-family: "Orbitron";
  font-size: 10px;
  background: #000000;
  border: 1px solid #444444;
  border-bottom-width: 2px;
  border-bottom-color: #666666;
  border-radius: 4px;
  padding: 2px 7px;
  color: #ffffff;
  margin: 0 2px;
}

.keyhint .desktop-only {
  display: block;
}

.mobile-ctrl {
  position: absolute;
  right: 22px;
  bottom: 96px;
  display: none;
  flex-direction: column;
  gap: 14px;
  pointer-events: auto;
}

.mob-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 30%,
      rgba(34, 224, 255, 0.18),
      rgba(14, 17, 32, 0.9));
  color: var(--txt);
  font-family: "Orbitron";
  font-size: 11px;
  letter-spacing: 0.1em;
  display: grid;
  place-items: center;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
  transition: 0.1s;
  text-align: center;
  line-height: 1.2;
}

.mob-btn:active {
  transform: scale(0.92);
  border-color: var(--cyan);
}

.mob-btn.sprint.on {
  border-color: var(--gold);
  box-shadow: 0 0 22px -6px var(--gold);
}

.toast {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translate(-50%, -14px);
  font-family: "Orbitron";
  font-size: 22px;
  letter-spacing: 0.1em;
  opacity: 0;
  transition: 0.4s;
  text-shadow: 0 0 24px currentColor;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 궁극기 시전 시 화면 테두리 컬러 확산 플래시 */
#screen-edge-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: 0;
  box-shadow: inset 0 0 0 0 rgba(255, 255, 255, 0);
  transition: none;
}

#screen-edge-flash.flash-active {
  animation: screen-edge-flash-anim var(--flash-duration, 0.6s) ease-out forwards;
}

@keyframes screen-edge-flash-anim {
  0% {
    opacity: 0.95;
    box-shadow: inset 0 0 0 22px var(--flash-color, #ffffff);
  }

  60% {
    opacity: 0.55;
    box-shadow: inset 0 0 0 10px var(--flash-color, #ffffff);
  }

  100% {
    opacity: 0;
    box-shadow: inset 0 0 0 0 var(--flash-color, #ffffff);
  }
}

.topleft-actions {
  position: absolute;
  top: 18px;
  left: 22px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.topleft-actions .btn {
  padding: 5px 10px;
  font-size: 8px;
}

/* ================= LOADING ================= */
#loading {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--bg);
}

#loading .ring {
  width: 54px;
  height: 54px;
  border: 3px solid var(--line);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#loading p {
  font-family: "Orbitron";
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--muted);
}

/* ================= RESPONSIVE ================= */
@media (max-width: 900px) {
  .select-body {
    grid-template-columns: 1fr;
  }

  .roster {
    grid-template-columns: repeat(3, 1fr);
  }

  .detail {
    position: fixed;
    inset: 0;
    z-index: 30;
    border-left: none;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    pointer-events: none;
  }

  .detail.open {
    transform: translateX(0);
    pointer-events: auto;
  }

  .close-detail {
    display: flex;
  }

  .tree {
    gap: 34px;
  }

  .commons {
    display: none !important;
  }
}

@media (max-width: 560px) {
  .top-bar {
    padding: 14px 18px;
  }

  .logo b {
    font-size: 19px;
  }

  .roster-wrap {
    padding: 18px;
  }

  .keyhint .desktop-only {
    display: none;
  }
}

/* ================= MOBILE LANDSCAPE LOW-HEIGHT OPTIMIZATIONS ================= */
@media (orientation: landscape) and (max-height: 620px),
(max-width: 960px) and (max-height: 600px) {
  .top-bar {
    padding: 25px 16px;
    height: 38px;
    min-height: 38px;
  }

  .top-bar .logo b {
    font-size: 14px;
  }

  .top-bar .logo span {
    font-size: 10px;
  }

  .stage-tag {
    font-size: 9.5px;
    padding: 2px 8px;
  }

  .select-body {
    padding: 6px 12px;
    gap: 10px;
    grid-template-columns: 1fr 340px !important;
  }

  .detail {
    position: static !important;
    transform: none !important;
    pointer-events: auto !important;
    display: flex !important;
    width: auto !important;
    height: auto !important;
    box-shadow: none !important;
    border-left: var(--neo-border) !important;
  }

  .close-detail {
    display: none !important;
  }

  .roster-wrap {
    padding: 8px 12px;
  }

  .roster-title {
    color: #ffde59;
    font-size: 10px;
    margin-bottom: 8px;
    letter-spacing: 0.18em;
  }

  .roster {
    display: grid;
    grid-template-columns: repeat(4, minmax(65px, 95px));
    gap: 8px;
    justify-content: start;
  }

  .card {
    position: relative;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    background: #080912;
    overflow: hidden;
    height: 105px;
    display: flex;
    flex-direction: column;
    touch-action: pan-y;
    padding: 0;
  }

  .card.selected {
    border-color: #ffde59 !important;
    box-shadow: 0 0 8px rgba(255, 222, 89, 0.8) !important;
  }

  .char-img-container {
    flex: 1;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background: #000;
    border-bottom: 2px solid var(--cc);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .char-roster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    transition: transform 0.35s ease;
    display: block;
  }

  .card .meta {
    position: relative;
    padding: 4px 6px 6px;
    background: rgba(10, 12, 22, 0.95);
    z-index: 2;
    text-align: center;
    border-left: none;
    display: block;
  }

  .card .meta h3 {
    font-family: "Orbitron", sans-serif;
    font-size: 11.5px;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
  }

  .card .meta small {
    font-size: 9px;
    color: var(--muted);
    display: block;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .commons {
    display: none !important;
  }

  .detail {
    padding: 10px 14px;
  }

  .d-head {
    gap: 8px;
    margin-bottom: 2px;
  }

  .d-head .badge {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }

  .d-head h2 {
    font-size: 17px;
  }

  .d-head p {
    font-size: 9.5px;
  }

  .skill {
    padding: 4px 7px;
    margin-bottom: 3px;
  }

  .skill b {
    font-size: 11px;
  }

  .skill span {
    font-size: 9.5px;
  }

  .skill .kind {
    font-size: 8px;
    padding: 1px 4px;
  }

  .detail .actions {
    margin-top: 6px;
    gap: 6px;
  }

  .detail .actions .btn {
    min-height: 32px !important;
    font-size: 11.5px !important;
    padding: 4px 8px !important;
  }
}

#game:not(.hidden) .mobile-container {
  display: block;
}

.touch .keyhint .desktop-only {
  display: none;
}

/* ================= MOBILE UI (JOYSTICK & SKILLS) ================= */
.mobile-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: none;
  z-index: 40;
}

.joystick-wrapper {
  position: absolute;
  bottom: 30px;
  left: 40px;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.joystick-base {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(20, 26, 46, 0.35);
  border: 2px solid rgba(38, 48, 77, 0.6);
  backdrop-filter: blur(4px);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.joystick-handle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg,
      rgba(34, 224, 255, 0.4),
      rgba(34, 224, 255, 0.1));
  border: 2px solid var(--cyan);
  box-shadow: 0 0 15px rgba(34, 224, 255, 0.3);
  position: absolute;
  transition: transform 0.05s ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.joy-mode-icon {
  font-size: 27px;
  line-height: 1;
  display: block;
  user-select: none;
  transition:
    transform 0.15s ease,
    font-size 0.15s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.joystick-handle.walking .joy-mode-icon {
  font-size: 29px;
}

.joystick-handle.sprinting .joy-mode-icon {
  font-size: 33px;
}

.action-buttons-wrapper {
  position: absolute;
  bottom: 25px;
  right: 40px;
  display: grid;
  grid-template-areas:
    "skill3 ult"
    "attack skill2"
    "dash heal";
  gap: 12px;
  pointer-events: auto;
}

.action-btn {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: bold;
  color: var(--txt);
  user-select: none;
  -webkit-user-select: none;
  backdrop-filter: blur(6px);
  border: 2.5px solid rgba(38, 48, 77, 0.7);
  transition:
    transform 0.1s,
    background-color 0.1s,
    border-color 0.2s,
    filter 0.2s,
    opacity 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: visible;
}

.action-btn:active {
  transform: scale(0.9);
}

/* 쿨타임 conic gradient 차오르는 링/오버레이 */
.action-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(rgba(0, 0, 0, 0.72) var(--cd-pct, 0%),
      transparent 0deg);
  pointer-events: none;
  z-index: 1;
  transition: background 0.05s linear;
}

.action-btn>* {
  position: relative;
  z-index: 2;
}

.action-btn .btn-label {
  transition:
    opacity 0.2s,
    font-size 0.2s;
}

.action-btn .btn-main {
  font-size: 11px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.12;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
  letter-spacing: -0.04em;
  max-width: 95%;
  overflow: visible;
  text-shadow: 0 1px 3px #000000, 0 0 5px rgba(0, 0, 0, 0.9);
}

.action-btn .btn-sub {
  font-size: 8.5px;
  color: #ffffff;
  font-weight: 700;
  margin-top: 1px;
  opacity: 0.95;
  text-shadow: 0 1px 2px #000000;
}

.action-btn.boost .btn-sub {
  color: #ffe066;
}

/* 부스트 종료 직후(해제) 표시: 회색 계열로 전환 */
.action-btn.boost .btn-sub.boost-off {
  color: #9aa4b8;
  font-weight: 700;
}

.action-btn.ult .btn-sub {
  color: #ff99dd;
}

.action-btn.attack .btn-sub {
  color: #a5f3fc;
}

.action-btn.skill2 .btn-sub {
  color: #ddd6fe;
}

.action-btn.dash .btn-sub {
  color: #fbcfe8;
}

.action-btn.heal .btn-sub {
  color: #86efac;
}

.btn-sub {
  font-size: 9px;
  color: #ffffff;
  margin-top: 2px;
  font-weight: 700;
  z-index: 2;
  text-shadow: 0 1px 2px #000000;
}

.action-btn .cd-num {
  display: none;
  font-family: "Orbitron", sans-serif;
  font-size: 16px;
  font-weight: 900;
  color: #ffffff;
  text-shadow:
    0 0 6px #000000,
    0 0 10px var(--cyan);
}

/* 쿨타임 작동 중일 때 상태 */
.action-btn.cd-active {
  opacity: 0.7;
  filter: grayscale(0.4);
  border-color: rgba(255, 255, 255, 0.3) !important;
  box-shadow: none !important;
}

.action-btn.cd-active .btn-label {
  font-size: 9px;
  opacity: 0.6;
}

.action-btn.cd-active .cd-num {
  display: block;
}

.action-btn.sprint {
  grid-area: sprint;
  background: rgba(38, 48, 77, 0.25);
  border-color: var(--muted);
}

.action-btn.sprint.on {
  background: rgba(34, 224, 255, 0.35);
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(34, 224, 255, 0.5);
}

.action-btn.dash {
  grid-area: dash;
  background: rgba(255, 47, 158, 0.15);
  border-color: rgba(255, 47, 158, 0.5);
}

.action-btn.dash:active {
  background: rgba(255, 47, 158, 0.4);
}

.action-btn.boost {
  grid-area: skill3;
  background: rgba(255, 202, 58, 0.2);
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 202, 58, 0.3);
}

.action-btn.boost:active {
  background: rgba(255, 202, 58, 0.45);
}

/* 부스트 지속 중: 버튼 황금 글로우 강조 (지속 중 서브 라벨과 함께 사용) */
.action-btn.boost.boost-active {
  background: rgba(255, 202, 58, 0.32);
  border-color: #ffde59 !important;
  box-shadow: 0 0 18px rgba(255, 202, 58, 0.85) !important;
}

.action-btn.boost.boost-active .btn-sub {
  color: #ffde59;
  font-weight: 900;
}

.action-btn.skill2 {
  grid-area: skill2;
  background: rgba(160, 107, 255, 0.2);
  border-color: #a06bff;
  box-shadow: 0 0 12px rgba(160, 107, 255, 0.3);
}

.action-btn.skill2:active {
  background: rgba(160, 107, 255, 0.45);
}

.action-btn.attack {
  grid-area: attack;
  width: 74px;
  height: 74px;
  background: rgba(34, 224, 255, 0.2);
  border-color: var(--cyan);
  box-shadow: 0 0 12px rgba(34, 224, 255, 0.2);
}

.action-btn.attack:active {
  background: rgba(34, 224, 255, 0.45);
}

.action-btn.ult {
  grid-area: ult;
  background: rgba(255, 70, 70, 0.15);
  border-color: var(--red);
}

.action-btn.heal {
  grid-area: heal;
  background: rgba(34, 197, 94, 0.18);
  border-color: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.25);
}

.action-btn.heal:active {
  background: rgba(34, 197, 94, 0.45);
}

.action-btn.ult:active {
  background: rgba(255, 70, 70, 0.4);
}

.action-btn.auto {
  grid-area: auto;
  font-size: 10px;
  background: rgba(139, 150, 184, 0.15);
  border-color: var(--muted);
}

.action-btn.auto.on {
  background: rgba(255, 202, 58, 0.3);
  border-color: var(--gold);
  box-shadow: 0 0 15px rgba(255, 202, 58, 0.5);
}

/* ---------------- COUNTDOWN OVERLAY ---------------- */
.combo-pill {
  position: absolute;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  font-family: "Orbitron", sans-serif;
  font-size: 13px;
  font-weight: 900;
  padding: 4px 16px;
  border-radius: 20px;
  background: rgba(13, 18, 34, 0.92);
  border: 1.5px solid var(--gold);
  color: var(--gold);
  box-shadow: 0 0 14px rgba(255, 202, 58, 0.6);
  letter-spacing: 0.08em;
  animation: comboPulse 0.6s infinite alternate ease-in-out;
  z-index: 25;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.combo-pill.tier-high {
  animation: comboPulseHigh 0.45s infinite alternate ease-in-out;
}

.combo-pill.tier-heat {
  animation: comboPulseHeat 0.35s infinite alternate ease-in-out;
  font-size: 14px;
}

.combo-pill.tier-blaze {
  animation: comboPulseBlaze 0.28s infinite alternate ease-in-out;
  font-size: 15px;
}

.combo-pill.tier-inferno {
  animation: comboPulseInferno 0.2s infinite alternate ease-in-out;
  font-size: 16px;
}

.combo-pill.hidden {
  display: none !important;
}

@keyframes comboPulse {
  from {
    transform: translateX(-50%) scale(1);
  }
  to {
    transform: translateX(-50%) scale(1.06);
  }
}

@keyframes comboPulseHigh {
  from {
    transform: translateX(-50%) scale(1.02);
  }
  to {
    transform: translateX(-50%) scale(1.10);
  }
}

@keyframes comboPulseHeat {
  from {
    transform: translateX(-50%) scale(1.04);
  }
  to {
    transform: translateX(-50%) scale(1.14);
  }
}

@keyframes comboPulseBlaze {
  from {
    transform: translateX(-50%) scale(1.06) rotate(-1deg);
  }
  to {
    transform: translateX(-50%) scale(1.18) rotate(1deg);
  }
}

@keyframes comboPulseInferno {
  from {
    transform: translateX(-50%) scale(1.08) rotate(-2deg);
  }
  to {
    transform: translateX(-50%) scale(1.24) rotate(2deg);
  }
}

.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 999;
}

.countdown-text {
  font-family: "Orbitron", sans-serif;
  font-size: 110px;
  font-weight: 900;
  color: #ffffff;
  text-shadow:
    0 0 20px rgba(34, 224, 255, 0.9),
    0 0 40px rgba(255, 70, 70, 0.8),
    0 4px 10px #000;
  letter-spacing: 4px;
  opacity: 0;
}

.countdown-text.pop {
  animation: cdPop 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.countdown-text.fight {
  font-size: 64px;
  color: #ffca3a;
  text-shadow:
    0 0 30px #ffca3a,
    0 0 60px #ff4646,
    0 6px 15px #000;
}

@keyframes cdPop {
  0% {
    transform: scale(2.5);
    opacity: 0;
  }

  35% {
    transform: scale(1);
    opacity: 1;
  }

  75% {
    transform: scale(1.08);
    opacity: 1;
  }

  100% {
    transform: scale(0.85);
    opacity: 0;
  }
}

/* HUD Key Badges & Tags */
.key-badge {
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  font-size: 11px;
  background: #131a2e;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  color: #ffffff;
  margin-right: 6px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.key-badge.x {
  border-color: #ffca3a;
  color: #ffca3a;
}

.key-badge.q {
  border-color: var(--cyan);
  color: var(--cyan);
}

.key-badge.c {
  border-color: #a06bff;
  color: #a06bff;
}

.key-badge.e {
  border-color: var(--magenta);
  color: var(--magenta);
}

.key-badge.r {
  border-color: #22c55e;
  color: #22c55e;
}

.s-kind {
  color: #ffffff;
  font-weight: 700;
  text-shadow: 0 1px 2px #000000;
}

.key-tag {
  position: absolute;
  top: -4px;
  right: -4px;
  font-family: "Orbitron", sans-serif;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 5px;
  background: #0b0f1d;
  border: 1.5px solid var(--line);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
  z-index: 10;
  line-height: 1;
  pointer-events: none;
  color: #ffffff;
}

.key-tag.x {
  color: #ffca3a;
  border-color: #ffca3a;
  box-shadow: 0 0 8px rgba(255, 202, 58, 0.5);
}

.key-tag.q {
  color: var(--cyan);
  border-color: var(--cyan);
  box-shadow: 0 0 8px rgba(34, 224, 255, 0.5);
}

.key-tag.c {
  color: #a06bff;
  border-color: #a06bff;
  box-shadow: 0 0 8px rgba(160, 107, 255, 0.5);
}

.key-tag.e {
  color: var(--magenta);
  border-color: var(--magenta);
  box-shadow: 0 0 8px rgba(255, 47, 158, 0.5);
}

.key-tag.r {
  color: #22c55e;
  border-color: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.key-tag.f {
  color: var(--gold);
  border-color: var(--gold);
}

.key-tag.t {
  color: #38bdf8;
  border-color: #38bdf8;
}

.key-tag.shift {
  color: #cbd5e1;
  border-color: #64748b;
  font-size: 8.5px;
  padding: 2px 4px;
}

.btn-main {
  font-size: 11.5px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
  text-align: center;
  max-width: 90%;
  word-break: keep-all;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

.btn-sub {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
  font-weight: 500;
  z-index: 2;
}

/* Mobile View: Hide shortcut key tags/badges/guides */
@media (max-width: 900px),
(max-height: 500px),
(pointer: coarse) {

  .keyhint,
  .key-badge,
  .key-tag {
    display: none !important;
  }
}

/* Mobile Portrait Landscape Prompt */
.rotate-notice {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(5, 6, 13, 0.96);
  backdrop-filter: blur(12px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
  color: #ffffff;
}

.rotate-notice .rotate-icon {
  font-size: 54px;
  margin-bottom: 16px;
  animation: rotatePulse 2s infinite ease-in-out;
}

@keyframes rotatePulse {
  0% {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(90deg) scale(1.15);
  }

  100% {
    transform: rotate(90deg) scale(1);
  }
}

.rotate-notice h3 {
  font-family: "Orbitron", sans-serif;
  font-size: 18px;
  color: var(--cyan);
  margin-bottom: 10px;
  letter-spacing: 0.05em;
}

.rotate-notice p {
  font-size: 13px;
  color: var(--muted);
  max-width: 320px;
  line-height: 1.5;
}

@media (max-width: 900px) and (orientation: portrait) {
  .rotate-notice:not(.dismissed) {
    display: flex !important;
  }
}

/* Update Notification Banner */
.update-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  background: rgba(13, 18, 34, 0.95);
  border: 2px solid var(--cyan);
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.8),
    0 0 20px rgba(34, 224, 255, 0.4);
  border-radius: 12px;
  padding: 14px 22px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  width: 90%;
  max-width: 480px;
  box-sizing: border-box;
}

.update-banner.hidden {
  display: none !important;
}

.ub-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ub-icon {
  font-size: 28px;
}

.ub-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.ub-text b {
  font-size: 14px;
  color: #ffffff;
}

.ub-text span {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.ub-btn {
  padding: 8px 16px;
  font-size: 12px;
  white-space: nowrap;
  border-radius: 8px;
}

/* Joystick Handle & Base Dynamic Mode Status */
.joystick-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.joy-mode-icon {
  font-size: 14px;
  pointer-events: none;
  user-select: none;
}

.joystick-handle.walking {
  background: rgba(34, 224, 255, 0.65) !important;
  border-color: var(--cyan) !important;
  box-shadow: 0 0 16px rgba(34, 224, 255, 0.9) !important;
}

.joystick-handle.sprinting {
  background: rgba(255, 202, 58, 0.9) !important;
  border-color: var(--gold) !important;
  box-shadow:
    0 0 24px rgba(255, 202, 58, 1),
    0 0 40px rgba(255, 70, 70, 0.8) !important;
  animation: joyPulse 0.4s infinite alternate ease-in-out;
}

@keyframes joyPulse {
  from {
    transform: translate(var(--rx, 0px), var(--ry, 0px)) scale(1);
  }

  to {
    transform: translate(var(--rx, 0px), var(--ry, 0px)) scale(1.12);
  }
}

.joystick-base.walking {
  border-color: var(--cyan) !important;
  box-shadow: 0 0 20px rgba(34, 224, 255, 0.45) !important;
}

.joystick-base.sprinting {
  border-color: var(--gold) !important;
  box-shadow:
    0 0 32px rgba(255, 202, 58, 0.75),
    0 0 50px rgba(255, 70, 70, 0.5) !important;
}

/* Top Right Actions (In-Match Pause & Settings) */
.topright-actions {
  position: absolute;
  top: 14px;
  right: 18px;
  display: flex;
  gap: 8px;
  z-index: 30;
}

.icon-btn {
  padding: 5px 11px;
  font-size: 13.5px;
  border-radius: 8px;
}

/* In-Match Pause Overlay */
.pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 90;
  background: rgba(5, 6, 13, 0.55);
  backdrop-filter: blur(2.5px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pause-overlay.hidden {
  display: none !important;
}

.pause-box {
  background: rgba(14, 20, 38, 0.95);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 30px rgba(34, 224, 255, 0.4);
  border-radius: 14px;
  padding: 28px 40px;
  text-align: center;
  color: #ffffff;
}

.pause-box h2 {
  font-family: "Orbitron", sans-serif;
  font-size: 24px;
  color: var(--cyan);
  margin-bottom: 8px;
}

.pause-box p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

/* Control Settings Modal (Semi-Transparent Live Preview Panel) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(14, 20, 38, 0.95);
  /* 전체 화면을 덮으므로 투명도를 조금 더 불투명하게 조정 */
  backdrop-filter: blur(10px);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 0;
}

.modal-backdrop.hidden {
  display: none !important;
}

.settings-modal {
  width: 100vw;
  height: 100vh;
  max-width: none;
  background: rgba(14, 20, 38, 0.98);
  border: none;
  border-radius: 0;
  color: #ffffff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 28, 54, 0.8);
}

.modal-head h3 {
  font-family: "Orbitron", sans-serif;
  font-size: 16px;
  color: var(--cyan);
  margin: 0;
}

.close-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  padding: 8px 16px;
  /* 터치 영역 개선 */
}

.close-btn:hover {
  color: #ffffff;
}

.modal-body {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 가로 모드 최적화 (가로 2열 배치) */
@media (orientation: landscape) {
  .modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-content: start;
  }
}

.setting-group label {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  display: block;
  margin-bottom: 8px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--cyan);
}

.slider-row span {
  font-family: "Orbitron", sans-serif;
  font-size: 12px;
  color: var(--cyan);
  min-width: 48px;
  text-align: right;
}

.preset-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-btn {
  font-size: 11px;
  padding: 6px 12px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  background: rgba(10, 14, 28, 0.9);
}

/* Portrait Rotate Notice Overlay */
.rotate-notice {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(5, 7, 15, 0.95);
  backdrop-filter: blur(12px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
  pointer-events: auto;
}

@media (orientation: portrait) {
  .rotate-notice:not(.dismissed) {
    display: flex;
  }
}

.rotate-notice.dismissed {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  z-index: -1 !important;
}

.rotate-icon {
  font-size: 44px;
  margin-bottom: 16px;
}

/* Pause Overlay Styling */
.pause-overlay {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 12, 0.65);
  backdrop-filter: blur(3.5px);
  pointer-events: auto;
  transition: opacity 0.25s ease;
}

.pause-overlay.hidden {
  opacity: 0;
  pointer-events: none !important;
  z-index: -1 !important;
}

/* Frost Storm Screen Overlay UI (중앙 캐릭터 선명도 100% 보장 & 블러 제거) */
.frost-overlay {
  position: absolute;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%,
      transparent 55%,
      rgba(34, 224, 255, 0.35) 82%,
      rgba(200, 245, 255, 0.8) 100%),
    linear-gradient(135deg,
      rgba(34, 224, 255, 0.2) 0%,
      transparent 40%,
      transparent 60%,
      rgba(34, 224, 255, 0.2) 100%);
  box-shadow: inset 0 0 60px rgba(34, 224, 255, 0.5);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.frost-overlay.active {
  opacity: 1;
  animation: frostPulse 1.4s ease-in-out infinite alternate;
}

@keyframes frostPulse {
  0% {
    opacity: 0.75;
    transform: scale(1);
  }

  100% {
    opacity: 1;
    transform: scale(1.02);
  }
}

/* Dark Screen Overlay for Wizard Meteor Ultimate */
.dark-overlay {
  position: absolute;
  inset: 0;
  z-index: 140;
  pointer-events: none;
  background: rgba(4, 6, 14, 0.85);
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dark-overlay.active {
  opacity: 1;
}

/* Poison Screen Overlay (Dark Purple/Poison Vignette) */
.poison-overlay {
  position: absolute;
  inset: 0;
  z-index: 145;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%,
      transparent 45%,
      rgba(160, 107, 255, 0.45) 80%,
      rgba(120, 40, 200, 0.8) 100%),
    linear-gradient(135deg,
      rgba(160, 107, 255, 0.3) 0%,
      transparent 40%,
      transparent 60%,
      rgba(160, 107, 255, 0.3) 100%);
  box-shadow: inset 0 0 70px rgba(160, 107, 255, 0.65);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.poison-overlay.active {
  opacity: 1;
  animation: poisonPulse 1.2s ease-in-out infinite alternate;
}

@keyframes poisonPulse {
  0% {
    opacity: 0.75;
    transform: scale(1);
  }

  100% {
    opacity: 1;
    transform: scale(1.02);
  }
}

/* Rainbow Overcharge Effect for Skill Buttons */
.rainbow-overcharge {
  position: relative;
  overflow: hidden !important;
}

.rainbow-overcharge::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: linear-gradient(90deg,
      #ff0055,
      #ff9900,
      #ffeb3b,
      #00e676,
      #00e5ff,
      #7c4dff,
      #ff0055);
  background-size: 200% 200%;
  z-index: 10;
  pointer-events: none;
  animation:
    rainbowSpin 0.8s linear infinite,
    fadeOutRainbow 1.2s forwards;
  box-shadow:
    0 0 16px rgba(0, 229, 255, 0.95),
    inset 0 0 10px rgba(255, 0, 85, 0.85);
}

@keyframes rainbowSpin {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 200% 50%;
  }
}

@keyframes fadeOutRainbow {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  75% {
    opacity: 1;
    transform: scale(1.04);
  }

  100% {
    opacity: 0;
    transform: scale(1.1);
  }
}

/* Absorb Overlay Modal Optimization for Mobile Landscape */
.absorb-screen-overlay {
  background: rgba(5, 6, 12, 0.94);
  backdrop-filter: blur(12px);
  z-index: 150;
  justify-content: center;
  align-items: center;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.absorb-modal-box {
  text-align: center;
  width: 100%;
  max-width: 900px;
  padding: 20px 24px;
  border: 1.5px solid var(--gold);
  background: var(--panel-2);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  max-height: 94vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.absorb-title {
  font-size: 24px;
  color: #008852;
  font-weight: 900;
  margin-bottom: 2px;
  letter-spacing: 0.08em;
}

.absorb-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 14px;
  letter-spacing: 0.03em;
}

.absorb-options-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
  align-items: center;
  width: 100%;
}

/* Mobile & Landscape Screen Adjustments */
@media (max-width: 900px) {
  .absorb-modal-box {
    max-width: 96vw;
    padding: 12px 14px;
  }

  .absorb-title {
    font-size: 20px;
    margin-bottom: 2px;
  }

  .absorb-subtitle {
    font-size: 11.5px;
    margin-bottom: 10px;
  }
}

@media (max-height: 500px) {
  .absorb-modal-box {
    padding: 10px 14px;
  }

  .absorb-title {
    font-size: 17px;
    margin-bottom: 2px;
  }

  .absorb-subtitle {
    font-size: 11px;
    margin-bottom: 6px;
  }
}

/* Champion Title Showcase Overlay CSS */
.champion-showcase-overlay {
  background: rgba(5, 6, 12, 0.96);
  backdrop-filter: blur(14px);
  z-index: 200;
  justify-content: center;
  align-items: center;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 8px;
}

.champion-showcase-box {
  text-align: center;
  width: 100%;
  max-width: 860px;
  padding: 14px 20px;
  border: 2px solid var(--gold);
  background: radial-gradient(circle at center,
      rgba(30, 25, 10, 0.95),
      rgba(12, 10, 20, 0.98));
  border-radius: 14px;
  box-shadow:
    0 0 35px rgba(255, 202, 58, 0.4),
    inset 0 0 20px rgba(255, 202, 58, 0.15);
  max-height: 96vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.champion-badge-header {
  margin-bottom: 12px;
}

.champion-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.crown-icon {
  font-size: 24px;
  display: inline-block;
  animation: pulse 1.5s ease-in-out infinite;
}

.champion-modal-title {
  font-size: 22px;
  color: var(--gold);
  text-shadow: 0 0 15px rgba(255, 202, 58, 0.6);
  margin-bottom: 0px;
  letter-spacing: 0.08em;
}

.champion-modal-sub {
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 500;
}

.title-match-cards-wrapper {
  display: flex;
  gap: 12px;
  width: 100%;
  align-items: stretch;
  justify-content: center;
  margin: 8px 0 10px;
}

.match-card {
  flex: 1 1 0px;
  border-radius: 12px;
  padding: 14px 16px;
  text-align: left;
  display: flex;
  align-items: center;
}

.player-showcase-card {
  background: rgba(14, 28, 48, 0.85);
  border: 1px solid var(--cyan);
  box-shadow: 0 0 15px rgba(34, 224, 255, 0.25);
}

.champion-showcase-card {
  background: rgba(38, 30, 10, 0.9);
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 20px rgba(255, 202, 58, 0.35);
}

.vs-divider {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-family: "Orbitron", sans-serif;
  font-weight: 900;
  font-size: 20px;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 202, 58, 0.8);
  padding: 0 2px;
}

.champion-skills-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  margin-top: 6px;
  font-size: 11.5px;
  max-height: 170px;
  overflow-y: auto;
}

.champion-skill-item {
  background: rgba(0, 0, 0, 0.45);
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 202, 58, 0.25);
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.1s;
}

.champion-skill-item:hover {
  background: rgba(255, 202, 58, 0.2);
  border-color: var(--gold);
  transform: scale(1.01);
}

/* ================= FINAL SHOP OVERLAY CSS ================= */
.final-shop-overlay {
  background: rgba(4, 6, 12, 0.95);
  backdrop-filter: blur(14px);
  z-index: 220;
  justify-content: center;
  align-items: center;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.final-shop-box {
  width: 100%;
  max-width: 980px;
  background: #0b1120;
  border: 1.5px solid #eab308;
  border-radius: 16px;
  box-shadow: 0 0 50px rgba(234, 179, 8, 0.25), inset 0 0 20px rgba(0, 0, 0, 0.8);
  padding: 20px 24px;
  max-height: 94vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.final-shop-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid rgba(234, 179, 8, 0.3);
  padding-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.final-shop-gold-badge {
  background: rgba(0, 0, 0, 0.6);
  border: 1.5px solid #eab308;
  border-radius: 8px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
}

.final-shop-body {
  display: flex;
  gap: 20px;
  align-items: stretch;
  flex-wrap: wrap;
}

.final-shop-items-col {
  flex: 1.6 1 420px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.final-shop-stats-col {
  flex: 1 1 280px;
  display: flex;
  flex-direction: column;
}

.shop-section-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.shop-sec-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
  font-weight: 900;
  color: #f8fafc;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 6px;
}

.shop-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.shop-item-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  position: relative;
  transition: border-color 0.15s;
}

.shop-item-card:hover {
  border-color: #38bdf8;
}

.item-head {
  display: flex;
  gap: 8px;
  align-items: center;
}

.item-icon {
  font-size: 20px;
}

.item-head div b {
  display: block;
  font-size: 13px;
  color: #ffffff;
}

.item-head div small {
  display: block;
  font-size: 11px;
}

.item-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.item-price {
  font-weight: 900;
  color: #ffca3a;
  font-size: 12.5px;
}

.shop-buy-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: bold;
}

.item-stack-tag {
  font-size: 10.5px;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 6px;
  border-radius: 4px;
  width: fit-content;
}

/* 실시간 스펙 요약 카드 */
.player-stats-preview-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid #38bdf8;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
  height: 100%;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: #cbd5e1;
}

/* 히든 패시브 선택 모달 */
.hidden-pick-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 300;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
}

.hidden-pick-backdrop.hidden {
  display: none !important;
}

.hidden-pick-box {
  width: 100%;
  max-width: 600px;
  background: #0f172a;
  border: 2px solid #fbbf24;
  border-radius: 14px;
  padding: 18px 20px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.4);
}

.hidden-pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hidden-pick-card {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 8px;
  padding: 10px 12px;
}

@media (max-width: 768px) {
  .final-shop-box {
    padding: 12px 14px;
  }
  .final-shop-body {
    flex-direction: column;
  }
}

.skill-label {
  font-size: 10px;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 3px;
  margin-right: 6px;
  color: #000;
  background: var(--gold);
}

.title-start-btn {
  font-size: 15px;
  font-weight: 900;
  padding: 10px 32px;
  border-radius: 30px;
  box-shadow: 0 0 25px rgba(255, 202, 58, 0.6);
  background: linear-gradient(135deg, #ffca3a, #ff9900);
  color: #000;
  border: none;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  margin: 20px;
}

.title-start-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 35px rgba(255, 202, 58, 0.9);
}

@media (max-width: 900px),
(max-height: 500px) {
  .select-body {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  }

  .roster-wrap {
    padding: 8px 12px;
  }

  .detail {
    padding: 10px 12px;
  }

  .roster-title {
    font-size: 11px;
    margin-bottom: 6px;
  }

  .roster {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
  }

  .card {
    height: 128px;
  }

  .card .meta {
    padding: 4px 4px 5px;
  }

  .card .meta h3 {
    font-size: 11px;
  }

  .card .meta small {
    font-size: 8.5px;
  }

  .champion-showcase-box {
    padding: 8px 10px;
  }

  .crown-icon {
    font-size: 18px;
  }

  .champion-modal-title {
    font-size: 17px;
  }

  .champion-modal-sub {
    font-size: 10.5px;
  }

  .title-match-cards-wrapper {
    gap: 8px;
    margin: 4px 0 6px;
  }

  .match-card {
    padding: 6px 8px;
  }

  .champion-skills-container {
    gap: 2px;
    font-size: 10.5px;
  }

  .champion-skill-item {
    padding: 2px 5px;
  }

  .title-start-btn {
    font-size: 13.5px;
    padding: 6px 20px;
  }
}

@media (max-height: 500px) {
  .champion-showcase-box {
    padding: 6px 10px;
  }

  .champion-badge-header {
    margin-bottom: 12px;
  }

  .crown-icon {
    font-size: 16px;
  }

  .champion-modal-title {
    font-size: 16px;
  }

  .title-match-cards-wrapper {
    margin: 4px 0 6px;
  }

  .title-start-btn {
    font-size: 13px;
    padding: 5px 18px;
  }
}

/* ============ RANKING MODAL ============ */
.ranking-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 13px;
}

.ranking-table th {
  color: #94a3b8;
  font-weight: 600;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ranking-table th:last-child {
  text-align: right;
}

.ranking-row {
  background: rgba(30, 41, 59, 0.7);
  transition: 0.15s;
  color: #f8fafc;
}

.ranking-row:hover {
  background: rgba(56, 189, 248, 0.15);
}

.ranking-row td {
  padding: 12px 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: middle;
  color: #f8fafc;
}

.ranking-row td:first-child {
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px 0 0 8px;
}

.ranking-row td:last-child {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 8px 8px 0;
  text-align: right;
  color: #cbd5e1;
}

.ranking-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 900;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #cbd5e1;
}

.ranking-medal.gold {
  background: rgba(245, 158, 11, 0.25);
  border: 2px solid #f59e0b;
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
  font-size: 14px;
}

.ranking-medal.silver {
  background: rgba(148, 163, 184, 0.3);
  border: 2px solid #94a3b8;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(148, 163, 184, 0.4);
  font-size: 14px;
}

.ranking-medal.bronze {
  background: rgba(217, 119, 6, 0.3);
  border: 2px solid #d97706;
  color: #fed7aa;
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.4);
  font-size: 14px;
}

.ranking-char {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}

.ranking-empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 20px;
  font-size: 14px;
}

.ranking-empty-icon {
  font-size: 36px;
  margin-bottom: 10px;
  display: block;
}

@media (max-width: 480px) {
  .ranking-table {
    font-size: 11.5px;
  }

  .ranking-table th,
  .ranking-row td {
    padding: 10px 6px;
  }
}

/* =====================================================================
   LOBBY RESET CONFIRM MODAL (CUSTOM DIALOG) CSS
   ===================================================================== */
.lobby-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 12, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.3s ease;
}

.lobby-confirm-box {
  background: linear-gradient(160deg, #141a2e, #0c0f1d);
  border: 1px solid rgba(255, 70, 70, 0.4);
  box-shadow: 0 0 25px rgba(255, 70, 70, 0.25), inset 0 0 15px rgba(255, 70, 70, 0.1);
  border-radius: 12px;
  width: 90%;
  max-width: 420px;
  padding: 24px;
  text-align: center;
  animation: modalSlideIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lobby-confirm-title {
  color: #ff4646;
  font-size: 20px;
  font-weight: 800;
  margin-top: 0;
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(255, 70, 70, 0.3);
}

.lobby-confirm-desc {
  color: #a4b3d6;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.lobby-confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.lobby-confirm-actions .btn {
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 6px;
  min-width: 120px;
}

.btn.danger {
  background: linear-gradient(135deg, #ff4646, #c02626);
  border: 1px solid #ff4646;
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 70, 70, 0.35);
  transition: all 0.2s;
}

.btn.danger:hover {
  background: linear-gradient(135deg, #ff5f5f, #d93838);
  box-shadow: 0 0 15px rgba(255, 70, 70, 0.5);
}

@keyframes modalSlideIn {
  from {
    transform: translateY(20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* =====================================================================
   NICKNAME & HEADER BUTTONS STYLING
   ===================================================================== */
.nick-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--gold);
  min-width: 150px;
}

.nick-label {
  color: var(--gold);
  white-space: nowrap;
}

.nick-value {
  color: #ffffff;
  font-weight: bold;
  white-space: nowrap;
}

#changeNickBtn {
  padding: 2px 8px;
  font-size: 10.5px;
  border-radius: 4px;
  min-width: 60px;
}

.header-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.header-action-btn {
  padding: 5px 12px;
  font-size: 11px;
  text-align: center;
  justify-content: center;
  display: inline-flex;
  align-items: center;
}

.header-action-btn .mobile-text {
  display: none;
}

.header-action-btn .pc-text {
  display: inline;
}

@media (max-width: 900px) and (orientation: portrait) {
  .top-bar {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    grid-template-areas:
      "logo buttons"
      "logo nickname";
    align-items: center;
    gap: 6px 12px;
    padding: 10px 16px;
  }

  .logo {
    grid-area: logo;
    max-width: 120px;
    margin-right: 8px;
    display: flex;
    align-items: center;
  }

  .logo b {
    font-size: 16px;
    text-shadow: 1px 1px 0px var(--gold);
    line-height: 1.1;
  }

  .header-actions {
    grid-area: buttons;
    margin-left: 0;
    justify-self: end;
    display: flex;
    gap: 6px;
  }

  .nick-wrap {
    grid-area: nickname;
    justify-self: end;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    min-width: auto;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--line);
    border-radius: 6px;
  }

  .header-action-btn {
    padding: 5px 8px;
    font-size: 10.5px;
    min-width: 80px;
  }

  .header-action-btn .pc-text {
    display: none;
  }

  .header-action-btn .mobile-text {
    display: inline;
  }

  .select-body {
    grid-template-columns: 1fr !important;
  }

  .roster-title {
    color: #e6ff00;
    text-shadow: 0 0 10px rgba(230, 255, 0, 0.7), 2px 2px 0px #000000;
  }

  .gauntlet-tree-container {
    width: 94%;
    max-width: none;
    padding: 10px 0;
  }

  .gauntlet-card {
    padding: 12px 14px;
  }

  .gauntlet-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
  }

  .gauntlet-stage-num {
    min-width: fit-content;
    font-size: 15px;
    font-weight: 900;
    white-space: nowrap;
  }

  .gauntlet-matchup {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    flex: 1;
    padding-left: 12px;
    border-left: 1px solid rgba(0, 0, 0, 0.15);
  }

  .gauntlet-player,
  .gauntlet-opponent {
    gap: 8px;
    width: auto;
    justify-content: flex-start;
  }

  .gauntlet-player .char-name,
  .gauntlet-opponent .char-name {
    font-size: 13px;
    font-weight: bold;
    color: #000;
  }

  .gauntlet-vs {
    font-size: 11px;
    margin: 0;
    margin-left: 10px;
    line-height: 1;
    text-shadow: none;
    color: #ff5757 !important;
    font-weight: 900;
    font-family: 'Orbitron';
  }

  .gauntlet-opponent .opp-info {
    align-items: flex-start;
  }

  .gauntlet-opponent .opp-desc {
    display: none;
  }

  .status-badge {
    padding: 4px 8px;
    font-size: 10.5px;
  }
}

/* =====================================================================
   GAUNTLET BRACKET STYLING
   ===================================================================== */
.gauntlet-tree-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 10px;
}

.gauntlet-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-radius: 10px;
  border: var(--neo-border);
  color: #000;
  width: 100%;
  transition: all 0.15s ease;
}

.gauntlet-card.active {
  background: var(--gold);
  box-shadow: var(--neo-shadow-lg);
}

.gauntlet-card.cleared {
  background: var(--panel-2);
  box-shadow: var(--neo-shadow);
}

.gauntlet-card:not(.active):not(.cleared) {
  background: #ffffff;
  box-shadow: var(--neo-shadow);
}

.gauntlet-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gauntlet-stage-num {
  font-family: 'Orbitron';
  font-size: 14px;
  font-weight: 900;
  min-width: 80px;
}

.gauntlet-matchup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gauntlet-player,
.gauntlet-opponent {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gauntlet-player .char-name,
.gauntlet-opponent .char-name {
  font-weight: bold;
  font-size: 13px;
  color: #000;
}

.gauntlet-opponent .opp-info {
  display: flex;
  flex-direction: column;
}

.gauntlet-opponent .opp-desc {
  font-size: 10px;
  font-weight: 700;
}

.gauntlet-vs {
  font-weight: 900;
  font-family: 'Orbitron';
  font-size: 13px;
  margin: 0 4px;
  color: var(--magenta);
  text-shadow: 1px 1px 0 #000;
}

.gauntlet-vs.current {
  color: #d90429;
  text-shadow: none;
}

.status-badge {
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  border: 2px solid #000;
  white-space: nowrap;
  display: inline-block;
}

.status-badge.cleared {
  background: var(--cyan);
  color: #000;
  box-shadow: 2px 2px 0px #000;
}

.status-badge.current {
  background: var(--gold);
  color: #000;
  box-shadow: 2px 2px 0px #000;
}

.status-badge.locked {
  background: #e5e5e5;
  color: #555;
}