:root {
  --bg: #060a16;
  --panel: rgba(15, 23, 42, 0.85);
  --accent: #00f5ff;
  --text: #e2e8f0;
  --text-dim: #b7c0ce;
  --success: #10b981;
  --danger: #ef4444;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* No scroll */
  font-size: 13px;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  padding: 10px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}


.brand {
  margin-left: 15px;
}

.brand h1 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--accent);
  letter-spacing: 0.5px;
}

.brand p {
  color: var(--text-dim);
  font-size: 13px;
}

.logo {
  font-family: 'Outfit', sans-serif;
  font-weight: 900;
  font-size: 16px;
  color: var(--accent);
  letter-spacing: 2px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.header-status-group {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  margin-right: 8px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #555;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

main {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 5px;
  padding: 5px;
  flex: 1;
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.panel {
  background: var(--panel);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 1px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(0, 245, 255, 0.1);
  padding-bottom: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Buttons & Inputs */
button {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  padding: 8px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  transition: 0.2s;
}

button:hover {
  border-color: var(--accent);
  background: rgba(0, 245, 255, 0.05);
}

button.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

input,
textarea {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 11px;
  width: 100%;
  transition: border-color 0.2s;
}

input::selection,
textarea::selection {
  background: rgba(0, 245, 255, 0.3) !important;
  color: #ffffff !important;
}

/* Override Chrome/Safari autofill colors in dark mode */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #0e172a inset !important;
  -webkit-text-fill-color: #ffffff !important;
  transition: background-color 5000s ease-in-out 0s, color 5000s ease-in-out 0s;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  outline: none;
}

/* Hide number input spin arrows */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type=number] {
  -moz-appearance: textfield;
}

/* Preview Box */
.preview-box {
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(0, 245, 255, 0.2);
  width: 100%;
  max-width: 450px;
  /* Capped to save height for the roster list */
  margin: 2px auto;
  aspect-ratio: 16/9;
}

.preview-box iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
  border: none;
  transform-origin: 0 0;
  display: block;
  pointer-events: none;
  opacity: 0;
  /* Hidden initially, shown when loaded */
  transition: opacity 0.3s;
}

.preview-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--accent);
  font-size: 14px;
  gap: 8px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
}

/* Compact Groups */
.control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.score-card {
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: 6px;
  flex: 1;
}

.score-val {
  font-family: 'Outfit', sans-serif;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  width: 100px;
  /* Increased for high scores */
  padding: 4px 0;
}

.score-val::-webkit-inner-spin-button,
.score-val::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mini-input-num {
  width: 80px !important;
}

.toggle-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 6px 0;
}

.switch {
  width: 36px !important;
  height: 15px !important;
  background: #333;
  border-radius: 9px;
  position: relative !important;
  cursor: pointer;
}

.switch::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff !important;
  left: 2px;
  transition: 0.2s;
}

.switch.on {
  background: var(--accent) !important;
}

.switch.on::after {
  left: 20px;
}

/* OBS Links Styling */
.obs-link-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.divider {
  /* height: 1px;
  background: rgb(211 211 211 / 10%); */
  margin: 12px 0px 0px 0px;
}

.url-copy-row {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  align-items: center;
}

.url-copy-row code {
  flex: 1;
  font-family: 'Courier New', Courier, monospace;
  font-size: 9px;
  color: #7fa4a5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.url-copy-row button {
  padding: 2px 8px;
  font-size: 8px;
  min-width: 45px;
}

/* Roster Cards */
.roster-card {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.roster-card.teamA {
  background: rgba(0, 170, 255, 0.05);
  border-color: rgba(0, 170, 255, 0.1);
}

.roster-card.teamB {
  background: rgba(255, 68, 68, 0.05);
  border-color: rgba(255, 68, 68, 0.1);
}

.input-label {
  font-size: 9px;
  /* color: var(--accent); */
  text-transform: uppercase;
  margin-bottom: 3px;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0.8;
}

/* Character Selection Squares */
.char-square {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: var(--text-dim);
  transition: all 0.2s;
  overflow: hidden;
  text-align: center;
  position: relative;
}

.char-square:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
}

.char-square.filled {
  background: rgba(var(--accent-rgb, 0, 245, 255), 0.1);
  border-color: var(--accent);
  color: #fff;
}

.char-square input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.char-label {
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 100%;
  font-size: 8px;
  background: rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.custom-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* Additional styles for weapons and deduction */
.weapon-square {
  border-color: rgba(255, 215, 0, 0.2) !important;
}

.weapon-square.filled {
  border-color: #ffd700 !important;
  background-color: rgba(255, 215, 0, 0.1) !important;
}

.deduction-input {
  color: #ff4444 !important;
  border-color: rgba(255, 68, 68, 0.2) !important;
}

.filter-btn {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 20px;
  cursor: pointer;
  font-size: 10px;
  transition: 0.2s;
  white-space: nowrap;
}

.filter-btn.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

/* AI Smart Filter active styling and animations */
#filter-weapon-smart {
  position: relative;
  overflow: visible;
}

#filter-weapon-smart.active {
  background-image: linear-gradient(#080c1c, #080c1c),
    linear-gradient(135deg, #ff0055, #ff7f00, #ffcc00, #00ffcc, #3300ff, #bd00ff, #ff0055) !important;
  background-origin: border-box !important;
  background-clip: padding-box, border-box !important;
  border: 2px solid transparent !important;
  color: #fff !important;
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.4), 0 0 5px rgba(189, 0, 255, 0.2), inset 0 0 8px rgba(0, 245, 255, 0.2) !important;
  animation: ai-pulse 1s infinite ease-in-out, rainbow-border 4s linear infinite;
  /* font-weight: 700; */
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
}

@keyframes ai-pulse {
  0% {
    box-shadow: 0 0 8px rgba(0, 245, 255, 0.3), 0 0 3px rgba(189, 0, 255, 0.1), inset 0 0 4px rgba(0, 245, 255, 0.1);
  }

  50% {
    box-shadow: 0 0 18px rgba(0, 245, 255, 0.6), 0 0 8px rgba(189, 0, 255, 0.3), inset 0 0 12px rgba(0, 245, 255, 0.3);
  }

  100% {
    box-shadow: 0 0 8px rgba(0, 245, 255, 0.3), 0 0 3px rgba(189, 0, 255, 0.1), inset 0 0 4px rgba(0, 245, 255, 0.1);
  }
}

@keyframes rainbow-border {
  0% {
    filter: hue-rotate(0deg);
  }

  100% {
    filter: hue-rotate(360deg);
  }
}

.filter-group {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  align-items: center;
}

.filter-group::-webkit-scrollbar {
  height: 4px;
}

.filter-group::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.filter-label {
  font-size: 10px;
  color: var(--accent);
  font-weight: bold;
  width: 60px;
  flex-shrink: 0;
}

/* Step Controls for Rank/RC */
.step-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  border-radius: 4px;
  width: 16px;
  height: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  padding: 0;
  user-select: none;
}

.step-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent);
}

/* -------------------------------------------
   EXTRACTED INLINE STYLES FROM HTML
------------------------------------------- */

/* Layout & Panels */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  overflow: hidden;
}

.scenes-panel {
  width: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  gap: 0;
  padding: 8px;
}

/* Section blocks */
.sp-section {
  background: rgba(8, 12, 28, 0.6);
  padding: 8px;
  margin-bottom: 4px;
  /* padding-bottom: 4px; */
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
}

.sp-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.sp-section-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.9;
  padding: 6px 0px 6px;
  margin: 5px 0px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Scene buttons — 2 column grid with icon + label */
.scene-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.scene-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  opacity: 0.85;
}

.scene-btn i {
  font-size: 14px;
}

.scene-btn:hover {
  background: rgba(0, 245, 255, 0.08);
  border-color: rgba(0, 245, 255, 0.3);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 245, 255, 0.08);
}

.scene-btn.active {
  background: rgba(0, 245, 255, 0.15) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.15), inset 0 0 8px rgba(0, 245, 255, 0.05) !important;
}

/* End scene red theme */
.scene-btn-end {
  border-color: rgba(239, 68, 68, 0.25);
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.scene-btn-end:hover {
  background: rgba(239, 68, 68, 0.12) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #ef4444 !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1) !important;
}

.scene-btn-end.active {
  background: rgba(255, 255, 255, 0.02) !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25) !important;
}

/* Overlays */
.sp-overlays {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sp-overlay-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.sp-overlay-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.sp-overlay-row span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
}

.sp-ov-icon {
  font-size: 10px;
  color: var(--text-dim);
  width: 12px;
  text-align: center;
}

/* OBS Links */
.sp-links {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sp-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 6px 10px;
  transition: all 0.2s ease;
}

.sp-link-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(0, 245, 255, 0.15);
}

.sp-link-name {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  opacity: 0.85;
}

.sp-copy-link-btn {
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 700;
  background: rgba(0, 245, 255, 0.08);
  border: 1px solid rgba(0, 245, 255, 0.2);
  color: var(--accent);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  outline: none;
}

.sp-copy-link-btn:hover {
  background: rgba(0, 245, 255, 0.18);
  border-color: rgba(0, 245, 255, 0.4);
  color: #fff;
  box-shadow: 0 0 8px rgba(0, 245, 255, 0.15);
}

.mt-10 {
  margin-top: 10px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-4 {
  margin-bottom: 4px;
}

.links-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.main-panel {
  flex: 1;
  overflow: hidden;
}

.flex-1 {
  flex: 1;
}

.text-center {
  text-align: center;
}

/* ── Responsive Design (Tablet & Mobile) ── */
@media (max-width: 1024px) {
  main {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .scenes-panel {
    width: 100%;
    height: auto;
    overflow: visible;
  }

  .main-panel {
    overflow: visible;
  }

  .top-row-controls {
    grid-template-columns: 1fr;
  }

  .preview-section {
    width: 100%;
  }

  .preview-box {
    max-width: 100%;
  }

  .right-controls-column {
    width: 100%;
  }

  .mcb-teams {
    flex-direction: column;
    gap: 16px;
  }

  .mcb-vs {
    flex-direction: row;
    padding: 10px 0;
  }

  .mcb-vs-line {
    width: 100px;
    height: 1px;
  }
}

@media (max-width: 768px) {
  header {
    padding: 10px 12px;
  }

  .brand h1 {
    font-size: 14px;
  }

  .status-badge {
    display: none;
    /* Hide on very small screens to save space */
  }

  .scene-grid {
    grid-template-columns: 1fr;
  }

  .music-time-row {
    flex-direction: column;
    gap: 4px;
  }
}

/* Match Controls */
.match-control-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-height: 0;
}

.top-row-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
  flex: 0 0 auto;
}

.right-controls-column {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 290px;
}

