:root {
  --bg-dark: #07080d;
  --bg-panel: rgba(12, 14, 22, 0.9);
  --neon-purple: #a855f7;
  --neon-cyan: #38bdf8;
  --neon-crimson: #f43f5e;
  --neon-gold: #fbbf24;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang TC", "Microsoft JhengHei", sans-serif;
}

#app { position: relative; width: 100vw; height: 100vh; overflow: hidden; }
#gameCanvas { display: block; width: 100%; height: 100%; }
.hidden { display: none !important; }

/* ==================== HUD ==================== */
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px 24px 12px;
}

.hud-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 16px;
}

.fighter-hud { display: flex; flex-direction: column; gap: 5px; }
.fighter-header { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: 0.06em; }
.p2-hud .fighter-header { justify-content: flex-end; }

.fighter-tag {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 2px 7px;
  font-size: 11px;
  border-radius: 3px;
  color: var(--neon-cyan);
}
.p2-hud .fighter-tag { color: var(--neon-crimson); }
.fighter-name { font-size: 18px; text-shadow: 0 0 12px rgba(168, 85, 247, 0.55); }
.fighter-title { font-size: 12px; color: var(--text-muted); font-weight: 600; }

.awakening-badge {
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, #f43f5e, #f59e0b);
  color: #fff;
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.8);
  animation: ultPulse 0.45s infinite alternate;
}

