/* ============================================
   あつ森 とたけけ楽曲所持チェッカー v1.2 - Style
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;500;700;800&family=Nunito:wght@400;600;700;800&display=swap');

/* ---- CSS Variables ---- */
:root {
  --bg-main: #e8f5e0;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-card-checked: rgba(167, 222, 139, 0.55);
  --bg-header: linear-gradient(135deg, #5ec576 0%, #3aaf85 50%, #28a085 100%);
  --bg-filter-bar: rgba(255, 255, 255, 0.6);
  --color-primary: #3aaf85;
  --color-primary-dark: #2d8a6a;
  --color-primary-light: #a7de8b;
  --color-accent: #f9d74c;
  --color-accent-dark: #e6c03a;
  --color-text: #2c3e2a;
  --color-text-light: #5a7a5a;
  --color-text-muted: #8aaa8a;
  --color-border: rgba(90, 160, 90, 0.18);
  --color-checked-border: rgba(90, 180, 90, 0.35);
  --color-checkbox: #5ec576;
  --color-checkbox-checked: #3aaf85;
  --shadow-card: 0 2px 12px rgba(60, 120, 60, 0.08);
  --shadow-card-hover: 0 8px 32px rgba(60, 120, 60, 0.18);
  --shadow-header: 0 4px 20px rgba(42, 120, 80, 0.25);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition-fast: 0.18s ease;
  --transition-med: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'M PLUS Rounded 1c', 'Nunito', 'Segoe UI', sans-serif;
  background: var(--bg-main);
  color: var(--color-text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ================================================================
   LOADING SCREEN
   ================================================================ */
.loading-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #2d8a6a 0%, #3aaf85 30%, #5ec576 60%, #a7de8b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, transform 0.8s ease;
  overflow: hidden;
}

.loading-screen.fade-out {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.loading-screen.hidden {
  display: none;
}

.loading-content {
  text-align: center;
  position: relative;
  z-index: 2;
}

.loading-leaf {
  font-size: 2.5rem;
  animation: loadLeafSpin 3s linear infinite;
  margin-bottom: 8px;
}

@keyframes loadLeafSpin {
  0% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(90deg) scale(1.1); }
  50% { transform: rotate(180deg) scale(1); }
  75% { transform: rotate(270deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

.loading-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: loadIconBounce 1.5s ease-in-out infinite;
}

@keyframes loadIconBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  30% { transform: translateY(-14px) rotate(-8deg); }
  60% { transform: translateY(-6px) rotate(4deg); }
}

.loading-title {
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0,0,0,0.15);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.loading-subtitle {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 32px;
}

/* Loading Start Button */
.loading-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 40px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 50px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: startBtnPulse 2s ease-in-out infinite;
  letter-spacing: 0.04em;
}

.loading-start-btn:hover {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.6);
  transform: scale(1.06);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.loading-start-btn:active {
  transform: scale(0.96);
}

.loading-start-btn.hidden {
  display: none;
}

.loading-start-icon {
  font-size: 1.2rem;
}

@keyframes startBtnPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(255,255,255,0.1); }
  50% { box-shadow: 0 4px 28px rgba(255,255,255,0.25); }
}

/* Loading Progress */
.loading-progress-area {
  display: none;
}

.loading-progress-area.visible {
  display: block;
  animation: fadeIn 0.4s ease;
}

.loading-bar-wrap {
  width: 280px;
  height: 12px;
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
  overflow: hidden;
  margin: 0 auto 12px;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.15);
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #fff 0%, #f9d74c 50%, #fff 100%);
  border-radius: 10px;
  transition: width 0.1s linear;
  position: relative;
  box-shadow: 0 0 12px rgba(249, 215, 76, 0.5);
}

.loading-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
  animation: loadBarShine 1.5s ease-in-out infinite;
}

@keyframes loadBarShine {
  0% { transform: translateX(-150%); }
  100% { transform: translateX(250%); }
}

.loading-percent {
  color: rgba(255,255,255,0.9);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.loading-welcome {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.loading-welcome.visible {
  opacity: 1;
  transform: translateY(0);
}

.welcome-text {
  color: #fff;
  font-family: 'Nunito', 'M PLUS Rounded 1c', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
  letter-spacing: 0.04em;
  padding: 12px 28px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.25);
  display: inline-block;
}

/* Loading floating decorations */
.loading-deco {
  position: absolute;
  pointer-events: none;
  font-size: 3rem;
  opacity: 0.12;
  animation: loadDecoFloat 6s ease-in-out infinite;
}

.loading-deco-1 { top: 10%; left: 8%; animation-delay: 0s; }
.loading-deco-2 { top: 60%; right: 5%; animation-delay: 1.5s; }
.loading-deco-3 { bottom: 15%; left: 12%; animation-delay: 3s; }
.loading-deco-4 { top: 25%; right: 15%; animation-delay: 4.5s; }

@keyframes loadDecoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-18px) rotate(8deg); }
  66% { transform: translateY(-8px) rotate(-5deg); }
}