/* ── PREVIEW SECTION ─────────────────────────────────────────────────────── */
.preview-section {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(8, 12, 28, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 10px;
  backdrop-filter: blur(8px);
  overflow: hidden;
}

.pv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.pv-title {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pv-fullscreen-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.15s;
  text-transform: none;
}

.pv-fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* ── MATCH CONTROLS BOX (redesigned) ──────────────────────────────────────── */
.match-controls-box {
  flex: 1;
  min-width: 290px;
  padding: 12px;
  background: rgba(8, 12, 28, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  backdrop-filter: blur(8px);
}

/* Header */
.mcb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mcb-title {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mcb-reset-btn {
  background: none;
  border: none;
  color: white;
  font-size: 11px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.15s;
  text-transform: none;
}

.mcb-reset-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  transform: rotate(90deg);
}

/* Teams row */
.mcb-teams {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.mcb-team {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.mcb-team::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
}

.mcb-team-a {
  background: rgba(0, 170, 255, 0.05);
  border: 1px solid rgba(0, 170, 255, 0.8);
}

.mcb-team-b {
  background: rgba(255, 68, 68, 0.05);
  border: 1px solid rgba(255, 68, 68, 0.8);
}

.mcb-team-label {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 2px;
  /* opacity: 0.5; */
}

.mcb-team-a .mcb-team-label {
  color: #00aaff;
}

.mcb-team-b .mcb-team-label {
  color: #ff4444;
  text-align: right;
}

.mcb-name-input {
  font-size: 13px;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  height: 28px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #fff;
  border-radius: 6px;
  padding: 0 8px;
  width: 100%;
  transition: border-color 0.2s;
}

.mcb-name-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.2);
}

.mcb-score-row {
  display: none !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 2px;
}

.mcb-score-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  transition: all 0.15s;
  text-transform: none;
}

.mcb-score-btn:hover {
  transform: scale(1.1);
}

.mcb-minus:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}

.mcb-plus:hover {
  background: rgba(0, 245, 255, 0.12);
  border-color: rgba(0, 245, 255, 0.35);
  color: var(--accent);
}

.mcb-score-val {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  width: 100px;
  height: 38px;
  padding: 0 4px;
}

.mcb-score-val::-webkit-inner-spin-button,
.mcb-score-val::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

/* VS divider */
.mcb-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  gap: 4px;
  flex-shrink: 0;
}

.mcb-vs-line {
  width: 1px;
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
}

.mcb-vs-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 9px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 1px;
  padding: 4px 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
}

/* Meta row: subtitle + break */
.mcb-meta-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.mcb-meta-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mcb-meta-flex {
  flex: 1;
}

.mcb-meta-break {
  width: 90px;
}

.mcb-meta-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #a3a4a9;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mcb-meta-input {
  height: 28px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-radius: 6px;
  padding: 0 8px;
  width: 100%;
  transition: border-color 0.2s;
}

.mcb-meta-input:focus {
  outline: none;
  border-color: rgba(0, 245, 255, 0.3);
}

.mcb-break-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mcb-break-unit {
  font-size: 9px;
  color: #a3a4a9;
  white-space: nowrap;
}

/* Ticker */
.mcb-ticker {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-height: 0;
}

.mcb-ticker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mcb-ticker-btn {
  font-size: 9px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 5px;
  background: rgba(0, 245, 255, 0.1);
  border: 1px solid rgba(0, 245, 255, 0.25);
  color: var(--accent);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mcb-ticker-btn:hover {
  background: rgba(0, 245, 255, 0.2);
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.15);
}

.mcb-ticker-textarea {
  flex: 1;
  resize: none;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  color: var(--text);
  font-size: 11px;
  padding: 6px 8px;
  min-height: 54px;
  line-height: 1.6;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
}

.mcb-ticker-textarea:focus {
  outline: none;
  border-color: rgba(0, 245, 255, 0.2);
}

.mcb-ticker-textarea::placeholder {
  color: rgba(255, 255, 255, 0.15);
}

/* ── SYSTEM MONITOR ──────────────────────────────────────────────────────── */
.system-monitor-box {
  flex: 0 0 auto;
  min-width: 250px;
  padding: 8px 12px;
  background: rgba(8, 12, 28, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(8px);
}

.system-monitor-box .sys-stats-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
  border-radius: 8px;
  border: none;
  min-height: 0;
}

.sys-client-card {
  background: rgba(0, 0, 0, 0.15);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgb(125 163 159 / 20%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.sys-client-card:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(0, 245, 255, 0.15);
}

.sys-badge-ping {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #10b981;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.sys-badge-ping.warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
  color: #f59e0b;
}

.sys-badge-ping.danger {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

.sys-stat-name {
  color: #a3a4a9;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sys-stat-name i {
  font-size: 10px;
  color: var(--accent);
  opacity: 0.8;
}

.sys-stat-val {
  font-family: 'DM Mono', monospace;
  color: #fff;
  font-size: 11px;
  /* font-weight: 600; */
}

/* Network Latency Sparkline Card (Horizontal Compact Fit) */
.sys-network-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  justify-content: space-between !important;
  padding: 8px 12px 18px 12px !important;
  /* Add bottom padding for x-axis */
  background: var(--panel) !important;
  border: 1px solid rgba(128, 128, 128, 0.2) !important;
  border-radius: 8px !important;
  gap: 16px;
  height: 65px;
  /* Slightly taller to fit x-axis */
}

/* Left Section: Icon & Info */
.sn-h-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 130px;
}

.sn-icon-box {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.25), rgba(64, 78, 237, 0.05));
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #a4a9ff;
  font-size: 16px;
  box-shadow: inset 0 0 0 1px rgba(164, 169, 255, 0.2);
}

.sn-title-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sn-title {
  color: var(--text);
  font-weight: 700;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.5px;
}

.sn-title i {
  color: var(--text-dim);
  font-size: 10px;
  cursor: help;
}

.sn-subtitle {
  color: var(--text-dim);
  font-size: 9px;
  font-family: 'Inter', sans-serif;
}

/* Middle Section: Chart & Axes */
.sn-h-middle {
  flex: 1;
  display: flex;
  align-items: stretch;
  padding: 0 35px 15px 10px;
  /* space for Y right, X bottom, and left margin */
  position: relative;
  min-width: 200px;
  /* ensure chart doesn't collapse to 0 */
  height: 100%;
}

.sn-chart-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
}

.sn-chart-wrapper canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.sn-y-axis {
  position: absolute;
  right: -30px;
  top: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 8px;
  /* Even smaller */
  font-family: 'Inter', sans-serif;
  pointer-events: none;
  text-align: left;
  white-space: nowrap;
}

