*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f5f0e6;
  --surface: #ebe4d6;
  --text: #1c1c1c;
  --text-secondary: #3d3d3d;
  --muted: #6b6b6b;
  --radius: 16px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h: 56px;
  --feed-controls-bottom: calc(20px + var(--safe-bottom));
  --feed-controls-right: 16px;
  --feed-control-size: 48px;
  --feed-control-gap: 8px;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.feed-open,
body.age-gate-open {
  height: 100%;
  overflow: hidden;
}

body.auth-open {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

#site-shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

body.auth-open #app,
#app[hidden] {
  display: none !important;
}

body.auth-open .feed {
  display: none !important;
}

body.age-gate-open #site-shell {
  pointer-events: none;
  user-select: none;
}

/* —— Age verification —— */
.age-gate {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: calc(20px + var(--safe-top));
  padding-bottom: calc(20px + var(--safe-bottom));
  background: rgba(28, 28, 28, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.age-gate[hidden] {
  display: none !important;
}

.age-gate--leaving {
  animation: age-gate-fade 0.28s ease forwards;
}

@keyframes age-gate-fade {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

.age-gate__panel {
  width: min(100%, 22rem);
  padding: 28px 24px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid rgba(28, 28, 28, 0.12);
  box-shadow:
    0 4px 12px rgba(28, 28, 28, 0.1),
    0 20px 48px rgba(28, 28, 28, 0.18);
  text-align: center;
}

.age-gate__badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.age-gate__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.age-gate__text {
  margin-top: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.age-gate__fine {
  margin-top: 10px;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--muted);
}

.age-gate__actions {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.age-gate__btn {
  width: 100%;
  padding: 14px 18px;
  border-radius: 999px;
  border: none;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.age-gate__btn:active {
  transform: scale(0.98);
}

.age-gate__btn--primary {
  background: var(--text);
  color: var(--bg);
}

.age-gate__btn--secondary {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(28, 28, 28, 0.18);
}

/* —— Premium upgrade prompt —— */
.upgrade-prompt {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-top: calc(20px + var(--safe-top));
  padding-bottom: calc(20px + var(--safe-bottom));
  background: rgba(28, 28, 28, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.upgrade-prompt[hidden] {
  display: none !important;
}

.upgrade-prompt__panel {
  width: min(100%, 22rem);
  padding: 28px 24px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid rgba(28, 28, 28, 0.12);
  box-shadow:
    0 4px 12px rgba(28, 28, 28, 0.1),
    0 20px 48px rgba(28, 28, 28, 0.18);
  text-align: center;
}

.upgrade-prompt__badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #d4af37;
  color: #1c1c1c;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.upgrade-prompt__title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.upgrade-prompt__collection {
  margin-top: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.upgrade-prompt__collection:empty {
  display: none;
}

.upgrade-prompt__text {
  margin-top: 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.upgrade-prompt__btn {
  margin-top: 22px;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.upgrade-prompt__btn:active {
  transform: scale(0.98);
}

body.upgrade-prompt-open {
  overflow: hidden;
}

/* —— Authentication —— */
.auth {
  flex: 1 0 auto;
  width: min(100%, 960px);
  margin-inline: auto;
  padding: 8px 16px calc(32px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth[hidden] {
  display: none !important;
}

.auth-intro {
  width: min(100%, 22rem);
  margin: 0 auto 16px;
  padding: 0 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
}

.auth-intro[hidden] {
  display: none !important;
}

.auth-intro__line {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.auth-previews {
  width: 100%;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (min-width: 540px) {
  .auth-previews {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }
}

.collection-card--preview {
  cursor: default;
  pointer-events: none;
}

.collection-card--preview:active {
  transform: none;
}

.auth-panel {
  width: min(100%, 22rem);
}

.auth-panel[hidden] {
  display: none !important;
}

.auth-panel__card {
  padding: 28px 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid rgba(28, 28, 28, 0.1);
  box-shadow:
    0 4px 12px rgba(28, 28, 28, 0.06),
    0 12px 32px rgba(28, 28, 28, 0.08);
}

.auth-panel__title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.auth-panel__lead {
  margin-top: 8px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.auth-form {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.auth-form__input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(28, 28, 28, 0.14);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.auth-form__input:focus {
  outline: 2px solid rgba(28, 28, 28, 0.25);
  outline-offset: 1px;
}

.auth-form__input:disabled {
  opacity: 0.65;
}

.auth-form__message {
  font-size: 0.8125rem;
  line-height: 1.45;
}

.auth-form__message[hidden] {
  display: none !important;
}

.auth-form__message--error {
  color: #9b2c2c;
}

.auth-form__message--success {
  color: #2f6b3f;
}

.auth-form__submit {
  margin-top: 4px;
  width: 100%;
  padding: 14px 18px;
  border: none;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.auth-form__submit:active:not(:disabled) {
  transform: scale(0.98);
}

.auth-form__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-panel__switch {
  margin-top: 18px;
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
}

.auth-panel__switch a {
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-user {
  flex-shrink: 0;
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  width: min(100%, 960px);
  margin-inline: auto;
  padding: 16px 20px calc(16px + var(--safe-bottom));
  border-top: 1px solid rgba(28, 28, 28, 0.1);
  background: var(--bg);
  position: relative;
  z-index: 50;
}

.auth-user[hidden] {
  display: none !important;
}

.auth-user__account {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}

.auth-user__crown {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d4af37;
  filter: drop-shadow(0 1px 1px rgba(180, 140, 20, 0.35));
}

.auth-user__crown[hidden] {
  display: none !important;
}

.auth-user__crown svg {
  display: block;
}

.auth-user__email {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.auth-user__admin {
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.auth-user__admin[hidden] {
  display: none !important;
}

.auth-user__admin:active {
  transform: scale(0.98);
}

.auth-user__logout {
  padding: 8px 14px;
  border: 1px solid rgba(28, 28, 28, 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  position: relative;
  z-index: 1;
}

.auth-user__logout:active {
  transform: scale(0.98);
}

#app {
  min-height: 100%;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

body.feed-open #app {
  height: 100%;
}

/* —— Homepage —— */
.site-banner {
  flex-shrink: 0;
  width: min(calc(100% - 32px), 960px);
  margin: calc(8px + var(--safe-top)) auto 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.site-banner__img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

@media (min-width: 480px) {
  .site-banner {
    width: min(calc(100% - 48px), 960px);
  }
}

.site-header {
  padding: 12px 20px 8px;
  margin-bottom: 1.5rem;
  flex-shrink: 0;
  width: min(100%, 960px);
  margin-inline: auto;
  text-align: center;
}

.site-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.site-taglines {
  margin-top: 10px;
  max-width: 22rem;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.site-tagline {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.home {
  flex: 1 0 auto;
  width: min(100%, 960px);
  margin-inline: auto;
  padding: 0 16px calc(32px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

@media (min-width: 540px) {
  .home {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding-inline: 24px;
  }
}

@media (min-width: 900px) {
  .home {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
  }
}

.collection-card--locked .collection-card__img {
  filter: brightness(0.45) saturate(0.85);
}

.collection-card--locked .collection-card__overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.92) 0%,
    rgba(0, 0, 0, 0.55) 50%,
    rgba(0, 0, 0, 0.25) 100%
  );
}

.collection-card__lock {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.95);
  pointer-events: none;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.55));
}

.collection-card {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: var(--outline-width, 2px) solid var(--outline-color, #3d3d3d);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 3 / 4;
  background: var(--surface);
  text-align: left;
  color: inherit;
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
  transform-origin: center center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow:
    0 2px 6px rgba(28, 28, 28, 0.08),
    0 10px 28px rgba(28, 28, 28, 0.16);
}

.collection-card:active:not(.collection-card--pop) {
  transform: scale(0.97);
}

@keyframes card-pop {
  0% {
    transform: scale(1);
  }
  55% {
    transform: scale(1.07);
  }
  100% {
    transform: scale(1);
  }
}

.collection-card--pop {
  animation: card-pop 0.26s cubic-bezier(0.34, 1.25, 0.64, 1);
  z-index: 1;
  position: relative;
}

.collection-card--link .collection-card__count::after {
  content: " ↗";
  opacity: 0.85;
}

.collection-card__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.collection-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85) 0%,
    rgba(0, 0, 0, 0.2) 45%,
    transparent 70%
  );
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px;
}

.collection-card__accent {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 12px currentColor;
}

.collection-card__title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.collection-card__count {
  margin-top: 4px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.collection-card__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  pointer-events: none;
}

.collection-card--basic {
  border-color: color-mix(in srgb, var(--outline-color, #3d3d3d) 72%, #ffffff);
}

.collection-card--basic .collection-card__badge--basic {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.collection-card--challenge {
  border-width: calc(var(--outline-width, 2px) + 1px);
  border-color: color-mix(in srgb, var(--accent, #46d9e3) 55%, #ffffff);
  box-shadow:
    0 2px 6px rgba(28, 28, 28, 0.08),
    0 10px 28px rgba(28, 28, 28, 0.16),
    0 0 0 1px color-mix(in srgb, var(--accent, #46d9e3) 35%, transparent),
    0 0 22px color-mix(in srgb, var(--accent, #46d9e3) 28%, transparent);
}

.collection-card--challenge .collection-card__overlay {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.35) 48%,
    transparent 72%
  );
}

.collection-card--challenge .collection-card__badge--challenge {
  color: #0a0a0a;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent, #46d9e3) 82%, #ffffff),
    color-mix(in srgb, var(--accent, #46d9e3) 55%, #000000)
  );
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent, #46d9e3) 45%, transparent);
}

/* —— Feed (TikTok-style) —— */
.feed {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000;
  display: flex;
  flex-direction: column;
  transform-origin: center center;
}

.feed[hidden] {
  display: none !important;
}

@keyframes feed-enter {
  0% {
    opacity: 0;
    transform: scale(0.94);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.feed--enter {
  animation: feed-enter 0.3s cubic-bezier(0.34, 1.15, 0.64, 1);
  transform-origin: center center;
}

.feed-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + var(--safe-top)) 12px 12px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent);
  pointer-events: none;
}

.feed-header > * {
  pointer-events: auto;
}

.back-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
}

.back-btn:active {
  background: rgba(255, 255, 255, 0.22);
}

.feed-title {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feed-scroll {
  flex: 1;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.feed-scroll::-webkit-scrollbar {
  display: none;
}

.video-slide {
  position: relative;
  height: 100%;
  min-height: 100%;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.video-slide__media {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-slide__media.is-arcade-shaking {
  will-change: transform;
}

.video-slide__poster {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.video-slide__poster.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.video-slide video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.video-slide__mega {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: #1a1a1a center / cover no-repeat;
}

.mega-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  background: #d9272e;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(217, 39, 46, 0.45);
}

.mega-open-btn:active {
  transform: scale(0.97);
}

.mega-open-hint {
  max-width: 18rem;
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
}

.mega-open-hint code {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.85);
}

.video-slide__gradient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.55) 0%,
    transparent 35%
  );
}

.video-slide__media.is-challenge-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease-out;
  box-shadow:
    inset 0 0 0 4px var(--challenge-glow-color, #fff),
    inset 0 0 36px color-mix(in srgb, var(--challenge-glow-color, #fff) 78%, transparent),
    inset 0 0 72px color-mix(in srgb, var(--challenge-glow-color, #fff) 48%, transparent),
    inset 0 0 110px color-mix(in srgb, var(--challenge-glow-color, #fff) 24%, transparent);
}

.video-slide__media.is-challenge-glow.is-challenge-glow--visible::after {
  opacity: 1;
}

.clip-message {
  position: absolute;
  top: 5%;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(10.5px + var(--safe-top) * 0.15)
    21px
    10.5px;
  background: rgba(0, 0, 0, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease-out;
}

.clip-message.clip-message--visible {
  opacity: 1;
}

.clip-message__text {
  margin: 0;
  max-width: min(100%, 546px);
  font-size: 1.138rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.026em;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65);
}

/* —— Challenge intro infographic (first clip) —— */
.challenge-intro {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(12px + var(--safe-top))
    12px
    calc(12px + var(--safe-bottom));
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.42) 0%,
    rgba(0, 0, 0, 0.72) 42%,
    rgba(0, 0, 0, 0.88) 100%
  );
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  touch-action: none;
  cursor: pointer;
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.challenge-intro--dismissed {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

.challenge-intro__panel {
  width: 100%;
  max-width: 420px;
  padding: 22px 20px 18px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--intro-accent, #a855f7) 42%, white);
  background:
    linear-gradient(
      160deg,
      rgba(18, 18, 22, 0.94) 0%,
      rgba(10, 10, 12, 0.98) 100%
    );
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 0 28px color-mix(in srgb, var(--intro-accent, #a855f7) 22%, transparent);
  user-select: none;
  -webkit-user-select: none;
}

.challenge-intro__subtitle {
  margin: 0 0 8px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--intro-accent, #a855f7) 72%, white);
}

.challenge-intro__title {
  margin: 0 0 14px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.22;
  color: #fff;
}

.challenge-intro__list {
  margin: 0;
  padding: 0 0 0 1.25rem;
  display: grid;
  gap: 10px;
}

.challenge-intro__list li {
  font-size: 0.9375rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.9);
}

.challenge-intro__list li::marker {
  color: var(--intro-accent, #a855f7);
}

.challenge-intro__hint {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  color: rgba(255, 255, 255, 0.78);
}

/* —— Arcade speed bar (single overlay, fixed while scrolling) —— */
.feed > .arcade-bar {
  --arcade-color: rgb(57, 255, 20);
  --arcade-glow: rgba(57, 255, 20, 0.78);
  --arcade-glow-soft: rgba(57, 255, 20, 0.38);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  position: absolute;
  left: calc(3% + 10px + env(safe-area-inset-left, 0px));
  top: 50%;
  z-index: 6;
  height: 33vh;
  min-height: 150px;
  max-height: 320px;
  transform: translateY(-50%);
  pointer-events: none;
  overflow: visible;
}

.feed > .arcade-bar[hidden] {
  display: none !important;
}

.feed > .arcade-bar.arcade-bar--white .arcade-bar__strip {
  background: color-mix(in srgb, #ffffff 58%, #141414);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.feed > .arcade-bar.arcade-bar--white .arcade-bar__leds {
  background: color-mix(in srgb, #ffffff 72%, #101010);
  box-shadow:
    inset 0 0 12px rgba(255, 255, 255, 0.35),
    0 0 10px rgba(255, 255, 255, 0.2);
}

.feed > .arcade-bar.arcade-bar--white .arcade-bar__leds::before {
  background: color-mix(in srgb, #ffffff 55%, white);
  box-shadow:
    0 0 4px #fff,
    0 0 10px #fff,
    0 0 16px rgba(255, 255, 255, 0.85);
}

.feed > .arcade-bar.arcade-bar--white .arcade-bar__segment {
  background: color-mix(in srgb, #ffffff 78%, transparent);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.85),
    0 0 8px rgba(255, 255, 255, 0.45);
}

.feed > .arcade-bar.arcade-bar--white .arcade-bar__segment::after {
  background: #fff;
  box-shadow: 0 0 5px #fff, 0 0 8px rgba(255, 255, 255, 0.9);
}

.feed > .arcade-bar.arcade-bar--white .arcade-bar__glow {
  box-shadow:
    0 0 6px rgba(255, 255, 255, 0.85),
    0 0 12px rgba(255, 255, 255, 0.45);
}

.feed > .arcade-bar.arcade-bar--white .arcade-bar__label-speed {
  color: #fff;
  text-shadow:
    0 0 8px rgba(255, 255, 255, 0.95),
    0 0 10px rgba(0, 0, 0, 0.9),
    0 1px 2px rgba(0, 0, 0, 0.95);
}

.feed > .arcade-bar .arcade-bar__frame {
  position: relative;
  flex: 0 0 12px;
  height: 100%;
  width: 12px;
  overflow: visible;
}

.feed > .arcade-bar .arcade-bar__label {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  align-self: stretch;
  height: 100%;
  margin-right: 6px;
  padding: 0 8px 0 4px;
  pointer-events: none;
}

.feed > .arcade-bar .arcade-bar__label::before {
  content: "";
  position: absolute;
  inset: 0 -4px 0 -10px;
  z-index: -1;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.46) 0%,
    rgba(0, 0, 0, 0.24) 48%,
    rgba(0, 0, 0, 0.06) 78%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0%,
    #000 10%,
    #000 90%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0%,
    #000 10%,
    #000 90%,
    transparent 100%
  );
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  pointer-events: none;
}

.feed > .arcade-bar .arcade-bar__label-line {
  position: relative;
  z-index: 1;
  display: inline-block;
  writing-mode: vertical-lr;
  text-orientation: mixed;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.1;
}

.feed > .arcade-bar .arcade-bar__label-title {
  color: rgba(255, 255, 255, 0.78);
  text-shadow:
    0 0 8px rgba(0, 0, 0, 0.9),
    0 1px 2px rgba(0, 0, 0, 0.95);
}

.feed > .arcade-bar .arcade-bar__label-sep {
  color: rgba(255, 255, 255, 0.32);
  font-weight: 700;
}

.feed > .arcade-bar .arcade-bar__label-speed {
  color: var(--arcade-color);
  text-shadow:
    0 0 6px var(--arcade-glow-soft),
    0 0 8px rgba(0, 0, 0, 0.9),
    0 1px 2px rgba(0, 0, 0, 0.95);
  transition: color 0.35s ease, text-shadow 0.35s ease;
}

.feed > .arcade-bar .arcade-bar__glow {
  position: absolute;
  left: 50%;
  top: 2%;
  bottom: 2%;
  width: 12px;
  transform: translateX(-50%);
  border-radius: 3px;
  pointer-events: none;
  box-shadow:
    0 0 4px var(--arcade-glow),
    0 0 8px var(--arcade-glow-soft);
  transition: box-shadow 0.35s ease;
}

.feed > .arcade-bar .arcade-bar__strip {
  position: relative;
  z-index: 1;
  height: 100%;
  width: 100%;
  padding: 1px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--arcade-color) 32%, #0a0a0a);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  transition: background 0.35s ease;
  pointer-events: none;
}

.feed > .arcade-bar .arcade-bar__leds {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  padding: 10% 2px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--arcade-color) 48%, #050505);
  box-shadow: inset 0 0 10px var(--arcade-glow-soft);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.feed > .arcade-bar .arcade-bar__leds::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 5%;
  bottom: 5%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 1px;
  background: color-mix(in srgb, var(--arcade-color) 40%, white);
  box-shadow:
    0 0 3px #fff,
    0 0 8px var(--arcade-color),
    0 0 12px var(--arcade-glow);
  opacity: 1;
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.feed > .arcade-bar .arcade-bar__segment {
  position: relative;
  z-index: 1;
  flex: 0 0 22%;
  width: 100%;
  border-radius: 2px;
  background: color-mix(in srgb, var(--arcade-color) 62%, transparent);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--arcade-color) 70%, white),
    0 0 6px var(--arcade-glow-soft);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.feed > .arcade-bar .arcade-bar__segment::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 8%;
  bottom: 8%;
  width: 2px;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--arcade-color) 35%, white);
  box-shadow:
    0 0 4px #fff,
    0 0 6px var(--arcade-color);
  opacity: 1;
}

.feed > .arcade-bar .arcade-bar__track {
  position: absolute;
  left: 50%;
  top: 3%;
  bottom: 3%;
  width: 44px;
  z-index: 2;
  transform: translateX(-50%);
  overflow: visible;
  pointer-events: none;
}

.feed > .arcade-bar .arcade-bar__indicator {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate3d(-50%, 0, 0);
  will-change: transform;
  filter: drop-shadow(0 0 5px var(--arcade-glow));
  transition: filter 0.35s ease;
}

.feed > .arcade-bar .arcade-bar__fist {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.feed-controls {
  position: absolute;
  right: var(--feed-controls-right);
  bottom: var(--feed-controls-bottom);
  z-index: 15;
  display: grid;
  grid-template-columns: repeat(3, var(--feed-control-size));
  grid-template-rows: repeat(2, var(--feed-control-size));
  gap: var(--feed-control-gap);
  pointer-events: none;
}

.feed-controls > button {
  pointer-events: auto;
}

.mute-btn,
.music-btn,
.mic-btn,
.auto-btn,
.loop-btn,
.game-btn {
  width: var(--feed-control-size);
  height: var(--feed-control-size);
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.auto-btn {
  grid-area: 1 / 1;
}

.feed-controls--challenge .auto-btn {
  display: none;
}

.feed-controls--challenge .loop-btn {
  grid-area: 1 / 1;
}

.feed-controls--challenge .game-btn {
  grid-area: 1 / 2;
}

.loop-btn {
  grid-area: 1 / 2;
}

.game-btn {
  grid-area: 1 / 3;
}

.mic-btn {
  grid-area: 2 / 1;
}

.music-btn {
  grid-area: 2 / 2;
}

.mute-btn {
  grid-area: 2 / 3;
}

.auto-btn__label {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.auto-btn--infinite .auto-btn__label {
  font-size: 1.35rem;
  letter-spacing: 0;
}

.auto-btn.is-active {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.22);
}

.loop-btn.is-active {
  color: #fde047;
  background: rgba(253, 224, 71, 0.22);
}

.auto-btn:not(.is-active),
.loop-btn:not(.is-active),
.game-btn:not(.is-active) {
  opacity: 0.55;
}

.game-btn.is-active {
  color: #c084fc;
  background: rgba(192, 132, 252, 0.22);
}

.music-btn:disabled,
.mic-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.music-btn.is-playing {
  color: #7ee787;
  background: rgba(126, 231, 135, 0.22);
}

.music-btn.is-open {
  color: #bbf7d0;
  background: rgba(126, 231, 135, 0.32);
}

.mic-btn.is-playing {
  color: #f9a8d4;
  background: rgba(249, 168, 212, 0.22);
}

.mic-btn.is-open {
  color: #fbcfe8;
  background: rgba(249, 168, 212, 0.32);
}

.voice-menu,
.music-menu {
  position: absolute;
  right: var(--feed-controls-right);
  bottom: calc(var(--feed-controls-bottom) + var(--feed-control-size) + 10px);
  z-index: 20;
  min-width: 148px;
  max-width: 210px;
  max-height: min(240px, 36vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 14px;
  padding: 6px;
  background: rgba(10, 10, 10, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.voice-menu__item,
.music-menu__item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.voice-menu__item:hover,
.voice-menu__item:focus-visible,
.music-menu__item:hover,
.music-menu__item:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

.voice-menu__item.is-active {
  color: #f9a8d4;
  background: rgba(249, 168, 212, 0.16);
}

.music-menu__item.is-active {
  color: #7ee787;
  background: rgba(126, 231, 135, 0.16);
}

.voice-menu__item--random,
.music-menu__item--random {
  margin-bottom: 4px;
  padding-bottom: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px 9px 6px 6px;
}

.voice-menu__item--stop,
.music-menu__item--stop {
  margin-top: 4px;
  padding-top: 11px;
  font-weight: 600;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px 6px 9px 9px;
  color: rgba(255, 255, 255, 0.72);
}

.voice-menu__item--stop:disabled,
.music-menu__item--stop:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.voice-menu__item--stop:not(:disabled):hover,
.voice-menu__item--stop:not(:disabled):focus-visible,
.music-menu__item--stop:not(:disabled):hover,
.music-menu__item--stop:not(:disabled):focus-visible {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.14);
}

.feed-hint {
  position: absolute;
  bottom: calc(128px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.75);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  animation: hint-pulse 2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes hint-pulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 1;
  }
}

.feed-hint.is-hidden {
  display: none;
}

/* Hide homepage when feed is open */
body.feed-open .site-banner,
body.feed-open .site-header,
body.feed-open .home,
body.feed-open .auth-user {
  visibility: hidden;
}
