/*
  colors:
  #B90016 - Red
  #F4F4F4 - Light Gray
  #1C1C1C - Dark Gray
  #003DA5 - Blue
 */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  height: 100dvh;
  width: 100%;
  font-family: sans-serif;
  background: #111;
  color: #fff;
  overflow: hidden;
  /* Prevent pull-to-refresh and bounce on mobile */
  overscroll-behavior: none;
  /* Block double-tap zoom and pinch zoom */
  touch-action: pan-y;
}

* {
  touch-action: pan-y;
}

.logo-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo {
  padding-top: 4px;
  height: 50px;
  width: auto;
  z-index: 30;
}

.swiper-controls {
  position: absolute;
  width: calc(100% - 40px);
  max-width: calc(100% - 40px);
  bottom: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  left: 20px;
  right: 20px;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
}

.swiper-slider {
  position: relative;
  display: flex;
  justify-content: center;
  z-index: 20;
}

.swiper-controls input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  width: 10rem;
}

.swiper-controls input[type="range"]:focus {
  outline: 2px solid #f4f4f4;
  outline-offset: 2px;
}

.swiper-controls input[type="range"]::-webkit-slider-runnable-track {
  background: #1c1c1c;
  height: 0.25rem;
  border-radius: 0.125rem;
  border: 1px solid #f4f4f4;
}

.swiper-controls input[type="range"]::-moz-range-track {
  background: #1c1c1c;
  height: 0.25rem;
  border-radius: 0.125rem;
  border: 1px solid #f4f4f4;
}

.swiper-controls input[type="range"]::-moz-range-thumb {
  border: none;
  border-radius: 0;
  background-color: #1c1c1c;
  height: 0.75rem;
  width: 0.75rem;
}

.swiper-controls input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  margin-top: -0.325rem;
  background-color: #1c1c1c;
  border: 1px solid #f4f4f4;
  height: 0.75rem;
  width: 0.75rem;
  border-radius: 0.375rem;
}