.sn-x-axis {
  position: absolute;
  bottom: -14px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 8px;
  /* Even smaller */
  font-family: 'Inter', sans-serif;
  pointer-events: none;
  white-space: nowrap;
}

.sn-x-axis span {
  flex: 1;
  text-align: center;
}

.sn-x-axis span:first-child {
  text-align: left;
}

.sn-x-axis span:last-child {
  text-align: right;
}

/* Right Section: Value & Trend */
.sn-h-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 2px;
  flex: 0 0 auto;
  border-left: 1px solid rgba(128, 128, 128, 0.2);
  padding-left: 16px;
  min-width: 100px;
}

.sn-value-group {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.sn-val {
  font-family: 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.sn-unit {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 500;
}

.sn-trend {
  text-align: left;
  font-size: 10px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  line-height: 1.2;
}

.sn-trend.good {
  color: var(--success);
}

.sn-trend.bad {
  color: var(--danger);
}

.sn-trend-sub {
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 400;
}

/* Preserve old roster-header-actions */
.roster-header-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.btn-clear-roster {
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.2s;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.btn-clear-roster:hover {
  background: rgba(255, 68, 68, 0.3);
}

.btn-save-roster {
  background: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.2s;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--success);
}

.btn-save-roster:hover {
  background: rgba(16, 185, 129, 0.25);
}

.break-input-container {
  width: 80px;
}

.btn-clear-row {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  opacity: 0.5;
  transition: 0.2s;
  /* margin-left: 4px; */
}

.btn-clear-row:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Ticker */
.ticker-section {
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 8px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-logout {
  border-radius: 4px;
  cursor: pointer;
  padding: 4px 10px;
  font-weight: 700;
  transition: 0.2s;
  display: flex;
  align-items: center;
}

.btn-logout:hover {
  background: rgba(255, 68, 68, 0.3);
}

.ticker-textarea {
  height: 50px;
  font-size: 10px;
  background: rgba(0, 0, 0, 0.2);
  line-height: 1.4;
  width: 100%;
  resize: none;
  padding: 5px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  outline: none;
}

.ticker-textarea:focus {
  border-color: var(--accent);
}

.btn-update-ticker {
  padding: 4px;
  margin-top: 6px;
  width: 100%;
  font-weight: 900;
  height: 28px;
  border-radius: 4px;
  font-size: 10px;
  letter-spacing: 1px;
  border: 1px solid #474747;
  cursor: pointer;
  transition: 0.2s;
}

.btn-update-ticker:hover {
  opacity: 0.8;
}

/* ── ROSTER PANEL (redesigned) ──────────────────────────────────────────── */
.roster-panel {
  flex: 1;
  min-height: 0;
  background: rgba(8, 12, 28, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(8px);
  overflow: hidden;
}

/* Roster header bar */
.rp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.rp-title {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.9;
  display: flex;
  align-items: center;
  gap: 5px;
}

.rp-actions {
  display: flex;
  gap: 5px;
  align-items: center;
}

.rp-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}



.rp-save-btn {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success);
}

.rp-save-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.15);
}

.rp-clear-btn {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: white;
  padding: 4px 8px;
}

.rp-clear-btn:hover {
  background: rgba(239, 68, 68, 0.18);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.12);
}

/* Team column label bar */
.rp-team-bar {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  flex-shrink: 0;
  gap: 0;
}

.rp-team-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.rp-wrapper-a {
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 170, 255, 0.2);
}

.rp-wrapper-b {
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 68, 68, 0.2);
}

.rp-team-tag {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.rp-tag-a {
  color: #00aaff;
}

.rp-tag-b {
  color: #ff4444;
}

.rp-team-score {
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 900;
  padding: 2px 8px;
  border-radius: 4px;
  min-width: 28px;
  text-align: center;
  line-height: 1;
  transition: all 0.2s ease;
}

.rp-score-a {
  color: #fff;
  background: linear-gradient(135deg, rgba(0, 170, 255, 0.4), rgba(0, 170, 255, 0.1));
  border: 1px solid rgba(0, 170, 255, 0.4);
  box-shadow: 0 0 10px rgba(0, 170, 255, 0.2);
}

.rp-score-b {
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 68, 68, 0.4), rgba(255, 68, 68, 0.1));
  border: 1px solid rgba(255, 68, 68, 0.4);
  box-shadow: 0 0 10px rgba(255, 68, 68, 0.2);
}

.rp-divider-space {
  width: 42px;
  flex-shrink: 0;
}

.divider-v {
  width: 1px;
}

.bg-light {
  background: rgba(255, 255, 255, 0.05);
}

.roster-rounds-container {
  flex: 1;
  overflow-y: auto;
}

.roster-rounds-inner {
  display: flex;
  min-height: 100%;
  width: 100%;
  box-sizing: border-box;
  padding: 0 12px;
  gap: 0;
}

.rounds-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 12px 0;
}

#roundsA-container {
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding-right: 10px;
}

#roundsB-container {
  padding-left: 10px;
}

/* Modal Styles */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 18, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  animation: fadeInModal 0.25s ease-out forwards;
}

