@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@700;800;900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: 'Exo 2', 'Segoe UI', sans-serif;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
}

body::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 120px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  z-index: 5;
  pointer-events: none;
}

/* --- Parallax Background --- */
.parallax-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 1;
}

.bg-layer {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  transition: transform 0.08s ease-out;
  will-change: transform;
}

.bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 35, 45, 0.45);
  transition: background 0.2s ease;
}

/* --- Main Menu Interface --- */
.menu-container {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.cb-logo {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background-color: #ff52a2;
  border: 7px solid #ffffff;
  box-shadow: 0 0 25px rgba(255, 82, 162, 0.8), 0 0 50px rgba(255, 82, 162, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  outline: none;
  z-index: 20;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cb-logo:hover {
  transform: scale(1.05);
}

.logo-text {
  color: #ffffff;
  font-size: 3.8rem;
  font-weight: 900;
  letter-spacing: -1px;
}

/* --- Sleek, Modern Side Menu --- */
.side-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: absolute;
  left: 175px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-20px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

.menu-container.menu-open .side-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

/* Modern Skewed Buttons with Soft Glass Glow */
.menu-btn {
  position: relative;
  background: rgba(22, 22, 26, 0.85);
  color: #e0e0e0;
  border: none;
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  padding: 11px 32px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-align: left;
  cursor: pointer;
  width: 190px;
  transform: skewX(-14deg);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.menu-btn:hover {
  background: rgba(35, 35, 42, 0.95);
  color: #ffffff;
  border-left-color: #ff52a2;
  transform: skewX(-14deg) translateX(10px);
  box-shadow: -4px 0 15px rgba(255, 82, 162, 0.4), 0 4px 15px rgba(0, 0, 0, 0.5);
}

.menu-btn:active {
  transform: skewX(-14deg) translateX(6px) scale(0.98);
}

/* --- Left Options Sidebar --- */
.settings-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 100vh;
  background: rgba(10, 10, 12, 0.95);
  border-right: 2px solid #ff52a2;
  z-index: 100;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.7);
}

.settings-sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.sidebar-header h2 {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 2px;
}

.close-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.8rem;
  cursor: pointer;
  transition: color 0.15s;
}

.close-btn:hover {
  color: #ff52a2;
}

.sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 25px;
  overflow-y: auto;
}

.group-title {
  color: #ff52a2;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  display: block;
  margin-bottom: 12px;
}

.control-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  color: #dddddd;
  font-size: 0.85rem;
  font-weight: 700;
}

input[type='range'] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #333333;
  border-radius: 3px;
  outline: none;
}

input[type='range']::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff52a2;
  cursor: pointer;
  box-shadow: 0 0 8px #ff52a2;
}

/* --- Interactive Keybinding Box --- */
.keybind-box {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bind-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}

.key-btn {
  background: #ff52a2;
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 32px;
  text-align: center;
  transition: all 0.15s ease;
}

.key-btn:hover {
  background: #ff77b7;
  transform: scale(1.05);
}

/* Rebinding state */
.key-btn.listening {
  background: #ffffff;
  color: #ff52a2;
  animation: keyPulse 0.8s infinite alternate;
}

