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

html,
body,
#root {
  width: 100%;
  height: 100%;
}

body {
  overflow: hidden;
  background: #000;
}
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 10;
}

.auth-modal {
  position: relative;
  width: min(22rem, calc(100vw - 2rem));
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem 1.5rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: url('#glass-refraction') blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.25),
    0 8px 32px rgba(0, 0, 0, 0.4);
  color: #fff;
  font-family: system-ui, sans-serif;
}

.auth-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.auth-modal-close:hover,
.auth-modal-close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.auth-modal-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 600;
  text-align: center;
}

.auth-modal-email {
  margin: 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.75);
}

.auth-modal-status {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

/* The fullscreen workaround explanation is long enough to wrap across
   several lines — justify it so the line widths stay consistent instead of
   the centered text giving each line a different length. */
.workaround-info {
  text-align: justify;
}

.auth-modal-preview {
  width: 100%;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    inset 0 -2px 4px rgba(0, 0, 0, 0.25);
}

.auth-modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-modal-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
}

.auth-modal-field input {
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 1rem;
  touch-action: manipulation;
}

.auth-modal-field input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.auth-modal-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
}

.auth-modal-checkbox input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.auth-modal-checkbox a {
  color: inherit;
  text-decoration: underline;
}

.auth-modal-error {
  margin: 0;
  font-size: 0.85rem;
  color: #ff8a8a;
  text-align: center;
}

.auth-modal-submit {
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.auth-modal-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.auth-modal-switch {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  text-decoration: underline;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
}

.auth-modal-actions {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.fullscreen-workaround {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* The fullscreen workaround is a Tesla in-car browser trick — hide it on
   phone- and tablet-sized screens where it doesn't apply. */
@media (max-width: 64rem) {
  .fullscreen-workaround {
    display: none;
  }
}

.auth-modal-checking {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.auth-modal-spinner {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-modal-spin 0.8s linear infinite;
}

@keyframes auth-modal-spin {
  to { transform: rotate(360deg); }
}
.screensaver {
  --fade-duration: 0.3s;
  --image-fade-duration: 1.2s;

  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Visually hidden but available to screen readers and search engines —
   the screensaver itself is just background images with no visible text. */
.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;
}

.image-layers {
  position: absolute;
  inset: 0;
}

.image-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.image-layer--entering {
  animation: image-fade-in var(--image-fade-duration) ease forwards;
}

/* Locked images are previewed blurred — expand past this layer's own bounds
   so the blur's edge fringe falls outside the viewport (cropped by
   .screensaver's overflow: hidden). Applied per-layer so an unlocked image
   crossfading in over a locked one stays sharp while the one underneath
   stays blurred. */
.image-layer--locked {
  inset: -4rem;
  filter: blur(3rem);
}

@keyframes image-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.glass-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.empty-genre-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(to bottom, #c3cdf7 0%, #ffffff 100%);
}

.empty-genre-overlay--entering {
  animation: image-fade-in var(--image-fade-duration) ease forwards;
}

.empty-genre-overlay--leaving {
  animation: image-fade-out var(--image-fade-duration) ease forwards;
}

@keyframes image-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.empty-genre-card {
  max-width: 24rem;
  padding: 1.75rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.45);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    inset 0 -2px 4px rgba(0, 0, 0, 0.06),
    0 8px 32px rgba(80, 90, 160, 0.18);
}

.empty-genre-overlay p {
  margin: 0;
  text-align: center;
  font-family: system-ui, sans-serif;
  font-size: 1.1rem;
  color: rgba(45, 50, 80, 0.8);
}

.corner-note {
  position: absolute;
  bottom: 1rem;
  z-index: 1;
  margin: 0;
  max-width: 20rem;
  font-family: system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.908);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 1);
  pointer-events: none;
}

.driving-disclaimer {
  left: 1rem;
}

.credit {
  right: 1rem;
  text-align: right;
}

/* The disclaimer text is purely decorative (`pointer-events: none` above so
   it doesn't block clicks on the screensaver beneath it), but the credit
   contains an actual link — opt it back into pointer events so it's clickable. */
.credit a {
  color: inherit;
  text-decoration: underline;
  pointer-events: auto;
}

.locked-note {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.locked-note-button {
  font-size: 1.05rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--image-fade-duration) ease;
}

/* Fades in/out in lockstep with the locked image it's shown over (see
   .image-layer--locked / --image-fade-duration), instead of cutting in or
   out abruptly mid-crossfade. */
.locked-note-button--visible {
  opacity: 1;
  pointer-events: auto;
}

/* Shared by every element that should fade in/out together with the on-screen
   controls (the menu, the driving disclaimer, …) — toggle `--hidden` on the
   same condition (`iconVisible`) so they all fade at the same rate and stay in sync. */
.fades-with-ui {
  opacity: 1;
  transition: opacity var(--fade-duration) ease;
}

.fades-with-ui--hidden {
  opacity: 0;
  pointer-events: none;
}

.menu-checking {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: rgba(255, 255, 255, 0.75);
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
}

.menu {
  position: absolute;
  top: 1rem;
  left: 1rem;
  font-family: system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 14rem;
  border-radius: 0.75rem;
  background: transparent;
  color: #fff;
  font-size: 0.95rem;
  text-align: left;
}

.menu label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.genre-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.genre-button {
  padding: 0.6rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem;
  background: transparent;
  backdrop-filter: url('#glass-refraction') blur(2px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.fullscreen-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 1;
}

/* The fullscreen workaround is a Tesla in-car browser trick — hide the
   button on phone- and tablet-sized screens where it doesn't apply (and
   where it can overlap the genre picker). */
@media (max-width: 64rem) {
  .fullscreen-button {
    display: none;
  }
}

.genre-button--active {
  background: rgba(255, 255, 255, 0.3);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2),
    0 0 0 2px rgba(255, 255, 255, 0.8);
}

.image-picker-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.image-picker {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

.image-picker-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.image-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}

/* On phone-sized screens the numbered image buttons reflow into a compact
   two-column grid (five rows for a full set of ten) instead of one long
   column that runs off the bottom of the screen. */
@media (max-width: 37.5rem) {
  .image-grid {
    display: grid;
    grid-template-columns: repeat(2, 2.75rem);
  }
}

.slideshow-button {
  height: 2.75rem;
  padding: 0 0.9rem;
}

.slideshow-button:disabled {
  opacity: 0.4;
  cursor: default;
}

.image-picker-button {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem;
  background: transparent;
  backdrop-filter: url('#glass-refraction') blur(2px) saturate(1.4);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

.image-picker-button--active {
  background: rgba(255, 255, 255, 0.3);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.5),
    inset 0 -2px 4px rgba(0, 0, 0, 0.2),
    0 0 0 2px rgba(255, 255, 255, 0.8);
}

.image-picker-button--remove {
  border-color: rgba(255, 130, 130, 0.6);
  background: rgba(255, 80, 80, 0.18);
  color: rgba(255, 210, 210, 0.95);
}

.upload-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: upload-spin 0.8s linear infinite;
}

@keyframes upload-spin {
  to {
    transform: rotate(360deg);
  }
}