@keyframes fadeInModal {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal-content {
  background: rgba(10, 15, 30, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  width: 950px;
  max-height: 85vh;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 245, 255, 0.15);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 245, 255, 0.05);
  animation: slideUpModal 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(0, 245, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  margin: 0;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.modal-close:hover {
  color: var(--danger);
  transform: scale(1.1) rotate(90deg);
}

.modal-body-top {
  padding: 16px 24px;
  border-bottom: 1px solid rgba(0, 245, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-search-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 245, 255, 0.03);
  border: 1px solid rgba(0, 245, 255, 0.15);
  color: #fff;
  border-radius: 6px;
  outline: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  transition: all 0.2s ease;
}

.modal-search-input:focus {
  border-color: var(--accent);
  background: rgba(0, 245, 255, 0.06);
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.2);
}

.modal-grid {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 12px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(0, 245, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-clear {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #ef4444;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-clear:hover {
  background: rgba(239, 68, 68, 0.18);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.1);
  transform: translateY(-1px);
}

.btn-confirm {
  background: var(--accent);
  color: #000;
  padding: 8px 26px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 15px rgba(0, 245, 255, 0.15);
}

.btn-confirm:hover {
  background: #fff;
  color: #000;
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

/* -------------------------------------------
   JS GENERATED STYLES (MODALS & ROSTERS)
------------------------------------------- */

/* Modal Dynamic Items */
.modal-item-card {
  position: relative;
  background: rgba(15, 23, 42, 0.4);
  border-radius: 8px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

.modal-item-card:hover {
  transform: translateY(-2px);
}

.modal-item-card.rank-5 {
  border-color: rgba(244, 175, 41, 0.35);
  box-shadow: 0 4px 12px rgba(244, 175, 41, 0.03);
}

.modal-item-card.rank-5:hover {
  background: rgba(244, 175, 41, 0.04);
  border-color: rgba(244, 175, 41, 0.7);
  box-shadow: 0 4px 15px rgba(244, 175, 41, 0.15);
}

.modal-item-card.rank-5 .modal-item-image {
  background: linear-gradient(180deg, rgba(244, 175, 41, 0.4) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(244, 175, 41, 0.35);
}

.modal-item-card.rank-4 {
  border-color: rgba(171, 96, 232, 0.35);
  box-shadow: 0 4px 12px rgba(171, 96, 232, 0.03);
}

.modal-item-card.rank-4:hover {
  background: rgba(171, 96, 232, 0.04);
  border-color: rgba(171, 96, 232, 0.7);
  box-shadow: 0 4px 15px rgba(171, 96, 232, 0.15);
}

.modal-item-card.rank-4 .modal-item-image {
  background: linear-gradient(180deg, rgba(171, 96, 232, 0.4) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(171, 96, 232, 0.35);
}

.modal-item-card.rank-3 {
  border-color: rgba(52, 152, 219, 0.35);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.03);
}

.modal-item-card.rank-3:hover {
  background: rgba(52, 152, 219, 0.04);
  border-color: rgba(52, 152, 219, 0.7);
  box-shadow: 0 4px 15px rgba(52, 152, 219, 0.15);
}

.modal-item-card.rank-3 .modal-item-image {
  background: linear-gradient(180deg, rgba(52, 152, 219, 0.4) 0%, rgba(15, 23, 42, 0.85) 100%);
  border: 1px solid rgba(52, 152, 219, 0.35);
}

.modal-item-card.is-selected {
  background: rgba(16, 185, 129, 0.08) !important;
  border: 1.5px solid var(--success) !important;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.25) !important;
}

.modal-item-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #678365;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.modal-item-energy {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10px;
  font-weight: 700;
  z-index: 10;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 7px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  transition: all 0.2s ease;
}

.modal-item-image {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
  border-radius: 6px;
  background-color: #111827;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-item-avatar {
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-item-fallback {
  width: 100%;
  height: 100%;
  font-size: 9px;
  font-weight: 600;
  text-align: center;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-sizing: border-box;
  word-break: break-word;
  z-index: 1;
  line-height: 1.2;
}

.modal-item-card:hover .modal-item-avatar {
  transform: scale(1.12);
}

.modal-item-stars {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 7px;
  letter-spacing: 0.5px;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9), 0 1px 1px rgba(0, 0, 0, 0.9);
  line-height: 1;
  z-index: 5;
}

.modal-item-card.rank-5 .modal-item-stars {
  color: #f4af29;
}

.modal-item-card.rank-4 .modal-item-stars {
  color: #d28cff;
}

.modal-item-card.rank-3 .modal-item-stars {
  color: #3498db;
}

.modal-item-name {
  font-size: 11px;
  color: #fff;
  word-break: break-word;
  font-weight: 500;
}

/* Roster Rows */
.round-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.15);
  padding: 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.round-row.active {
  border-color: #63c0c3;
  /* background: rgba(0, 245, 255, 0.05); */
  box-shadow: 0 0 8px rgba(0, 245, 255, 0.1);
}

.round-label {
  font-size: 9px;
  opacity: 0.7;
  font-weight: 700;
  width: 15px;
}

.round-heroes-container {
  display: flex;
  gap: 4px;
}

.char-col {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.char-square,
.weapon-square {
  width: 54px;
  height: 54px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background-color: rgba(15, 23, 42, 0.4);
  box-shadow: none;

  /* Fix răng cưa và tràn ảnh ở góc bo tròn */
  overflow: hidden;
  background-clip: padding-box;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.char-square:hover,
.weapon-square:hover {
  transform: scale(1.05);
  border-color: rgba(0, 245, 255, 0.3) !important;
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.15);
}

/* Premium Gacha-Style Rank Slots for Roster Rounds (Option B: Crisp 1px Border) */
.char-square.rank-5,
.weapon-square.rank-5 {
  border: 1px solid rgba(244, 175, 41, 0.5) !important;
  box-shadow: 0 0 8px rgba(244, 175, 41, 0.25);
  background-color: #26180a !important;
}

.char-square.rank-5:hover,
.weapon-square.rank-5:hover {
  border-color: rgba(244, 175, 41, 0.95) !important;
  box-shadow: 0 0 12px rgba(244, 175, 41, 0.45);
}

.char-square.rank-4,
.weapon-square.rank-4 {
  border: 1px solid rgba(171, 96, 232, 0.5) !important;
  box-shadow: 0 0 8px rgba(171, 96, 232, 0.25);
  background-color: #1c0d2b !important;
}

.char-square.rank-4:hover,
.weapon-square.rank-4:hover {
  border-color: rgba(171, 96, 232, 0.95) !important;
  box-shadow: 0 0 12px rgba(171, 96, 232, 0.45);
}

.char-square.rank-3,
.weapon-square.rank-3 {
  border: 1px solid rgba(52, 152, 219, 0.5) !important;
  box-shadow: 0 0 8px rgba(52, 152, 219, 0.25);
  background-color: #0d1a2e !important;
}

.char-square.rank-3:hover,
.weapon-square.rank-3:hover {
  border-color: rgba(52, 152, 219, 0.95) !important;
  box-shadow: 0 0 12px rgba(52, 152, 219, 0.45);
}

.char-square span,
.weapon-square span {
  font-size: 16px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.2);
}

.rc-label {
  font-size: 9px;
  color: var(--accent);
  /* font-weight: 900; */
  margin-top: 4px;
  line-height: 1;
}

.r-label {
  font-size: 9px;
  color: #10b981;
  font-weight: 900;
  margin-top: 4px;
  line-height: 1;
}

.step-container {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.step-container-wp {
  margin-top: 4px;
}

.divider-v-short {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.05);
}

/* Roster Scores */
.score-inputs-wrapper {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

.score-input-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.score-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.score-sign-plus {
  color: var(--accent);
  font-weight: 900;
  font-size: 12px;
  width: 8px;
  text-align: center;
}

.score-pt-input {
  width: 100px;
  height: 24px;
  font-size: 12px;
  text-align: center;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--accent);
  border-radius: 4px;
  outline: none;
}

.score-sign-minus {
  color: #ff4444;
  font-weight: 900;
  font-size: 12px;
  width: 8px;
  text-align: center;
}

.score-deduct-input {
  width: 100px;
  height: 24px;
  font-size: 12px;
  text-align: center;
  font-weight: 700;
  background: rgb(0 0 0 / 5%);
  border: 1px solid rgb(255 68 68 / 10%) !important;
  color: #ff4444;
  border-radius: 4px;
  outline: none;
}

.score-buy-input {
  width: 100px;
  height: 24px;
  font-size: 12px;
  text-align: center;
  font-weight: 700;
  background: rgba(255, 159, 67, 0.05);
  border: 1px solid rgba(255, 159, 67, 0.15);
  color: #ff9f43;
  border-radius: 4px;
  outline: none;
}

.score-buy-input:focus {
  border-color: #ff9f43;
}

.score-sign-equal {
  color: #fff;
  font-weight: 900;
  font-size: 12px;
}

.score-net-box {
  width: 100px;
  height: 24px;
  line-height: 24px;
  font-size: 14px;
  text-align: center;
  font-weight: 900;
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.score-net-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.score-actions-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

.btn-submit-row,
.btn-clear-row {
  height: 24px;
  width: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-submit-row {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--success);
}

.btn-submit-row:hover {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
  transform: translateY(-1px);
}

.btn-submit-row:disabled,
.btn-submit-row.disabled {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.25) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
  opacity: 0.5;
}

.btn-clear-row {
  background: rgba(239, 68, 68, 0.06);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: rgba(255, 255, 255, 0.6);
}

.btn-clear-row:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fff;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.15);
  transform: translateY(-1px);
}