@keyframes keyPulse {
  0% { box-shadow: 0 0 4px #ffffff; }
  100% { box-shadow: 0 0 12px #ff52a2; }
}

.bind-hint {
  color: #888888;
  font-size: 0.75rem;
  transition: color 0.2s ease;
}

.bind-hint.active {
  color: #ff52a2;
  font-weight: 700;
}

/* --- User Profile Section --- */
.user-profile {
  position: absolute;
  bottom: 20px;
  left: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 14px 6px 6px;
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

.avatar-box {
  width: 32px;
  height: 32px;
  background-color: #ff52a2;
  color: #ffffff;
  border-radius: 6px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
  font-size: 1.1rem;
}

.username {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
}

/* --- Top Navigation Header --- */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 52px;
  background: rgba(13, 17, 23, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
  z-index: 200;
  backdrop-filter: blur(8px);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 30px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon {
  background: #ff52a2;
  color: #fff;
  font-weight: 900;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 6px;
}

.brand-title {
  color: #ffffff;
  font-weight: 800;
  font-size: 1.05rem;
}

.nav-links {
  display: flex;
  gap: 16px;
}

.nav-link {
  background: none;
  border: none;
  color: #8b949e;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s;
}

.nav-link:hover, .nav-link.active {
  color: #ffffff;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  filter: grayscale(1);
  transition: filter 0.2s;
}

.icon-btn:hover {
  filter: grayscale(0);
}

/* --- Song Selection Overlay --- */
.song-select-screen {
  position: fixed;
  inset: 0;
  top: 52px; /* Header clearance */
  background: #0b0e14;
  z-index: 150;
  display: flex;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Screen visibility when active */
body.in-song-select .song-select-screen {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

body.in-song-select .menu-container,
body.in-song-select .user-profile {
  display: none;
}

/* --- Left Filter Panel --- */
.filter-panel {
  width: 320px;
  min-width: 320px;
  background: #11151c;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
}

.panel-tabs {
  display: flex;
  background: #0d1017;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: #6e7681;
  padding: 12px 0;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: #ffffff;
  border-bottom-color: #388bfd;
  background: rgba(56, 139, 253, 0.08);
}

.filter-scroll-area {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  color: #8b949e;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box {
  display: flex;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  overflow: hidden;
}

.search-box input {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 12px;
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}

.search-btn {
  background: #1f6feb;
  border: none;
  padding: 0 12px;
  cursor: pointer;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.mode-btn {
  background: #161b22;
  border: 1px solid #30363d;
  color: #8b949e;
  padding: 6px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.mode-btn.active {
  background: #1f6feb;
  color: #ffffff;
  border-color: #388bfd;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  font-size: 0.72rem;
  color: #8b949e;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s;
}

.chip:hover, .chip.active {
  color: #388bfd;
  font-weight: 700;
}

/* Custom Pink Range Slider for Song Select */
.slider-range-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#diff-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 5px;
  background: #21262d;
  border-radius: 3px;
  outline: none;
}

#diff-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ff52a2;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 82, 162, 0.8);
  transition: transform 0.1s ease;
}

#diff-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.diff-value {
  color: #c9d1d9;
  font-size: 0.85rem;
  font-weight: 800;
}

/* --- Panel Views Switching --- */
.panel-view {
  display: none;
  flex: 1;
  overflow: hidden;
}

.panel-view.active {
  display: flex;
  flex-direction: column;
}

/* --- Mods Scroll Container --- */
.mods-scroll-area {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
}

/* Multiplier Badge */
.multiplier-badge-container {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.multiplier-badge {
  background: rgba(22, 27, 34, 0.9);
  border: 1px solid rgba(56, 139, 253, 0.4);
  color: #58a6ff;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 6px 18px;
  border-radius: 20px;
  box-shadow: 0 0 12px rgba(56, 139, 253, 0.15);
}

/* Mod Sections */
.mod-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mod-section h3 {
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: 0.3px;
}

.mod-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mod-label {
  color: #8b949e;
  font-size: 0.8rem;
  font-weight: 600;
}

/* Slick Modern Toggle Switches */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #21262d;
  border-radius: 20px;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: #8b949e;
  border-radius: 50%;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

input:checked + .toggle-slider {
  background-color: #1f6feb;
  border-color: #388bfd;
  box-shadow: 0 0 8px rgba(31, 111, 235, 0.5);
}

input:checked + .toggle-slider:before {
  transform: translateX(18px);
  background-color: #ffffff;
}

/* Custom Song Speed Slider */
.mod-speed-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.speed-header {
  display: flex;
  justify-content: space-between;
}

.speed-value {
  color: #388bfd;
  font-size: 0.8rem;
  font-weight: 800;
}

.mod-speed-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: #21262d;
  border-radius: 2px;
  outline: none;
}

.mod-speed-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #388bfd;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(56, 139, 253, 0.8);
}

.mod-description {
  color: #6e7681;
  font-size: 0.7rem;
  line-height: 1.35;
  margin: 2px 0 0 0;
}

/* Dark Red Reset Button */
.reset-mods-btn {
  width: 100%;
  background: #8e1b1b;
  color: #ffffff;
  border: none;
  padding: 10px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
  margin-top: 8px;
}

.reset-mods-btn:hover {
  background: #b22222;
}

.reset-mods-btn:active {
  transform: scale(0.98);
}

/* --- Settings Panel View --- */
.settings-scroll-area {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.settings-search-row {
  display: flex;
  gap: 8px;
}

.settings-search-row input {
  flex: 1;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 8px 12px;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.8rem;
  outline: none;
}

.settings-search-row input:focus {
  border-color: #388bfd;
}

.menu-list-btn {
  background: #1f6feb;
  border: none;
  color: #ffffff;
  border-radius: 6px;
  width: 36px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.setting-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.setting-section h3 {
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 800;
  margin: 0;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-row.vertical {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.setting-header, .label-with-icon {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.label-with-icon {
  justify-content: flex-start;
  gap: 6px;
}

.setting-icon {
  font-size: 0.85rem;
}

.setting-label {
  color: #8b949e;
  font-size: 0.78rem;
  font-weight: 600;
}

.setting-value {
  color: #58a6ff;
  font-size: 0.75rem;
  font-weight: 800;
  margin-left: auto;
}

.setting-hint {
  color: #6e7681;
  font-size: 0.7rem;
  line-height: 1.35;
  margin: -4px 0 4px 0;
}

/* Color Picker Input */
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 50%;
}

.color-preview {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #388bfd;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(56, 139, 253, 0.6);
}

/* Generic Settings Sliders */
.setting-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: #21262d;
  border-radius: 2px;
  outline: none;
}

.setting-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #58a6ff;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(88, 166, 255, 0.8);
}

/* --- Keybinds Panel --- */
.keybinds-scroll-area {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.keybind-notice {
  color: #8b949e;
  font-size: 0.72rem;
  line-height: 1.4;
  margin: 0;
}

.keybind-mode-tabs {
  display: flex;
  gap: 6px;
  background: #161b22;
  padding: 4px;
  border-radius: 6px;
  border: 1px solid #30363d;
}

.mode-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #8b949e;
  padding: 6px 0;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 4px;
  cursor: pointer;
}

.mode-tab-btn.active {
  background: #21262d;
  color: #ffffff;
}

.keybind-section {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.keybind-section.active {
  display: flex;
}

.sub-heading {
  color: #ffffff;
  font-size: 0.8rem;
  margin: 8px 0 2px 0;
  font-weight: 800;
}

.bind-row-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bind-label {
  color: #c9d1d9;
  font-size: 0.75rem;
  font-weight: 600;
}

.bind-inputs {
  display: flex;
  gap: 6px;
}

.key-bind-btn {
  background: #21262d;
  border: 1px solid #30363d;
  color: #58a6ff;
  border-radius: 4px;
  min-width: 70px;
  padding: 6px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.key-bind-btn.empty {
  color: #484f58;
}

.key-bind-btn.listening {
  border-color: #58a6ff;
  background: #1f6feb;
  color: #ffffff;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* --- Beatmap Grid Layout --- */
.beatmap-grid-container {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.beatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* --- Individual Card Styling --- */
.beatmap-card {
  position: relative;
  height: 160px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
}

.beatmap-card:hover {
  transform: translateY(-3px);
  border-color: #ff52a2;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(13, 17, 23, 0.3) 0%, rgba(13, 17, 23, 0.9) 100%);
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-status,
.status-badge {
  align-self: flex-start;
  background: #238636;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.diff-pills {
  display: flex;
  gap: 3px;
}

.diff-pill {
  width: 4px;
  height: 12px;
  border-radius: 2px;
}

.diff-pill.easy { background: #4ade80; }
.diff-pill.normal { background: #60a5fa; }
.diff-pill.hard { background: #facc15; }
.diff-pill.insane { background: #f87171; }
.diff-pill.expert { background: #c084fc; }
.diff-pill.extra { background: #ec4899; }

.card-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.card-icon-btn {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #c9d1d9;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.card-body {
  margin-top: auto;
}

.card-info .song-title,
.map-title {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-info .artist-name,
.map-artist {
  color: #8b949e;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 2px 0 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 6px;
}

.map-stat {
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 600;
}

/* --- Active Card Highlight --- */
.beatmap-card.selected {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4), 0 8px 24px rgba(0, 0, 0, 0.6);
  transform: translateY(-2px);
}

.beatmap-card.selected::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: #38bdf8;
  border-radius: 0 0 8px 8px;
}

/* --- Difficulty Popover Drawer --- */
.card-popover {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 95%;
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.7);
  z-index: 100;
  cursor: default;
}

.popover-stats {
  display: flex;
  justify-content: space-around;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.popover-tags {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 10px;
}

.pop-tag {
  background: #1e293b;
  color: #38bdf8;
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.popover-diff-title {
  color: #f8fafc;
  font-size: 0.8rem;
  font-weight: 700;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
  padding-bottom: 4px;
  margin-bottom: 6px;
  text-align: center;
}

.star-rating-pill {
  display: inline-block;
  background: #facc15;
  color: #422006;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.popover-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  font-size: 0.68rem;
  color: #64748b;
}

.stat-bar-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-bar-label {
  display: flex;
  justify-content: space-between;
}

.stat-bar-bg {
  width: 100%;
  height: 4px;
  background: #1e293b;
  border-radius: 2px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  background: #38bdf8;
  border-radius: 2px;
}

/* --- Audio Preview Bar --- */
#audio-preview-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 12px 24px;
  display: none;
  align-items: center;
  justify-content: space-between;
  z-index: 900;
}

#audio-preview-bar.active {
  display: flex;
}

.preview-controls-left,
.preview-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar-btn {
  background: none;
  border: none;
  color: #c0c7d0;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.bar-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.bar-btn.active {
  color: #38bdf8;
}

.preview-seeker-container {
  flex: 1;
  margin: 0 20px;
  display: flex;
  align-items: center;
}

/* Custom Seek and Volume Sliders */
#seek-slider,
#volume-slider {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #475569;
  outline: none;
  cursor: pointer;
}

#volume-slider {
  width: 60px;
}

#seek-slider::-webkit-slider-thumb,
#volume-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 50%;
  background: #38bdf8;
  cursor: pointer;
}

.time-display {
  font-family: monospace;
  font-size: 12px;
  color: #e2e8f0;
  white-space: nowrap;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* --- Modal Overlay Styling --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 15, 25, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 1000;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #131b26;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: 90%;
  max-width: 520px;
  padding: 24px;
  color: #f1f5f9;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.modal-header h2 {
  font-size: 1.25rem;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #fff;
}

.update-badge {
  display: inline-block;
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border: 1px solid rgba(234, 179, 8, 0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.update-status {
  font-size: 0.95rem;
  color: #cbd5e1;
  line-height: 1.5;
  margin-bottom: 20px;
}

.update-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.timeline-item {
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid #3b82f6;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
}

.timeline-item.upcoming {
  border-left-color: #64748b;
  opacity: 0.85;
}

.timeline-date {
  font-size: 0.75rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 600;
}

.timeline-item h4 {
  margin: 4px 0 8px;
  font-size: 0.95rem;
}

.timeline-item ul {
  margin: 0;
  padding-left: 18px;
  font-size: 0.85rem;
  color: #94a3b8;
}

.timeline-item li {
  margin-bottom: 4px;
}

/* --- Gameplay Overlay & Canvas --- */
.gameplay-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #000;
  display: none;
  z-index: 1000;
}

.gameplay-overlay.active {
  display: block;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#game-ui {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  font-family: sans-serif;
  text-align: right;
  pointer-events: none;
}

#score-display {
  font-size: 32px;
  font-weight: bold;
  letter-spacing: 2px;
}

#accuracy-display {
  font-size: 20px;
  color: #00e676;
}

#exit-game-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
}

#exit-game-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* --- Results / End Score Screen Styling --- */
.results-screen-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 26, 0.95);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  padding: 40px;
  color: #ffffff;
  font-family: 'Exo 2', sans-serif;
}

.results-header h1 {
  font-size: 28px;
  font-weight: 800;
  margin: 0;
  color: #38bdf8;
}

.results-header p {
  margin: 4px 0 0 0;
  color: #94a3b8;
  font-weight: 600;
}

.results-body {
  display: flex;
  flex: 1;
  gap: 40px;
  margin-top: 30px;
}

.results-left-panel {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 16px;
  padding: 24px;
}

.results-score-display {
  display: flex;
  flex-direction: column;
}

.results-score-display .score-label {
  font-size: 14px;
  color: #38bdf8;
  font-weight: 800;
  letter-spacing: 2px;
}

#results-score-value {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 4px;
  text-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
}

.judgement-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.judgement-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(30, 41, 59, 0.5);
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 800;
}

.judgement-row.score-300 { border-left: 4px solid #67e8f9; }
.judgement-row.score-100 { border-left: 4px solid #58d68d; }
.judgement-row.score-50 { border-left: 4px solid #f1c40f; }
.judgement-row.miss { border-left: 4px solid #ff4757; }
.results-stats-row {
  display: flex;
  gap: 20px;
}

.stat-box {
  flex: 1;
  background: rgba(30, 41, 59, 0.5);
  padding: 16px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 700;
}

.stat-val {
  font-size: 28px;
  font-weight: 900;
  color: #ffffff;
}

.results-right-panel {
  flex: 0.8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 16px;
  padding: 24px;
}

.rank-letter {
  font-size: 160px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 30px currentColor;
}

.rank-ss { color: #f1c40f; }
.rank-s  { color: #f1c40f; }
.rank-a  { color: #2ecc71; }
.rank-b  { color: #3498db; }
.rank-c  { color: #9b59b6; }
.rank-d  { color: #e74c3c; }

.results-action-buttons {
  display: flex;
  gap: 16px;
  width: 100%;
}

.results-action-buttons button {
  flex: 1;
}

/* --- Pause Menu Overlay --- */
.pause-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 25, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1100;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pause-menu-content {
  background: #11151c;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 32px 40px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 82, 162, 0.2);
  min-width: 280px;
}

.pause-title {
  color: #ffffff;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 3px;
  margin-bottom: 24px;
  text-shadow: 0 0 15px rgba(255, 82, 162, 0.5);
}

.pause-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pause-btn {
  background: #161b22;
  color: #ffffff;
  border: 1px solid #30363d;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pause-btn:hover {
  background: #1f6feb;
  border-color: #388bfd;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(31, 111, 235, 0.4);
}

.pause-btn.danger:hover {
  background: #da3633;
  border-color: #f85149;
  box-shadow: 0 4px 12px rgba(218, 54, 51, 0.4);
}

/* --- UPDATED DIFFICULTY DROPDOWN --- */
.diff-dropdown-container {
  display: block;
  margin: 8px 0;
  position: relative;
  width: 100%;
}

.diff-select-dropdown {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background-color: #0d1117;
  color: #f0f6fc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 28px 6px 10px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.diff-dropdown-container::after {
  content: '▼';
  font-size: 0.6rem;
  color: #ff52a2;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

.diff-select-dropdown:hover,
.diff-select-dropdown:focus {
  border-color: #ff52a2;
  background-color: #161b22;
  box-shadow: 0 0 8px rgba(255, 82, 162, 0.4);
}

.diff-select-dropdown option {
  background-color: #0d1117;
  color: #ffffff;
  padding: 8px;
  font-weight: 600;
}

/* --- Gameplay Countdown Overlay & Skip Intro Control --- */
.gameplay-countdown-overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 7rem;
  font-weight: 900;
  color: #38bdf8;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.8), 0 0 40px rgba(56, 189, 248, 0.4);
  z-index: 1050;
  pointer-events: none;
  animation: countdownPulse 0.6s infinite alternate;
}

@keyframes countdownPulse {
  from { transform: scale(0.95); opacity: 0.8; }
  to { transform: scale(1.08); opacity: 1; }
}

.game-hud-btn {
  position: absolute;
  bottom: 30px;
  right: 30px;
  background: rgba(255, 82, 162, 0.85);
  border: 2px solid #ffffff;
  color: #ffffff;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 1px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 1050;
  display: none;
  box-shadow: 0 0 15px rgba(255, 82, 162, 0.6);
  transition: transform 0.15s ease, background 0.15s ease;
}

.game-hud-btn:hover {
  background: rgba(255, 82, 162, 1);
  transform: scale(1.05);
}

/* ==========================================================================
   osu! Style Intro Splash Animation
   ========================================================================== */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at center, #1e1b4b 0%, #090d16 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.intro-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.intro-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

/* Pulsing Main Pink Circle */
.intro-circle {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: #ff52a2;
  border: 8px solid #ffffff;
  box-shadow: 0 0 35px rgba(255, 82, 162, 0.9), 0 0 70px rgba(255, 82, 162, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  animation: osuPopIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
             osuPulse 0.5s ease-in-out infinite alternate 0.8s;
}

.intro-title {
  color: #ffffff;
  font-size: 4.5rem;
  font-weight: 900;
  letter-spacing: -2px;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  animation: textPop 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Subtitle text below the circle */
.intro-welcome {
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(15px);
  animation: slideUpFade 0.6s ease-out 0.5s forwards;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

/* Keyframe Animations */
@keyframes osuPopIn {
  0% {
    transform: scale(0) rotate(-15deg);
    opacity: 0;
  }
  70% {
    transform: scale(1.15) rotate(3deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes textPop {
  0% {
    transform: scale(0.3);
  }
  80% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes osuPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 35px rgba(255, 82, 162, 0.9), 0 0 70px rgba(255, 82, 162, 0.5);
  }
  100% {
    transform: scale(1.06);
    box-shadow: 0 0 50px rgba(255, 82, 162, 1), 0 0 90px rgba(255, 82, 162, 0.8);
  }
}

@keyframes slideUpFade {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Exit Overlay Screen */
.exit-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: #050b14;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.exit-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.exit-content {
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.exit-overlay.active .exit-content {
  transform: scale(1);
}

.exit-title {
  font-size: 3.5rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(103, 232, 249, 0.6), 0 0 40px rgba(103, 232, 249, 0.3);
  animation: glowPulse 2s infinite alternate ease-in-out;
}

/* Smooth Fade Out for Main App Container */
body.exiting {
  opacity: 0;
  transition: opacity 1.2s ease;
  pointer-events: none;
}

@keyframes glowPulse {
  from {
    text-shadow: 0 0 15px rgba(103, 232, 249, 0.4);
  }
  to {
    text-shadow: 0 0 30px rgba(103, 232, 249, 0.9), 0 0 50px rgba(103, 232, 249, 0.5);
  }
}

/* --- Credits Modal Styling --- */
.modal-card {
  background: #11151c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: 90%;
  max-width: 560px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 82, 162, 0.2);
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.credits-body {
  color: #c9d1d9;
  font-size: 0.88rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.credits-disclaimer {
  background: rgba(255, 82, 162, 0.1);
  border-left: 3px solid #ff52a2;
  padding: 10px 14px;
  border-radius: 0 6px 6px 0;
  color: #e0e0e0;
}

.credits-section h3 {
  color: #ff52a2;
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.credits-section ul {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.credits-section li {
  position: relative;
  padding-left: 16px;
}

.credits-section li::before {
  content: '•';
  color: #38bdf8;
  position: absolute;
  left: 0;
  font-weight: bold;
}

.credits-section code {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
}