/* ================================================================
   APP WRAPPER (hidden during loading)
   ================================================================ */
.app-wrapper {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.app-wrapper.visible {
  opacity: 1;
}

/* ---- Background Decoration ---- */
body::before {
  content: '';
  position: fixed;
  top: -120px;
  right: -120px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(94, 197, 118, 0.18) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -80px;
  left: -80px;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(249, 215, 76, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* ---- Floating Decorations ---- */
.floating-deco {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  opacity: 0.07;
  font-size: 3.5rem;
  animation: floatDeco 8s ease-in-out infinite;
}

.deco-1 { top: 12%; left: 4%; animation-delay: 0s; }
.deco-2 { top: 45%; right: 3%; animation-delay: 2s; }
.deco-3 { bottom: 25%; left: 6%; animation-delay: 4s; }
.deco-4 { top: 70%; right: 8%; animation-delay: 6s; font-size: 2.5rem; }

@keyframes floatDeco {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-12px) rotate(5deg); }
  50% { transform: translateY(-6px) rotate(-3deg); }
  75% { transform: translateY(-15px) rotate(4deg); }
}

/* ---- Header ---- */
.header {
  background: var(--bg-header);
  padding: 36px 24px 32px;
  text-align: center;
  box-shadow: var(--shadow-header);
  position: relative;
  z-index: 10;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
}

.header-icon {
  font-size: 2.8rem;
  margin-bottom: 6px;
  display: inline-block;
  animation: iconBounce 2.5s ease-in-out infinite;
}

@keyframes iconBounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  20% { transform: translateY(-8px) rotate(-5deg); }
  40% { transform: translateY(-4px) rotate(3deg); }
  60% { transform: translateY(-10px) rotate(-3deg); }
  80% { transform: translateY(-2px) rotate(2deg); }
}

.header h1 {
  font-size: 1.65rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.12);
  margin-bottom: 4px;
}

.header .subtitle {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.82);
  font-weight: 500;
}

/* Settings button in header */
.btn-settings {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.25);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: all var(--transition-med);
  z-index: 11;
}

.btn-settings:hover {
  background: rgba(255,255,255,0.3);
  transform: rotate(90deg) scale(1.1);
}

.btn-settings:active {
  transform: rotate(90deg) scale(0.95);
}

/* ---- Progress Section ---- */
.progress-section {
  max-width: 960px;
  margin: -20px auto 0;
  padding: 0 16px;
  position: relative;
  z-index: 11;
}

.progress-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-card);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.progress-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text);
}

.progress-count {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.progress-count .current {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-count .separator {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin: 0 2px;
}

.progress-count .total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-light);
}

.progress-count .unit {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-left: 4px;
}

.progress-percentage {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-primary);
  background: rgba(94, 197, 118, 0.12);
  padding: 4px 12px;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.progress-bar-wrap {
  width: 100%;
  height: 14px;
  background: rgba(94, 197, 118, 0.12);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #5ec576, #3aaf85, #28a085);
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-width: 0;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: progressShine 2.5s ease-in-out infinite;
}

@keyframes progressShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(200%); }
}

/* ---- Bulk Actions ---- */
.bulk-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.btn-bulk {
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 5px;
}

.btn-bulk:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-bulk:active {
  transform: translateY(0);
}

.btn-select-all {
  background: var(--color-primary);
  color: #fff;
}

.btn-select-all:hover {
  background: var(--color-primary-dark);
}

.btn-deselect-all {
  background: rgba(94, 197, 118, 0.12);
  color: var(--color-primary-dark);
}

.btn-deselect-all:hover {
  background: rgba(94, 197, 118, 0.22);
}

/* ---- Filter Section ---- */
.filter-section {
  max-width: 960px;
  margin: 16px auto 0;
  padding: 0 16px;
  position: relative;
  z-index: 10;
}

.filter-card {
  background: var(--bg-filter-bar);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
}

/* Search Input */
.search-wrapper {
  position: relative;
  margin-bottom: 16px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--color-text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 13px 44px 13px 44px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.92rem;
  color: var(--color-text);
  background: rgba(255,255,255,0.7);
  transition: all var(--transition-fast);
  outline: none;
}