.step-val {
  width: 12px;
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  color: #fff;
}

/* Saved Matches Slot List styles */
.save-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 11px;
  gap: 6px;
  transition: 0.2s;
}

.save-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.save-item-info {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: #e2e8f0;
  text-align: left;
}

.save-item-actions {
  display: flex;
  gap: 4px;
}

.btn-save-action {
  background: none !important;
  border: none !important;
  cursor: pointer;
  padding: 2px 4px !important;
  border-radius: 3px;
  font-size: 10px;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto !important;
  height: auto !important;
}

.btn-save-load {
  color: var(--accent) !important;
}

.btn-save-load:hover {
  background: rgba(0, 245, 255, 0.2) !important;
}

.btn-save-delete {
  color: var(--danger) !important;
}

.btn-save-delete:hover {
  background: rgba(239, 68, 68, 0.25) !important;
}

/* Responsive layout adjustments for screens larger than 1920px (2K, 4K, Ultra-wide) */
@media (min-width: 1921px) {
  main {
    grid-template-columns: 380px 1fr;
    gap: 12px;
    padding: 12px;
  }

  .scenes-panel {
    width: 380px;
    padding: 16px;
  }

  .sp-section {
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 10px;
  }

  .sp-section-title {
    margin: 8px 0;
    letter-spacing: 2px;
  }

  .scene-btn {
    padding: 16px 10px;
    gap: 8px;
    border-radius: 10px;
  }

  .scene-btn i {
    font-size: 18px;
  }

  .btn-pick-folder {
    padding: 12px;
  }

  .music-now-playing {
    padding: 16px;
    gap: 12px;
  }

  .music-btn {
    width: 42px;
    height: 42px;
    font-size: 15px;
  }
}

/* ── MUSIC PLAYER ───────────────────────────────────────────────────────────── */
.music-player-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Folder Picker Button */
.btn-pick-folder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  background: rgba(0, 245, 255, 0.06);
  border: 1px dashed rgba(0, 245, 255, 0.35);
  border-radius: 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  user-select: none;
}

.btn-pick-folder:hover {
  background: rgba(0, 245, 255, 0.12);
  border-style: solid;
}

/* Now Playing */
.music-now-playing {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  min-height: 74px;
  overflow: hidden;
  transition: border-color 0.3s;
}

.music-now-playing.mp-playing {
  border-color: rgba(0, 245, 255, 0.3);
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.07);
  animation: mp-pulse 2.5s ease-in-out infinite;
}