.swiper-controls button {
  background: #1c1c1c;
  color: #f4f4f4;
  border: 1px solid #f4f4f4;
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.swiper-controls button:hover {
  background: #2c2c2c;
}

.swiper-controls button:focus {
  outline: 2px solid #f4f4f4;
  outline-offset: 2px;
}

.swiper {
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.swiper-pagination {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 10;
  color: white;
}

.swiper-slide {
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px;
  text-align: center;
  overflow: hidden;
  height: calc(100vh - 80px);
  height: calc(100dvh - 80px);
  max-width: 100%;
  min-width: 0;
}

.content {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  padding-top: 50px;
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-bottom: 20px;
}

.main--welcome {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.song-top {
  display: flex;
  padding-top: 20px;
  gap: 20px;
  align-items: center;
  margin-bottom: 20px;
}

img.cover {
  width: 100px;
  height: 100px;
  max-width: 100px;
  max-height: 100px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}

.song-meta {
  flex: 1;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding-top: 8px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 5px;
}

.song-title {
  font-size: 1.4rem;
  font-weight: bold;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.band-name {
  font-size: 0.9rem;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.instruments {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
  width: 100%;
  max-width: 600px;
  text-align: left;
}

.instruments a {
  transition: opacity 0.2s ease;
}

.instruments a:hover {
  opacity: 0.85;
}

.instruments a:focus {
  outline: 2px solid #f4f4f4;
  outline-offset: 2px;
}

.footer-next {
  flex-shrink: 0;
  font-size: 0.9rem;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Guest view: footer outside .main, pin to bottom */
.content > .footer-next {
  margin-top: auto;
}

/* Host view: footer inside .main, add scroll clearance */
.main > .footer-next {
  margin-bottom: 50px;
}

.gradient-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 200px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  pointer-events: none;
  z-index: 10;
}

.setlist {
  text-align: left;
  max-width: 600px;
  line-height: 1.4;
}

.setlist div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.85rem;
}

.setlist-item {
  transition: background 0.2s ease, color 0.2s ease;
  padding: 5px 8px;
  border-radius: 4px;
  margin: 1px 0;
}

.setlist-item:hover {
  background: rgba(244, 244, 244, 0.1);
  color: #f4f4f4;
}

.setlist-item:focus {
  outline: 2px solid #f4f4f4;
  outline-offset: 2px;
}

.background-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

picture {
  display: contents;
}

.background-img-overflow {
  background: rgba(0, 0, 0, 0.5);
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  position: absolute;
  z-index: 1;
}

.image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
}

.host-block {
  padding-top: 20px;
  text-align: center;
}

.host-list {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 15px;
  margin-bottom: 15px;
}

.host-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.host-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.host-link {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #f4f4f4;
  text-decoration: underline;
  font-size: 1rem;
  transition: opacity 0.2s ease;
}

.host-link:hover {
  opacity: 0.85;
}

.host-link:focus {
  outline: 2px solid #f4f4f4;
  outline-offset: 2px;
}

.host-footer {
  opacity: 0.8;
  font-size: 0.9rem;
  margin-top: 10px;
}

.social-media-block {
  text-align: center;
  padding-top: 30px;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.social-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #fff;
  transition: transform 0.2s ease, opacity 0.2s ease;
  width: 56px;
  max-width: 100%;
}

.social-link img {
  height: 40px;
  width: 40px;
  object-fit: contain;
  margin-bottom: 8px;
}

.social-link span {
  font-size: 0.7rem;
  text-align: center;
  line-height: 1.2;
}

.social-link:hover {
  transform: scale(1.05);
  opacity: 0.85;
}

.social-link:focus {
  outline: 2px solid #f4f4f4;
  outline-offset: 2px;
}

.host {
  font-size: 0.9rem;
  color: rgba(244, 244, 244, 0.75);
  white-space: nowrap;
  margin-right: 12px;
}

#loading-overlay,
#error-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  color: #f4f4f4;
}

.spinner {
  border: 4px solid #1c1c1c;
  border-top: 4px solid #f4f4f4;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#error-overlay button {
  margin-top: 20px;
  background: #1c1c1c;
  color: #f4f4f4;
  border: 1px solid #f4f4f4;
  border-radius: 5px;
  padding: 10px 20px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

#error-overlay button:hover {
  background: #2c2c2c;
}

#error-overlay button:focus {
  outline: 2px solid #f4f4f4;
  outline-offset: 2px;
}

/* ── Mobile optimizations ── */
@media (max-width: 600px) {
  .swiper-slide {
    padding: 12px 16px 0;
  }

  .content {
    padding-top: 45px;
    padding-bottom: 0;
  }

  .main {
    padding-bottom: 16px;
  }

  .setlist div {
    font-size: 0.9rem;
  }

  .setlist-item {
    padding: 6px 8px;
  }

  .setlist {
    line-height: 1.3;
  }

  .song-top {
    padding-top: 10px;
    gap: 14px;
    margin-bottom: 14px;
  }

  .instruments {
    gap: 8px;
    margin: 14px 0;
    font-size: 0.95rem;
  }

  .footer-next {
    padding-top: 8px;
    gap: 10px;
  }

  .host-list {
    gap: 24px;
  }

  .social-media-block {
    padding-top: 20px;
  }

  .social-links {
    gap: 20px;
    margin-top: 14px;
  }

  .social-link {
    width: 56px;
  }

  .social-link img {
    height: 36px;
    width: 36px;
  }

  .gradient-bottom {
    height: 120px;
  }

  h1 {
    font-size: 1.5rem;
    margin-top: 10px;
    margin-bottom: 10px;
  }

  h2 {
    font-size: 1.3rem;
    margin-top: 8px;
    margin-bottom: 8px;
  }
}

/* Extra small phones */
@media (max-width: 380px) {
  .setlist div {
    font-size: 0.85rem;
  }

  .host-list {
    gap: 16px;
  }

  .social-links {
    gap: 14px;
  }
}