.search-input::placeholder {
  color: var(--color-text-muted);
}

.search-input:focus {
  border-color: var(--color-primary);
  background: rgba(255,255,255,0.95);
  box-shadow: 0 0 0 4px rgba(94, 197, 118, 0.12);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  display: none;
  transition: color var(--transition-fast);
}

.search-clear:hover {
  color: var(--color-text);
}

.search-clear.visible {
  display: block;
}

/* Filter Groups */
.filter-group {
  margin-bottom: 14px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  display: block;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  padding: 7px 15px;
  border: 2px solid var(--color-border);
  border-radius: 50px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-light);
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all var(--transition-med);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.filter-pill::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.5s ease;
}

.filter-pill:hover::before {
  left: 100%;
}

.filter-pill:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(94, 197, 118, 0.06);
  transform: translateY(-1px);
}

.filter-pill.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(58, 175, 133, 0.3);
}

/* ---- Song List ---- */
.song-list-section {
  max-width: 960px;
  margin: 18px auto 0;
  padding: 0 16px 120px;
  position: relative;
  z-index: 5;
}

.song-count-info {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 12px;
  padding-left: 4px;
}

.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* ---- Song Card ---- */
.song-card {
  background: var(--bg-card);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all var(--transition-med);
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px);
  animation: cardAppear 0.4s ease forwards;
}

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

.song-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(135deg, rgba(94, 197, 118, 0.06) 0%, transparent 100%);
  opacity: 0;
  transition: opacity var(--transition-med);
  pointer-events: none;
}

.song-card:hover {
  border-color: rgba(94, 197, 118, 0.35);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-3px);
}

.song-card:hover::before {
  opacity: 1;
}

.song-card:active {
  transform: translateY(-1px);
}

.song-card.checked {
  background: var(--bg-card-checked);
  border-color: var(--color-checked-border);
}

.song-card.checked::before {
  opacity: 1;
}

/* Album Jacket */
.song-jacket {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all var(--transition-med);
  position: relative;
  cursor: zoom-in;
}

.song-jacket img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.song-card:hover .song-jacket img {
  transform: scale(1.08);
}

.song-jacket .jacket-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: #ccc;
  background: linear-gradient(135deg, #f5f5f5 0%, #eee 100%);
}

.song-card.checked .song-jacket {
  box-shadow: 0 3px 10px rgba(58, 175, 133, 0.25);
}

/* Custom Checkbox */
.song-checkbox-wrap {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  position: relative;
}

.song-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-visual {
  width: 28px;
  height: 28px;
  border: 2.5px solid rgba(94, 197, 118, 0.35);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  background: rgba(255,255,255,0.5);
  position: relative;
}

.checkbox-visual svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.5) rotate(-10deg);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.song-card.checked .checkbox-visual {
  background: var(--color-checkbox-checked);
  border-color: var(--color-checkbox-checked);
  box-shadow: 0 2px 8px rgba(58, 175, 133, 0.35);
  animation: checkPop 0.35s ease;
}

.song-card.checked .checkbox-visual svg {
  opacity: 1;
  transform: scale(1) rotate(0);
}

@keyframes checkPop {
  0% { transform: scale(1); }
  30% { transform: scale(1.2); }
  60% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

/* Song Info */
.song-info {
  flex: 1;
  min-width: 0;
}

.song-name-ja {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  transition: color var(--transition-fast);
}

.song-card.checked .song-name-ja {
  color: var(--color-primary-dark);
}

/* Hidden */
.song-card.hidden {
  display: none;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 56px 20px;
  display: none;
}

.no-results.visible {
  display: block;
  animation: fadeIn 0.3s ease;
}

.no-results-icon {
  font-size: 3.5rem;
  margin-bottom: 14px;
  opacity: 0.5;
}

.no-results-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text-muted);
}

.no-results-sub {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 6px;
}

/* ---- Footer ---- */
.footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(232, 245, 224, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--color-border);
  padding: 12px 20px 16px;
  text-align: center;
  z-index: 20;
}

.footer-text {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-bottom: 4px;
}

.footer-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 700;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

.footer-links {
  margin-top: 4px;
}

.btn-footer-link {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--color-text-light);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.btn-footer-link:hover {
  color: var(--color-primary-dark);
}

/* ---- Changelog FAB ---- */
.fab-changelog {
  position: fixed;
  bottom: 56px;
  right: 20px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(58, 175, 133, 0.35);
  transition: all var(--transition-med);
  animation: fabPulse 3s ease-in-out infinite;
}