.music-visualizer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5px;
  width: 100%;
  height: 22px;
  opacity: 0;
  transition: opacity 0.3s;
}

.music-now-playing.mp-playing .music-visualizer {
  opacity: 1.0;
}

.vis-bar {
  flex: 1;
  height: 2px;
  min-height: 2px;
  border-radius: 2px;
}

/* Stunning dense rainbow repeating sequence across the 60 waveform bars */
.vis-bar:nth-child(6n+1) {
  background: #ff2d55;
  box-shadow: 0 0 5px rgba(255, 45, 85, 0.25);
}

.vis-bar:nth-child(6n+2) {
  background: #ff9500;
  box-shadow: 0 0 5px rgba(255, 149, 0, 0.25);
}

.vis-bar:nth-child(6n+3) {
  background: #ffcc00;
  box-shadow: 0 0 5px rgba(255, 204, 0, 0.25);
}

.vis-bar:nth-child(6n+4) {
  background: #4cd964;
  box-shadow: 0 0 5px rgba(76, 217, 100, 0.25);
}

.vis-bar:nth-child(6n+5) {
  background: #5ac8fa;
  box-shadow: 0 0 5px rgba(90, 200, 250, 0.25);
}

.vis-bar:nth-child(6n) {
  background: #5856d6;
  box-shadow: 0 0 5px rgba(88, 86, 214, 0.25);
}

@keyframes mp-pulse {

  0%,
  100% {
    box-shadow: 0 0 8px rgba(0, 245, 255, 0.07);
  }

  50% {
    box-shadow: 0 0 18px rgba(0, 245, 255, 0.18);
  }
}

.music-marquee-wrap {
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
  height: 20px;
}

.music-track-name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  display: block;
  text-align: center;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  height: 20px;
  line-height: 20px;
  width: 100%;
}

.music-now-playing.mp-playing .music-track-name.marquee-active {
  display: inline-block;
  padding-left: 100%;
  width: auto;
  text-align: left;
  animation: miniMarquee 15s linear infinite;
  text-overflow: clip;
  overflow: visible;
}



@keyframes miniMarquee {
  0% {
    transform: translate3d(0, 0, 0);
  }

  100% {
    transform: translate3d(-100%, 0, 0);
  }
}

/* Progress row */
.music-time-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  color: var(--text-dim);
}

.music-progress {
  flex: 1;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  border: none;
  padding: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

.music-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 4px rgba(0, 245, 255, 0.5);
}

/* Controls row */
.music-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.music-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  text-transform: none;
}

.music-btn:hover {
  background: rgba(0, 245, 255, 0.1);
  color: var(--accent);
  border-color: rgba(0, 245, 255, 0.3);
}

.music-btn-play {
  width: 34px;
  height: 34px;
  font-size: 13px;
  background: rgba(0, 245, 255, 0.12);
  border-color: rgba(0, 245, 255, 0.35);
  color: var(--accent);
}

.music-btn-play:hover {
  background: rgba(0, 245, 255, 0.22);
}

.music-btn.mp-active {
  color: var(--accent);
  border-color: rgba(0, 245, 255, 0.4);
  background: rgba(0, 245, 255, 0.1);
}

/* Volume */
.music-volume-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  min-width: 0;
}

.music-vol-icon {
  font-size: 10px;
  color: var(--text-dim);
  flex-shrink: 0;
}

.music-volume {
  width: 54px;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
  border: none;
  padding: 0;
  cursor: pointer;
  accent-color: var(--accent);
}

.music-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}

.music-volume-pct {
  font-size: 9px;
  color: #8288b5;
  font-family: 'DM Mono', monospace;
  min-width: 24px;
  text-align: right;
  flex-shrink: 0;
}

/* Playlist */
.music-playlist {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  padding: 4px;
}

.music-playlist-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 18px 8px;
  color: #9498b7;
  font-size: 10px;
  opacity: 0.5;
}

.music-playlist-empty i {
  font-size: 20px;
}

/* Playlist row */
.mp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  min-width: 0;
}

.mp-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.mp-row-active {
  background: rgba(0, 245, 255, 0.1) !important;
  border-left: 2px solid var(--accent);
}

.mp-row-active .mp-row-name {
  color: var(--accent);
}

.mp-row-num {
  font-size: 9px;
  color: #c8d3f5;
  width: 14px;
  flex-shrink: 0;
  text-align: right;
}

.mp-row-info {
  flex: 1;
  min-width: 0;
}

.mp-row-name {
  font-size: 10px;
  font-weight: 600;
  color: #c8d3f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-dur {
  font-size: 9px;
  color: #8288b5;
  flex-shrink: 0;
  font-family: 'DM Mono', monospace;
}

/* FLOATING MINI MUSIC PLAYER */
.mini-music-player {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 245, 255, 0.15);
  border-radius: 40px;
  padding: 8px 16px 8px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 245, 255, 0.1);
  z-index: 9999;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  width: 280px;
}

.mini-music-player:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 245, 255, 0.3);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 245, 255, 0.2);
}

.mini-music-disc-wrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.mini-music-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at center, #1e293b 30%, #0f172a 100%);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 14px;
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.2);
}

/* Spinning Disc Animation */
@keyframes spinDisc {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

span#music-current-time {
  color: aqua;
}

span#music-duration {
  color: white;
}

.mini-music-player.playing .mini-music-disc {
  animation: spinDisc 4s linear infinite;
  border-color: var(--accent);
  color: var(--accent);
}

.mini-music-info {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mini-music-marquee {
  width: 100%;
  overflow: hidden;
  white-space: nowrap;
  position: relative;
}

.mini-music-marquee span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.5px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
}

.mini-music-player.playing .mini-music-marquee span {
  display: inline-block;
  padding-left: 100%;
  animation: miniMarquee 15s linear infinite;
}

.mini-music-status {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 1px;
  margin-top: 2px;
}