.round-dots { display: flex; gap: 6px; margin-left: auto; }
.p2-hud .round-dots { margin-left: 0; margin-right: auto; }
.round-dot {
  width: 12px; height: 12px; border-radius: 2px; transform: skewX(-16deg);
  border: 1.5px solid rgba(255, 255, 255, 0.35); background: rgba(0, 0, 0, 0.45);
}
.round-dot.won { background: var(--neon-gold); border-color: #fff; box-shadow: 0 0 12px var(--neon-gold); }

.hp-bar-wrap {
  position: relative; height: 22px; background: rgba(8, 10, 14, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.24); transform: skewX(-16deg);
  overflow: hidden; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.65);
}
.hp-bar-ghost, .hp-bar-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; transition: width 0.08s linear; }
.p2-hud .hp-bar-ghost, .p2-hud .hp-bar-fill { left: auto; right: 0; }
.hp-bar-ghost { background: rgba(251, 191, 36, 0.72); transition: width 0.42s ease-out; }
.p1-hud .hp-bar-fill { background: linear-gradient(90deg, #6d28d9, #a855f7 60%, #38bdf8); }
.p2-hud .hp-bar-fill { background: linear-gradient(270deg, #9f1239, #f43f5e 60%, #fb7185); }
.hp-text {
  position: absolute; inset: 0; display: flex; align-items: center; padding: 0 12px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; transform: skewX(16deg);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
}
.p2-hud .hp-text { justify-content: flex-end; }

.sub-bars { display: flex; gap: 8px; align-items: center; }
.meter-wrap {
  position: relative; height: 11px; background: rgba(8, 10, 14, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16); transform: skewX(-16deg); overflow: hidden;
}
.ultimate-wrap { flex: 3; }
.guard-wrap { flex: 1; }
.meter-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0%; transition: width 0.1s ease-out; }
.p2-hud .meter-fill { left: auto; right: 0; }
.ult-fill { background: linear-gradient(90deg, #f59e0b, #f43f5e); }
.ult-fill.ready { background: linear-gradient(90deg, #fef08a, #f43f5e, #38bdf8); animation: ultPulse 0.6s infinite alternate; }
@keyframes ultPulse {
  from { filter: brightness(1); box-shadow: 0 0 8px #f43f5e; }
  to { filter: brightness(1.45); box-shadow: 0 0 22px #fbbf24; }
}
.guard-fill { background: #38bdf8; width: 100%; }
.meter-label {
  position: absolute; inset: 0; display: flex; align-items: center; padding: 0 8px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.08em; transform: skewX(16deg); text-shadow: 0 1px 3px #000;
}
.p2-hud .meter-label { justify-content: flex-end; }

.boss-armor-wrap {
  position: relative; height: 10px; background: rgba(15, 10, 6, 0.9);
  border: 1px solid rgba(251, 191, 36, 0.55); transform: skewX(-16deg); overflow: hidden;
}
.boss-armor-fill {
  position: absolute; top: 0; bottom: 0; right: 0; width: 100%;
  background: linear-gradient(270deg, #d97706, #fbbf24, #fef08a); transition: width 0.12s ease-out;
}
.boss-armor-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end;
  padding: 0 8px; font-size: 8px; font-weight: 900; color: #fff; transform: skewX(16deg); text-shadow: 0 1px 3px #000;
}

/* 4-Skill Bar + Tag Switch Slot */
.skill-bar { display: flex; gap: 5px; margin-top: 2px; flex-wrap: wrap; }
.p2-skill-bar { justify-content: flex-end; }
.skill-slot {
  position: relative; min-width: 68px; height: 28px; background: rgba(12, 15, 22, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.42); border-radius: 5px; padding: 0 6px;
  display: flex; align-items: center; gap: 4px; overflow: hidden; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.skill-slot.ult-slot { border-color: rgba(244, 63, 94, 0.68); }
.skill-slot.tag-slot { border-color: rgba(251, 191, 36, 0.72); min-width: 82px; }
.skill-slot.ready-glow { border-color: #fbbf24; box-shadow: 0 0 14px rgba(251, 191, 36, 0.6); }

.sk-key {
  font-size: 10px; font-weight: 900; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #0b0d14; background: #38bdf8; padding: 1px 4px; border-radius: 3px; z-index: 2;
}
.ult-slot .sk-key { background: #f43f5e; color: #fff; }
.tag-key { background: #fbbf24 !important; color: #090b10 !important; }
.sk-name { font-size: 10.5px; font-weight: 800; color: #f1f5f9; z-index: 2; white-space: nowrap; }
.tag-meta { display: flex; flex-direction: column; gap: 2px; z-index: 2; flex: 1; }
.tag-hp-mini { height: 4px; width: 100%; background: rgba(255,255,255,0.16); border-radius: 2px; overflow: hidden; }
.tag-hp-fill { height: 100%; width: 100%; background: #4ade80; }

.sk-cd-mask {
  position: absolute; inset: 0; background: rgba(6, 8, 12, 0.8);
  transform-origin: bottom; transform: scaleY(0); z-index: 3;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: #fbbf24;
}

.hud-center { display: flex; flex-direction: column; align-items: center; min-width: 116px; }
.mode-badge { font-size: 10px; font-weight: 800; letter-spacing: 0.16em; color: var(--neon-gold); margin-bottom: 2px; }
.timer-box { font-size: 34px; font-weight: 900; line-height: 1; color: #fff; text-shadow: 0 0 18px rgba(244, 63, 94, 0.55); }
.wave-sub { font-size: 11px; font-weight: 700; color: #cbd5e1; letter-spacing: 0.14em; margin-top: 2px; }

.arcade-hud { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.arcade-stat-row { display: flex; gap: 22px; }
.arcade-stat { display: flex; flex-direction: column; align-items: flex-end; }
.stat-label { font-size: 10px; font-weight: 800; letter-spacing: 0.14em; color: var(--text-muted); }
.stat-val { font-size: 24px; font-weight: 900; color: #fff; text-shadow: 0 0 14px rgba(56, 189, 248, 0.45); }
.relic-pills { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.relic-pill {
  font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 4px;
  background: rgba(251, 191, 36, 0.16); border: 1px solid rgba(251, 191, 36, 0.5); color: #fde047;
}

.combo-display { position: absolute; top: 162px; display: flex; align-items: baseline; gap: 8px; animation: comboPop 0.12s ease-out; }
.p1-combo { left: 32px; }
.p2-combo { right: 32px; flex-direction: row-reverse; }
.combo-num { font-size: 64px; font-weight: 900; font-style: italic; line-height: 0.9; color: #fff; text-shadow: 0 0 24px var(--neon-crimson), 3px 3px 0 #000; }
.combo-meta { display: flex; flex-direction: column; gap: 2px; }
.combo-word { font-size: 12px; font-weight: 900; letter-spacing: 0.16em; color: var(--neon-gold); }
.combo-rank { font-size: 28px; font-weight: 900; font-style: italic; color: var(--neon-cyan); text-shadow: 0 0 14px var(--neon-cyan); }
@keyframes comboPop { 0% { transform: scale(1.4); } 100% { transform: scale(1); } }

.center-banner { position: absolute; top: 43%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.banner-sub { font-size: 15px; font-weight: 800; letter-spacing: 0.34em; color: var(--neon-gold); margin-bottom: 4px; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.95); }
.banner-main { font-size: 66px; font-weight: 900; font-style: italic; letter-spacing: 0.08em; color: #fff; text-shadow: 0 0 34px rgba(244, 63, 94, 0.88), 0 4px 0 #000; }

.hud-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.controls-strip {
  font-size: 11px; color: rgba(248, 250, 252, 0.84); background: rgba(8, 10, 15, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.12); padding: 6px 12px; border-radius: 6px; backdrop-filter: blur(6px); line-height: 1.5;
}
.controls-strip kbd, .ctrl-col kbd {
  display: inline-block; padding: 1px 5px; font-size: 10px; font-weight: 700;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.25); border-radius: 4px; color: #fff;
}
.hud-actions { display: flex; gap: 8px; pointer-events: auto; }
.mini-btn {
  background: rgba(12, 15, 22, 0.84); color: #e2e8f0; border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.15s ease;
}
.mini-btn:hover { background: rgba(244, 63, 94, 0.24); border-color: var(--neon-crimson); color: #fff; }

/* ==================== OVERLAY SCREENS ==================== */
.overlay-screen {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 24%, rgba(50, 14, 34, 0.52), rgba(7, 8, 13, 0.92));
  backdrop-filter: blur(5px); z-index: 20;
}
.title-bg-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 52px 52px; pointer-events: none;
}
.title-content { position: relative; width: min(1060px, 94vw); text-align: center; }
.title-eyebrow { font-size: 11px; font-weight: 800; letter-spacing: 0.34em; color: var(--neon-gold); margin-bottom: 8px; }
.game-logo { font-size: clamp(46px, 6.8vw, 80px); font-weight: 900; font-style: italic; letter-spacing: 0.06em; line-height: 1; margin-bottom: 10px; }
.logo-neon { color: #c084fc; text-shadow: 0 0 30px rgba(168, 85, 247, 0.85); }
.logo-slash { color: var(--neon-crimson); margin: 0 6px; }
.logo-blade { color: #fff; text-shadow: 0 0 26px rgba(56, 189, 248, 0.55); }
.logo-ver { font-size: 0.4em; color: var(--neon-gold); vertical-align: super; margin-left: 6px; text-shadow: 0 0 18px rgba(251, 191, 36, 0.85); }
.title-subtitle { font-size: 13.5px; color: #cbd5e1; margin-bottom: 24px; letter-spacing: 0.07em; }

.mode-cards.five-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; margin-bottom: 20px; }
.mode-card {
  text-align: left; background: rgba(14, 17, 26, 0.92); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px; padding: 16px 20px; color: #fff; cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative; overflow: hidden;
}
.mode-card.wide-card { grid-column: span 2; padding: 14px 20px; }
.mode-card::before { content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--neon-cyan); }
.mode-card.primary-card::before { background: var(--neon-purple); }
.mode-card.accent-card::before { background: var(--neon-crimson); }
.mode-card.gold-card::before { background: var(--neon-gold); }
.mode-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.45); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), 0 0 20px rgba(244, 63, 94, 0.22); }

.card-tag { font-size: 10px; font-weight: 800; letter-spacing: 0.16em; color: var(--neon-cyan); margin-bottom: 5px; }
.primary-card .card-tag { color: #c084fc; }
.accent-card .card-tag { color: #fb7185; }
.gold-card .card-tag { color: #fde047; }
.card-title { font-size: 19px; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.best-badge { font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: rgba(251, 191, 36, 0.18); border: 1px solid rgba(251, 191, 36, 0.45); color: #fde047; }
.card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.48; }
.title-footer { display: flex; justify-content: center; gap: 12px; }

.ghost-btn {
  background: rgba(255, 255, 255, 0.06); color: #e2e8f0; border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 9px 16px; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.15s ease;
}
.ghost-btn:hover { background: rgba(255, 255, 255, 0.14); border-color: #fff; color: #fff; }

/* ==================== CHARACTER SELECT ==================== */
.select-container { width: min(1200px, 95vw); display: flex; flex-direction: column; gap: 14px; }
.select-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.select-heading { text-align: center; }
.select-mode-tag { font-size: 11px; font-weight: 800; letter-spacing: 0.22em; color: var(--neon-gold); }
.select-heading h2 { font-size: 25px; font-weight: 900; }
.header-right-controls { display: flex; align-items: center; gap: 12px; }
.stage-picker, .difficulty-wrap { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--text-muted); }

.diff-btn {
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.18);
  color: #cbd5e1; padding: 5px 10px; border-radius: 6px; font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.diff-btn.active { background: var(--neon-crimson); border-color: #fda4af; color: #fff; }

.select-stage { display: grid; grid-template-columns: 264px 1fr 264px; gap: 16px; align-items: stretch; }
.preview-box {
  background: rgba(13, 16, 24, 0.92); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px; padding: 12px; display: flex; flex-direction: column; align-items: center;
}
.p1-preview { border-top: 3px solid var(--neon-purple); }
.p2-preview { border-top: 3px solid var(--neon-gold); }
.preview-badge { font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; color: var(--text-muted); margin-bottom: 2px; }
.preview-info { width: 100%; text-align: center; }
.preview-name { font-size: 21px; font-weight: 900; letter-spacing: 0.06em; }
.preview-role { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.preview-skills { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; margin-top: 7px; }
.prev-sk-tag { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: rgba(56, 189, 248, 0.12); border: 1px solid rgba(56, 189, 248, 0.3); color: #bae6fd; }
.preview-ult { margin-top: 7px; font-size: 11.5px; font-weight: 700; color: var(--neon-gold); background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.28); padding: 4px 7px; border-radius: 6px; }

.roster-column { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.roster-grid.eight-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.roster-card {
  background: rgba(16, 20, 29, 0.92); border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px; padding: 10px 11px; text-align: left; color: #fff; cursor: pointer; transition: all 0.14s ease;
}
.roster-card:hover { border-color: rgba(255, 255, 255, 0.45); transform: translateY(-2px); }
.roster-card.selected-p1 { border-color: var(--neon-purple); box-shadow: 0 0 16px rgba(168, 85, 247, 0.45); }
.roster-card.selected-p2 { border-color: var(--neon-gold); box-shadow: 0 0 16px rgba(251, 191, 36, 0.45); }
.roster-card.selected-both { border-color: var(--neon-crimson); box-shadow: 0 0 18px rgba(244, 63, 94, 0.45); }
.roster-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; gap: 4px; }
.roster-name { font-size: 14px; font-weight: 900; }
.roster-pill { font-size: 9.5px; font-weight: 800; padding: 1px 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); white-space: nowrap; }
.roster-desc { font-size: 11px; color: var(--text-muted); line-height: 1.38; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.select-status { text-align: center; font-size: 13px; color: var(--neon-cyan); font-weight: 700; }

.start-fight-btn {
  background: linear-gradient(135deg, #9333ea, #f43f5e); color: #fff; border: none; padding: 13px 24px;
  border-radius: 10px; font-size: 16px; font-weight: 900; letter-spacing: 0.1em; cursor: pointer;
  box-shadow: 0 8px 26px rgba(244, 63, 94, 0.42); transition: transform 0.15s ease, filter 0.15s ease;
}
.start-fight-btn:hover { transform: translateY(-2px); filter: brightness(1.12); }

/* ==================== ROGUELIKE RUNE MODAL ==================== */
.rune-modal-card { width: min(860px, 92vw); text-align: center; border-color: rgba(251, 191, 36, 0.35); }
.rune-eyebrow { font-size: 11px; font-weight: 900; letter-spacing: 0.26em; color: var(--neon-gold); margin-bottom: 6px; }
.rune-title { font-size: 26px; font-weight: 900; margin-bottom: 20px; }
.rune-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.rune-card {
  background: linear-gradient(180deg, rgba(30, 24, 42, 0.96), rgba(14, 16, 24, 0.96));
  border: 1.5px solid rgba(251, 191, 36, 0.35); border-radius: 12px; padding: 20px 16px;
  color: #fff; cursor: pointer; transition: all 0.18s ease;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.rune-card:hover { transform: translateY(-5px); border-color: #fde047; box-shadow: 0 12px 28px rgba(251, 191, 36, 0.3); }
.rune-icon { font-size: 36px; }
.rune-name { font-size: 18px; font-weight: 900; color: #fde047; }
.rune-desc { font-size: 12.5px; color: #cbd5e1; line-height: 1.5; }

/* ==================== MODALS ==================== */
.modal-backdrop { position: absolute; inset: 0; background: rgba(6, 8, 12, 0.84); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 40; }
.modal-card { width: min(860px, 92vw); background: #131620; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 14px; padding: 24px; box-shadow: 0 22px 54px rgba(0, 0, 0, 0.68); }
.compact-modal { width: min(440px, 90vw); text-align: center; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-sub { color: var(--text-muted); font-size: 14px; margin: 8px 0 22px; }
.controls-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ctrl-col h4 { font-size: 14px; color: var(--neon-cyan); margin-bottom: 10px; }
.ctrl-col ul { list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; color: #e2e8f0; }
.ctrl-note { margin-top: 12px; font-size: 12px; color: var(--neon-gold); line-height: 1.5; }
.tips-bar { margin-top: 16px; padding: 12px 14px; background: rgba(244, 63, 94, 0.12); border: 1px solid rgba(244, 63, 94, 0.35); border-radius: 8px; font-size: 12.5px; line-height: 1.6; }
.modal-btn-row { display: flex; flex-direction: column; gap: 10px; }

/* ==================== ONLINE 2-DEVICE ROOM LOBBY ==================== */
.mode-cards.six-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.mode-card.online-card::before { background: linear-gradient(180deg, #10b981, #38bdf8); }
.online-card .card-tag { color: #34d399; }
.mode-card.online-card { border-color: rgba(16, 185, 129, 0.45); background: linear-gradient(135deg, rgba(10, 32, 30, 0.92), rgba(14, 17, 28, 0.94)); }
.mode-card.online-card:hover { border-color: #34d399; box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55), 0 0 24px rgba(16, 185, 129, 0.3); }

.room-modal-card { width: min(880px, 94vw); border-color: rgba(52, 211, 153, 0.38); }
.room-title-wrap { display: flex; align-items: center; gap: 12px; }
.ping-badge {
  font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 99px;
  background: rgba(148, 163, 184, 0.14); border: 1px solid rgba(148, 163, 184, 0.35); color: #cbd5e1;
}
.ping-badge.online { background: rgba(16, 185, 129, 0.18); border-color: #34d399; color: #6ee7b7; }

.server-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12.5px; font-weight: 700; color: var(--text-muted); }
.room-input {
  flex: 1; background: rgba(7, 9, 14, 0.9); border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px; padding: 8px 12px; color: #f8fafc; font-size: 13px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; outline: none; user-select: text; -webkit-user-select: text;
}
.room-input:focus { border-color: #34d399; box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.22); }
.room-guide-tip {
  font-size: 12px; color: #cbd5e1; background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28); border-radius: 8px; padding: 8px 12px; margin-bottom: 16px; line-height: 1.5;
}
.room-guide-tip code { background: rgba(0, 0, 0, 0.45); padding: 1px 6px; border-radius: 4px; color: #fde047; font-size: 11.5px; }

.room-entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.room-entry-box {
  background: rgba(18, 22, 34, 0.92); border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 10px;
}
.host-box { border-top: 3px solid #34d399; }
.guest-box { border-top: 3px solid #38bdf8; }
.entry-tag { font-size: 10px; font-weight: 900; letter-spacing: 0.18em; color: #34d399; }
.guest-box .entry-tag { color: #38bdf8; }
.room-entry-box h4 { font-size: 18px; font-weight: 900; }
.room-entry-box p { font-size: 12px; color: var(--text-muted); line-height: 1.5; flex: 1; }
.join-row { display: flex; gap: 8px; }
.code-input { max-width: 150px; text-align: center; font-size: 18px; font-weight: 900; letter-spacing: 0.18em; }
.join-btn { flex: 1; padding: 10px 14px; font-size: 14px; background: linear-gradient(135deg, #0284c7, #10b981); }

.room-code-banner {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  background: rgba(10, 26, 28, 0.85); border: 1px solid rgba(52, 211, 153, 0.42);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 14px;
}
.code-col, .lan-col, .status-col { display: flex; flex-direction: column; gap: 3px; }
.code-label { font-size: 10px; font-weight: 800; letter-spacing: 0.14em; color: var(--text-muted); }
.code-value { font-size: 32px; font-weight: 900; letter-spacing: 0.16em; color: #fde047; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1; }
.lan-url-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lan-url-row code { font-size: 13.5px; font-weight: 800; color: #6ee7b7; background: rgba(0,0,0,0.45); padding: 4px 9px; border-radius: 6px; user-select: text; -webkit-user-select: text; }
.lobby-status-pill {
  font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 99px;
  background: rgba(251, 191, 36, 0.16); border: 1px solid rgba(251, 191, 36, 0.5); color: #fde047;
}
.lobby-status-pill.ready { background: rgba(16, 185, 129, 0.2); border-color: #34d399; color: #6ee7b7; }

.lobby-players { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; margin-bottom: 14px; }
.lobby-player-card {
  background: rgba(16, 20, 30, 0.94); border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px; padding: 12px 14px;
}
.lobby-player-card.p1-card { border-left: 4px solid var(--neon-purple); }
.lobby-player-card.p2-card { border-right: 4px solid var(--neon-cyan); text-align: right; }
.lp-tag { font-size: 10.5px; font-weight: 800; color: var(--text-muted); letter-spacing: 0.12em; }
.lp-name { font-size: 20px; font-weight: 900; margin-top: 2px; }
.lp-role { font-size: 11.5px; color: #cbd5e1; margin-top: 2px; }
.lobby-vs { font-size: 24px; font-weight: 900; font-style: italic; color: var(--neon-crimson); text-shadow: 0 0 14px rgba(244, 63, 94, 0.7); }

.lobby-picker-block { margin-bottom: 12px; }
.picker-title { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 7px; }
.lobby-hero-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lobby-hero-pill {
  background: rgba(18, 22, 33, 0.92); border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px; padding: 8px 10px; color: #fff; cursor: pointer; text-align: left;
  transition: all 0.14s ease; display: flex; flex-direction: column; gap: 2px;
}
.lobby-hero-pill:hover { border-color: rgba(255, 255, 255, 0.45); transform: translateY(-1px); }
.lobby-hero-pill.active { border-color: #34d399; background: rgba(16, 185, 129, 0.18); box-shadow: 0 0 14px rgba(16, 185, 129, 0.35); }
.lobby-hero-pill .lhp-name { font-size: 13px; font-weight: 900; }
.lobby-hero-pill .lhp-sub { font-size: 10.5px; color: var(--text-muted); }

.lobby-stage-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.lobby-actions { display: flex; gap: 10px; align-items: center; }
.lobby-actions .start-fight-btn { flex: 1; }
.lobby-actions .start-fight-btn:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.5); transform: none; }
.room-error {
  margin-top: 12px; padding: 9px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 700;
  background: rgba(244, 63, 94, 0.16); border: 1px solid rgba(244, 63, 94, 0.5); color: #fda4af;
}
.net-mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.net-tab {
  background: rgba(18, 22, 34, 0.85); border: 1.5px solid rgba(255, 255, 255, 0.14);
  color: #94a3b8; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; font-weight: 800;
  cursor: pointer; transition: all 0.15s ease;
}
.net-tab:hover { border-color: rgba(255, 255, 255, 0.35); color: #f8fafc; }
.net-tab.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(56, 189, 248, 0.2));
  border-color: #34d399; color: #ffffff; box-shadow: 0 0 16px rgba(16, 185, 129, 0.28);
}