.fab-changelog:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 24px rgba(58, 175, 133, 0.45);
}

/* ---- About FAB ---- */
.fab-about {
  position: fixed;
  bottom: 56px;
  left: 20px;
  background: #fff;
  color: var(--color-text-light);
  border: 2px solid var(--color-border);
  border-radius: 50px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all var(--transition-med);
}

.fab-about:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 20px rgba(58, 175, 133, 0.2);
}

@keyframes fabPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(58, 175, 133, 0.35); }
  50% { box-shadow: 0 4px 24px rgba(58, 175, 133, 0.55); }
}

.fab-icon { font-size: 1.1rem; }

/* ---- Modal (shared) ---- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 70vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: translateY(30px) scale(0.95);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  background: linear-gradient(135deg, rgba(94, 197, 118, 0.08) 0%, transparent 100%);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-text);
}

.modal-close {
  background: rgba(0,0,0,0.06);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: rgba(0,0,0,0.12);
  color: var(--color-text);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

/* ---- Changelog Entries ---- */
.changelog-entry {
  margin-bottom: 20px;
}

.changelog-entry:last-child {
  margin-bottom: 0;
}

.changelog-version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.changelog-date {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  display: block;
}

.changelog-list {
  list-style: none;
  padding: 0;
}

.changelog-list li {
  font-size: 0.84rem;
  color: var(--color-text-light);
  padding: 4px 0 4px 20px;
  position: relative;
  line-height: 1.5;
}

.changelog-list li::before {
  content: '✦';
  position: absolute;
  left: 0;
  color: var(--color-primary);
  font-size: 0.7rem;
}

/* ================================================================
   SETTINGS MODAL
   ================================================================ */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-divider {
  height: 1px;
  background: var(--color-border);
  margin: 4px 0;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(94, 197, 118, 0.04);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  gap: 12px;
}

.settings-item-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-item-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.settings-item-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-text);
}

.settings-item-desc {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Toggle Button */
.toggle-btn {
  position: relative;
  width: 60px;
  height: 32px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: #ccc;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  overflow: hidden;
}

.toggle-btn.active {
  background: var(--color-primary);
}

.toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  z-index: 2;
}

.toggle-btn.active .toggle-slider {
  left: 31px;
}

.toggle-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  z-index: 1;
  transition: opacity 0.25s ease;
}

.toggle-on {
  left: 8px;
  opacity: 0;
}

.toggle-off {
  right: 8px;
  opacity: 1;
}

.toggle-btn.active .toggle-on {
  opacity: 1;
}

.toggle-btn.active .toggle-off {
  opacity: 0;
}

/* Skip Button */
.btn-skip {
  padding: 8px 18px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-sm);
  background: rgba(58, 175, 133, 0.08);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition-med);
  flex-shrink: 0;
}

.btn-skip:hover {
  background: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(58, 175, 133, 0.3);
}

.btn-skip:active {
  transform: translateY(0);
}

/* ================================================================
   ABOUT MODAL & LANG TOGGLE
   ================================================================ */
.about-modal-content {
  max-width: 680px;
  max-height: 85vh;
}

.lang-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,0,0,0.04);
  padding: 6px 12px;
  border-radius: 50px;
}

.lang-label {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--color-text-muted);
  transition: color var(--transition-fast);
}

.lang-label.active {
  color: var(--color-primary);
}

.lang-toggle-btn {
  position: relative;
  width: 44px;
  height: 24px;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: #ccc;
  transition: background 0.3s ease;
}

.lang-toggle-btn.en-active {
  background: #4a90e2; /* Different color for EN to distinguish */
}

.lang-toggle-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.lang-toggle-btn.en-active .lang-toggle-slider {
  left: 23px;
}

/* About Text Content */
.about-body {
  padding: 24px 32px;
  line-height: 1.7;
}

.about-content {
  animation: fadeIn 0.4s ease;
}

.about-content.hidden {
  display: none;
}

.about-section {
  margin-bottom: 28px;
}

.about-section:last-child {
  margin-bottom: 0;
}

.about-section h3 {
  font-size: 1.05rem;
  color: var(--color-primary-dark);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid rgba(94, 197, 118, 0.2);
}

.about-section p {
  font-size: 0.88rem;
  color: var(--color-text);
  margin-bottom: 12px;
}

.about-section p:last-child {
  margin-bottom: 0;
}

.about-list {
  margin: 0 0 16px 20px;
  font-size: 0.88rem;
  color: var(--color-text);
}