.mini-music-player.playing .mini-music-status {
  color: var(--accent);
}

.mini-music-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-control-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  transition: 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-control-btn:hover {
  color: var(--accent);
  transform: scale(1.1);
}

.mini-control-btn.play-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
}

.mini-control-btn.play-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0d14;
}

.mini-music-player.playing .mini-control-btn.play-btn {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0d14;
}

/* SPA ACTIVE TAB WRAPPER */
.main-content-tab {
  display: none;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow: hidden;
  position: relative;
}


/* Fix: rank styles phải thắng .filled - KHÔNG dùng background shorthand */
.char-square.filled.rank-5,
.weapon-square.filled.rank-5 {
  background-color: rgba(244, 175, 41, 0.15) !important;
  border-color: rgba(244, 175, 41, 0.8) !important;
  box-shadow: 0 0 10px rgba(244, 175, 41, 0.35) !important;
}

.char-square.filled.rank-4,
.weapon-square.filled.rank-4 {
  background-color: rgba(171, 96, 232, 0.15) !important;
  border-color: rgba(171, 96, 232, 0.8) !important;
  box-shadow: 0 0 10px rgba(171, 96, 232, 0.35) !important;
}

.char-square.filled.rank-3,
.weapon-square.filled.rank-3 {
  background-color: rgba(52, 152, 219, 0.15) !important;
  border-color: rgba(52, 152, 219, 0.8) !important;
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.35) !important;
}

.char-square.filled.rank-2,
.weapon-square.filled.rank-2 {
  background-color: rgba(102, 204, 102, 0.15) !important;
  border-color: rgba(102, 204, 102, 0.8) !important;
}

.char-square.filled.rank-1,
.weapon-square.filled.rank-1 {
  background-color: rgba(179, 179, 179, 0.15) !important;
  border-color: rgba(179, 179, 179, 0.8) !important;
}

/* Magic auto-fill animation styles */
@property --a {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

@keyframes border-rotate {
  0% {
    --a: 0deg;
  }

  100% {
    --a: 360deg;
  }
}

@keyframes magic-pop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.4);
  }

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

@keyframes magic-row-flash {
  0% {
    background: rgba(15, 23, 42, 0.85);
  }

  20% {
    background: linear-gradient(90deg, rgba(0, 245, 255, 0.25), rgba(189, 0, 255, 0.25));
    box-shadow: inset 0 0 20px rgba(0, 245, 255, 0.2);
  }

  100% {
    background: rgba(15, 23, 42, 0.85);
  }
}

.magic-filled {
  position: relative;
  z-index: 10;
  animation: magic-pop 0.5s ease-out;
}

.magic-filled::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  pointer-events: none;
  border: 2px solid transparent;
  background-image: linear-gradient(#080c16, #080c16), conic-gradient(from var(--a), #00f5ff, #bd00ff, #ffd700, #ff007f, #00f5ff);
  background-origin: border-box;
  background-clip: padding-box, border-box;
  animation: border-rotate 1s linear infinite;
  z-index: 5;
}

.magic-row {
  animation: magic-row-flash 1s ease-out;
}

/* Sparkle/Particle Effect */
.sparkle-particle {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  z-index: 9999;
  animation: fly-and-fade 1.2s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes fly-and-fade {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

/* ── Mobile & Tablet Responsive Layout Rules ── */
@media (max-width: 1024px) {
  .roster-rounds-container {
    flex-direction: column !important;
    gap: 20px !important;
  }

  .divider-v {
    display: none !important;
  }

  #roundsA-container::before {
    content: "TEAM BLUE" !important;
    display: block !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    color: #00aaff !important;
    letter-spacing: 2px !important;
    padding: 8px 4px !important;
    border-bottom: 2px solid rgba(0, 170, 255, 0.4) !important;
    margin-bottom: 10px !important;
  }

  #roundsB-container::before {
    content: "TEAM RED" !important;
    display: block !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    color: #ff4444 !important;
    letter-spacing: 2px !important;
    padding: 8px 4px !important;
    border-bottom: 2px solid rgba(255, 68, 68, 0.4) !important;
    margin-bottom: 10px !important;
  }

  .rp-team-bar {
    display: none !important;
  }

  /* Make modal responsive */
  .modal-content {
    width: 95% !important;
    max-height: 90vh !important;
  }

  .modal-body-top {
    padding: 12px 16px !important;
  }

  .filter-group {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .filter-label {
    width: auto !important;
    margin-right: 8px !important;
  }
}

@media (max-width: 768px) {
  .round-row {
    display: grid !important;
    grid-template-areas:
      "label slots"
      "label weapons"
      "scores scores" !important;
    grid-template-columns: 32px 1fr !important;
    gap: 10px !important;
    padding: 12px 10px !important;
  }

  .round-label {
    grid-area: label;
    align-self: center;
    font-size: 13px !important;
    font-weight: 900 !important;
    text-align: center;
    color: var(--accent);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .round-row>.round-heroes-container:nth-of-type(1) {
    grid-area: slots;
  }

  .round-row>.round-heroes-container:nth-of-type(2) {
    grid-area: weapons;
  }

  .round-row>.divider-v-short {
    display: none !important;
  }

  .round-row>.flex-1 {
    display: none !important;
  }

  .score-inputs-wrapper {
    grid-area: scores;
    margin-left: 0 !important;
    display: flex !important;
    justify-content: space-between !important;
    border-top: 1px dashed rgba(255, 255, 255, 0.1) !important;
    padding-top: 10px !important;
    width: 100% !important;
  }

  .step-container {
    gap: 2px !important;
  }

  .step-btn {
    width: 15px !important;
    height: 15px !important;
    font-size: 8px !important;
  }

  .char-square,
  .weapon-square {
    width: 48px !important;
    height: 48px !important;
  }
}