/* 1. Custom Font */
@font-face {
  font-family: 'NewRodin';
  src: url('./FOT-NewRodin Pro EB.otf') format('opentype');
  font-weight: bold; font-style: normal; font-display: swap;
}

:root {
  --bg: #0b0f12;
  --surface: #12171c;
  --surface-2: #1c242c;
  --text: #ffffff;
  --muted: #a0a0a0;
  --accent: #5ad1ff;
  --border: #2c363f;
  --shadow: 0 10px 50px rgba(0,0,0,0.8);
  --header-h: 110px; /* 增加高度以容纳三行副标题 */
}

/* Difficulty Colors (0-6) */
.lv-0 { background-color: #053d87 !important; }
.lv-1 { background-color: #3e8a24 !important; }
.lv-2 { background-color: #6a6a21 !important; }
.lv-3 { background-color: #950000 !important; }
.lv-4 { background-color: #7c157c !important; }
.lv-5 { background-color: #f48df4 !important; color: #000 !important; }
.lv-6 { background-color: #cc7400 !important; }

html, body { background-color: #0b0f12; color: #ffffff; margin: 0; padding: 0; width: 100%; min-height: 100%; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: 'NewRodin', system-ui, sans-serif; line-height: 1.4; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }

/* Header Styling */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: rgba(11, 15, 18, 0.95); backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border); width: 100%;
}
.header-inner {
  max-width: 1500px; margin: 0 auto; height: 100%; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; flex-direction: column; min-width: 0; }
.logo { font-size: 20px; font-weight: bold; letter-spacing: 1px; color: #fff; margin-bottom: 4px; }
.subtitle { font-size: 9px; color: var(--muted); line-height: 1.3; }
.subtitle a { color: var(--accent); text-decoration: underline; }

/* Gallery Layout (Main Page) */
.content { max-width: 1500px; margin: 0 auto; padding: 16px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
  .content { padding: 24px; }
  .header-inner { padding: 0 24px; }
  .logo { font-size: 22px; }
  .subtitle { font-size: 10px; }
  .brand { margin-right: 20px; }
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; transition: 0.2s; }
.card:hover { transform: translateY(-5px); border-color: var(--accent); }
.card .cover { aspect-ratio: 1; width: 100%; object-fit: cover; background: #000; }
.card .meta { padding: 10px; }
.card .title { font-size: 13px; font-weight: bold; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .sub { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Difficulty Badges on Gallery */
.badges { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px; }
.badge {
  font-size: 8px; padding: 1px 4px; border-radius: 3px;
  font-weight: bold; color: #fff; text-transform: uppercase;
}

/* Player Page (Song Detail) */
.player-page {
  display: flex; flex-direction: column; align-items: center;
  gap: 30px; padding: 20px 16px; max-width: 1600px; margin: 0 auto;
  min-height: calc(100vh - var(--header-h));
}

.unity-wrapper {
  width: 100%; max-width: min(650px, 90vw); max-height: 70vh; 
  aspect-ratio: 1/1; background: #000; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border); position: relative;
  box-shadow: var(--shadow); flex-shrink: 0;
}

#unity-canvas { width: 100% !important; height: 100% !important; position: absolute; top: 0; left: 0; display: block; }

.info-panel { width: 100%; max-width: 600px; }
.info-header h1 { font-size: clamp(22px, 4vw, 42px); margin: 0; line-height: 1.2; }
.info-header p { font-size: clamp(15px, 1.5vw, 20px); color: var(--muted); margin-top: 6px; }

.level-section { margin-top: 24px; }
.level-title { font-size: 11px; color: var(--muted); text-transform: uppercase; margin-bottom: 10px; letter-spacing: 1px; }

.level-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-lv {
  padding: 10px 16px; border: none; border-radius: 8px;
  color: #fff; font-family: 'NewRodin'; font-size: 13px;
  cursor: pointer; font-weight: bold; transition: 0.2s;
}
.btn-lv:hover { filter: brightness(1.2); }

@media (min-width: 1024px) {
  .player-page { flex-direction: row-reverse; justify-content: center; gap: 60px; padding: 40px; }
  .info-panel { text-align: right; align-items: flex-end; }
  .level-grid { justify-content: flex-end; }
}

.search-bar input {
  background: var(--surface); border: 1px solid var(--border); color: #fff;
  padding: 8px 12px; border-radius: 8px; font-family: 'NewRodin'; outline: none;
  font-size: 13px; width: clamp(120px, 20vw, 350px);
}
.search-bar input:focus { border-color: var(--accent); }

.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite linear; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }