:root {
  --main-athletic-font: "Barlow Condensed", sans-serif;
  --accent-font: "Montserrat", sans-serif;
  --primary-green: #3e7a0c;
  --error-red: #cd2714;
  --light-bg: #f4f4f4;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--accent-font);
  background-color: #8eb89a;
  overflow-x: hidden;
}

.run-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.run-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    #87b8d4 0%,
    #a8cfe0 28%,
    #c5ddd0 58%,
    #9bc4a8 82%,
    #7aaf8c 100%
  );
}

.run-layer {
  position: absolute;
  left: 0;
  right: 0;
  background-repeat: repeat-x;
  background-position: 0 100%;
}

.run-trees {
  background-position: 0 100%;
}

/* FAR TREE LAYER (background)   */
.run-trees--far {
  bottom: 12%;
  height: clamp(72px, 14vh, 140px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 120' preserveAspectRatio='none'%3E%3Cpath fill='%231a3d28' d='M0 120 L0 68 L18 52 L32 68 L46 48 L60 68 L74 50 L88 68 L102 46 L116 68 L130 52 L144 68 L158 48 L172 68 L186 54 L200 68 L214 50 L228 68 L242 56 L256 68 L256 120 Z'/%3E%3C/svg%3E");
  background-size: 256px 100%;
  opacity: 0.88;
  animation: run-drift-256 38s linear infinite;
}

/* NEAR TREE LAYER (foreground)  */
.run-trees--near {
  bottom: 10%;
  height: clamp(96px, 18vh, 180px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 140' preserveAspectRatio='none'%3E%3Cpath fill='%230f2d1c' d='M0 140 L0 52 L22 28 L38 52 L52 32 L68 52 L84 24 L100 52 L116 28 L132 52 L148 36 L164 52 L180 30 L196 52 L212 34 L228 52 L244 36 L256 52 L256 140 Z'/%3E%3C/svg%3E");
  background-size: 256px 100%;
  opacity: 0.95;
  animation: run-drift-256 16s linear infinite;
}

.run-ground {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(56px, 11vh, 100px);
  background-color: #1e4028;
  background-image: linear-gradient(
      180deg,
      #2d5a3d 0%,
      #1e4028 50%,
      #152e1f 100%
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 11px,
      rgba(255, 255, 255, 0.05) 11px,
      rgba(255, 255, 255, 0.05) 13px
    );
  background-size: auto, 26px 100%;
  animation: run-ground-streak 11s linear infinite;
}

@keyframes run-drift-256 {
  to {
    background-position-x: -256px;
  }
}

@keyframes run-ground-streak {
  to {
    background-position: 0 0, -26px 0;
  }
}

.site-content {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

@media (prefers-reduced-motion: reduce) {
  .run-trees--far,
  .run-trees--near,
  .run-ground {
    animation: none;
  }

  .run-trees--far {
    background-position-x: -80px;
  }

  .run-trees--near {
    background-position-x: -40px;
  }
}

.main-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 20px 0;
  background: transparent;
  display: flex;
  justify-content: center;
}

.title-cloud {
  --cloud-white: #ffffff;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 44px auto 16px;
  padding: 1.15rem 2.85rem 1.05rem;
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    #ffffff 92%,
    #f7f8fa 100%
  );
  background-color: #ffffff;
  border-radius: 100px;
  pointer-events: auto;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.95),
    0 0 16px 8px rgba(255, 255, 255, 0.85),
    0 0 32px 16px rgba(175, 198, 232, 0.38),
    0 0 48px 24px rgba(140, 165, 210, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

.title-cloud__bulge {
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  background: #ffffff;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.95),
    0 0 12px 6px rgba(255, 255, 255, 0.7),
    0 0 24px 12px rgba(165, 190, 228, 0.32);
}

/* Medium left hump */
.title-cloud__bulge--left {
  width: 76px;
  height: 76px;
  left: 10%;
  top: -38px;
}

/* Largest center hump */
.title-cloud__bulge--mid {
  width: 108px;
  height: 108px;
  left: 50%;
  top: -52px;
  transform: translateX(-50%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.95),
    0 0 14px 8px rgba(255, 255, 255, 0.75),
    0 0 30px 14px rgba(165, 190, 228, 0.35);
}

/* Smaller, slightly lower right hump */
.title-cloud__bulge--right {
  width: 56px;
  height: 56px;
  right: 11%;
  top: -30px;
}

.title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 2.25rem;
  font-family: var(--main-athletic-font);
  font-weight: 600;
  color: #2c3e48;
  text-align: center;
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.3;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.pace-selector {
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px 20px;
}

.pace-converter-card {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

.converter-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.converter-icon {
  font-size: 1.8rem;
  color: var(--primary-green);
}

.converter-title {
  margin: 0;
  font-size: 1.5rem;
  font-family: var(--main-athletic-font);
  color: #222;
  font-weight: 600;
}

.converter-subtitle {
  font-size: 0.95rem;
  margin: 0 0 20px 0;
}

.converter-content {
  display: flex;
  align-items: flex-end;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.pace-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pace-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.converter-content input {
  width: 80px;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1.2rem;
  font-family: var(--main-athletic-font);
  text-align: center;
  outline: none;
  transition: border-color 0.3s;
}

.converter-content input:focus {
  border-color: var(--primary-green);
}

.pace-separator {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 5px;
  margin-top: 25px;
}

.pace-unit {
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-family: var(--accent-font);
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 600;
}

.btn-primary {
  background-color: var(--primary-green);
  color: white;
  margin-bottom: 8px;
}

.btn-primary:hover {
  background-color: #3aa018;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(64, 183, 30, 0.3);
}

.btn-secondary {
  background-color: #ddd;
  color: #333;
  margin-bottom: 8px;
}

.btn-secondary:hover {
  background-color: #ccc;
  transform: translateY(-2px);
}

.bpm-result-box {
  padding: 15px 20px;
  background-color: var(--primary-green);
  color: white;
  border-radius: 8px;
  font-family: var(--main-athletic-font);
  font-size: 1.2rem;
  font-weight: bold;
  animation: fadeIn 0.3s ease-in;
}

.bpm-result-box.bpm-error {
  background-color: var(--error-red);
}

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

.info-card {
  background: white;
  border-left: 5px solid var(--primary-green);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  line-height: 1.6;
}

.info-card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #222;
  font-family: var(--main-athletic-font);
  text-transform: uppercase;
  font-size: 1rem;
  font-weight: 600;
}

.info-card p {
  margin: 0 0 15px 0;
  color: #555;
  font-size: 0.95rem;
}

.main-content {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 25px;
  align-items: start;
}

.songs-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-filter-container {
  margin-bottom: 25px;
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: var(--light-bg);
  border: 2px solid #ddd;
  border-radius: 25px;
  padding: 0 20px;
  margin-bottom: 20px;
  transition: border-color 0.3s;
}

.search-bar:focus-within {
  border-color: var(--primary-green);
}

.search-icon {
  margin-right: 10px;
  font-size: 1.2rem;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 0;
  font-size: 1rem;
  font-family: var(--accent-font);
  outline: none;
  color: #333;
}

.song-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 15px;
  max-height: 600px;
  overflow-y: auto;  
}

.suggestion-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.3s;
}

.card-top {
  flex: 1;
  min-width: 0;
}

.suggestion-card:hover {
  border-color: var(--primary-green);
  box-shadow: 0 4px 16px rgba(64, 183, 30, 0.15);
  transform: translateY(-2px);
}

.card-info {
  margin-bottom: 10px;
}

.card-title {
  margin: 0;
  color: #222;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--main-athletic-font);
}

.card-author {
  margin: 4px 0 0 0;
  font-size: 0.85rem;
}

.card-stats {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
}

.card-bpm {
  color: var(--primary-green);
  font-weight: bold;
  font-family: var(--main-athletic-font);
}

.add-btn {
  width: 40px;
  height: 40px;
  margin-left: auto;
  background-color: var(--primary-green);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  flex-shrink: 0;
}

.add-btn:hover {
  transform: scale(1.1);
  background-color: #3aa018;
  box-shadow: 0 4px 12px rgba(64, 183, 30, 0.3);
}

.playlist-section {
  position: sticky;
  top: 20px;
}

.playlist-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.playlist-header-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid #ececec;
  background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
}

.playlist-icon {
  font-size: 1.5rem;
  color: var(--primary-green);
}

.playlist-title {
  margin: 0;
  font-size: 1.3rem;
  font-family: var(--main-athletic-font);
  color: #222;
  font-weight: 600;
}

.playlist-container {
  padding: 20px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  flex: 1;
  max-height: 600px;
  overflow-y: auto; 
}

.playlist-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
  box-sizing: border-box;
}

.playlist-stat-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 5px;
}

.playlist-stat-card__label {
  color: var(--primary-green);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  font-weight: 600;
  font-family: var(--accent-font);
}

.playlist-stat-card__value {
  color: var(--primary-green);
  font-size: 1.5rem;
  font-family: var(--accent-font);
  font-weight: 600;
  line-height: 1;
}

.playlist-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 8px 24px;
  min-height: 240px;
}

.playlist-empty__icon-wrap {
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: linear-gradient(160deg, #e8f4ea 0%, #f4faf5 100%);
  border: 1px solid rgba(62, 122, 12, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
}

.playlist-empty__icon {
  font-size: 1.75rem;
  line-height: 1;
  color: var(--primary-green);
  opacity: 0.92;
}

.playlist-empty__title {
  margin: 0 0 10px;
  font-family: var(--main-athletic-font);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #2a2a2a;
}

.playlist-empty__hint {
  margin: 0;
  max-width: 260px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #6b6b6b;
}

.playlist-empty__plus-demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 0 3px;
  vertical-align: middle;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background: var(--primary-green);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(62, 122, 12, 0.35);
}

.playlist-grid-header {
  display: grid;
  grid-template-columns: 80px 1fr 45px 80px;
  align-items: center;
  width: 100%;
  color: var(--primary-green);
  font-size: 0.9rem;
  padding: 10px 0 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #ececec;
}

.col-num {
  padding-left: 17px;
}


.col-time {
  text-align: right;
  padding-right: 50px;
}

.song-row {
  position: relative;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 12px 42px 15px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s;
  margin-bottom: 10px;
}

.song-row:hover {
  border-color: var(--primary-green);
  box-shadow: 0 4px 16px rgba(64, 183, 30, 0.15);
  transform: translateY(-2px);
}

.song-index {
  width: 10px;
  font-weight: 600;
  color: var(--primary-green);
  font-family: var(--main-athletic-font);
  text-align: center;
}

.song-info {
  flex: 1;
}

.song-title {
  margin: 0;
  color: #222;
  font-size: 0.95rem;
  font-weight: 500;
  font-family: var(--main-athletic-font);
}

.song-author {
  margin: 3px 0 0 0;
  font-size: 0.75rem;
}

.song-duration {
  color: #000000;
}

.delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  padding: 0;
  line-height: 1;
  background-color: var(--error-red);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
  opacity: 0;
}

