/* baseline reset (auto-injected) */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; }
img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; }
ul, ol { list-style: none; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

:root {
  --color-primary: #ef4444;
  --color-accent: #f87171;
  --color-bg: #050506;
  --color-surface: #111214;
  --color-text: #ffffff;
  --color-text-muted: #9ca3af;
  --radius-lg: 20px;
  --radius-md: 12px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 20px;
  --space-lg: 32px;
  --shadow-glow: 0 0 40px rgba(239, 68, 68, 0.45);
}

html, body {
  height: 100%;
  background: var(--color-bg);
}

.body {
  position: relative;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, rgba(59, 130, 246, 0.1), transparent 60%),
    url("../images/hero-bg.webp") center/cover no-repeat,
    var(--color-bg);
  font-family: -apple-system, Roboto, Helvetica, sans-serif;
  cursor: pointer;
  color: var(--color-text);
}

.overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.78));
  z-index: 5;
}

.player {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  z-index: 1;
}

.play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(60px, 10vw, 92px);
  height: auto;
  pointer-events: none;
  user-select: none;
  opacity: 0.45;
  filter: drop-shadow(0 0 30px rgba(96, 165, 250, 0.5));
  z-index: 2;
}

.toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  padding: var(--space-md) clamp(16px, 4vw, 40px) calc(var(--space-md) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.progress {
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.bar {
  width: 18%;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

.controls, .settings {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.controls { justify-content: space-between; }
.settings { justify-content: flex-end; margin-top: var(--space-xs); }

.control-img {
  width: 22px;
  height: 22px;
  opacity: 0.75;
  pointer-events: none;
  user-select: none;
}

.time {
  color: var(--color-text-muted);
  font-size: 13px;
  letter-spacing: 0.02em;
  margin-left: auto;
}

.notification-toast {
  position: fixed;
  top: clamp(16px, 4vh, 32px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: rgba(17, 18, 20, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: toast-in 500ms ease both;
  pointer-events: none;
  max-width: min(88vw, 320px);
}

.notification-toast__bell {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.notification-toast__text {
  font-size: 13px;
  color: var(--color-text);
  font-weight: 500;
  overflow-wrap: break-word;
  min-width: 0;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

#modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  width: min(90vw, 340px);
  background: linear-gradient(180deg, rgba(17, 18, 20, 0.98), rgba(8, 8, 9, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md) var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: modal-in 320ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.modal__close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
}

.modal__img.close {
  width: 16px;
  height: 16px;
  opacity: 0.6;
  transition: opacity 200ms ease;
  pointer-events: none;
}

.modal__close:hover .modal__img.close,
.modal__close:focus-visible .modal__img.close {
  opacity: 1;
}

.modal__close:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 50%;
}

.modal__text-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding-top: var(--space-xs);
}

.modal__text {
  font-size: clamp(15px, 4vw, 17px);
  line-height: 1.5;
  color: var(--color-text);
  font-weight: 600;
  text-wrap: balance;
  overflow-wrap: break-word;
  min-width: 0;
}

.modal__play-cta {
  --size: 92px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 35% 30%, var(--color-accent), var(--color-primary) 70%);
  box-shadow: var(--shadow-glow);
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.modal__play-cta:hover {
  transform: scale(1.05);
  box-shadow: 0 0 55px rgba(96, 165, 250, 0.6);
}

.modal__play-cta:active { transform: scale(0.97); }

.modal__play-cta:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 4px;
}

.modal__play-icon {
  width: 48px;
  height: 48px;
  pointer-events: none;
  user-select: none;
}

.modal__decline {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  font-size: 14px;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  transition: color 200ms ease;
}

.modal__decline:hover,
.modal__decline:focus-visible {
  color: var(--color-text);
}

.modal__decline:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
  border-radius: 8px;
}

.hidden { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .notification-toast, #modal, .modal__play-cta {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 480px) {
  .toolbar { padding: var(--space-sm) 16px calc(16px + env(safe-area-inset-bottom)); }
  .control-img { width: 20px; height: 20px; }
}

@media (min-width: 1024px) {
  #modal { width: 380px; padding: 40px 32px 32px; }
  .modal__play-cta { --size: 104px; }
  .notification-toast { top: 32px; }
}

html,
body {
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
}
