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

:root {
  --accent: #e94560;
  --accent-hover: #d63450;
  --radius: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #74ebd5 0%, #ACB6E5 50%, #f7ce68 100%);
  background-attachment: fixed;
  color: #2d3436;
}

/* Soft blobs behind content */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  z-index: 0;
  opacity: 0.3;
  pointer-events: none;
}

body::before {
  width: 500px;
  height: 500px;
  background: #ff9a9e;
  top: -100px;
  right: -100px;
}

body::after {
  width: 600px;
  height: 600px;
  background: #a18cd1;
  bottom: -150px;
  left: -150px;
}

/* ---- Desktop layout ---- */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

header {
  margin-bottom: 1.25rem;
}

h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tagline {
  color: rgba(255,255,255,0.8);
  font-size: 0.95rem;
  margin-top: 0.25rem;
  font-weight: 500;
}

#player-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #1a1a2e;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.25),
    0 0 0 1px rgba(255,255,255,0.1);
  transition: width 0.4s ease, height 0.4s ease, padding-top 0.4s ease, max-width 0.4s ease;
}

/* Vertical video — tall & narrow, height-driven */
#player-wrap.vertical {
  padding-top: 0;
  height: 80vh;
  width: calc(80vh * 9 / 16);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

#player-wrap iframe,
#player-wrap #player,
#player-wrap .placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 1.25rem;
  background: #1a1a2e;
}

/* Overlay elements — hidden on desktop */
#overlay-top,
#overlay-bottom,
#overlay-info {
  display: none;
}

#video-info {
  display: none;
}

#shuffle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(233,69,96,0.4);
}

#shuffle-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(233,69,96,0.5);
}

#shuffle-btn:active {
  transform: translateY(0);
}

#shuffle-btn .icon {
  font-size: 1.3rem;
}

#error p {
  color: rgba(255,255,255,0.7);
  font-style: italic;
}

footer {
  position: relative;
  z-index: 1;
  padding: 1rem;
  color: rgba(255,255,255,0.5);
  font-size: 0.7rem;
  text-align: center;
}

/* ---- Mobile: immersive full-screen ---- */
/* Portrait phones + landscape phones */
@media (max-width: 600px), (max-height: 500px) and (hover: none) {
  body {
    background: #000;
  }

  body::before,
  body::after {
    display: none;
  }

  html, body {
    overflow: hidden;
    height: 100dvh;
    max-height: 100dvh;
    position: fixed;
    width: 100%;
  }

  .container {
    padding: 0;
    max-width: none;
    justify-content: stretch;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  header,
  #video-info,
  #shuffle-btn,
  #error,
  footer {
    display: none !important;
  }

  main {
    flex: 1;
    display: flex;
    overflow: hidden;
  }

  #player-wrap,
  #player-wrap.vertical {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    padding-top: 0;
    border-radius: 0;
    margin: 0;
    z-index: 1;
    overflow: hidden;
    box-shadow: none;
  }

  #player-wrap iframe,
  #player-wrap #player,
  #player-wrap .placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    max-height: 100dvh;
    z-index: 1 !important;
  }

  /* Top bar — site name */
  #overlay-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    z-index: 100;
    padding-top: env(safe-area-inset-top, 0px);
    pointer-events: none;
  }

  /* Bottom — shuffle button */
  #overlay-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.25rem 1rem;
    padding-bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    z-index: 100;
  }

  #overlay-shuffle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 20px rgba(233,69,96,0.4);
    position: relative;
    z-index: 101;
  }

  #overlay-shuffle .icon {
    font-size: 1.1rem;
  }
}