.song-row:hover .delete-btn {
  opacity: 1;
}

.delete-btn:hover {
  transform: scale(1.08);
  background-color: #a80f0a;
}

@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
  }

  .playlist-section {
    position: static;
  }

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

@media (max-width: 768px) {
  .title-cloud {
    margin-top: 38px;
    padding: 0.95rem 1.65rem 0.85rem;
  }

  .title-cloud__bulge--left {
    width: 58px;
    height: 58px;
    top: -30px;
    left: 8%;
  }

  .title-cloud__bulge--mid {
    width: 84px;
    height: 84px;
    top: -42px;
  }

  .title-cloud__bulge--right {
    width: 44px;
    height: 44px;
    top: -24px;
    right: 9%;
  }

  .title {
    font-size: 1.875rem;
  }

  .converter-content {
    flex-direction: column;
    align-items: stretch;
  }

  .converter-content input {
    width: 100%;
  }

  .pace-separator {
    margin: 0;
  }

  .song-cards-container {
    grid-template-columns: 1fr;
  }

  .suggestion-card {
    flex-direction: column;
    align-items: stretch;
  }

  .card-top {
    width: 100%;
  }

  .add-btn {
    align-self: flex-end;
  }

  .playlist-stat-card {
    padding: 9px 8px;
    border-radius: 9px;
    gap: 4px;
  }

  .playlist-stat-card__label {
    font-size: 0.62rem;
    letter-spacing: 0.04em;
  }

  .playlist-stat-card__value {
    font-size: 1.2rem;
  }
}

.card-album-art {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  background: #f0f0f0;
}

.album-art-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}