.about-list li {
  margin-bottom: 4px;
}

.about-section a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
}

.about-section a:hover {
  color: var(--color-primary-dark);
}

.credits-section {
  background: rgba(94, 197, 118, 0.08);
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.credits-section h3 {
  border-bottom: none;
  margin-bottom: 8px;
  padding-bottom: 0;
}

.credits-notice {
  margin-top: 12px !important;
  font-size: 0.82rem !important;
  color: var(--color-text-muted) !important;
}

/* ================================================================
   ALBUM PREVIEW MODAL
   ================================================================ */
.album-preview-content {
  position: relative;
  text-align: center;
  animation: albumPreviewAppear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes albumPreviewAppear {
  0% { opacity: 0; transform: scale(0.7); }
  100% { opacity: 1; transform: scale(1); }
}

.album-preview-close {
  position: absolute;
  top: -12px;
  right: -12px;
  z-index: 5;
  background: #fff !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.album-preview-img-wrap {
  width: 256px;
  height: 256px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  margin: 0 auto 16px;
  position: relative;
}

.album-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.album-preview-img.hidden {
  display: none;
}

.album-preview-placeholder {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  color: #ccc;
  background: linear-gradient(135deg, #f5f5f5 0%, #eee 100%);
}

.album-preview-placeholder.visible {
  display: flex;
}

.album-preview-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  padding: 8px 20px;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(8px);
  border-radius: 50px;
  display: inline-block;
}

/* ================================================================
   BGM NOW PLAYING TOAST
   ================================================================ */
.bgm-toast {
  position: fixed;
  bottom: 140px;
  right: -340px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 22px 12px 16px;
  box-shadow: 0 6px 24px rgba(60, 120, 60, 0.15);
  z-index: 25;
  transition: right 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 320px;
}

.bgm-toast.visible {
  right: 20px;
}

.bgm-toast-icon {
  font-size: 1.6rem;
  animation: toastNoteFloat 1.5s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes toastNoteFloat {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-3px) rotate(-5deg); }
  75% { transform: translateY(2px) rotate(5deg); }
}

.bgm-toast-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 2px;
}

.bgm-toast-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(94, 197, 118, 0.25);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(94, 197, 118, 0.4);
}

/* ---- Celebration ---- */
.celebration-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 200;
  pointer-events: none;
  display: none;
}

.celebration-overlay.active {
  display: block;
}

.celebration-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  animation: celebMessage 1s ease-out;
}

.celebration-message h3 {
  font-size: 2rem;
  color: var(--color-primary-dark);
  text-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 8px;
}

.celebration-message p {
  font-size: 1rem;
  color: var(--color-text-light);
}

@keyframes celebMessage {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  60% { transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.confetti {
  position: absolute;
  border-radius: 3px;
  animation: confettiFall 3.5s ease-out forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg) scale(1);
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg) scale(0.3);
    opacity: 0;
  }
}

/* ---- Utility Animations ---- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Responsive ---- */
@media screen and (max-width: 600px) {
  .header {
    padding: 26px 16px 24px;
  }

  .header h1 {
    font-size: 1.25rem;
  }

  .header-icon {
    font-size: 2.2rem;
  }

  .btn-settings {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .progress-card {
    padding: 16px 18px;
  }

  .progress-count .current {
    font-size: 1.6rem;
  }

  .filter-card {
    padding: 16px 14px;
  }

  .filter-pill {
    padding: 5px 11px;
    font-size: 0.72rem;
  }

  .song-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  .song-jacket {
    width: 44px;
    height: 44px;
  }

  .bulk-actions {
    justify-content: center;
  }

  .fab-changelog {
    bottom: 52px;
    right: 14px;
    padding: 10px 16px;
    font-size: 0.75rem;
  }

  .fab-about {
    bottom: 52px;
    left: 14px;
    padding: 10px;
  }

  .fab-about .fab-text {
    display: none; /* Icon only on mobile to save space */
  }

  .modal-content {
    max-height: 80vh;
  }

  .about-body {
    padding: 20px;
  }

  .loading-title {
    font-size: 1.15rem;
  }

  .loading-bar-wrap {
    width: 220px;
  }

  .welcome-text {
    font-size: 0.9rem;
    padding: 10px 20px;
  }

  .bgm-toast {
    bottom: 120px;
    max-width: 260px;
  }

  .bgm-toast.visible {
    right: 14px;
  }

  .album-preview-img-wrap {
    width: 200px;
    height: 200px;
  }
}

@media screen and (min-width: 601px) and (max-width: 960px) {
  .song-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
