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

body {
  background: #1a1a2e;
  color: #eee;
  font-family: 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
  height: 100vh;
}

/* --- Login Screen --- */
#login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 20px;
}

#login-screen h1 {
  font-size: 72px;
  color: #ff66ab;
  text-shadow: 0 0 30px rgba(255, 102, 171, 0.5);
  letter-spacing: -2px;
}

#login-screen .subtitle { color: #888; font-size: 14px; margin-top: -15px; }
#login-screen .error { color: #ff4444; font-size: 14px; min-height: 20px; }
.login-hint { color: #555; font-size: 11px; margin-top: -8px; }

.login-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 320px;
}

.login-btn {
  padding: 14px 24px;
  border-radius: 25px;
  border: 2px solid transparent;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.login-guest {
  background: #16213e;
  color: #fff;
  border-color: #333;
}
.login-guest:hover { border-color: #ff66ab; background: #1a2540; }

.login-account {
  background: #ff66ab;
  color: #fff;
}
.login-account:hover { background: #ff4596; }

.login-osu {
  background: #1a1a2e;
  color: #ff66ab;
  border-color: #ff66ab;
}
.login-osu:hover { background: #ff66ab; color: #fff; }

.login-fields {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 320px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.login-account-submit { width: 100%; }

#login-screen input {
  width: 100%;
  padding: 12px 16px;
  border-radius: 25px;
  border: 2px solid #333;
  background: #16213e;
  color: #eee;
  font-size: 16px;
  text-align: center;
  outline: none;
}

#login-screen input:focus { border-color: #ff66ab; }

.sidebar-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid #ff66ab;
  object-fit: cover;
}

/* --- Menu Layout --- */
#menu {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* --- Top Bar (osu!-style) --- */
.topbar {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 48px;
  background: #0e1526;
  border-bottom: 1px solid #222;
  flex-shrink: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-logo {
  font-size: 20px;
  font-weight: 800;
  color: #ff66ab;
  letter-spacing: -0.5px;
}

.topbar-status {
  font-size: 10px;
  color: #4caf50;
  line-height: 1;
}

.topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar-search {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.topbar-search-icon {
  position: absolute;
  left: 12px;
  font-size: 14px;
  color: #555;
  pointer-events: none;
}

.topbar-search input {
  width: 100%;
  padding: 7px 14px 7px 36px;
  border-radius: 20px;
  border: 1px solid #333;
  background: #1a1a2e;
  color: #eee;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.topbar-search input:focus {
  border-color: #ff66ab;
  box-shadow: 0 0 12px rgba(255, 102, 171, 0.15);
}

.topbar-search input::placeholder {
  color: #555;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.topbar-user {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.topbar-divider {
  width: 1px;
  height: 20px;
  background: #333;
}

.topbar-clock {
  font-size: 13px;
  font-weight: 600;
  color: #ccc;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.topbar-playtime {
  font-size: 11px;
  color: #888;
  font-variant-numeric: tabular-nums;
}

.topbar-icon {
  background: none;
  border: none;
  color: #888;
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.topbar-icon:hover {
  color: #ff66ab;
  background: rgba(255, 102, 171, 0.08);
}

.topbar-icon.logout:hover {
  color: #ff4444;
  background: rgba(255, 68, 68, 0.08);
}

.topbar-notif {
  font-size: 16px;
}

.notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #ff4444;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* --- Menu Background --- */
.menu-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  filter: brightness(0.4);
  transition: opacity 0.3s ease;
}

/* --- Main Content (osu!-style: left=details, right=carousel) --- */
.menu-content {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

.menu-left {
  width: 792px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
  clip-path: polygon(0 0, 100% 0, calc(100% - 8.75vh) 100%, 0 100%);
}

.menu-right {
  width: 30%;
  margin-left: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.menu-right .error {
  padding: 4px 12px;
  text-align: center;
}

.menu-right .card-grid {
  padding: 8px 12px;
  overflow-y: auto;
  max-height: 40%;
}

/* --- Map Detail Panel (left side) --- */
/* --- Map Detail Panel (left side) --- */
.map-detail {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.map-detail-header {
  padding: 16px 24px 14px;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid #222;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  min-height: 180px;
}

/* No separate cover image — body background shows through */

.map-detail-header > * {
  position: relative;
  z-index: 1;
}

.map-ranked-badge {
  display: inline-block;
  background: #4caf50;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  width: fit-content;
}

.map-detail-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.5px;
  line-height: 1.2;
}
.map-title-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}
.map-title-link:hover {
  color: #ff66ab;
  text-decoration: underline;
}

.map-detail-artist {
  font-size: 14px;
  color: #aaa;
  font-weight: 600;
}

/* Action row: play/fav buttons + duration + BPM */
.map-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.map-action-btn {
  background: none;
  border: 1px solid #444;
  color: #ccc;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.map-action-btn:hover {
  border-color: #ff66ab;
  color: #ff66ab;
}

.map-action-stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #aaa;
  margin-left: 4px;
}

.action-icon {
  font-size: 14px;
  color: #888;
}

/* Star badge + diff name line */
.map-diff-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.map-star-badge {
  background: #ff66ab;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  white-space: nowrap;
}

.map-diff-name {
  font-size: 13px;
  color: #ff66ab;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stats row */
.map-detail-meta {
  padding: 10px 24px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid #333;
}

.map-meta-row {
  display: flex;
  gap: 0;
}

.map-meta-item {
  display: flex;
  flex-direction: column;
  padding: 0 16px;
  border-right: 1px solid #333;
}

.map-meta-item:last-child {
  border-right: none;
}

.map-meta-item:first-child {
  padding-left: 0;
}

.map-meta-divider {
  width: 2px;
  background: #444;
  margin: 0 8px;
  align-self: stretch;
}

.meta-label {
  font-size: 10px;
  color: #666;
  white-space: nowrap;
}

.meta-value {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.map-scores-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid #1a1a2e;
  height: 38px;
}

.score-tab {
  background: none;
  border: none;
  color: #888;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 16px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  height: 100%;
  display: flex;
  align-items: center;
}

.score-tab.active {
  color: #fff;
  background: rgba(255, 102, 171, 0.08);
  border-bottom-color: #ff66ab;
}

.score-tab:hover:not(.active) {
  color: #ccc;
  background: rgba(255,255,255,0.03);
}

.score-tabs-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 125px;
  padding-right: 12px;
}

.score-tab-select {
  background: rgba(255,255,255,0.08);
  border: 1px solid #444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.score-tab-select:hover {
  border-color: #ff66ab;
}

.map-scores-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transform: skewX(-5deg);
  transform-origin: top right;
  width: 700px;
  padding: 8px 0 8px 16px;
  position: relative;
  left: 60px;
}

.map-scores-list::-webkit-scrollbar {
  display: none;
}

.scores-empty {
  text-align: center;
  padding: 40px 20px;
  color: #555;
  font-size: 13px;
}

/* Score Entry — osu!lazer style rows */
/* Container (.map-scores-list) is skewed → rows auto-cascade diagonally */
/* Individual rows are NOT skewed (lazer: d.Shear = Vector2.Zero in wedge) */
.score-entry {
  display: flex;
  align-items: center;
  height: 50px;
  margin-bottom: 4px;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  animation: scoreSlideIn 0.35s ease both;
  transition: filter 0.2s;
}

/* Background layer (dark, 0.4 alpha like lazer Background5) */
.score-entry::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(20, 22, 28, 0.85);
  border-radius: 10px;
  z-index: 0;
}

/* Grade color gradient on right side (lazer rightContent) */
.score-entry::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 120px;
  z-index: 0;
  border-radius: 0 10px 10px 0;
}

/* Grade-specific right gradients (lazer ForRank colors) */
.score-entry[data-grade="SS"]::after,
.score-entry[data-grade="X"]::after  { background: linear-gradient(to right, transparent, rgba(222,49,174,0.5)); }
.score-entry[data-grade="S"]::after  { background: linear-gradient(to right, transparent, rgba(2,181,195,0.5)); }
.score-entry[data-grade="A"]::after  { background: linear-gradient(to right, transparent, rgba(136,218,32,0.5)); }
.score-entry[data-grade="B"]::after  { background: linear-gradient(to right, transparent, rgba(227,177,48,0.5)); }
.score-entry[data-grade="C"]::after  { background: linear-gradient(to right, transparent, rgba(255,142,93,0.5)); }
.score-entry[data-grade="D"]::after  { background: linear-gradient(to right, transparent, rgba(255,90,90,0.5)); }
.score-entry[data-grade="F"]::after  { background: linear-gradient(to right, transparent, rgba(60,60,60,0.5)); }

/* Inner content sits above pseudo-elements */
.score-entry > * {
  position: relative;
  z-index: 1;
}

@keyframes scoreSlideIn {
  from { opacity: 0; transform: translateX(40px); filter: blur(2px); }
  to   { opacity: 1; transform: translateX(0);    filter: blur(0); }
}

@keyframes scoreSlideOut {
  from { opacity: 1; transform: translateX(0);    filter: blur(0); }
  to   { opacity: 0; transform: translateX(40px); filter: blur(2px); }
}

.score-entry.slide-out {
  animation: scoreSlideOut 0.25s ease forwards;
}

.score-entry:nth-child(1) { animation-delay: 0s; }
.score-entry:nth-child(2) { animation-delay: 0.04s; }
.score-entry:nth-child(3) { animation-delay: 0.08s; }
.score-entry:nth-child(4) { animation-delay: 0.12s; }
.score-entry:nth-child(5) { animation-delay: 0.16s; }
.score-entry:nth-child(6) { animation-delay: 0.20s; }
.score-entry:nth-child(7) { animation-delay: 0.24s; }
.score-entry:nth-child(8) { animation-delay: 0.28s; }
.score-entry:nth-child(9) { animation-delay: 0.32s; }
.score-entry:nth-child(10) { animation-delay: 0.36s; }
.score-entry:nth-child(n+11) { animation-delay: 0.40s; }

.score-entry:hover {
  filter: brightness(1.25);
}

/* Rank number — lazer rank_label_width=40 */
.score-rank-num {
  font-size: 15px;
  font-weight: 800;
  color: rgba(255,255,255,0.7);
  min-width: 40px;
  text-align: center;
  flex-shrink: 0;
}
.score-rank-num.gold { color: #ffcc22; }
.score-rank-num.silver { color: #ccc; }
.score-rank-num.bronze { color: #cd7f32; }

/* Avatar — lazer HEIGHT=50, avatar fills height */
.score-avatar {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Player info block: flag + time / name */
.score-info {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 80px;
  flex-shrink: 0;
  margin: 0 10px;
  overflow: hidden;
}

.score-info-top {
  display: flex;
  align-items: center;
  gap: 5px;
}

.score-flag {
  font-size: 12px;
  flex-shrink: 0;
}

.score-time {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  flex-shrink: 0;
}

.score-player {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stats: MAXIMALE COMBO + GENAUIGKEIT — lazer spacing=20 */
.score-stats-group {
  display: flex;
  gap: 14px;
  flex-shrink: 1;
  min-width: 0;
  padding-right: 6px;
}

.score-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.score-stat-label {
  font-size: 8px;
  font-weight: 700;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}

.score-stat-value {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}

/* Score + mods + grade right section */
.score-right-section {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  gap: 4px;
  padding-right: 6px;
  flex-shrink: 0;
}

/* Large score number */
.score-value {
  font-size: 18px;
  font-weight: 300;
  color: #fff;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
  letter-spacing: -0.5px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* Mod pills */
.score-mods {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
  align-items: center;
}

.score-mod-pill {
  font-size: 8px;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 8px;
  white-space: nowrap;
}

.score-mod-pill.mod-speed {
  background: rgba(255, 80, 50, 0.75);
  color: #fff;
}

.score-mod-pill.mod-ar {
  background: rgba(80, 200, 80, 0.75);
  color: #fff;
}

.score-mod-pill.mod-default {
  background: rgba(255, 102, 171, 0.4);
  color: #ff66ab;
}

/* Grade badge — lazer grade_width=35, Font Numeric size=14 */
.score-grade {
  font-size: 14px;
  font-weight: 900;
  min-width: 35px;
  text-align: center;
  flex-shrink: 0;
  letter-spacing: -2px;
}

/* Lazer GetRankLetterColour: SS/S = gold gradient, A-D = dark tones on colored bg */
.score-grade.grade-ss,
.score-grade.grade-x  { color: #ffe7a8; text-shadow: 0 1px 0 #ffb800; }
.score-grade.grade-s  { color: #ffe7a8; text-shadow: 0 1px 0 #ffb800; }
.score-grade.grade-a  { color: #275227; }
.score-grade.grade-b  { color: #553a2b; }
.score-grade.grade-c  { color: #473625; }
.score-grade.grade-d  { color: #512525; }
.score-grade.grade-f  { color: #cc3333; }

.score-replay-btn {
  background: rgba(255, 102, 171, 0.15);
  border: 1px solid rgba(255, 102, 171, 0.4);
  color: #ff66ab;
  font-size: 12px;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
  position: relative;
  z-index: 2;
}
.score-replay-btn:hover {
  background: rgba(255, 102, 171, 0.35);
  border-color: #ff66ab;
  transform: scale(1.1);
}

/* --- Carousel (right side, lazer-style) --- */
.carousel-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.carousel {
  width: 100%;
  height: 100%;
  overflow-y: scroll;
  overscroll-behavior: contain;
  padding: 40vh 0;
  scrollbar-width: none;
}

.carousel::-webkit-scrollbar { display: none; }

/* Set wrapper - logical container for header + diffs */
.carousel-set {
  position: relative;
}

/* --- Set header panel (lazer: 72px, we use 80px for web readability) --- */
.carousel-item {
  position: relative;
  margin: 2px 0;
  height: 80px;
  border-radius: 10px 0 0 10px;
  overflow: hidden;
  cursor: pointer;
  transition: height 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              filter 0.1s ease;
  border: 2px solid transparent;
  will-change: transform;
}

.carousel-item:hover {
  filter: brightness(1.12);
  border-color: rgba(255, 255, 255, 0.12);
}

.carousel-item.active {
  height: 90px;
  border-color: rgba(255, 102, 171, 0.5);
  box-shadow: 0 0 18px rgba(255, 102, 171, 0.2),
              0 0 6px rgba(255, 102, 171, 0.15),
              0 2px 8px rgba(0, 0, 0, 0.4);
}

.carousel-item.set-expanded {
  border-color: rgba(255, 102, 171, 0.35);
  box-shadow: 0 0 12px rgba(255, 102, 171, 0.15),
              0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Chevron expand indicator (lazer: 0→18px width, elastic) */
.ci-chevron {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  font-size: 20px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.25);
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275),
              color 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
  opacity: 0.6;
}

.set-expanded .ci-chevron {
  transform: translateY(-50%) rotate(90deg);
  color: #ff66ab;
  opacity: 1;
}

/* --- Difficulty sub-panels container (height-animated) --- */
.carousel-diffs {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0;
}

.carousel-diffs.expanded {
  opacity: 1;
}

/* --- Difficulty panel (lazer: 45px, we use 52px) --- */
.carousel-diff {
  position: relative;
  height: 52px;
  margin: 2px 0;
  border-radius: 10px 0 0 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.25s ease,
              filter 0.1s ease;
  border: 2px solid transparent;
  border-left: 3px solid rgba(255, 102, 171, 0.25);
  will-change: transform;
}

.carousel-diff:hover {
  filter: brightness(1.12);
  border-left-color: rgba(255, 102, 171, 0.7);
}

.carousel-diff.diff-selected {
  border-color: rgba(255, 102, 171, 0.5);
  border-left-color: #ff66ab;
  box-shadow: 0 0 10px rgba(255, 102, 171, 0.2),
              0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Play hint - always in DOM, shown only on selected diff */
.ci-play-hint {
  display: none;
  color: #ff66ab;
  font-size: 14px;
  font-weight: bold;
  margin-left: 6px;
  animation: ciPulse 1s infinite;
}

.diff-selected .ci-play-hint {
  display: inline;
}

@keyframes ciPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.ci-stars {
  font-weight: bold;
  font-size: 15px;
  margin-right: 5px;
}

.ci-diff-stats {
  font-size: 12px;
  color: #999;
  letter-spacing: 0.4px;
  margin-top: 1px;
}

.carousel-diff .ci-content {
  padding: 6px 18px;
}

/* --- Background image layer --- */
.carousel-item .ci-bg,
.carousel-diff .ci-bg {
  position: absolute;
  inset: 0;
  background: #1a1a3e;
  background-size: cover;
  background-position: center;
  border-radius: inherit;
}

.carousel-item .ci-bg::after,
.carousel-diff .ci-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.04);
  border-radius: inherit;
}

/* --- Content layer --- */
.carousel-item .ci-content {
  position: relative;
  z-index: 1;
  padding: 12px 18px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.carousel-diff .ci-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.carousel-item .ci-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8), 0 0 8px rgba(0,0,0,0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 28px;
}

.carousel-diff .ci-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.carousel-item .ci-artist {
  font-size: 11px;
  color: #ccc;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.carousel-item .ci-bottom,
.carousel-diff .ci-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.carousel-item .ci-rank,
.carousel-diff .ci-rank {
  font-size: 17px;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.carousel-item .ci-acc,
.carousel-diff .ci-acc {
  font-size: 14px;
  color: #ccc;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

.carousel-item .ci-plays,
.carousel-diff .ci-plays {
  font-size: 14px;
  color: #999;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
}

.carousel-item .ci-diff {
  font-size: 12px;
  color: #bbb;
  background: rgba(0,0,0,0.4);
  padding: 1px 6px;
  border-radius: 8px;
  text-shadow: none;
}

/* --- Delete button --- */
.ci-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #ff4444;
  font-size: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 3;
  line-height: 22px;
  padding: 0;
}
.carousel-item:hover .ci-delete { opacity: 1; }
.ci-delete:hover { background: rgba(255,0,0,0.3); color: #fff; }

.carousel-empty {
  text-align: center;
  color: #555;
  padding: 40px 20px;
  font-size: 13px;
}

/* --- Search (legacy, now in topbar) --- */

.menu-content .error {
  color: #ff4444;
  font-size: 14px;
  min-height: 20px;
  text-align: center;
}

/* --- Beatmap Cards Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
}

.beatmap-card {
  background: #16213e;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #2a2a4a;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.beatmap-card:hover {
  border-color: #ff66ab;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(255, 102, 171, 0.15);
}

.card-cover {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
  background: #111;
}

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

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-artist {
  font-size: 12px;
  color: #888;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.card-diff {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  color: #fff;
}

.card-mapper {
  font-size: 11px;
  color: #666;
  margin-top: 6px;
}

/* Star difficulty colors */
.stars-1 { background: #88b300; }
.stars-2 { background: #66ccff; }
.stars-3 { background: #ffcc22; }
.stars-4 { background: #ff66ab; }
.stars-5 { background: #ff4444; }
.stars-6 { background: #aa44ff; }

/* Audio preview button */
.card-preview {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.beatmap-card:hover .card-preview {
  opacity: 1;
}

.card-preview:hover {
  background: rgba(255, 102, 171, 0.6);
}

/* --- Section Label --- */
.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #ff66ab;
  font-weight: 600;
  margin-bottom: 10px;
}

/* --- Settings Drawer --- */
.settings-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
}

.settings-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.settings-drawer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 300px;
  background: #16213e;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.settings-close {
  background: none;
  border: none;
  color: #888;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.settings-close:hover { color: #ff66ab; }

/* --- Sidebar Sections (reused in settings drawer) --- */
.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #ff66ab;
  font-weight: 600;
}

.sidebar-user {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.sidebar-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #aaa;
}

.stat-row span:last-child {
  color: #fff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.keybind-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #aaa;
}

.keybind-btn {
  width: 48px;
  height: 32px;
  border-radius: 6px;
  border: 2px solid #333;
  background: #1a1a2e;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
}

.keybind-btn:hover { border-color: #ff66ab; }

.keybind-btn.listening {
  border-color: #ff66ab;
  background: rgba(255, 102, 171, 0.15);
  animation: pulse-border 0.8s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: #ff66ab; }
  50% { border-color: #ff99cc; }
}

.sidebar-volume {
  width: 100%;
  height: 4px;
  accent-color: #ff66ab;
  cursor: pointer;
}

.res-input {
  width: 70px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 2px solid #333;
  background: #1a1a2e;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  outline: none;
}

.res-input:focus { border-color: #ff66ab; }

.mod-row {
  display: flex;
  gap: 6px;
}

.mod-btn {
  flex: 1;
  height: 32px;
  padding: 0;
  border-radius: 6px;
  border: 2px solid #333;
  background: #1a1a2e;
  color: #888;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.mod-btn:hover {
  border-color: #555;
}

.mod-btn.active {
  border-color: #ff66ab;
  color: #fff;
  background: rgba(255, 102, 171, 0.15);
}

.logout-btn {
  margin-top: 20px;
  padding: 8px 20px !important;
  font-size: 13px !important;
  background: #16213e !important;
  border: 1px solid #333 !important;
}

.logout-btn:hover { border-color: #ff66ab !important; }

/* --- Game --- */
#game-container {
  display: none;
  position: relative;
  width: 100vw;
  height: 100vh;
}

canvas {
  display: block;
  cursor: none;
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 10px 20px;
  z-index: 10;
}

#hud .info { pointer-events: auto; }

#hud .score {
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

#hud .combo {
  font-size: 28px;
  font-weight: 600;
  color: #ff66ab;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

#hud .info {
  font-size: 14px;
  color: #aaa;
  text-align: right;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.volume-control label {
  font-size: 12px;
  color: #888;
}

.volume-control input[type="range"] {
  width: 80px;
  height: 4px;
  accent-color: #ff66ab;
  cursor: pointer;
}

.loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
  z-index: 100;
  font-size: 24px;
  color: #ff66ab;
}

/* --- Diff Picker Modal --- */
.diff-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.diff-modal {
  background: #16213e;
  border-radius: 16px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.diff-modal h2 {
  color: #ff66ab;
  font-size: 20px;
  text-align: center;
}

.diff-subtitle {
  color: #888;
  font-size: 13px;
  text-align: center;
  margin-top: -10px;
}

.diff-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  max-height: 400px;
}

.diff-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #333;
  background: #1a1a2e;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.diff-btn:hover {
  border-color: #ff66ab;
  background: #1a1a3e;
}

.diff-name { font-weight: 600; }
.diff-stats { font-size: 12px; color: #888; }

.diff-cancel {
  align-self: center;
  padding: 8px 24px;
  border-radius: 20px;
  border: 1px solid #333;
  background: transparent;
  color: #888;
  font-size: 13px;
  cursor: pointer;
}

.diff-cancel:hover {
  border-color: #ff66ab;
  color: #fff;
}

/* --- Search Loading Spinner --- */
.search-loading {
  text-align: center;
  padding: 40px;
  color: #888;
  font-size: 14px;
}

.search-empty {
  text-align: center;
  padding: 40px;
  color: #555;
  font-size: 14px;
}

.footer {
  position: fixed;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: #555;
  pointer-events: none;
  z-index: 1;
}

/* --- Topbar Browse Button --- */
.topbar-browse-btn {
  background: rgba(255, 102, 171, 0.15);
  border: 1px solid rgba(255, 102, 171, 0.3);
  color: #ff66ab;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.topbar-browse-btn:hover {
  background: rgba(255, 102, 171, 0.3);
  border-color: #ff66ab;
}

/* --- Beatmap Browser Overlay --- */
.browser-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.browser-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

.browser-panel {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #1a1a2e;
  border-radius: 0;
  border: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid #333;
}

.browser-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #ff66ab;
}

.browser-close {
  background: rgba(255,255,255,0.06);
  border: 1px solid #444;
  color: #ccc;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 8px;
  transition: all 0.15s;
  line-height: 1;
}
.browser-close:hover { color: #fff; background: rgba(255,68,68,0.3); border-color: #ff4444; }

.browser-search-row {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid #222;
}

.browser-search-row input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid #444;
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  outline: none;
}
.browser-search-row input:focus { border-color: #ff66ab; }

.browser-search-row select {
  background: rgba(255,255,255,0.06);
  border: 1px solid #444;
  color: #ccc;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.browser-results {
  flex: 1;
  overflow-y: auto;
  padding: 12px 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: min-content;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,102,171,0.3) transparent;
  align-content: start;
}
@media (max-width: 1400px) { .browser-results { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 1000px) { .browser-results { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .browser-results { grid-template-columns: 1fr; } }

.browser-empty, .browser-loading {
  text-align: center;
  color: #555;
  padding: 60px 20px;
  font-size: 14px;
  grid-column: 1 / -1;
}

/* Browser Card */
.browser-card {
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.browser-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,102,171,0.3);
}

.browser-card-cover {
  width: 100%;
  height: 120px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  position: relative;
}

.browser-card-status {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0,0,0,0.7);
  color: #aaa;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.browser-card-info {
  flex: 1;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.browser-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-card-artist {
  font-size: 12px;
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.browser-card-mapper {
  font-size: 11px;
  color: #666;
}
.browser-card-mapper strong { color: #999; }

.browser-card-meta {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: #555;
  margin-top: 2px;
}

.browser-card-downloaded {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(0,180,80,0.85);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
}

.browser-card-diffs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.browser-diff-dot {
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  padding: 1px 5px;
  border-radius: 8px;
  white-space: nowrap;
}

.browser-card-stats {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 11px;
  color: #777;
  margin-top: auto;
}

.browser-dl-btn {
  background: rgba(255,102,171,0.15);
  border: 1px solid rgba(255,102,171,0.3);
  color: #ff66ab;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.15s;
}
.browser-dl-btn:hover {
  background: rgba(255,102,171,0.3);
  border-color: #ff66ab;
}

.browser-card.playing {
  border-color: #ff66ab;
  box-shadow: 0 0 12px rgba(255,102,171,0.3);
  background: rgba(255,102,171,0.08);
}

/* --- Replay Player --- */
#replay-container {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
}

#replay-canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

#replay-transport {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(10, 10, 20, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1001;
}

.replay-btn {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s;
}

.replay-btn:hover {
  background: rgba(255,102,171,0.3);
  border-color: #ff66ab;
}

.replay-scrubber {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  cursor: pointer;
}

.replay-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ff66ab;
  cursor: pointer;
}

.replay-speed-slider {
  width: 80px;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
}

.replay-speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #66ccff;
  cursor: pointer;
}

.replay-speed-label {
  color: #66ccff;
  font-size: 13px;
  font-weight: bold;
  min-width: 48px;
  text-align: center;
}

.replay-info {
  color: #999;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 400px;
}

/* --- Results Overlay (replay button on result screen) --- */
#results-overlay {
  position: fixed;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  z-index: 100;
}

.results-btn {
  background: rgba(40, 40, 60, 0.9);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 10px 28px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.results-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
}

.results-replay-btn {
  background: rgba(255,102,171,0.2);
  border-color: #ff66ab;
}

.results-replay-btn:hover {
  background: rgba(255,102,171,0.4);
}
