.eyebrow {
  margin: 0;
  color: rgba(248, 249, 250, 0.75);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 1.4rem;
  line-height: 1.25;
}

p {
  margin: 0;
  color: rgba(248, 249, 250, 0.88);
}

.screen__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.app-screen {
  position: relative;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

:root {
  --flow-screen-pad-x: clamp(17px, 4.8vw, 22px);
}

.pulseboard-screen,
.sandsword-screen,
.quizblitz-screen {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

.pulseboard-canvas,
.pulseboard-hand-canvas,
.sandsword-canvas {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.quizblitz-question-card,
.quizblitz-question-card__answers,
.quizblitz-question-card__answers .btn,
[data-qb-answer-index] {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.app-screen > * {
  position: relative;
  z-index: 1;
}

.app-screen--brand {
  background:
    radial-gradient(circle at 84% 8%, rgba(138, 63, 252, 0.28), transparent 40%),
    radial-gradient(circle at 12% 88%, rgba(255, 106, 0, 0.2), transparent 44%),
    linear-gradient(170deg, rgba(28, 31, 43, 0.95) 0%, rgba(15, 18, 36, 0.98) 65%, rgba(25, 16, 35, 0.98) 100%);
}

.app-screen--brand::before {
  content: "";
  position: absolute;
  inset: -16% -12% auto;
  height: 340px;
  background:
    radial-gradient(circle at 28% 30%, rgba(255, 106, 0, 0.2), transparent 56%),
    radial-gradient(circle at 78% 20%, rgba(138, 63, 252, 0.24), transparent 58%);
  filter: blur(30px);
  pointer-events: none;
  z-index: 0;
}

.start-hero {
  align-items: center;
  text-align: center;
  gap: var(--space-3);
}

.start-title {
  margin: 0;
  font-size: 1.75rem;
  letter-spacing: 0.01em;
}

.start-claim {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  max-width: 28ch;
}

.start-content {
  flex: 1 1 auto;
  min-height: 0;
  justify-content: space-between;
  gap: clamp(var(--space-4), 2.4dvh, var(--space-6));
  width: 100%;
  max-width: 360px;
  margin-inline: auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.start-content > .start-glass-card,
.start-content > .start-pills,
.start-content > .start-actions {
  flex-shrink: 0;
}

.start-screen {
  justify-content: space-between;
  gap: clamp(var(--space-3), 2.4dvh, var(--space-6));
  padding:
    max(var(--space-6), env(safe-area-inset-top, 0px))
    max(var(--space-5), env(safe-area-inset-right, 0px))
    var(--space-6)
    max(var(--space-5), env(safe-area-inset-left, 0px));
}

.start-screen:has(.start-menu-button) .start-hero {
  padding-inline: 52px 52px;
  box-sizing: border-box;
}

.start-menu-button {
  position: absolute;
  top: max(var(--space-5), env(safe-area-inset-top, 0px));
  right: max(var(--space-5), env(safe-area-inset-right, 0px));
  z-index: 6;
  width: 46px;
  height: 46px;
  margin: 0;
  padding: 0;
  border: 1px solid rgba(255, 106, 0, 0.5);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)),
    rgba(15, 18, 36, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(138, 63, 252, 0.18),
    0 8px 22px rgba(6, 8, 20, 0.38),
    0 0 18px rgba(255, 106, 0, 0.24);
  color: var(--color-text-light);
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.start-menu-button:active {
  transform: translateY(1px);
}

.start-menu-button:focus-visible {
  outline: 2px solid rgba(255, 106, 0, 0.72);
  outline-offset: 2px;
}

.start-menu-button__bars {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 18px;
}

.start-menu-button__bars span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: rgba(248, 249, 250, 0.94);
  box-shadow: 0 0 8px rgba(255, 106, 0, 0.35);
}

.start-logo {
  width: min(210px, 72%);
}

.glass-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 106, 0, 0.45);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 14px 34px rgba(6, 8, 20, 0.38),
    0 0 18px rgba(255, 106, 0, 0.22),
    0 0 32px rgba(138, 63, 252, 0.12);
}

.start-glass-card {
  padding: var(--space-5);
}

.start-glass-card::before {
  content: "";
  position: absolute;
  inset: 18% -8%;
  background:
    radial-gradient(circle at 24% 48%, rgba(255, 106, 0, 0.28), transparent 58%),
    radial-gradient(circle at 78% 56%, rgba(138, 63, 252, 0.24), transparent 60%);
  filter: blur(26px);
  z-index: -1;
}

.start-glass-card p {
  line-height: 1.5;
  text-align: center;
}

.start-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--color-text-light);
  font-size: 0.85rem;
}

.start-feature-pill {
  border-color: rgba(255, 106, 0, 0.45);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 12px rgba(255, 106, 0, 0.16), 0 0 22px rgba(138, 63, 252, 0.1);
}

.brand-logo {
  width: min(170px, 55%);
  height: auto;
}

.card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.button-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.screen-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  flex-shrink: 0;
}

.screen-actions .btn {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 106, 0, 0.35);
  box-shadow: 0 0 14px rgba(255, 106, 0, 0.16), 0 0 24px rgba(138, 63, 252, 0.08);
}

.start-actions {
  gap: clamp(10px, 1.3dvh, 14px);
}

.start-actions .btn {
  min-height: 48px;
  font-weight: 600;
}

.start-debug-button {
  opacity: 0.72;
  font-size: 0.82rem;
}

.btn {
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  min-height: 44px;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  color: #fff;
  box-shadow: 0 10px 24px rgba(255, 106, 0, 0.28), 0 0 16px rgba(255, 106, 0, 0.2);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-light);
  border: 1px solid rgba(255, 106, 0, 0.35);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: 0 0 10px rgba(255, 106, 0, 0.12), 0 0 18px rgba(138, 63, 252, 0.08);
}

@container (max-width: 430px) {
  .start-hero {
    gap: var(--space-2);
  }

  .start-logo {
    width: min(150px, 48vw);
  }

  .start-title {
    font-size: clamp(1.7rem, 7vw, 2.2rem);
  }

  .start-claim {
    font-size: 0.92rem;
    max-width: 24ch;
  }

  .start-glass-card {
    padding: 18px 16px;
  }

  .start-glass-card p {
    line-height: 1.42;
  }

  .start-actions {
    gap: clamp(8px, 1.2dvh, 12px);
  }

  .start-actions .btn {
    min-height: 46px;
  }

  .start-footer p {
    font-size: 0.76rem;
  }
}

.start-footer {
  flex-shrink: 0;
  margin-top: 0;
}

.start-footer p {
  margin: 0;
  color: rgba(248, 249, 250, 0.75);
  font-size: 0.8rem;
  text-align: center;
}

.guest-screen {
  /* Responsiv: Karten komprimieren statt Scrollbereich im Content. */
  --guest-card-py: var(--space-4);
  --guest-card-px: var(--space-4);
  --guest-card-inner-gap: var(--space-3);
  --guest-hero-logo-w: clamp(78px, 14dvh, 96px);
  justify-content: space-between;
  gap: clamp(12px, 2dvh, 22px);
  /* Oberhalb Logo: halbe bisherige Screen-Padding-Top (war implizit space-5). */
  padding:
    max(calc(var(--space-5) * 0.5), env(safe-area-inset-top, 0px))
    max(var(--flow-screen-pad-x), env(safe-area-inset-right, 0px))
    var(--space-5)
    max(var(--flow-screen-pad-x), env(safe-area-inset-left, 0px));
  min-height: 0;
  flex: 1 1 auto;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.guest-hero {
  flex: 0 0 auto;
  text-align: center;
  align-items: center;
  gap: clamp(4px, 0.9dvh, 8px);
}

.guest-player-mark {
  width: var(--guest-hero-logo-w);
  height: auto;
  margin: 0 auto calc(var(--space-1) * 0.5);
  display: block;
}

.guest-hero p {
  max-width: 34ch;
}

.guest-content {
  width: 100%;
  max-width: 370px;
  margin-inline: auto;
  flex: 1 1 auto;
  min-height: 0;
  justify-content: space-between;
  gap: clamp(12px, 2dvh, 22px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-2);
}

.guest-content > .guest-glass-card,
.guest-content > .guest-actions {
  flex-shrink: 0;
}

.guest-content .screen-actions {
  padding-bottom: 0;
}

.guest-glass-card {
  display: flex;
  flex-direction: column;
  gap: var(--guest-card-inner-gap);
  padding: var(--guest-card-py) var(--guest-card-px);
}

.guest-name-input {
  min-height: 48px;
  border: 1px solid rgba(255, 106, 0, 0.42);
  background: rgba(10, 15, 36, 0.54);
  color: var(--color-text-light);
}

.guest-name-input::placeholder {
  color: rgba(248, 249, 250, 0.55);
}

.guest-name-input:focus {
  outline: none;
  border-color: rgba(255, 106, 0, 0.76);
  box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.18), 0 0 18px rgba(138, 63, 252, 0.2);
}

.guest-name-input--locked {
  cursor: default;
  opacity: 0.92;
  border-color: rgba(138, 63, 252, 0.38);
}

.guest-name-input--locked:focus {
  border-color: rgba(138, 63, 252, 0.48);
  box-shadow: 0 0 0 2px rgba(138, 63, 252, 0.12);
}

.guest-helper {
  font-size: 0.82rem;
  color: rgba(248, 249, 250, 0.78);
}

.guest-rules-title {
  margin: 0;
  font-size: 1rem;
}

.guest-rules-list {
  margin: 0;
  padding-left: 1.05rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.guest-rules-list li {
  color: rgba(248, 249, 250, 0.9);
  line-height: 1.4;
}

/* --- Globale Audio-Icon-Steuerung (Warm-up-Hub, data-audio-controls) -------- */

.audio-icon-toggle {
  /* iOS Safari / WebKit: Appearance-Reset ist zwingend, sonst weißer Button-Background. */
  -webkit-appearance: none;
  appearance: none;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 50%;
  opacity: 0.38;
  filter: brightness(0.55) saturate(0.75);
  transition:
    opacity 140ms ease,
    filter 140ms ease,
    transform 140ms ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.audio-icon-toggle:focus-visible {
  outline: 2px solid rgba(255, 106, 0, 0.7);
  outline-offset: 3px;
}

.audio-icon-toggle:active {
  transform: translateY(1px) scale(0.95);
}

.audio-icon-toggle.is-active {
  opacity: 1;
  filter: brightness(1.12) saturate(1.2) drop-shadow(0 0 6px rgba(255, 106, 0, 0.55));
}

.audio-icon-toggle.is-muted {
  opacity: 1;
  filter: brightness(1.12) saturate(1.2) drop-shadow(0 0 6px rgba(194, 30, 86, 0.55));
}

.audio-icon-toggle__icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  pointer-events: none;
  display: block;
  background: transparent;
}

/* --- /globale Audio-Icon-Steuerung ----------------------------------------- */

.guest-footer {
  flex-shrink: 0;
}

.guest-footer p {
  margin: 0;
  text-align: center;
  color: rgba(248, 249, 250, 0.74);
  font-size: 0.78rem;
}

.warmup-screen {
  --warmup-pad-x: 16px;
  --warmup-pad-top: 14px;
  --warmup-pad-bottom: 12px;
  --warmup-logo-size: 144px;
  --warmup-logo-gap: 4px;
  --warmup-card-padding: 12px;
  --warmup-item-padding-y: 8px;
  --warmup-item-padding-x: 10px;
  --warmup-action-height: 42px;
  /* Hero oben; vertikale Verteilung im Content-Bereich (.warmup-content). */
  justify-content: flex-start;
  gap: clamp(8px, 1.8dvh, 16px);
  padding: var(--warmup-pad-top) var(--warmup-pad-x) var(--warmup-pad-bottom);
  overflow: hidden;
  min-height: 0;
  flex: 1 1 auto;
  height: 100%;
  box-sizing: border-box;
}

.warmup-hero {
  flex: 0 0 auto;
  text-align: center;
  align-items: center;
  gap: 4px;
}

.warmup-hero h1 {
  line-height: 1.15;
}

.warmup-hero p {
  max-width: 35ch;
  line-height: 1.28;
  font-size: 0.9rem;
}

.warmup-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 370px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(10px, 1.8dvh, 18px);
  overflow: visible;
}

/* Warm-up Hub: gleichmäßige Verteilung (nicht Quiz Blitz / Leaderboard). */
.warmup-screen:not(.quizblitz-screen):not(.warmup-leaderboard-screen) {
  --warmup-pad-x: var(--flow-screen-pad-x);
  justify-content: space-between;
  padding-bottom: calc(var(--warmup-pad-bottom) + 10px);
}

.warmup-screen:not(.quizblitz-screen):not(.warmup-leaderboard-screen) .warmup-hero {
  gap: clamp(8px, 1.4dvh, 14px);
}

.warmup-screen:not(.quizblitz-screen):not(.warmup-leaderboard-screen) .warmup-content {
  justify-content: space-between;
  gap: clamp(12px, 2dvh, 22px);
}

/* Quiz Blitz: lokaler Start-Countdown-Overlay (gleiche Klassen wie PulseBoard). */
.quizblitz-screen {
  --quizblitz-gap: clamp(10px, 1.5dvh, 16px);
  --quizblitz-hud-height: 74px;
  justify-content: flex-start;
  gap: var(--quizblitz-gap);
}

.quizblitz-screen .warmup-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  gap: var(--quizblitz-gap);
  width: 100%;
  max-width: 370px;
  overflow: hidden;
}

.quizblitz-hud {
  flex: 0 0 auto;
  min-height: var(--quizblitz-hud-height);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 106, 0, 0.28);
  box-shadow: 0 0 14px rgba(255, 106, 0, 0.1), 0 0 22px rgba(138, 63, 252, 0.1);
}

.quizblitz-hud__item {
  min-width: 0;
  text-align: center;
}

.quizblitz-hud__label {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(248, 249, 250, 0.68);
  white-space: nowrap;
}

.quizblitz-hud__value {
  display: block;
  margin-top: 2px;
  font-size: clamp(1.2rem, 4.8vw, 1.55rem);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-light);
}

.quizblitz-play {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  width: 100%;
}

.quizblitz-question-card {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(18px, 3dvh, 24px) 20px 18px;
}

.quizblitz-question-card::before {
  content: "";
  position: absolute;
  inset: 8% 6%;
  background-image: url("../../assets/logos/fight.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: min(72%, 280px);
  opacity: 0.06;
  pointer-events: none;
  z-index: 0;
}

.quizblitz-question-card > * {
  position: relative;
  z-index: 1;
}

.quizblitz-question-card__question-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-bottom: 12px;
  overflow: hidden;
}

.quizblitz-question-card__question {
  margin: 0;
  font-size: clamp(1.45rem, 5.6vw, 2.05rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.quizblitz-question-card__status {
  min-height: 1.2em;
  margin-top: 8px;
  font-size: 0.9rem;
}

.quizblitz-question-card__answers {
  flex: 0 0 auto;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quizblitz-question-card__answers .btn {
  min-height: clamp(48px, 6.2dvh, 58px);
}

@media (max-height: 760px) {
  .quizblitz-screen {
    --quizblitz-gap: clamp(8px, 1.2dvh, 12px);
  }

  .quizblitz-hud {
    padding: 9px 13px;
  }

  .quizblitz-question-card {
    padding: 16px 18px 16px;
  }

  .quizblitz-question-card__question {
    font-size: clamp(1.25rem, 4.8vw, 1.72rem);
    line-height: 1.18;
  }

  .quizblitz-question-card__answers .btn {
    min-height: clamp(44px, 5.4dvh, 52px);
  }
}

@media (max-height: 640px) {
  .quizblitz-screen {
    --quizblitz-hud-height: 64px;
    --quizblitz-gap: 8px;
  }

  .quizblitz-hud {
    padding: 8px 12px;
  }

  .quizblitz-question-card {
    padding: 12px 16px 12px;
  }

  .quizblitz-question-card__question {
    font-size: clamp(1.1rem, 4.2vw, 1.5rem);
  }

  .quizblitz-question-card__answers {
    gap: 8px;
  }

  .quizblitz-question-card__answers .btn {
    min-height: 42px;
  }
}

.quizblitz-screen > .warmup-content > .screen-actions {
  flex: 0 0 auto;
}

.warmup-audio-controls,
.challenge-settings-audio-controls {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  flex-shrink: 0;
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.haptic-support-hint {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translate(-50%, -4px);
  z-index: 8;
  width: max-content;
  max-width: min(280px, 78vw);
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 106, 0, 0.42);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.05)),
    rgba(15, 18, 36, 0.94);
  box-shadow:
    0 10px 24px rgba(6, 8, 20, 0.38),
    0 0 14px rgba(255, 106, 0, 0.18),
    0 0 20px rgba(138, 63, 252, 0.12);
  color: rgba(248, 249, 250, 0.94);
  font-size: 0.74rem;
  line-height: 1.25;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.haptic-support-hint.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.warmup-progress-card {
  padding: var(--warmup-card-padding);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.warmup-progress-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.warmup-progress-value {
  font-weight: 600;
}

.warmup-progress-track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.warmup-progress-step {
  min-height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.warmup-progress-step--done {
  background: rgba(53, 196, 117, 0.62);
  border-color: rgba(53, 196, 117, 0.82);
}

.warmup-progress-step--current {
  background: rgba(255, 106, 0, 0.3);
  border-color: rgba(255, 106, 0, 0.68);
  box-shadow: 0 0 10px rgba(255, 106, 0, 0.2);
}

.warmup-game-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.warmup-game-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--warmup-item-padding-y) var(--warmup-item-padding-x);
  min-height: 0;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.warmup-game-item p {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.25;
}

.warmup-game-status {
  white-space: nowrap;
  min-height: 30px;
  padding: 6px 10px;
  font-size: 0.78rem;
  border-color: rgba(255, 255, 255, 0.18);
}

.warmup-game-status--done {
  border-color: rgba(53, 196, 117, 0.82);
  background: rgba(53, 196, 117, 0.2);
}

.warmup-game-status--current {
  border-color: rgba(255, 106, 0, 0.62);
  background: rgba(255, 106, 0, 0.2);
}

.warmup-game-status--open {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
}

.warmup-note {
  margin: 0;
  flex-shrink: 0;
  text-align: center;
  color: rgba(248, 249, 250, 0.82);
  line-height: 1.28;
  font-size: 0.84rem;
}

.warmup-content .screen-actions {
  flex-shrink: 0;
  gap: 8px;
}

.warmup-content .screen-actions .btn {
  min-height: var(--warmup-action-height);
}

.warmup-footer p {
  margin: 0;
  text-align: center;
  color: rgba(248, 249, 250, 0.74);
  font-size: 0.7rem;
  line-height: 1.25;
}

.warmup-footer {
  flex: 0 0 auto;
  flex-shrink: 0;
  margin-top: 0;
  padding-bottom: 0;
}

.warmup-leaderboard-screen {
  justify-content: space-between;
  height: 100%;
  min-height: 0;
}

.warmup-leaderboard-hero-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  overflow: visible;
}

.warmup-leaderboard-hero {
  display: block;
  width: min(44%, 128px);
  height: auto;
  max-height: clamp(70px, 14dvh, 118px);
  border: none;
  border-radius: 0;
  box-shadow: none;
  object-fit: contain;
  transform-origin: center center;
  animation: warmup-end-card-hero-pulse 2.4s ease-in-out infinite;
}

.warmup-leaderboard-content {
  flex: 1 1 auto;
  min-height: 0;
  justify-content: stretch;
  overflow: hidden;
}

.warmup-leaderboard-card {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}

.warmup-leaderboard-state {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.warmup-leaderboard-state__title {
  font-weight: 700;
  color: #fff;
}

.warmup-leaderboard-state--error {
  border-color: rgba(255, 77, 79, 0.48);
}

.warmup-leaderboard-list-head,
.warmup-leaderboard-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.warmup-leaderboard-list-head {
  padding: 0 10px 4px;
  color: rgba(248, 249, 250, 0.62);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.warmup-leaderboard-list {
  min-height: 0;
  margin: 0;
  padding: 0 2px 2px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.warmup-leaderboard-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.warmup-leaderboard-row {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.warmup-leaderboard-row--gold {
  border-color: rgba(255, 205, 72, 0.78);
  background:
    linear-gradient(135deg, rgba(255, 205, 72, 0.18), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 14px rgba(255, 205, 72, 0.2);
  animation: warmup-leaderboard-gold-pulse 2.2s ease-in-out infinite;
}

.warmup-leaderboard-row--silver {
  border-color: rgba(218, 226, 236, 0.7);
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.06), rgba(218, 226, 236, 0.18), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 12px rgba(218, 226, 236, 0.14);
}

.warmup-leaderboard-row--bronze {
  border-color: rgba(205, 127, 50, 0.72);
  background:
    linear-gradient(135deg, rgba(205, 127, 50, 0.16), rgba(255, 255, 255, 0.05)),
    rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 12px rgba(205, 127, 50, 0.16);
}

.warmup-leaderboard-row--current {
  border-color: rgba(255, 106, 0, 0.9);
  box-shadow:
    0 0 0 1px rgba(255, 106, 0, 0.22),
    0 0 18px rgba(255, 106, 0, 0.34),
    0 0 28px rgba(138, 63, 252, 0.16);
  animation: warmup-leaderboard-current-pulse 1.8s ease-in-out infinite;
}

.warmup-leaderboard-current-divider {
  display: block;
  height: 10px;
  margin: 2px 10px;
  border-top: 1px dashed rgba(255, 106, 0, 0.38);
}

.warmup-leaderboard-row__rank {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 106, 0, 0.16);
  border: 1px solid rgba(255, 106, 0, 0.38);
  color: #fff;
  font-weight: 700;
}

.warmup-leaderboard-row--gold .warmup-leaderboard-row__rank {
  background: rgba(255, 205, 72, 0.24);
  border-color: rgba(255, 205, 72, 0.78);
}

.warmup-leaderboard-row--silver .warmup-leaderboard-row__rank {
  background: rgba(218, 226, 236, 0.18);
  border-color: rgba(218, 226, 236, 0.68);
}

.warmup-leaderboard-row--bronze .warmup-leaderboard-row__rank {
  background: rgba(205, 127, 50, 0.2);
  border-color: rgba(205, 127, 50, 0.72);
}

@keyframes warmup-leaderboard-current-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 106, 0, 0.22),
      0 0 18px rgba(255, 106, 0, 0.34),
      0 0 28px rgba(138, 63, 252, 0.16);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 106, 0, 0.42),
      0 0 24px rgba(255, 106, 0, 0.48),
      0 0 36px rgba(138, 63, 252, 0.24);
  }
}

@keyframes warmup-leaderboard-gold-pulse {
  0%, 100% {
    box-shadow: 0 0 14px rgba(255, 205, 72, 0.2);
  }
  50% {
    box-shadow: 0 0 22px rgba(255, 205, 72, 0.34);
  }
}

.warmup-leaderboard-row__name {
  min-width: 0;
  overflow: hidden;
  color: rgba(248, 249, 250, 0.92);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warmup-leaderboard-row__score {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.has-warmup-leaderboard-overlay > *:not(.warmup-leaderboard-overlay) {
  pointer-events: none;
}

.warmup-leaderboard-overlay {
  position: absolute;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2dvh, 18px);
  box-sizing: border-box;
  overflow: hidden;
  pointer-events: auto;
}

.warmup-leaderboard-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 20, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.warmup-leaderboard-overlay__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 380px);
  max-height: min(100%, calc(100dvh - 24px));
  display: flex;
  overflow: hidden;
}

.warmup-leaderboard-overlay__card {
  width: 100%;
  max-height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.3dvh, 12px);
  padding: clamp(12px, 2dvh, 16px);
  overflow: hidden;
}

.warmup-leaderboard-overlay__header {
  flex: 0 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.warmup-leaderboard-overlay__header h2 {
  margin: 0;
  color: var(--color-text-light, #f8f9fa);
  font-size: 1.18rem;
  line-height: 1.2;
}

.warmup-leaderboard-overlay__header p {
  font-size: 0.84rem;
  line-height: 1.25;
}

.warmup-leaderboard-overlay__board {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.warmup-leaderboard-overlay .warmup-leaderboard-state {
  min-height: 160px;
}

.warmup-leaderboard-overlay__close {
  flex: 0 0 auto;
  width: 100%;
  min-height: clamp(40px, 5.6dvh, 44px);
}

@container (max-width: 430px) {
  .start-screen {
    padding: 18px 16px 20px;
  }

  .start-menu-button {
    top: max(14px, env(safe-area-inset-top, 0px));
    right: max(14px, env(safe-area-inset-right, 0px));
    width: 44px;
    height: 44px;
  }

  .start-screen:has(.start-menu-button) .start-hero {
    padding-inline: 48px;
  }

  .guest-screen {
    /* Oberer Innenrand halbiert (Logo näher an den Rand), unten unverändert. */
    padding: 9px var(--flow-screen-pad-x) 20px;
    gap: clamp(10px, 1.8dvh, 16px);
    --guest-card-py: 12px;
    --guest-card-px: 12px;
    --guest-card-inner-gap: var(--space-2);
    --guest-hero-logo-w: clamp(76px, 20vw, 90px);
  }

  .guest-content {
    gap: clamp(10px, 1.8dvh, 18px);
  }

  .start-content {
    gap: clamp(var(--space-3), 1.8dvh, var(--space-5));
  }

  .guest-hero p {
    font-size: 0.92rem;
  }

  .guest-rules-list li {
    font-size: 0.9rem;
  }

  .warmup-screen {
    --warmup-pad-top: 12px;
    --warmup-pad-bottom: 10px;
    --warmup-logo-size: 144px;
    --warmup-logo-gap: 4px;
  }

  .warmup-progress-card {
    padding: var(--warmup-card-padding);
    gap: var(--space-2);
  }

  .warmup-game-item {
    padding: 9px 10px;
  }

  .warmup-game-item p {
    font-size: 0.9rem;
  }

}

@media (max-height: 760px) {
  .start-screen {
    gap: var(--space-3);
  }

  .start-menu-button {
    top: max(10px, env(safe-area-inset-top, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .start-menu-button__bars {
    width: 16px;
    gap: 4px;
  }

  .start-screen:has(.start-menu-button) .start-hero {
    padding-inline: 44px;
  }

  .start-hero {
    gap: 6px;
  }

  .start-logo {
    width: min(126px, 42vw);
  }

  .start-title {
    font-size: clamp(1.45rem, 6.4vw, 1.8rem);
  }

  .start-claim {
    font-size: 0.86rem;
  }

  .start-glass-card {
    padding: 14px 14px;
  }

  .pill {
    min-height: 32px;
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .start-content {
    justify-content: space-between;
    gap: clamp(8px, 1.4dvh, 12px);
  }

  .start-footer p,
  .guest-footer p,
  .warmup-footer p {
    font-size: 0.72rem;
  }

  .warmup-screen {
    --warmup-pad-top: 10px;
    --warmup-pad-bottom: 10px;
    --warmup-logo-size: 136px;
    --warmup-logo-gap: 2px;
    --warmup-card-padding: 10px;
    --warmup-item-padding-y: 7px;
    --warmup-action-height: 40px;
  }

  .warmup-hero p {
    font-size: 0.84rem;
    line-height: 1.22;
  }

  .warmup-screen:not(.quizblitz-screen):not(.warmup-leaderboard-screen) {
    justify-content: space-between;
    gap: 8px;
  }

  .warmup-screen:not(.quizblitz-screen):not(.warmup-leaderboard-screen) .warmup-content {
    justify-content: space-between;
    gap: 10px;
  }

  .warmup-screen:not(.quizblitz-screen):not(.warmup-leaderboard-screen) .warmup-audio-controls {
    gap: 18px;
  }

  .warmup-screen:not(.quizblitz-screen):not(.warmup-leaderboard-screen) .warmup-progress-card {
    padding: 10px 12px;
    gap: 7px;
  }

  .warmup-screen:not(.quizblitz-screen):not(.warmup-leaderboard-screen) .warmup-note {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.22;
  }

  .guest-screen {
    gap: 10px;
    padding-top: max(8px, env(safe-area-inset-top, 0px));
    padding-bottom: 14px;
    --guest-card-py: 12px;
    --guest-card-px: 14px;
    --guest-card-inner-gap: var(--space-2);
    --guest-hero-logo-w: clamp(64px, 10.5dvh, 76px);
  }

  .guest-content {
    justify-content: space-between;
    gap: clamp(8px, 1.4dvh, 12px);
  }

  .guest-hero h1 {
    font-size: clamp(1.12rem, 3.6vw + 0.55rem, 1.3rem);
    line-height: 1.2;
  }

  .guest-hero p {
    font-size: 0.82rem;
    line-height: 1.22;
  }

  .guest-name-input {
    min-height: 42px;
    padding: 10px 12px;
  }

  .guest-helper {
    font-size: 0.76rem;
  }

  .guest-rules-title {
    font-size: 0.92rem;
  }

  .guest-rules-list {
    gap: 6px;
  }

  .guest-rules-list li {
    font-size: 0.82rem;
    line-height: 1.28;
  }

  .guest-content .screen-actions .btn {
    min-height: 42px;
  }
}

@media (max-height: 640px) {
  .guest-screen {
    padding: calc(var(--space-5) * 0.35) var(--space-3) var(--space-3);
    gap: var(--space-2);
    --guest-card-py: 8px;
    --guest-card-px: 10px;
    --guest-card-inner-gap: 6px;
    --guest-hero-logo-w: clamp(52px, 9dvh, 60px);
  }

  .guest-content {
    justify-content: flex-start;
    gap: 8px;
  }

  .guest-hero {
    gap: clamp(3px, 0.6dvh, 5px);
  }

  .guest-hero h1 {
    font-size: clamp(1.05rem, 3.2vw + 0.5rem, 1.22rem);
  }

  .guest-hero p {
    font-size: 0.78rem;
    line-height: 1.2;
  }

  .guest-name-input {
    min-height: 40px;
    padding: 8px 10px;
  }

  .guest-rules-list li {
    font-size: 0.78rem;
    line-height: 1.26;
  }

  .guest-content .screen-actions .btn {
    min-height: 40px;
  }

  .warmup-screen {
    --warmup-pad-top: 8px;
    --warmup-pad-bottom: 8px;
    --warmup-card-padding: 8px;
    --warmup-item-padding-y: 6px;
    --warmup-action-height: 38px;
  }

  .warmup-content {
    gap: clamp(6px, 1.4dvh, 12px);
  }

  .warmup-screen:not(.quizblitz-screen):not(.warmup-leaderboard-screen) .warmup-content {
    justify-content: space-between;
  }

  .warmup-audio-controls,
  .challenge-settings-audio-controls {
    gap: 18px;
  }
}

.text-input {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-light);
  padding: 12px;
}

/* --- Tall mobile viewports: cap vertical stretch from space-between ------- */

@media (min-height: 880px) {
  .guest-screen {
    gap: clamp(14px, 2dvh, 22px);
  }

  .guest-content {
    gap: clamp(14px, 2.2dvh, 24px);
  }

  .start-content {
    gap: clamp(var(--space-4), 2.2dvh, var(--space-6));
  }

  .warmup-screen:not(.quizblitz-screen):not(.warmup-leaderboard-screen) {
    justify-content: space-between;
    gap: clamp(14px, 2dvh, 22px);
  }

  .warmup-screen:not(.quizblitz-screen):not(.warmup-leaderboard-screen) .warmup-content {
    justify-content: space-between;
    gap: clamp(14px, 2.2dvh, 24px);
  }
}

/* ==========================================================================
   Challenge Intro Screen
   ========================================================================== */

.challenge-intro-screen {
  --challenge-pad-x: clamp(18px, 5vw, 28px);
  --challenge-pad-top: clamp(8px, 1.4dvh, 14px);
  --challenge-pad-bottom: clamp(8px, 1.2dvh, 12px);
  --challenge-logo-size: clamp(104px, 19dvh, 156px);
  --challenge-section-gap: clamp(8px, 1.4dvh, 14px);

  height: 100%;
  min-height: 0;
  overflow: hidden;
  overscroll-behavior-y: none;
  padding:
    max(var(--challenge-pad-top), env(safe-area-inset-top, 0px))
    max(var(--challenge-pad-x), env(safe-area-inset-right, 0px))
    var(--challenge-pad-bottom)
    max(var(--challenge-pad-x), env(safe-area-inset-left, 0px));
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: var(--challenge-section-gap);
}

/* --- Hero ----------------------------------------------------------------- */

.challenge-hero {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(3px, 0.7dvh, 7px);
  padding: 0;
  position: relative;
}

.challenge-hero::after {
  content: "";
  position: absolute;
  inset: -10% -20% auto;
  height: 220px;
  background:
    radial-gradient(circle at 30% 50%, rgba(138, 63, 252, 0.22), transparent 55%),
    radial-gradient(circle at 75% 40%, rgba(255, 106, 0, 0.18), transparent 52%);
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}

.challenge-hero > * {
  position: relative;
  z-index: 1;
}

.challenge-hero__logo {
  width: var(--challenge-logo-size);
  max-width: min(48vw, 170px);
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0;
  filter:
    drop-shadow(0 0 6px rgba(255, 106, 0, 0.4))
    drop-shadow(0 0 14px rgba(138, 63, 252, 0.28));
  opacity: 0.96;
}

.challenge-hero .challenge-hero__eyebrow {
  margin: 0;
  color: #fff;
  font-size: clamp(1.05rem, 2.4dvh, 1.28rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.08;
  text-transform: uppercase;
}

.challenge-hero__title {
  margin: 0;
  font-size: clamp(1.3rem, 5.5vw, 1.6rem);
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-text-light);
}

.challenge-hero__sub {
  margin: 0;
  max-width: 32ch;
  font-size: clamp(0.82rem, 1.7dvh, 0.95rem);
  line-height: 1.25;
  color: rgba(248, 249, 250, 0.82);
}

/* --- Content column ------------------------------------------------------- */

.challenge-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 390px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  padding: 0;
  box-sizing: border-box;
}

.challenge-main-stack {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: clamp(8px, 1.2dvh, 14px);
}

.challenge-main-stack > .challenge-game-start-stack,
.challenge-main-stack > .challenge-info-card {
  flex-shrink: 0;
}

.challenge-game-start-stack {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.2dvh, 10px);
}

/* --- Progress ------------------------------------------------------------- */

.challenge-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.challenge-progress__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(248, 249, 250, 0.88);
  letter-spacing: 0.02em;
}

.challenge-progress__track {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.challenge-progress__step {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background 250ms ease, border-color 250ms ease;
}

.challenge-progress__step--done {
  background: rgba(53, 196, 117, 0.62);
  border-color: rgba(53, 196, 117, 0.82);
}

.challenge-progress__step--current {
  background: rgba(255, 106, 0, 0.3);
  border-color: rgba(255, 106, 0, 0.72);
  box-shadow: 0 0 10px rgba(255, 106, 0, 0.22);
}

/* --- Game Grid ------------------------------------------------------------ */

.challenge-game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 2.8vw, 14px);
  width: 100%;
  max-width: 100%;
  min-height: 0;
  box-sizing: border-box;
  padding-inline: 3px;
  overflow: visible;
}

/* --- Game Card ------------------------------------------------------------ */

.challenge-game-card {
  --challenge-game-card-radius: 14px;

  /* Reset button */
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;

  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
  box-sizing: border-box;
  border-radius: var(--challenge-game-card-radius);
  overflow: visible;
  isolation: isolate;
  border: 1px solid rgba(255, 106, 0, 0.3);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 6px 18px rgba(6, 8, 20, 0.34),
    0 0 12px rgba(138, 63, 252, 0.1);
  transition:
    transform 130ms ease,
    box-shadow 130ms ease,
    border-color 130ms ease;
}

.challenge-game-card:disabled {
  cursor: default;
}

.challenge-game-card--active {
  z-index: 1;
  animation: challenge-card-pulse 1.8s ease-in-out infinite;
  border-color: rgba(255, 106, 0, 0.95);
  box-shadow:
    0 0 0 1px rgba(255, 106, 0, 0.35),
    0 0 18px rgba(255, 106, 0, 0.48),
    0 0 30px rgba(168, 72, 255, 0.24);
}

.challenge-game-card--active:active {
  transform: translateY(1px) scale(0.98);
}

@keyframes challenge-card-pulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
    box-shadow:
      0 0 0 1px rgba(255, 106, 0, 0.28),
      0 0 14px rgba(255, 106, 0, 0.36),
      0 0 24px rgba(168, 72, 255, 0.18);
  }

  50% {
    transform: translateY(-1px) scale(1.015);
    box-shadow:
      0 0 0 1px rgba(255, 106, 0, 0.52),
      0 0 22px rgba(255, 106, 0, 0.62),
      0 0 38px rgba(168, 72, 255, 0.32);
  }
}

@media (prefers-reduced-motion: reduce) {
  .challenge-game-card--active {
    animation: none;
    transform: none;
    border-color: rgba(255, 106, 0, 0.75);
    box-shadow:
      0 6px 18px rgba(6, 8, 20, 0.36),
      0 0 16px rgba(255, 106, 0, 0.28),
      0 0 28px rgba(138, 63, 252, 0.18);
  }
}

.challenge-game-card--done {
  border-color: rgba(53, 196, 117, 0.55);
  opacity: 0.78;
}

.challenge-game-card--locked {
  border-color: rgba(255, 255, 255, 0.12);
  opacity: 0.52;
}

/* --- Card Preview --------------------------------------------------------- */

.challenge-game-card__preview {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-top-left-radius: var(--challenge-game-card-radius);
  border-top-right-radius: var(--challenge-game-card-radius);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: linear-gradient(160deg, rgba(25, 20, 48, 0.9), rgba(12, 10, 30, 0.95));
}

/* Per-game fallback gradient when image is missing */
.challenge-game-card__preview--pulseBoard {
  background:
    radial-gradient(circle at 60% 40%, rgba(138, 63, 252, 0.5), transparent 55%),
    radial-gradient(circle at 30% 70%, rgba(255, 106, 0, 0.35), transparent 50%),
    linear-gradient(160deg, #18123a, #0a0f24);
}

.challenge-game-card__preview--sandSword {
  background:
    radial-gradient(circle at 50% 35%, rgba(224, 185, 122, 0.55), transparent 52%),
    radial-gradient(circle at 25% 65%, rgba(255, 106, 0, 0.38), transparent 50%),
    linear-gradient(160deg, #271a08, #120e04);
}

.challenge-game-card__preview--quizBlitz {
  background:
    radial-gradient(circle at 55% 38%, rgba(50, 180, 240, 0.48), transparent 54%),
    radial-gradient(circle at 35% 68%, rgba(138, 63, 252, 0.38), transparent 50%),
    linear-gradient(160deg, #091828, #060f1c);
}

.challenge-game-card__img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

/* --- Card Badge ----------------------------------------------------------- */

.challenge-game-card__badge {
  position: absolute;
  z-index: 3;
  top: 6px;
  right: 6px;
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
}

.challenge-game-card__badge--active {
  background: rgba(255, 106, 0, 0.85);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 106, 0, 0.4);
}

.challenge-game-card__badge--done {
  background: rgba(53, 196, 117, 0.78);
  color: #fff;
}

.challenge-game-card__badge--locked {
  background: rgba(255, 255, 255, 0.14);
  color: rgba(248, 249, 250, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

/* --- Card Meta ------------------------------------------------------------ */

.challenge-game-card__meta {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 6px 8px;
  text-align: left;
}

.challenge-game-card__title {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-light);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.challenge-game-card__sub {
  display: block;
  font-size: 0.64rem;
  color: rgba(248, 249, 250, 0.6);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Info Card ------------------------------------------------------------ */

.challenge-info-card {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 10px 14px;
  margin-block: auto;
}

.challenge-info-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.challenge-info-list__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: rgba(248, 249, 250, 0.88);
  line-height: 1.3;
}

.challenge-info-list__dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  box-shadow: 0 0 6px rgba(255, 106, 0, 0.5);
}

.challenge-completed-actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 1rem;
}

.challenge-completed-actions__title {
  font-weight: 800;
  color: rgba(255, 255, 255, 0.96);
}

.challenge-completed-actions__text {
  color: rgba(255, 255, 255, 0.72);
}

/* --- Bottom Nav ----------------------------------------------------------- */

.challenge-bottom-nav {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 8px 12px;
  margin: clamp(4px, 0.8dvh, 8px) 0 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    0 8px 22px rgba(6, 8, 20, 0.3),
    0 0 14px rgba(138, 63, 252, 0.1);
}

.challenge-bottom-nav__button {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(248, 249, 250, 0.55);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: color 120ms ease, background 120ms ease;
  min-height: 52px;
  justify-content: center;
}

.challenge-bottom-nav__button:not(:disabled):hover,
.challenge-bottom-nav__button:not(:disabled):focus-visible {
  color: rgba(248, 249, 250, 0.9);
  background: rgba(255, 255, 255, 0.07);
}

.challenge-bottom-nav__button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.challenge-bottom-nav__icon {
  font-size: 1.1rem;
  line-height: 1;
  display: block;
  filter: none;
}

.challenge-bottom-nav__img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255, 106, 0, 0.28));
}

.challenge-bottom-nav__button:disabled .challenge-bottom-nav__img {
  opacity: 0.72;
}

.challenge-bottom-nav__label {
  font-size: 0.6rem;
  letter-spacing: 0.02em;
  line-height: 1;
  font-weight: 500;
  white-space: nowrap;
}

/* --- Debug Actions -------------------------------------------------------- */

.challenge-debug-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.challenge-debug-actions .btn {
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.85;
}

/* --- Footer --------------------------------------------------------------- */

.challenge-footer {
  flex-shrink: 0;
  padding: clamp(2px, 0.4dvh, 6px) 0 0;
}

.challenge-footer p {
  margin: 0;
  text-align: center;
  color: rgba(248, 249, 250, 0.48);
  font-size: 0.68rem;
  line-height: 1.3;
}

/* --- Challenge ticket overlay (pre-start) -------------------------------- */

.challenge-ticket-status {
  margin: 0;
  margin-top: clamp(2px, 0.4dvh, 4px);
  font-size: clamp(0.72rem, 1.5dvh, 0.82rem);
  line-height: 1.15;
  font-weight: 700;
  color: rgba(255, 205, 72, 0.92);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.challenge-intro-screen > .challenge-ticket-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  box-sizing: border-box;
}

.challenge-intro-screen > .challenge-ticket-overlay[hidden] {
  display: none;
}

/* Hard guard: closed overlays must never block clicks */
.challenge-ticket-overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.challenge-ticket-overlay:not(.is-open) {
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
}

.challenge-ticket-overlay.is-open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.challenge-ticket-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 22, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.challenge-ticket-modal {
  position: relative;
  z-index: 1;
  width: min(100%, 330px);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  border-color: rgba(255, 106, 0, 0.78);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.45),
    0 0 22px rgba(255, 106, 0, 0.36),
    0 0 36px rgba(168, 72, 255, 0.22);
}

.challenge-ticket-modal__close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 249, 250, 0.88);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.challenge-ticket-modal__title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.16;
}

.challenge-ticket-modal__text,
.challenge-ticket-modal__legal {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.35;
  color: rgba(248, 249, 250, 0.84);
}

.challenge-ticket-modal__price {
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 205, 72, 0.58);
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 205, 72, 0.28), transparent 50%),
    rgba(255, 255, 255, 0.07);
}

.challenge-ticket-modal__price-main {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.challenge-ticket-modal__price-sub {
  display: block;
  margin-top: 2px;
  font-size: 0.76rem;
  color: rgba(248, 249, 250, 0.72);
}

.challenge-ticket-modal__legal {
  font-size: 0.76rem;
  color: rgba(248, 249, 250, 0.68);
}

.challenge-ticket-modal__cta,
.challenge-ticket-modal__secondary {
  width: 100%;
}

/* --- Challenge Start-Overlay ------------------------------------------------ */

.challenge-intro-screen > .challenge-start-overlay {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: grid;
  place-items: center;
  padding: 18px;
  box-sizing: border-box;
}

.challenge-intro-screen > .challenge-start-overlay[hidden] {
  display: none;
}

/* Hard guard: closed overlays must never block clicks */
.challenge-start-overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.challenge-start-overlay:not(.is-open) {
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
}

.challenge-start-overlay.is-open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.challenge-start-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 22, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.challenge-start-modal {
  position: relative;
  z-index: 1;
  width: min(100%, 330px);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
  border-color: rgba(255, 106, 0, 0.78);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.45),
    0 0 22px rgba(255, 106, 0, 0.36),
    0 0 36px rgba(168, 72, 255, 0.22);
}

.challenge-start-modal__close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(248, 249, 250, 0.88);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.challenge-start-modal__hero {
  width: min(130px, 44vw);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(255, 106, 0, 0.45));
  animation: challenge-start-hero-pulse 2s ease-in-out infinite;
}

.challenge-start-modal__title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.16;
}

.challenge-start-modal__text {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.35;
  color: rgba(248, 249, 250, 0.84);
}

.challenge-start-modal__cta,
.challenge-start-modal__secondary {
  width: 100%;
}

@keyframes challenge-start-hero-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 10px rgba(255, 106, 0, 0.35));
  }

  50% {
    transform: scale(1.04);
    filter: drop-shadow(0 0 18px rgba(255, 106, 0, 0.62));
  }
}

/* --- Challenge Settings-Overlay ------------------------------------------- */

.challenge-intro-screen > .challenge-settings-overlay,
.start-screen > .challenge-settings-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  box-sizing: border-box;
}

.challenge-intro-screen > .challenge-settings-overlay[hidden],
.start-screen > .challenge-settings-overlay[hidden] {
  display: none;
}

/* Hard guard: closed overlays must never block clicks */
.challenge-settings-overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.challenge-settings-overlay:not(.is-open) {
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
}

.challenge-settings-overlay.is-open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.challenge-settings-overlay {
  transition: opacity 220ms ease, visibility 220ms ease;
}

.challenge-settings-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 18, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 220ms ease;
}

.challenge-settings-overlay.is-open .challenge-settings-overlay__backdrop {
  opacity: 1;
}

.challenge-settings-modal {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 18px 18px;
  border-color: rgba(255, 106, 0, 0.78);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.45),
    0 0 22px rgba(255, 106, 0, 0.36),
    0 0 36px rgba(168, 72, 255, 0.22);
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  transition: opacity 240ms ease, transform 240ms ease;
}

.challenge-settings-overlay.is-open .challenge-settings-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .challenge-settings-overlay,
  .challenge-settings-overlay__backdrop,
  .challenge-settings-modal {
    transition: none !important;
  }

  .challenge-settings-overlay:not(.is-open) .challenge-settings-modal,
  .challenge-settings-overlay.is-open .challenge-settings-modal {
    transform: none;
  }
}

.challenge-settings-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-light);
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.challenge-settings-modal__title {
  margin: 0;
  color: var(--color-text-light);
  font-size: 1.2rem;
  line-height: 1.25;
}

.challenge-settings-modal__text {
  margin: 0;
  color: rgba(248, 249, 250, 0.86);
  font-size: 0.9rem;
  line-height: 1.45;
}

.challenge-settings-modal__hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  padding: 4px 44px 0;
}

.challenge-settings-modal__hero .challenge-settings-modal__text {
  max-width: 36ch;
}

.challenge-settings-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 106, 0, 0.28);
}

.challenge-settings-group__title {
  margin: 0;
  color: rgba(248, 249, 250, 0.78);
  font-size: 0.78rem;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.challenge-settings-link {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 106, 0, 0.4);
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text-light);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  box-shadow:
    0 0 12px rgba(255, 106, 0, 0.14),
    0 0 20px rgba(138, 63, 252, 0.08);
}

.challenge-settings-link:active,
.challenge-settings-modal__close:active {
  transform: translateY(1px);
}

.challenge-settings-link:focus-visible,
.challenge-settings-modal__close:focus-visible {
  outline: 2px solid rgba(255, 106, 0, 0.72);
  outline-offset: 2px;
}

/* --- Responsive tweaks ---------------------------------------------------- */

@media (max-height: 760px) {
  .challenge-intro-screen {
    --challenge-logo-size: clamp(88px, 16dvh, 128px);
    --challenge-section-gap: 8px;
  }

  .challenge-main-stack {
    justify-content: flex-start;
    gap: clamp(8px, 1.2dvh, 14px);
  }

  .challenge-hero__title {
    font-size: clamp(1.15rem, 4.8vw, 1.4rem);
  }

  .challenge-hero__sub {
    font-size: 0.8rem;
  }

  .challenge-game-card__title {
    font-size: 0.72rem;
  }

  .challenge-game-card__sub {
    font-size: 0.6rem;
  }

  .challenge-info-card {
    margin-block: auto;
    padding-block: 10px;
    padding-inline: 12px;
  }

  .challenge-game-card__meta {
    padding-block: 8px;
    padding-inline: 6px;
  }

  .challenge-info-list {
    gap: 5px;
  }

  .challenge-info-list__item {
    font-size: 0.78rem;
  }

  .challenge-bottom-nav {
    padding: 6px 10px;
    margin: 6px 0 0;
  }

  .challenge-bottom-nav__button {
    min-height: 46px;
    padding: 5px 3px;
  }

  .challenge-bottom-nav__icon {
    font-size: 1rem;
  }

  .challenge-bottom-nav__label {
    font-size: 0.58rem;
  }

  .challenge-footer {
    padding: 4px 0 0;
  }

  .challenge-footer p {
    font-size: 0.64rem;
  }
}

@media (max-height: 700px) {
  .start-screen {
    gap: clamp(var(--space-2), 1.8dvh, var(--space-4));
    padding-bottom: var(--space-4);
  }

  .start-content {
    justify-content: space-between;
    gap: clamp(var(--space-3), 1.6dvh, var(--space-4));
  }

  .challenge-intro-screen {
    --challenge-logo-size: clamp(72px, 13.5dvh, 108px);
    --challenge-section-gap: 6px;
    --challenge-pad-top: 6px;
  }

  .challenge-hero::after {
    height: 150px;
  }

  .challenge-main-stack {
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .challenge-info-card {
    margin-block: 0;
    padding-block: 8px;
  }

  .challenge-bottom-nav {
    margin-top: 4px;
    padding: 5px 8px;
  }

  .challenge-bottom-nav__button {
    min-height: 44px;
  }

  .challenge-footer {
    flex-shrink: 0;
  }
}

@media (max-height: 680px) {
  .challenge-intro-screen {
    --challenge-logo-size: clamp(68px, 13dvh, 104px);
    --challenge-section-gap: 6px;
  }

  .challenge-main-stack {
    gap: clamp(8px, 1.2dvh, 14px);
  }

  .challenge-hero__sub {
    line-height: 1.18;
  }

  .challenge-footer p {
    font-size: 0.68rem;
    line-height: 1.15;
  }

  .challenge-game-grid {
    gap: 6px;
  }

  .challenge-game-card__meta {
    padding: 5px 5px 6px;
  }

  .challenge-bottom-nav {
    margin: 4px 0 0;
    padding: 5px 8px;
    border-radius: 14px;
  }

  .challenge-bottom-nav__button {
    min-height: 42px;
  }
}

@container (max-width: 390px) {
  .challenge-game-card__title {
    font-size: 0.7rem;
  }

  .challenge-game-card__sub {
    font-size: 0.58rem;
  }

  .challenge-game-card__badge {
    font-size: 0.56rem;
    padding: 2px 5px;
  }
}

/* ==========================================================================
   Challenge Result + Leaderboard
   ========================================================================== */

.challenge-result-screen,
.challenge-leaderboard-screen {
  height: 100%;
  min-height: 0;
  padding:
    max(14px, env(safe-area-inset-top, 0px))
    max(var(--flow-screen-pad-x), env(safe-area-inset-right, 0px))
    12px
    max(var(--flow-screen-pad-x), env(safe-area-inset-left, 0px));
  gap: clamp(10px, 1.8dvh, 16px);
  overflow: hidden;
}

.challenge-leaderboard-screen {
  display: flex;
  flex-direction: column;
}

.challenge-result-hero,
.challenge-leaderboard-hero {
  flex: 0 0 auto;
  text-align: center;
  align-items: center;
  gap: clamp(4px, 0.8dvh, 8px);
}

.challenge-result-hero p,
.challenge-leaderboard-hero p {
  max-width: 36ch;
  line-height: 1.3;
  font-size: 0.86rem;
}

.challenge-result-content,
.challenge-leaderboard-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 390px;
  margin-inline: auto;
  overflow: hidden;
}

.challenge-leaderboard-content {
  display: flex;
  flex-direction: column;
}

.challenge-leaderboard-content > .challenge-leaderboard-mode-toggle,
.challenge-leaderboard-content > .challenge-leaderboard-view-toggle,
.challenge-leaderboard-content > .screen-actions {
  flex-shrink: 0;
}


.challenge-result-content {
  justify-content: flex-start;
  gap: clamp(10px, 1.6dvh, 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
  padding-bottom: var(--space-2);
}

.challenge-result-content > .screen-actions {
  padding-bottom: 0;
}

.challenge-result-content > .challenge-result-card,
.challenge-result-content > .challenge-score-summary,
.challenge-result-content > .challenge-token-note,
.challenge-result-content > .challenge-submit-status,
.challenge-result-content > .challenge-submit-error,
.challenge-result-content > .screen-actions {
  flex-shrink: 0;
}

.challenge-result-card,
.challenge-leaderboard-card,
.challenge-pot-card {
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  border: 1px solid rgba(255, 106, 0, 0.34);
  box-shadow:
    0 10px 26px rgba(6, 8, 20, 0.34),
    0 0 16px rgba(255, 106, 0, 0.14),
    0 0 26px rgba(138, 63, 252, 0.1);
}

.challenge-pot-card {
  padding: 0.65rem;
}

.challenge-score-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.challenge-score-summary div {
  min-width: 0;
  padding: 10px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.challenge-pot-item {
  min-width: 0;
  min-height: 52px;
  padding: 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  text-align: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.challenge-score-summary span,
.challenge-game-result-item span,
.challenge-leaderboard-meta span {
  display: block;
  color: rgba(248, 249, 250, 0.66);
  font-size: 0.72rem;
  line-height: 1.25;
}

.challenge-score-summary strong {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.challenge-pot-item strong {
  display: block;
  margin-top: 0;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.challenge-pot-item span {
  display: block;
  color: rgba(248, 249, 250, 0.66);
  font-size: 0.72rem;
  line-height: 1.15;
}

.challenge-score-summary__value {
  font-size: 1.35rem !important;
  text-shadow:
    0 0 12px rgba(255, 106, 0, 0.48),
    0 0 20px rgba(138, 63, 252, 0.26);
}

.challenge-game-result-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.challenge-game-result-item,
.challenge-leaderboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.challenge-game-result-item strong,
.challenge-leaderboard-meta strong {
  color: #fff;
}

.challenge-game-result-item > div:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.challenge-token-note {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.challenge-token-note strong {
  color: #fff;
}

.challenge-token-note p,
.simulation-note {
  font-size: 0.76rem;
  line-height: 1.35;
  color: rgba(248, 249, 250, 0.7);
}

.challenge-submit-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 77, 79, 0.14);
  border: 1px solid rgba(255, 77, 79, 0.38);
  color: rgba(255, 215, 216, 0.96);
  font-size: 0.82rem;
  line-height: 1.35;
}

.challenge-day-label {
  color: rgba(255, 205, 72, 0.88) !important;
  font-weight: 700;
}

.challenge-leaderboard-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.35rem;
}

.challenge-leaderboard-stack {
  min-height: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow: visible;
}

.challenge-pot-card,
.challenge-outside-top100 {
  flex: 0 0 auto;
}

.challenge-leaderboard-state {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  text-align: center;
}

.challenge-leaderboard-state__title {
  font-weight: 800;
  color: #fff;
}

.challenge-leaderboard-state--error {
  color: rgba(255, 215, 216, 0.96);
}

.challenge-leaderboard-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  color: rgba(248, 249, 250, 0.68);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.challenge-leaderboard-section-head strong {
  color: #fff;
  letter-spacing: normal;
  text-transform: none;
}

.challenge-pot-card .challenge-leaderboard-section-head {
  margin-bottom: 0.5rem;
}

.challenge-pot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.challenge-leaderboard-mode-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.challenge-leaderboard-view-toggle {
  margin-bottom: 0.45rem;
}

.challenge-leaderboard-view-toggle .challenge-leaderboard-mode-btn {
  min-height: 36px;
  padding: 0.4rem 0.65rem;
  font-size: 0.74rem;
}

.challenge-leaderboard-mode-btn {
  flex: 1 1 auto;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(248, 249, 250, 0.88);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.challenge-leaderboard-mode-btn--active {
  border-color: rgba(255, 106, 0, 0.72);
  background: rgba(255, 106, 0, 0.18);
  color: #fff;
}

.challenge-demo-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 106, 0, 0.5);
  background: rgba(255, 106, 0, 0.14);
  color: rgba(255, 235, 220, 0.95);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.challenge-simulation-note-card {
  flex: 0 0 auto;
  padding: 0.75rem 1rem;
  border-color: rgba(255, 106, 0, 0.4);
}

.challenge-simulation-note-card--compact {
  padding: 0.35rem 0.65rem;
}

.challenge-simulation-note-card p {
  font-size: 0.82rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.82);
}

.challenge-simulation-note-card--compact p {
  font-size: 0.72rem;
  line-height: 1.25;
}

.challenge-leaderboard-list {
  flex: 0 0 auto;
  min-height: auto;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.challenge-leaderboard-table {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 0.25rem 0.5rem 0;
  list-style: none;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.challenge-feedback-status {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 106, 0, 0.24);
  color: rgba(248, 249, 250, 0.82);
  font-size: 0.8rem;
  line-height: 1.3;
  text-align: center;
}

.challenge-leaderboard-row {
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-height: 54px;
}

.challenge-leaderboard-row--score-only {
  grid-template-columns: 34px minmax(0, 1fr) minmax(72px, auto);
  align-items: center;
}

.challenge-leaderboard-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(248, 249, 250, 0.92);
  font-size: 0.95rem;
  font-weight: 500;
}

.challenge-leaderboard-score-value {
  justify-self: end;
  color: #fff;
  font-size: 0.98rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.challenge-leaderboard-row--current {
  border-color: rgba(255, 106, 0, 0.9);
  box-shadow:
    0 0 0 1px rgba(255, 106, 0, 0.22),
    0 0 18px rgba(255, 106, 0, 0.28),
    0 0 28px rgba(138, 63, 252, 0.18);
  animation: challenge-leaderboard-current-pulse 2.4s ease-in-out infinite;
}

@keyframes challenge-leaderboard-current-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(255, 106, 0, 0.22),
      0 0 16px rgba(255, 106, 0, 0.24),
      0 0 24px rgba(138, 63, 252, 0.14);
  }

  50% {
    box-shadow:
      0 0 0 1px rgba(255, 106, 0, 0.34),
      0 0 22px rgba(255, 106, 0, 0.36),
      0 0 32px rgba(138, 63, 252, 0.22);
  }
}

.challenge-you-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 106, 0, 0.72);
  background: rgba(255, 106, 0, 0.22);
  color: rgba(255, 235, 220, 0.98);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.challenge-outside-top100 {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.challenge-outside-top100__label {
  margin: 0 0 0.35rem;
  color: rgba(248, 249, 250, 0.62);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.challenge-leaderboard-rank {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 106, 0, 0.18);
  border: 1px solid rgba(255, 106, 0, 0.42);
  color: #fff;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.challenge-leaderboard-meta {
  min-width: 0;
}

.challenge-leaderboard-meta strong,
.challenge-leaderboard-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.challenge-prize-pill {
  justify-self: end;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(53, 196, 117, 0.14);
  border: 1px solid rgba(53, 196, 117, 0.34);
  color: rgba(225, 255, 239, 0.96);
  font-size: 0.76rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.simulation-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

@media (max-height: 760px) {
  .challenge-result-screen,
  .challenge-leaderboard-screen {
    padding: 10px 14px;
    gap: 8px;
  }

  .challenge-result-content {
    justify-content: flex-start;
    gap: clamp(8px, 1.3dvh, 12px);
  }

  .challenge-result-card,
  .challenge-leaderboard-card,
  .challenge-pot-card {
    padding: 10px;
  }

  .challenge-result-hero p,
  .challenge-leaderboard-hero p {
    font-size: 0.8rem;
  }

  .challenge-pot-grid {
    gap: 0.5rem;
  }
}

@media (max-height: 640px) {
  .challenge-result-hero .eyebrow,
  .challenge-leaderboard-hero .eyebrow {
    display: none;
  }

  .challenge-score-summary {
    gap: 6px;
  }

  .challenge-score-summary div {
    padding: 8px 6px;
  }

  .challenge-pot-item {
    padding: 0.5rem 0.6rem;
    min-height: 52px;
  }

  .challenge-game-result-item,
  .challenge-leaderboard-row {
    min-height: 44px;
    padding: 8px;
  }

  .challenge-leaderboard-row--score-only {
    min-height: 44px;
    padding: 8px;
    gap: 8px;
  }

  .challenge-leaderboard-name {
    font-size: 0.9rem;
  }

  .challenge-leaderboard-score-value {
    font-size: 0.92rem;
  }

  .challenge-prize-pill {
    padding-inline: 7px;
    font-size: 0.72rem;
  }
}

/* Daily History (Sprint 4 PR 2) */
.challenge-daily-history-screen {
  height: 100%;
  min-height: 0;
  padding: 14px 16px 12px;
  gap: clamp(10px, 1.8dvh, 16px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.challenge-daily-history-hero {
  flex: 0 0 auto;
  text-align: center;
  align-items: center;
  gap: clamp(4px, 0.8dvh, 8px);
}

.challenge-daily-history-hero p {
  max-width: 38ch;
  line-height: 1.3;
  font-size: 0.86rem;
}

.challenge-daily-history-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 390px;
  margin-inline: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.challenge-daily-history-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  border: 1px solid rgba(255, 106, 0, 0.34);
  box-shadow:
    0 10px 26px rgba(6, 8, 20, 0.34),
    0 0 16px rgba(255, 106, 0, 0.14),
    0 0 26px rgba(138, 63, 252, 0.1);
}

.challenge-daily-history-stack {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
}

.challenge-daily-history-list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0 0.25rem 0 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.challenge-daily-history-row {
  padding: 10px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.challenge-daily-history-meta {
  min-width: 0;
  margin-bottom: 8px;
}

.challenge-daily-history-meta strong {
  display: block;
  color: #fff;
  font-size: 0.92rem;
}

.challenge-daily-history-meta span {
  display: block;
  margin-top: 2px;
  color: rgba(248, 249, 250, 0.66);
  font-size: 0.76rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.challenge-daily-history-stats {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.challenge-daily-history-stats div {
  min-width: 0;
  padding: 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.challenge-daily-history-stats dt {
  margin: 0;
  color: rgba(248, 249, 250, 0.66);
  font-size: 0.68rem;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.challenge-daily-history-stats dd {
  margin: 3px 0 0;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.challenge-daily-history-stats div:last-child {
  grid-column: 1 / -1;
  border-color: rgba(53, 196, 117, 0.34);
  background: rgba(53, 196, 117, 0.08);
}

.challenge-daily-history-note {
  flex: 0 0 auto;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 106, 0, 0.34);
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
}

@media (max-height: 760px) {
  .challenge-daily-history-screen {
    padding: 10px 14px;
    gap: 8px;
  }

  .challenge-daily-history-card {
    padding: 10px;
  }

  .challenge-daily-history-hero p {
    font-size: 0.8rem;
  }
}

@media (max-height: 640px) {
  .challenge-daily-history-row {
    padding: 8px;
  }

  .challenge-daily-history-stats div {
    padding: 6px;
  }
}

/* ---------------------------------------------------------- */
/* GridFill – archiviert                                      */
/* Früherer Warm-up-Spiel-1-Ansatz, ersetzt durch PulseBoard. */
/* Klassen werden aktuell nicht aktiv genutzt.                */
/* ---------------------------------------------------------- */

.gridfill-screen {
  --gridfill-pad-x: 14px;
  --gridfill-pad-y: 10px;
  --gridfill-gap: 10px;
  justify-content: flex-start;
  gap: var(--gridfill-gap);
  padding: var(--gridfill-pad-y) var(--gridfill-pad-x);
  overflow: hidden;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
  /* iOS-Schutz: keine Textauswahl, kein "Kopieren / Mit Google suchen"-Menü
     bei langem Drücken auf HUD-, Header- oder Deko-Elemente.
     Buttons und Canvas bleiben trotzdem voll bedienbar. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.gridfill-hero {
  flex: 0 0 auto;
  text-align: center;
  align-items: center;
  gap: 2px;
  position: relative;
}

.gridfill-hero h1 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.15;
}

.gridfill-brand-mark {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
  margin: 0 auto 2px;
  filter:
    drop-shadow(0 0 6px rgba(255, 106, 0, 0.45))
    drop-shadow(0 0 10px rgba(138, 63, 252, 0.35));
  opacity: 0.92;
}

.gridfill-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  gap: var(--gridfill-gap);
  display: flex;
  flex-direction: column;
}

.gridfill-hud {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 106, 0, 0.28);
  box-shadow: 0 0 14px rgba(255, 106, 0, 0.1), 0 0 22px rgba(138, 63, 252, 0.1);
}

.gridfill-hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
}

.gridfill-hud-label {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 249, 250, 0.6);
}

.gridfill-hud-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-light);
  line-height: 1;
}

.gridfill-play {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  /* Gesten im Spielbereich gehören dem Canvas, nichts an den Browser abgeben. */
  touch-action: none;
  -ms-touch-action: none;
}

.gridfill-board {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  /* Swipes auf dem Board dürfen NICHT die Seite scrollen oder zoomen. */
  touch-action: none;
  -ms-touch-action: none;
}

.gridfill-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 14px;
  background: #090d22;
  box-shadow:
    0 0 0 1px rgba(255, 106, 0, 0.32),
    0 0 22px rgba(255, 106, 0, 0.16),
    0 0 34px rgba(138, 63, 252, 0.18);
  /* Zentral für Touch-Gesten: nichts an den Browser abgeben. */
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  cursor: pointer;
}

.gridfill-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
  z-index: 2;
}

.gridfill-overlay--visible {
  opacity: 1;
}

.gridfill-overlay-text {
  font-size: clamp(2.6rem, 12vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text-light);
  text-shadow:
    0 0 18px rgba(255, 106, 0, 0.55),
    0 0 28px rgba(138, 63, 252, 0.45);
}

.gridfill-footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
}

.gridfill-footer-status {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(53, 196, 117, 0.92);
}

.gridfill-footer-cta {
  min-height: 44px;
  width: 100%;
  /* Kein 300ms-Tap-Delay auf iOS, aber double-tap-zoom auf Buttons verhindert. */
  touch-action: manipulation;
}

/* Phasen-gesteuerte Feinheiten */
.gridfill-screen[data-phase="gameover"] .gridfill-hud {
  opacity: 0.75;
}

.gridfill-screen[data-phase="idle"] .gridfill-board {
  filter: saturate(0.7);
}

.gridfill-screen[data-phase="gameover"] .gridfill-footer {
  border-color: rgba(53, 196, 117, 0.45);
  box-shadow:
    0 12px 28px rgba(6, 8, 20, 0.4),
    0 0 16px rgba(53, 196, 117, 0.2),
    0 0 26px rgba(138, 63, 252, 0.12);
}

@container (max-width: 430px) {
  .gridfill-screen {
    --gridfill-pad-x: 12px;
    --gridfill-pad-y: 8px;
    --gridfill-gap: 8px;
  }

  .gridfill-hero h1 {
    font-size: 1.18rem;
  }

  .gridfill-brand-mark {
    width: 34px;
    height: 34px;
  }

  .gridfill-hud-value {
    font-size: 0.94rem;
  }
}

@media (max-height: 760px) {
  .gridfill-screen {
    --gridfill-gap: 6px;
  }

  .gridfill-hero h1 {
    font-size: 1.12rem;
  }

  .gridfill-brand-mark {
    width: 30px;
    height: 30px;
    margin-bottom: 0;
  }

  .gridfill-hud {
    padding: 4px 6px;
  }

  .gridfill-hud-value {
    font-size: 0.9rem;
  }

  .gridfill-footer {
    padding: 8px 10px;
  }
}

@media (max-height: 640px) {
  .gridfill-hero .eyebrow {
    display: none;
  }

  .gridfill-brand-mark {
    display: none;
  }

  .gridfill-hud-label {
    font-size: 0.58rem;
  }

  .gridfill-hud-value {
    font-size: 0.86rem;
  }

  .gridfill-footer-status {
    font-size: 0.72rem;
  }
}

/* ---------------------------------------------------------- */
/* PulseBoard – Warm-up Spiel 1                                */
/* TNW Block-Puzzle, Hand-System, 8x8, kein Fallspiel.         */
/* ---------------------------------------------------------- */

.pulseboard-close-button {
  position: absolute;
  /* Screen-Padding ausgleichen, damit der Button in der äußeren Ecke sitzt. */
  top: calc(max(6px, env(safe-area-inset-top, 0px)) - var(--pb-pad-y, 10px));
  right: calc(max(6px, env(safe-area-inset-right, 0px)) - var(--pb-pad-x, 14px));
  z-index: 8;
  width: 30px;
  height: 30px;
  margin: 10px 15px;
  padding: 0;
  border: 1px solid rgba(255, 106, 0, 0.5);
  border-radius: 12px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)),
    rgba(15, 18, 36, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(138, 63, 252, 0.18),
    0 6px 18px rgba(6, 8, 20, 0.36),
    0 0 14px rgba(255, 106, 0, 0.22);
  color: var(--color-text-light);
  font-size: 1.28rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 120ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.pulseboard-close-button:active {
  transform: translateY(1px);
}

.pulseboard-close-button:focus-visible {
  outline: 2px solid rgba(255, 106, 0, 0.72);
  outline-offset: 2px;
}

.pulseboard-screen {
  --pb-pad-x: 14px;
  --pb-pad-y: 10px;
  --pb-gap: 10px;
  --pb-hand-height: 96px;
  position: relative;
  justify-content: flex-start;
  gap: var(--pb-gap);
  padding: var(--pb-pad-y) var(--pb-pad-x);
  overflow: hidden;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
  /* iOS-Schutz: keine Textauswahl, kein Kontextmenü, kein Browser-Callout. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -ms-touch-action: manipulation;
}

.pulseboard-hero {
  flex: 0 0 auto;
  text-align: center;
  align-items: center;
  gap: 2px;
  position: relative;
}

.pulseboard-hero h1 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.15;
}

.pulseboard-brand-mark {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
  margin: 0 auto 2px;
  filter:
    drop-shadow(0 0 6px rgba(255, 106, 0, 0.45))
    drop-shadow(0 0 10px rgba(138, 63, 252, 0.35));
  opacity: 0.92;
}

.pulseboard-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  gap: var(--pb-gap);
  display: flex;
  flex-direction: column;
}

.pulseboard-hud {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 106, 0, 0.28);
  box-shadow: 0 0 14px rgba(255, 106, 0, 0.1), 0 0 22px rgba(138, 63, 252, 0.1);
}

.pulseboard-hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
}

.pulseboard-hud-label {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 249, 250, 0.6);
}

.pulseboard-hud-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-light);
  line-height: 1;
}

/* Restzeit-Warnung: ab 10 s pulsiert der Restzeit-Wert rot.
   Reine UI-Anzeige, beeinflusst keine Engine-Logik. */
.pulseboard-hud-value--low-time {
  color: #ff4d4f;
  text-shadow: 0 0 6px rgba(255, 77, 79, 0.55);
  animation: pulseboard-low-time 0.9s ease-in-out infinite;
}

@keyframes pulseboard-low-time {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulseboard-hud-value--low-time {
    animation: none;
  }
}

.pulseboard-play {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  /* Layout-Schutz: Kinder (Canvas) dürfen Play-Höhe NIE ausdehnen. */
  overflow: hidden;
  touch-action: none;
  -ms-touch-action: none;
}

.pulseboard-board {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  /* Layout-Schutz: Falls Canvas-Attribut intrinsische Höhe ausstrahlt,
     lassen wir es lieber abschneiden statt das Layout wachsen zu lassen. */
  overflow: hidden;
  touch-action: none;
  -ms-touch-action: none;
  /* kurzes "Atmen" bei Clears (Pulse) – rein kosmetisch, transform beeinflusst kein Layout. */
  transition: transform 180ms ease;
  transform: scale(1);
  will-change: transform;
}

.pulseboard-board--breathe {
  transform: scale(1.012);
}

.pulseboard-board--breathe-strong {
  transform: scale(1.02);
}

.pulseboard-canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 18px;
  background: #090d22;
  box-shadow:
    0 0 0 1px rgba(255, 106, 0, 0.32),
    0 0 22px rgba(255, 106, 0, 0.16),
    0 0 34px rgba(138, 63, 252, 0.18);
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* P1-8B1: Clarity underlay — DOM board cells under opaque static canvas (player-invisible). */
.pulseboard-clarity-underlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  border-radius: 18px;
}

.pulseboard-clarity-underlay__cell {
  position: absolute;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: none;
  border: none;
  pointer-events: none;
}

.pulseboard-clarity-hand-underlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.pulseboard-hand-slot > .pulseboard-hand-canvas {
  position: relative;
  z-index: 1;
}

/* P1.1: Layer stack – static / board-state / dynamic canvases share one grid cell. */
.pulseboard-board > .pulseboard-canvas {
  grid-area: 1 / 1;
}

.pulseboard-canvas--static-layer {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
  box-shadow: none;
  border-radius: 18px;
  z-index: 0;
}

.pulseboard-canvas--board-state-layer {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  pointer-events: none;
  background: transparent;
  box-shadow: none;
  border-radius: 18px;
  z-index: 1;
}

.pulseboard-canvas--dynamic-layer {
  position: relative;
  z-index: 2;
  background: transparent;
}

.pulseboard-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
  z-index: 2;
}

.pulseboard-overlay--visible {
  opacity: 1;
}

.pulseboard-overlay-text {
  font-size: clamp(2.6rem, 12vw, 3.8rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text-light);
  text-shadow:
    0 0 18px rgba(255, 106, 0, 0.55),
    0 0 28px rgba(138, 63, 252, 0.45);
}

/* Hand-Tray: FIXE Höhe. Ohne feste Höhe können Flex-/Grid-Items (Canvas mit
   intrinsischer Attribut-Größe) den Tray wachsen lassen. Mit fester Höhe
   bleibt der Tray layoutstabil – egal was die Kinder machen. */
.pulseboard-hand {
  flex: 0 0 var(--pb-hand-height);
  height: var(--pb-hand-height);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: 1fr;
  gap: 8px;
  padding: 8px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 106, 0, 0.3);
  box-shadow:
    0 8px 22px rgba(6, 8, 20, 0.32),
    0 0 14px rgba(255, 106, 0, 0.12),
    0 0 22px rgba(138, 63, 252, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  /* Sicherheit: Inhalt (Canvas) darf den Tray niemals visuell über das Fixmaß aufblähen. */
  overflow: hidden;
}

/* Slot: fest in Grid-Row. Keine intrinsische Höhen-Ausdehnung. */
.pulseboard-hand-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: rgba(10, 15, 36, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: grab;
  overflow: hidden;
  /* Slot-Gesten gehören dem Drag, nichts an den Browser abgeben. */
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  /* Kein Transform-Transition – damit nichts Layout-relevantes animiert. */
  transition: box-shadow 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

.pulseboard-hand-slot:active {
  cursor: grabbing;
}

.pulseboard-hand-slot--empty {
  opacity: 0.35;
  cursor: default;
  border-style: dashed;
}

.pulseboard-hand-slot--dragging {
  border-color: rgba(255, 106, 0, 0.6);
  box-shadow:
    inset 0 0 18px rgba(255, 106, 0, 0.18),
    0 0 22px rgba(138, 63, 252, 0.22);
}

/* Canvas füllt den Slot komplett aus – CSS entscheidet über Anzeigegröße,
   damit das Attribut (canvas.width/height) nur als Pixel-Buffer wirkt.
   Kein Inline-style.width/height im JS mehr setzen. */
.pulseboard-hand-canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.pulseboard-screen:not([data-phase="gameover"]) .pulseboard-footer {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.pulseboard-footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
}

.pulseboard-trash-drop {
  align-self: center;
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(248, 249, 250, 0.88);
  opacity: 0;
  transform: scale(0.88);
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 200ms ease,
    border-color 180ms ease,
    box-shadow 200ms ease,
    background 180ms ease;
}

.pulseboard-trash-drop__icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
}

.pulseboard-trash-drop__icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.pulseboard-trash-drop.is-visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: none;
  border-color: rgba(255, 106, 0, 0.42);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
    rgba(15, 18, 36, 0.42);
  box-shadow:
    0 0 0 1px rgba(138, 63, 252, 0.16),
    0 8px 18px rgba(6, 8, 20, 0.34),
    0 0 14px rgba(255, 106, 0, 0.2);
  animation: pb-trash-idle-pulse 1.6s ease-in-out infinite;
}

.pulseboard-trash-drop.is-visible.is-armed {
  transform: scale(1.12);
  border-color: rgba(255, 106, 0, 0.72);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05)),
    rgba(20, 12, 28, 0.58);
  box-shadow:
    0 0 0 1px rgba(138, 63, 252, 0.28),
    0 10px 24px rgba(6, 8, 20, 0.42),
    0 0 22px rgba(255, 106, 0, 0.42),
    0 0 30px rgba(138, 63, 252, 0.22);
  animation: pb-trash-armed-pulse 0.85s ease-in-out infinite;
}

.pulseboard-trash-drop.is-visible.is-armed .pulseboard-trash-drop__icon {
  width: 32px;
  height: 32px;
}

@keyframes pb-trash-idle-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(138, 63, 252, 0.16),
      0 8px 18px rgba(6, 8, 20, 0.34),
      0 0 14px rgba(255, 106, 0, 0.2);
  }

  50% {
    box-shadow:
      0 0 0 1px rgba(138, 63, 252, 0.22),
      0 8px 20px rgba(6, 8, 20, 0.38),
      0 0 20px rgba(255, 106, 0, 0.3);
  }
}

@keyframes pb-trash-armed-pulse {
  0%,
  100% {
    transform: scale(1.1);
    box-shadow:
      0 0 0 1px rgba(138, 63, 252, 0.28),
      0 10px 24px rgba(6, 8, 20, 0.42),
      0 0 22px rgba(255, 106, 0, 0.42),
      0 0 30px rgba(138, 63, 252, 0.22);
  }

  50% {
    transform: scale(1.16);
    box-shadow:
      0 0 0 1px rgba(138, 63, 252, 0.36),
      0 12px 28px rgba(6, 8, 20, 0.48),
      0 0 28px rgba(255, 106, 0, 0.55),
      0 0 38px rgba(138, 63, 252, 0.32);
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulseboard-trash-drop.is-visible,
  .pulseboard-trash-drop.is-armed {
    animation: none;
  }
}

.pulseboard-footer-status {
  margin: 0;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(53, 196, 117, 0.92);
}

.pulseboard-footer-cta {
  min-height: 44px;
  width: 100%;
  /* Kein 300ms-Tap-Delay auf iOS, aber double-tap-zoom auf Buttons verhindert. */
  touch-action: manipulation;
}

/* Phasen-Feinheiten */
.pulseboard-screen[data-phase="gameover"] .pulseboard-hud {
  opacity: 0.75;
}

.pulseboard-screen[data-phase="idle"] .pulseboard-board {
  filter: saturate(0.7);
}

.pulseboard-screen[data-phase="gameover"] .pulseboard-footer {
  border-color: rgba(53, 196, 117, 0.45);
  box-shadow:
    0 12px 28px rgba(6, 8, 20, 0.4),
    0 0 16px rgba(53, 196, 117, 0.2),
    0 0 26px rgba(138, 63, 252, 0.12);
}

/* Challenge: trash-only dock — no status/back CTA, keep footer invisible on gameover */
.pulseboard-screen[data-phase="gameover"] .pulseboard-footer--trash-dock {
  padding: 0;
  gap: 0;
  border-color: transparent;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.pulseboard-screen[data-phase="gameover"] .pulseboard-footer--trash-dock .pulseboard-trash-drop {
  display: none;
}

/* Drag-Ghost liegt global über allem, komplett außerhalb des Spiel-Layouts.
   position:fixed + translate() -> KEIN Layout-Reflow beim Dragging.
   Kleiner und halbtransparent, damit Zielzellen unter dem Finger sichtbar bleiben.
   Ausgerichtet wird top/left: 0, die Position kommt über style.transform. */
.pulseboard-ghost {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.78;
  filter:
    drop-shadow(0 8px 14px rgba(0, 0, 0, 0.4))
    drop-shadow(0 0 10px rgba(255, 106, 0, 0.25))
    drop-shadow(0 0 16px rgba(138, 63, 252, 0.25));
  transform: translate3d(-9999px, -9999px, 0);
  transform-origin: top left;
  will-change: transform;
}

.pulseboard-ghost-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

@container (max-width: 430px) {
  .pulseboard-screen {
    --pb-pad-x: 12px;
    --pb-pad-y: 8px;
    --pb-gap: 8px;
    --pb-hand-height: 92px;
  }

  .pulseboard-hero h1 {
    font-size: 1.18rem;
  }

  .pulseboard-brand-mark {
    width: 34px;
    height: 34px;
  }

  .pulseboard-hud-value {
    font-size: 0.94rem;
  }
}

@media (max-height: 760px) {
  .pulseboard-screen {
    --pb-gap: 6px;
    --pb-hand-height: 86px;
  }

  .pulseboard-hero h1 {
    font-size: 1.12rem;
  }

  .pulseboard-brand-mark {
    width: 30px;
    height: 30px;
    margin-bottom: 0;
  }

  .pulseboard-hud {
    padding: 4px 6px;
  }

  .pulseboard-hud-value {
    font-size: 0.9rem;
  }

  .pulseboard-footer {
    padding: 8px 10px;
  }
}

@media (max-height: 640px) {
  .pulseboard-screen {
    --pb-hand-height: 78px;
  }

  .pulseboard-hero .eyebrow {
    display: none;
  }

  .pulseboard-brand-mark {
    display: none;
  }

  .pulseboard-hud-label {
    font-size: 0.58rem;
  }

  .pulseboard-hud-value {
    font-size: 0.86rem;
  }

  .pulseboard-footer-status {
    font-size: 0.72rem;
  }
}

/* ---------------------------------------------------------- */
/* Globale Regelkarte (Overlay über Spiel, kein Screen)         */
/* ---------------------------------------------------------- */

.has-rule-card-overlay > *:not(.rule-card-overlay) {
  pointer-events: none;
}

.rule-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1.8dvh, 12px);
  box-sizing: border-box;
  overflow: hidden;
  pointer-events: auto;
}

.rule-card-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 20, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.rule-card-overlay__panel {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 360px;
  max-height: 100%;
  overflow: visible;
}

.rule-card-overlay__card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-height: 100%;
  gap: clamp(6px, 1.2dvh, 12px);
  padding:
    clamp(10px, 1.8dvh, 14px)
    clamp(12px, 3.6vw, 16px)
    clamp(12px, 2dvh, 16px);
  text-align: center;
  overflow: hidden;
}

/* Hero: horizontal zur Kartenmitte (y-Achse / Symmetrieachse), auch bei width > 100 %. */
.rule-card-overlay__hero-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  overflow: visible;
}

/* Hero: freistehendes Rules-PNG, ohne Bildrahmen; nur Glow + dezente Pulse. */
.rule-card-overlay__hero {
  display: block;
  width: min(118%, 420px);
  max-width: none;
  height: auto;
  margin-inline: 0;
  max-height: clamp(150px, 28dvh, 230px);
  object-fit: contain;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transform-origin: center center;
  animation: rule-card-hero-pulse 2.5s ease-in-out infinite;
}

@keyframes rule-card-hero-pulse {
  0%, 100% {
    transform: scale(1);
    filter:
      drop-shadow(0 0 6px rgba(255, 106, 0, 0.42))
      drop-shadow(0 0 14px rgba(255, 106, 0, 0.22));
  }
  50% {
    transform: scale(1.035);
    filter:
      drop-shadow(0 0 10px rgba(255, 106, 0, 0.58))
      drop-shadow(0 0 22px rgba(255, 106, 0, 0.32));
  }
}

.rule-card-overlay__eyebrow {
  margin: 0;
}

.rule-card-overlay__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-light, #f8f9fa);
}

.rule-card-overlay__rules {
  margin: 0;
  padding: 0 0 0 1.1rem;
  text-align: left;
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(248, 249, 250, 0.88);
}

.rule-card-overlay__rule {
  margin-bottom: 0.35rem;
}

.rule-card-overlay__rule:last-child {
  margin-bottom: 0;
}

.rule-card-overlay__cta {
  width: 100%;
  margin-top: 2px;
  animation: rule-card-cta-pulse 1.35s ease-in-out infinite;
}

@keyframes rule-card-cta-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 106, 0, 0.5),
      0 0 18px rgba(255, 106, 0, 0.35);
    transform: scale(1);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 106, 0, 0.75),
      0 0 28px rgba(255, 106, 0, 0.5),
      0 0 36px rgba(138, 63, 252, 0.22);
    transform: scale(1.02);
  }
}

@media (max-height: 700px) {
  .rule-card-overlay {
    padding: 8px;
  }

  .rule-card-overlay__card {
    gap: 7px;
    padding: 10px 12px 12px;
  }

  .rule-card-overlay__hero {
    width: min(112%, 380px);
    max-height: clamp(126px, 24dvh, 170px);
  }

  .rule-card-overlay__title {
    font-size: 1.12rem;
    line-height: 1.14;
  }

  .rule-card-overlay__rules {
    font-size: 0.78rem;
    line-height: 1.32;
  }

  .rule-card-overlay__rule {
    margin-bottom: 0.24rem;
  }

  .rule-card-overlay__cta {
    min-height: 42px;
  }
}

@media (max-height: 640px) {
  .rule-card-overlay__hero {
    max-height: clamp(104px, 21dvh, 140px);
  }

  .rule-card-overlay__rules {
    font-size: 0.74rem;
    line-height: 1.26;
  }

  .rule-card-overlay__card {
    gap: 6px;
    padding: 8px 10px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rule-card-overlay__hero {
    animation: none;
    transform: none;
    filter:
      drop-shadow(0 0 8px rgba(255, 106, 0, 0.45))
      drop-shadow(0 0 16px rgba(255, 106, 0, 0.22));
  }

  .rule-card-overlay__cta {
    animation: none;
  }
}

/* ---------------------------------------------------------- */
/* Warm-up Endkarte (Overlay über Spiel, kein Screen)         */
/* ---------------------------------------------------------- */

.has-warmup-end-card-overlay > *:not(.warmup-end-card-overlay):not(.warmup-leaderboard-overlay) {
  pointer-events: none;
}

.warmup-end-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2dvh, 18px);
  box-sizing: border-box;
  overflow: hidden;
  pointer-events: auto;
}

.warmup-end-card-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 20, 0.56);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.warmup-end-card-overlay__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 380px);
  max-height: min(100%, calc(100dvh - 24px));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.warmup-end-card-overlay__card {
  width: 100%;
  max-height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(6px, 1dvh, 10px);
  padding: clamp(12px, 2dvh, 18px);
  text-align: center;
  overflow: hidden;
}

.warmup-end-card-overlay__hero-wrap {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  overflow: hidden;
}

.warmup-end-card-overlay__hero {
  display: block;
  width: min(58%, 180px);
  height: auto;
  max-height: clamp(110px, 26dvh, 210px);
  border: none;
  border-radius: 0;
  box-shadow: none;
  object-fit: contain;
  transform-origin: center center;
  animation: warmup-end-card-hero-pulse 2.4s ease-in-out infinite;
}

@keyframes warmup-end-card-hero-pulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    filter:
      drop-shadow(0 0 8px rgba(255, 106, 0, 0.52))
      drop-shadow(0 0 16px rgba(138, 63, 252, 0.26));
  }
  50% {
    transform: translateY(-1px) scale(1.04);
    filter:
      drop-shadow(0 0 12px rgba(255, 106, 0, 0.7))
      drop-shadow(0 0 24px rgba(138, 63, 252, 0.36));
  }
}

.warmup-end-card-overlay__eyebrow {
  margin: 0;
}

.warmup-end-card-overlay__title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.2;
  color: var(--color-text-light, #f8f9fa);
}

.warmup-end-card-overlay__score {
  margin: 0;
  font-size: clamp(2rem, 8vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow:
    0 0 12px rgba(255, 106, 0, 0.42),
    0 0 20px rgba(138, 63, 252, 0.24);
}

.warmup-end-card-overlay__score-label {
  margin: -4px 0 2px;
  font-size: 0.82rem;
  color: rgba(248, 249, 250, 0.76);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.warmup-end-card-overlay__breakdown {
  flex: 0 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: clamp(4px, 0.75dvh, 6px);
  overflow: hidden;
}

.warmup-end-card-overlay__breakdown-row {
  min-height: 32px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(248, 249, 250, 0.9);
  font-size: 0.82rem;
}

.warmup-end-card-overlay__breakdown-row strong {
  color: #fff;
  font-size: 0.84rem;
}

.warmup-end-card-overlay__actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.warmup-end-card-overlay__actions .btn {
  width: 100%;
  min-height: clamp(40px, 5.6dvh, 44px);
}

.warmup-end-card-overlay__placeholder {
  margin: 0;
  min-height: 1.05rem;
  font-size: 0.78rem;
  color: rgba(248, 249, 250, 0.74);
}

.challenge-end-card-overlay .warmup-end-card-overlay__card {
  border-color: rgba(255, 106, 0, 0.78);
}

.challenge-end-card-overlay .warmup-end-card-overlay__hero {
  width: min(46.4%, 144px);
}

.challenge-end-card-overlay__meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  width: 100%;
}

.challenge-end-card-overlay__meta-item {
  width: 100%;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.challenge-end-card-overlay__meta-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(248, 249, 250, 0.62);
}

.challenge-end-card-overlay__meta-value {
  display: block;
  margin-top: 2px;
  font-weight: 800;
  color: #fff;
}

.challenge-end-card-overlay__security-note {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.3;
  color: rgba(248, 249, 250, 0.68);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .warmup-end-card-overlay__hero,
  .warmup-leaderboard-hero,
  .warmup-leaderboard-row--gold,
  .warmup-leaderboard-row--current {
    animation: none;
    transform: none;
  }
}

@media (max-height: 760px) {
  .warmup-leaderboard-hero {
    width: min(44%, 126px);
    max-height: clamp(68px, 16dvh, 116px);
  }

  .warmup-end-card-overlay__card {
    gap: clamp(5px, 0.9dvh, 8px);
    padding: clamp(11px, 1.8dvh, 14px);
  }

  .warmup-end-card-overlay__hero {
    width: min(54%, 160px);
    max-height: clamp(90px, 22dvh, 150px);
  }

  .warmup-end-card-overlay__title {
    font-size: clamp(1rem, 2.5dvh, 1.14rem);
  }

  .warmup-end-card-overlay__score {
    font-size: clamp(1.8rem, 5dvh, 2.4rem);
    line-height: 1;
  }

  .warmup-end-card-overlay__score-label {
    margin-bottom: 0;
  }

  .warmup-end-card-overlay__breakdown-row {
    min-height: 30px;
    padding-block: 6px;
  }

  .warmup-end-card-overlay__actions .btn {
    min-height: 40px;
  }
}

@media (max-height: 640px) {
  .warmup-leaderboard-hero {
    width: min(38%, 104px);
    max-height: clamp(54px, 13dvh, 92px);
  }

  .warmup-leaderboard-overlay__card {
    gap: 7px;
    padding: 10px;
  }

  .warmup-leaderboard-overlay__header p {
    font-size: 0.78rem;
  }

  .warmup-leaderboard-overlay .warmup-leaderboard-state {
    min-height: 130px;
  }

  .warmup-leaderboard-overlay .warmup-leaderboard-row {
    min-height: 36px;
    padding-block: 6px;
  }

  .warmup-end-card-overlay {
    padding: clamp(8px, 1.6dvh, 12px);
  }

  .warmup-end-card-overlay__card {
    gap: 5px;
    padding: 10px;
  }

  .warmup-end-card-overlay__hero {
    width: min(48%, 136px);
    max-height: clamp(72px, 18dvh, 120px);
  }

  .warmup-end-card-overlay__eyebrow,
  .warmup-end-card-overlay__score-label {
    font-size: 0.68rem;
  }

  .warmup-end-card-overlay__title {
    font-size: 1rem;
  }

  .warmup-end-card-overlay__score {
    font-size: 1.8rem;
  }

  .warmup-end-card-overlay__breakdown-row {
    min-height: 28px;
    padding-block: 5px;
    font-size: 0.78rem;
  }

  .warmup-end-card-overlay__breakdown-row strong {
    font-size: 0.8rem;
  }

  .warmup-end-card-overlay__actions {
    gap: 6px;
  }

  .warmup-end-card-overlay__actions .btn {
    min-height: 38px;
  }
}

/* ==========================================================================
   Sand Sword – Warm-up 2
   Orientiert sich eng an PulseBoard-Patterns, aber ohne Hand-Tray.
   ========================================================================== */

.sandsword-screen {
  --ss-gap: 10px;
  /* Seitliche Gaps wie die anderen Brand-Screens (mobile-first). */
  padding: 12px 16px 12px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.sandsword-screen * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* --- Hero ----------------------------------------------------------------- */

.sandsword-hero {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-1);
}

.sandsword-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  width: 100%;
}

/* V1.2.2: Das frueher hier wohnende ".sandsword-level-badge" wurde
   entfernt. Feldinformation laeuft jetzt nur noch ueber den HUD-Slot
   "Feld" und das interne Transition-Overlay. */

.sandsword-subline {
  margin: 0;
  font-size: 0.78rem;
  color: rgba(248, 249, 250, 0.65);
  line-height: 1.4;
}

/* --- Content-Spalte ------------------------------------------------------- */

.sandsword-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 440px;
  margin-inline: auto;
  gap: var(--ss-gap);
  display: flex;
  flex-direction: column;
}

/* --- HUD ------------------------------------------------------------------ */

.sandsword-hud {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(224, 185, 122, 0.3);
  box-shadow:
    0 0 14px rgba(224, 185, 122, 0.1),
    0 0 22px rgba(138, 63, 252, 0.08);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sandsword-hud--quad {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sandsword-hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
}

.sandsword-hud-label {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 249, 250, 0.6);
}

.sandsword-hud-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-light);
  line-height: 1;
}

.sandsword-hud-value--low-time {
  color: #ff4d4f;
  text-shadow: 0 0 6px rgba(255, 77, 79, 0.55);
  animation: sandsword-low-time 0.9s ease-in-out infinite;
}

@keyframes sandsword-low-time {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sandsword-hud-value--low-time {
    animation: none;
  }
}

/* --- Play-Bereich --------------------------------------------------------- */

.sandsword-play {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  overflow: hidden;
  touch-action: none;
  -ms-touch-action: none;
}

.sandsword-board {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(224, 185, 122, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 14px rgba(224, 185, 122, 0.1),
    0 0 22px rgba(138, 63, 252, 0.08);
  isolation: isolate;
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.sandsword-board::before {
  content: none;
}

.sandsword-board::after {
  content: none;
}

/* P1-8B2: Clarity underlay — DOM fill bands under transparent canvas (player-invisible). */
.sandsword-clarity-underlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: 18px;
}

.sandsword-clarity-underlay__bottle {
  position: absolute;
  pointer-events: none;
  overflow: hidden;
}

.sandsword-clarity-underlay__band {
  position: absolute;
  pointer-events: none;
}

.sandsword-canvas {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 18px;
  background: transparent;
  box-shadow:
    0 0 0 1px rgba(224, 185, 122, 0.28),
    0 0 22px rgba(255, 106, 0, 0.12),
    0 0 34px rgba(138, 63, 252, 0.16);
  filter: none;
  touch-action: none;
  -ms-touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.sandsword-hud *,
.sandsword-hero,
.sandsword-hero * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sandsword-board * {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

/* --- Overlay (Illegal-Move-Feedback etc.) --------------------------------- */

.sandsword-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms ease;
  z-index: 2;
}

.sandsword-overlay--visible {
  opacity: 1;
}

.sandsword-overlay-text {
  font-size: clamp(2.4rem, 11vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-text-light);
  text-align: center;
  padding: 6px 18px;
  border-radius: 14px;
  text-shadow:
    0 0 18px rgba(255, 106, 0, 0.55),
    0 0 28px rgba(138, 63, 252, 0.45);
}

/* Countdown-Phase: Touch-Eingaben am Canvas blockieren, damit waehrend "3-2-1-Los"
   keine Selektion oder Pour ausgeloest werden kann. Touch-Events sind danach
   in "playing" wieder normal aktiv. */
.sandsword-screen[data-phase="countdown"] .sandsword-canvas,
.sandsword-screen[data-phase="transition"] .sandsword-canvas {
  pointer-events: none;
}

/* Kurzer Levelwechsel-Pop: Overlay-Text und Glas-Glow leicht heller. */
.sandsword-screen[data-phase="transition"] .sandsword-overlay-text {
  text-shadow:
    0 0 22px rgba(255, 200, 60, 0.65),
    0 0 32px rgba(255, 106, 0, 0.5);
  animation: sandsword-level-pop 540ms ease-out;
}

@keyframes sandsword-level-pop {
  0% {
    opacity: 0;
    transform: scale(0.85);
  }
  35% {
    opacity: 1;
    transform: scale(1.06);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sandsword-screen[data-phase="transition"] .sandsword-overlay-text {
    animation: none;
  }
}

/* --- Footer --------------------------------------------------------------- */

.sandsword-footer {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
}

.sandsword-footer-status {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.4;
  color: rgba(248, 249, 250, 0.88);
}

.sandsword-footer-status strong {
  color: #ff6a00;
}

.sandsword-footer-cta {
  min-height: 44px;
  width: 100%;
  touch-action: manipulation;
}

/* --- Phasen-Feinheiten ---------------------------------------------------- */

.sandsword-screen[data-phase="gameover"] .sandsword-hud {
  opacity: 0.75;
}

.sandsword-screen[data-phase="gameover"] .sandsword-footer {
  border-color: rgba(53, 196, 117, 0.4);
  box-shadow:
    0 12px 28px rgba(6, 8, 20, 0.4),
    0 0 16px rgba(53, 196, 117, 0.18),
    0 0 22px rgba(255, 106, 0, 0.1);
}

/* Bei "solved" ist der Solved-Glow im Canvas. Footer bekommt Gold-Tint. */
.sandsword-screen[data-phase="gameover"][data-gameover-reason="solved"] .sandsword-footer {
  border-color: rgba(255, 200, 60, 0.5);
  box-shadow:
    0 12px 28px rgba(6, 8, 20, 0.4),
    0 0 18px rgba(255, 200, 60, 0.22),
    0 0 28px rgba(255, 106, 0, 0.14);
}

/* --- Kompakt-Ansicht für kleine Smartphones (<540px Höhe) ----------------- */

@media (max-height: 540px) {
  .sandsword-screen {
    --ss-gap: 6px;
    padding: 8px 12px 8px;
  }

  .sandsword-hud {
    padding: 4px;
    gap: 4px;
    border-radius: 10px;
  }

  .sandsword-hud-value {
    font-size: 0.88rem;
  }

  .sandsword-footer {
    padding: 6px 10px;
    gap: 6px;
  }

  .sandsword-footer-cta {
    min-height: 38px;
  }
}

/* --- Etwas mehr Raum auf taller Screens ----------------------------------- */

@media (min-height: 700px) {
  .sandsword-screen {
    --ss-gap: 12px;
  }
}

/* --- Feedback Screen ------------------------------------------------------ */

.feedback-screen {
  padding:
    max(var(--space-5), env(safe-area-inset-top, 0px))
    max(var(--flow-screen-pad-x), env(safe-area-inset-right, 0px))
    var(--space-4)
    max(var(--flow-screen-pad-x), env(safe-area-inset-left, 0px));
  gap: var(--space-3);
}

.feedback-hero {
  flex: 0 0 auto;
  text-align: center;
  align-items: center;
  gap: 6px;
}

.feedback-hero h1 {
  font-size: 1.35rem;
  line-height: 1.25;
  text-shadow:
    0 0 12px rgba(255, 106, 0, 0.32),
    0 0 22px rgba(138, 63, 252, 0.18);
}

.feedback-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 390px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.feedback-form,
.feedback-thanks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feedback-thanks:not([hidden]) {
  flex: 1 1 auto;
  min-height: 0;
  justify-content: space-between;
}

.feedback-thanks:not([hidden]) > .feedback-thanks-card,
.feedback-thanks:not([hidden]) > .feedback-thanks-mascot,
.feedback-thanks:not([hidden]) > .feedback-thanks-actions {
  flex-shrink: 0;
}

.feedback-form[hidden],
.feedback-thanks[hidden] {
  display: none !important;
}

.feedback-card {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feedback-section-title {
  margin: 0;
  color: rgba(248, 249, 250, 0.92);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}

.feedback-sentiment-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.feedback-sentiment-button {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  min-height: 64px;
  min-width: 0;
  max-width: 100%;
  flex: 1 1 auto;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 106, 0, 0.38);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  color: #fff;
  text-align: center;
  overflow-wrap: break-word;
  font-family: var(--font-family-base);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 120ms ease, border-color 140ms ease, box-shadow 160ms ease, background 160ms ease;
}

.feedback-sentiment-button[data-feedback-sentiment="fun"] {
  flex: 2 1 0;
  background: linear-gradient(135deg, rgba(53, 196, 117, 0.92), rgba(31, 145, 86, 0.86));
  border-color: rgba(53, 196, 117, 0.9);
  box-shadow: 0 0 14px rgba(53, 196, 117, 0.28);
}

.feedback-sentiment-button[data-feedback-sentiment="bumpy"] {
  flex: 1 1 0;
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.92), rgba(205, 78, 0, 0.86));
  border-color: rgba(255, 106, 0, 0.9);
  box-shadow: 0 0 14px rgba(255, 106, 0, 0.28);
}

.feedback-sentiment-button:active {
  transform: translateY(1px);
}

.feedback-sentiment-button[data-feedback-sentiment="fun"].is-selected {
  border-color: rgba(180, 255, 210, 0.95);
  box-shadow:
    0 0 0 1px rgba(220, 255, 235, 0.55) inset,
    0 0 20px rgba(53, 196, 117, 0.45),
    0 0 32px rgba(31, 145, 86, 0.35);
  color: #fff;
}

.feedback-sentiment-button[data-feedback-sentiment="bumpy"].is-selected {
  border-color: rgba(255, 210, 170, 0.95);
  box-shadow:
    0 0 0 1px rgba(255, 220, 190, 0.5) inset,
    0 0 20px rgba(255, 106, 0, 0.42),
    0 0 30px rgba(205, 78, 0, 0.32);
  color: #fff;
}

.feedback-sentiment-button:focus-visible {
  outline: 2px solid rgba(255, 106, 0, 0.75);
  outline-offset: 2px;
}

.feedback-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(228, 88, 76, 0.16);
  border: 1px solid rgba(228, 88, 76, 0.5);
  color: rgba(255, 215, 216, 0.96);
  font-size: 0.82rem;
  line-height: 1.35;
}

.feedback-radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-radio {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 0;
  min-width: 0;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-light);
  font-family: var(--font-family-base);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 120ms ease, border-color 140ms ease, background 160ms ease, box-shadow 160ms ease;
}

.feedback-radio:active {
  transform: translateY(1px);
}

.feedback-radio.is-selected {
  border-color: rgba(255, 106, 0, 0.85);
  background: linear-gradient(145deg, rgba(255, 106, 0, 0.2), rgba(138, 63, 252, 0.16));
  color: #fff;
  box-shadow:
    0 0 14px rgba(255, 106, 0, 0.26),
    0 0 22px rgba(138, 63, 252, 0.18);
}

.feedback-radio:focus-visible {
  outline: 2px solid rgba(255, 106, 0, 0.7);
  outline-offset: 2px;
}

.feedback-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-chip {
  -webkit-appearance: none;
  appearance: none;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-light);
  font-family: var(--font-family-base);
  font-size: 0.85rem;
  line-height: 1.2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 120ms ease, border-color 140ms ease, background 160ms ease, box-shadow 160ms ease;
}

.feedback-chip:active {
  transform: translateY(1px);
}

.feedback-chip.is-selected {
  border-color: rgba(255, 106, 0, 0.82);
  background: linear-gradient(145deg, rgba(255, 106, 0, 0.22), rgba(138, 63, 252, 0.16));
  color: #fff;
  box-shadow:
    0 0 12px rgba(255, 106, 0, 0.24),
    0 0 18px rgba(138, 63, 252, 0.16);
}

.feedback-chip:focus-visible {
  outline: 2px solid rgba(255, 106, 0, 0.7);
  outline-offset: 2px;
}

.feedback-textarea-label {
  display: block;
  color: rgba(248, 249, 250, 0.92);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}

.feedback-textarea {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  box-sizing: border-box;
  min-height: 112px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 106, 0, 0.42);
  background: rgba(10, 15, 36, 0.54);
  color: var(--color-text-light);
  font-family: var(--font-family-base);
  font-size: 16px;
  line-height: 1.4;
  resize: vertical;
  touch-action: manipulation;
}

.feedback-textarea::placeholder {
  color: rgba(248, 249, 250, 0.55);
}

.feedback-textarea:focus {
  outline: none;
  border-color: rgba(255, 106, 0, 0.78);
  box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.18), 0 0 18px rgba(138, 63, 252, 0.2);
}

.feedback-actions {
  margin-top: 2px;
}

.feedback-submit--success,
.feedback-submit--success:disabled {
  background: linear-gradient(135deg, rgba(53, 196, 117, 0.96), rgba(31, 145, 86, 0.92));
  border-color: rgba(53, 196, 117, 0.95);
  color: #fff;
  opacity: 1;
  box-shadow:
    0 10px 24px rgba(53, 196, 117, 0.28),
    0 0 18px rgba(53, 196, 117, 0.24);
}

.feedback-thanks-card {
  align-items: center;
  text-align: center;
  gap: 8px;
}

.feedback-thanks-title {
  margin: 0;
  font-size: 1.4rem;
  color: #fff;
  text-shadow:
    0 0 14px rgba(255, 106, 0, 0.4),
    0 0 22px rgba(138, 63, 252, 0.22);
}

.feedback-thanks-card p {
  line-height: 1.45;
  max-width: 32ch;
}

.feedback-thanks-mascot {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 6px auto 2px;
  padding: 4px 0 8px;
  pointer-events: none;
  isolation: isolate;
}

.feedback-thanks-mascot::before {
  content: "";
  position: absolute;
  width: min(58vw, 220px);
  height: min(58vw, 220px);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(255, 42, 76, 0.36) 0%, rgba(255, 42, 76, 0.22) 34%, transparent 68%),
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.22), transparent 18%),
    radial-gradient(circle at 70% 62%, rgba(255, 110, 130, 0.22), transparent 20%);
  filter: blur(18px);
  opacity: 0.95;
  transform: scale(0.95);
  animation: feedback-red-glow-pulse 2.4s ease-in-out infinite;
  z-index: -2;
}

.feedback-thanks-mascot::after {
  content: "";
  position: absolute;
  width: min(62vw, 235px);
  height: min(62vw, 235px);
  border-radius: 999px;
  background:
    radial-gradient(circle at 20% 26%, rgba(255, 255, 255, 0.9) 0 2px, transparent 4px),
    radial-gradient(circle at 76% 22%, rgba(255, 180, 190, 0.9) 0 2px, transparent 4px),
    radial-gradient(circle at 82% 72%, rgba(255, 255, 255, 0.78) 0 1.5px, transparent 4px),
    radial-gradient(circle at 28% 78%, rgba(255, 95, 120, 0.75) 0 2px, transparent 5px);
  opacity: 0.72;
  animation: feedback-red-sparkle 1.9s ease-in-out infinite;
  z-index: -1;
}

.feedback-thanks-mascot__image {
  display: block;
  width: min(44vw, 165px);
  height: auto;
  object-fit: contain;
  filter:
    drop-shadow(0 0 14px rgba(255, 42, 76, 0.55))
    drop-shadow(0 0 28px rgba(255, 42, 76, 0.32));
  animation: feedback-heart-mascot-pulse 2.4s ease-in-out infinite;
}

@keyframes feedback-heart-mascot-pulse {
  0%,
  100% {
    transform: scale(1);
    filter:
      drop-shadow(0 0 12px rgba(255, 42, 76, 0.48))
      drop-shadow(0 0 24px rgba(255, 42, 76, 0.26));
  }

  50% {
    transform: scale(1.045);
    filter:
      drop-shadow(0 0 20px rgba(255, 42, 76, 0.78))
      drop-shadow(0 0 42px rgba(255, 42, 76, 0.42));
  }
}

@keyframes feedback-red-glow-pulse {
  0%,
  100% {
    opacity: 0.62;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}

@keyframes feedback-red-sparkle {
  0%,
  100% {
    opacity: 0.38;
    transform: rotate(0deg) scale(0.96);
  }

  50% {
    opacity: 0.9;
    transform: rotate(7deg) scale(1.06);
  }
}

.feedback-thanks-actions {
  margin-top: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .feedback-thanks-mascot::before,
  .feedback-thanks-mascot::after,
  .feedback-thanks-mascot__image {
    animation: none;
  }
}

@container (max-width: 380px) {
  .feedback-sentiment-button {
    min-height: 58px;
    font-size: 0.9rem;
  }

  .feedback-radio {
    font-size: 0.82rem;
    padding: 9px 10px;
  }

  .feedback-chip {
    font-size: 0.82rem;
    padding: 8px 12px;
  }
}

@media (max-height: 720px) {
  .feedback-screen {
    padding: var(--space-4) var(--space-4) var(--space-3);
    gap: var(--space-2);
  }

  .feedback-hero h1 {
    font-size: 1.2rem;
  }

  .feedback-card {
    padding: 12px;
    gap: 8px;
  }

  .feedback-sentiment-button {
    min-height: 56px;
  }

  .feedback-textarea {
    min-height: 96px;
  }

  .feedback-thanks:not([hidden]) {
    justify-content: space-evenly;
    gap: 10px;
  }

  .feedback-thanks-mascot {
    margin-block: 0;
    padding-block: 2px 4px;
  }

  .feedback-thanks-mascot__image {
    width: min(40vw, 148px);
  }
}

/* --- Legal links (Start + Challenge Hub) ---------------------------------- */

.start-legal-nav {
  width: 100%;
  max-width: 360px;
  margin: 8px auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-items: center;
  align-items: center;
  gap: 8px 10px;
}

.legal-text-link {
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  background: transparent;
  color: rgba(248, 249, 250, 0.82);
  font: inherit;
  font-size: 0.76rem;
  line-height: 1.3;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding: 8px 6px;
  min-height: 36px;
  border-radius: 8px;
  touch-action: manipulation;
}

.legal-text-link:active {
  opacity: 0.78;
}

.legal-text-link:focus-visible {
  outline: 2px solid rgba(255, 106, 0, 0.72);
  outline-offset: 2px;
}

.legal-text-link--start {
  justify-self: center;
  text-align: center;
  padding-inline: 4px;
}

/* --- Legal screens (internal scroll only) -------------------------------- */

.legal-screen {
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-4);
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.legal-hero {
  flex: 0 0 auto;
  text-align: center;
  align-items: center;
  gap: var(--space-2);
}

.legal-hero__sub {
  max-width: 34ch;
  margin-inline: auto;
  font-size: 0.92rem;
  line-height: 1.4;
}

.legal-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 390px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  overflow: hidden;
}

.legal-card {
  flex: 1 1 auto;
  min-height: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.legal-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
  touch-action: pan-y;
}

.legal-copy {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 4px;
}

.legal-copy h2,
.legal-copy h3,
.legal-copy h4 {
  margin: 0;
  color: var(--color-text-light);
  line-height: 1.28;
}

.legal-copy h2 {
  font-size: 1.05rem;
}

.legal-copy h3 {
  margin-top: 6px;
  font-size: 0.92rem;
}

.legal-copy h4 {
  margin-top: 10px;
  font-size: 0.84rem;
}

.legal-copy a {
  color: rgba(255, 170, 90, 0.95);
}

.legal-copy p {
  margin: 0;
  color: rgba(248, 249, 250, 0.9);
  font-size: 0.86rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.legal-copy .legal-label {
  font-weight: 600;
  color: rgba(248, 249, 250, 0.92);
}

.legal-copy .legal-subheading {
  margin: 8px 0 0;
  font-size: 0.86rem;
  line-height: 1.5;
  font-weight: 600;
  color: rgba(248, 249, 250, 0.95);
}

.legal-copy ul {
  margin: 0;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legal-copy li {
  color: rgba(248, 249, 250, 0.9);
  font-size: 0.86rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.legal-copy .legal-link-list a {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-copy__source {
  margin-top: 4px;
  font-size: 0.76rem;
  color: rgba(248, 249, 250, 0.68);
}

.legal-actions {
  flex: 0 0 auto;
}

.legal-actions .btn {
  width: 100%;
}

/* --- Consent banner & settings (global, fixed) --------------------------- */

.consent-host {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  display: block;
}

.consent-banner {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 12px max(12px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  pointer-events: none;
  box-sizing: border-box;
}

.consent-banner[hidden] {
  display: none !important;
}

.consent-banner__inner {
  width: min(100%, 430px);
  margin-inline: auto;
  pointer-events: auto;
}

.consent-banner__card {
  width: 100%;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-color: rgba(255, 106, 0, 0.65);
  background: rgba(15, 19, 48, 0.55);
  box-shadow:
    0 -8px 32px rgba(0, 0, 0, 0.45),
    0 0 20px rgba(255, 106, 0, 0.28),
    0 0 28px rgba(168, 72, 255, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.consent-banner__eyebrow {
  margin: 0;
}

.consent-banner__title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  color: var(--color-text-light);
}

.consent-banner__text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: rgba(248, 249, 250, 0.9);
}

.consent-banner__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.consent-banner__btn {
  width: 100%;
}

@media (min-width: 400px) {
  .consent-banner__actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .consent-banner__btn {
    flex: 1 1 calc(33.333% - 8px);
    min-width: min(100%, 140px);
  }
}

.consent-settings-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(12px, env(safe-area-inset-top)) 14px max(12px, env(safe-area-inset-bottom));
  box-sizing: border-box;
  pointer-events: none;
}

.consent-settings-overlay[hidden] {
  display: none !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

.consent-settings-overlay:not(.is-open) {
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
}

.consent-settings-overlay.is-open {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.consent-settings-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 18, 0.76);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.consent-settings-modal {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
  max-height: min(92dvh, 720px);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 18px 16px 14px;
  border-color: rgba(255, 106, 0, 0.78);
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.45),
    0 0 22px rgba(255, 106, 0, 0.36),
    0 0 36px rgba(168, 72, 255, 0.22);
  pointer-events: auto;
}

.consent-settings-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-light);
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
}

.consent-settings-modal__close:active {
  transform: translateY(1px);
}

.consent-settings-modal__close:focus-visible {
  outline: 2px solid rgba(255, 106, 0, 0.72);
  outline-offset: 2px;
}

.consent-settings-modal__eyebrow {
  margin: 0 0 2px;
}

.consent-settings-modal__title {
  margin: 0;
  padding-right: 36px;
  color: var(--color-text-light);
  font-size: 1.18rem;
  line-height: 1.22;
}

.consent-settings-modal__intro,
.consent-settings-modal__note {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: rgba(248, 249, 250, 0.88);
}

.consent-settings-modal__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
  margin-top: 4px;
}

.consent-category {
  padding: 12px 12px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 106, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.consent-category__header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.consent-category__title {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.25;
  color: var(--color-text-light);
}

.consent-category__badge {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(138, 63, 252, 0.22);
  border: 1px solid rgba(168, 72, 255, 0.45);
  color: rgba(248, 249, 250, 0.92);
}

.consent-category__text {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(248, 249, 250, 0.84);
}

.consent-category__details {
  margin: 0;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.consent-category__summary {
  cursor: pointer;
  padding: 10px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 186, 120, 0.95);
  list-style: none;
}

.consent-category__summary::-webkit-details-marker {
  display: none;
}

.consent-category__details[open] .consent-category__summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.consent-category__detail-intro,
.consent-category__detail-block-title {
  margin: 0 12px 6px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(248, 249, 250, 0.78);
}

.consent-category__list {
  margin: 0 12px 12px;
  padding-left: 1.1rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(248, 249, 250, 0.86);
}

.consent-category__important {
  margin: 0 12px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 186, 120, 0.92);
}

.consent-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  margin-top: 2px;
}

.consent-toggle__input {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: rgba(255, 106, 0, 0.95);
  cursor: pointer;
}

.consent-toggle__label {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(248, 249, 250, 0.9);
  line-height: 1.35;
}

.consent-settings-hint {
  margin: 4px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(248, 249, 250, 0.72);
}

.consent-settings-privacy-link {
  -webkit-appearance: none;
  appearance: none;
  align-self: flex-start;
  margin: 0;
  padding: 6px 0 2px;
  border: 0;
  background: none;
  color: rgba(255, 186, 120, 0.95);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  text-align: left;
}

.consent-settings-privacy-link:focus-visible {
  outline: 2px solid rgba(255, 106, 0, 0.72);
  outline-offset: 2px;
  border-radius: 4px;
}

.consent-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.consent-actions__primary,
.consent-actions__secondary {
  width: 100%;
}

/* Shared hero icon badges (Wallet, Community, Leaderboard, Settings modal) */

.wallet-preview-hero__icon,
.community-preview-hero__icon,
.challenge-leaderboard-hero__icon,
.challenge-settings-modal__icon {
  flex-shrink: 0;
  width: clamp(44px, 11vw, 52px);
  height: clamp(44px, 11vw, 52px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 106, 0, 0.52);
  box-shadow:
    0 0 0 1px rgba(138, 63, 252, 0.2),
    0 0 22px rgba(255, 106, 0, 0.38),
    0 0 36px rgba(138, 63, 252, 0.28);
}

.wallet-preview-hero__icon img,
.community-preview-hero__icon img,
.challenge-leaderboard-hero__icon img,
.challenge-settings-modal__icon img {
  width: clamp(24px, 6.5vw, 30px);
  height: clamp(24px, 6.5vw, 30px);
  object-fit: contain;
  display: block;
}

/* --- Community Preview Screen --------------------------------------------- */

.community-preview-screen {
  height: 100%;
  min-height: 0;
  padding: clamp(14px, 2dvh, 18px) var(--space-4) var(--space-4);
  gap: clamp(10px, 1.8dvh, 16px);
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.community-preview-hero {
  position: relative;
  flex: 0 0 auto;
  gap: clamp(6px, 1dvh, 10px);
  text-align: center;
  align-items: center;
}

.community-preview-hero__topline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.2dvh, 12px);
  width: 100%;
  box-sizing: border-box;
  padding-inline: 40px;
}

.community-preview-hero__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  text-align: center;
}

.community-preview-hero__copy .eyebrow {
  line-height: 1.2;
}

.community-preview-hero__copy h1 {
  font-size: clamp(1.25rem, 3.8vw, 1.45rem);
  line-height: 1.15;
}

.community-preview-hero__bell {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: rgba(248, 249, 250, 0.42);
  pointer-events: none;
}

.community-preview-hero__bell svg {
  display: block;
}

.community-preview-hero__sub {
  margin: 0;
  margin-inline: auto;
  max-width: 38ch;
  font-size: clamp(0.8rem, 1.65dvh, 0.9rem);
  line-height: 1.35;
  color: rgba(248, 249, 250, 0.82);
  text-align: center;
}

.community-preview-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 390px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6dvh, 14px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-right: 2px;
  box-sizing: border-box;
}

.community-preview-card {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2dvh, 12px);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
}

.community-preview-card__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 186, 120, 0.92);
}

.community-preview-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-light);
}

.community-preview-card__text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(248, 249, 250, 0.86);
}

.community-preview-card__preview-label {
  margin: 0;
  margin-top: 2px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(248, 249, 250, 0.55);
}

.community-preview-card--vote {
  padding: clamp(14px, 2dvh, 18px);
  border-color: rgba(255, 106, 0, 0.62);
  box-shadow:
    0 14px 36px rgba(6, 8, 20, 0.42),
    0 0 22px rgba(255, 106, 0, 0.32),
    0 0 36px rgba(138, 63, 252, 0.22);
}

.community-preview-card--friends,
.community-preview-card--chat {
  padding: clamp(12px, 1.6dvh, 16px);
}

.community-vote-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.community-vote-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.community-vote-item__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  min-width: 0;
}

.community-vote-item__name {
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.community-vote-item__count {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(248, 249, 250, 0.62);
  white-space: nowrap;
}

.community-vote-item__track {
  height: 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.community-vote-item__fill {
  display: block;
  height: 100%;
  width: var(--community-vote-progress, 0%);
  max-width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  box-shadow: 0 0 10px rgba(255, 106, 0, 0.35);
}

.community-preview-pill {
  align-self: flex-start;
  margin-top: 4px;
  min-height: 32px;
  padding: 6px 12px;
  font-size: 0.78rem;
  opacity: 0.92;
}

.community-friend-avatars {
  display: flex;
  align-items: center;
  padding: 4px 0 2px;
}

.community-friend-avatar {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(28, 31, 43, 0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  margin-right: -12px;
}

.community-friend-avatar__img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  opacity: 0.72;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.12));
}

.community-friend-avatar:last-child {
  margin-right: 0;
}

.community-friend-avatar--one {
  z-index: 3;
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.85), rgba(194, 30, 86, 0.75));
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(255, 106, 0, 0.35);
}

.community-friend-avatar--two {
  z-index: 2;
  background: linear-gradient(135deg, rgba(138, 63, 252, 0.88), rgba(255, 106, 0, 0.45));
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(138, 63, 252, 0.35);
}

.community-friend-avatar--three {
  z-index: 1;
  background: linear-gradient(135deg, rgba(194, 30, 86, 0.75), rgba(138, 63, 252, 0.65));
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.35),
    0 0 12px rgba(194, 30, 86, 0.28);
}

.community-friend-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 2px;
}

.community-friend-stat {
  min-height: 30px;
  padding: 5px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.community-chat-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  padding-top: 2px;
}

.community-chat-bubble {
  margin: 0;
  max-width: 100%;
  padding: 8px 11px;
  border-radius: 14px 14px 14px 4px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: rgba(248, 249, 250, 0.9);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.community-chat-bubble--alt {
  align-self: flex-end;
  border-radius: 14px 14px 4px 14px;
  background: linear-gradient(135deg, rgba(138, 63, 252, 0.22), rgba(255, 255, 255, 0.06));
  border-color: rgba(138, 63, 252, 0.35);
}

.community-preview-note {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 16px rgba(6, 8, 20, 0.22);
}

.community-preview-note p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: rgba(248, 249, 250, 0.78);
}

.community-preview-actions {
  flex: 0 0 auto;
  width: 100%;
  max-width: 390px;
  margin-inline: auto;
  padding-top: 2px;
  box-sizing: border-box;
}

@media (max-height: 720px) {
  .community-preview-screen {
    padding: clamp(10px, 1.4dvh, 14px) var(--space-3) var(--space-3);
    gap: clamp(8px, 1.2dvh, 12px);
  }

  .community-preview-content {
    gap: clamp(8px, 1.2dvh, 11px);
  }

  .community-preview-card {
    padding: var(--space-3);
    gap: 6px;
  }

  .community-preview-card--vote {
    padding: clamp(11px, 1.4dvh, 14px);
  }

  .community-preview-hero__sub {
    font-size: clamp(0.76rem, 1.45dvh, 0.84rem);
    line-height: 1.32;
  }

  .community-preview-hero__icon {
    width: 44px;
    height: 44px;
  }

  .community-preview-hero__icon img {
    width: 26px;
    height: 26px;
  }
}

/* --- /Community Preview Screen -------------------------------------------- */

/* --- Wallet Preview Screen ------------------------------------------------ */

.wallet-preview-screen {
  height: 100%;
  min-height: 0;
  padding: clamp(14px, 2dvh, 18px) var(--space-4) var(--space-4);
  gap: clamp(10px, 1.8dvh, 16px);
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.wallet-preview-hero {
  flex: 0 0 auto;
  gap: clamp(8px, 1.2dvh, 12px);
  text-align: center;
  align-items: center;
}

.wallet-preview-hero__topline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.2dvh, 12px);
  width: 100%;
  min-width: 0;
}

.wallet-preview-hero__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.wallet-preview-hero__copy .eyebrow {
  line-height: 1.2;
}

.wallet-preview-hero__copy h1 {
  font-size: clamp(1.45rem, 5vw, 1.95rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-shadow:
    0 0 18px rgba(255, 106, 0, 0.35),
    0 0 28px rgba(138, 63, 252, 0.22);
}

.wallet-preview-hero__sub {
  margin: 0;
  margin-inline: auto;
  max-width: 40ch;
  font-size: clamp(0.8rem, 1.65dvh, 0.92rem);
  line-height: 1.38;
  color: rgba(248, 249, 250, 0.84);
  text-align: center;
}

.wallet-preview-content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 390px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6dvh, 14px);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-right: 2px;
  box-sizing: border-box;
}

.wallet-summary-card {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.4dvh, 14px);
  padding: clamp(14px, 2dvh, 18px);
  border-radius: var(--radius-lg);
}

.wallet-summary-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-light);
}

.wallet-balance__meta,
.wallet-ticket-row__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
}

.wallet-balance__label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(248, 249, 250, 0.62);
}

.wallet-balance__pill {
  font-size: 0.74rem;
  min-height: 30px;
  padding: 5px 10px;
}

.wallet-balance__value {
  margin: 0;
  margin-top: 4px;
  font-size: clamp(1.65rem, 5.5vw, 2.05rem);
  font-weight: 800;
  line-height: 1.1;
  color: var(--color-text-light);
  text-shadow: 0 0 16px rgba(255, 106, 0, 0.22);
}

.wallet-ticket-row__value {
  margin: 0;
  margin-top: 4px;
  font-size: clamp(1.35rem, 4.2vw, 1.65rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-text-light);
}

.wallet-ticket-row__hint {
  margin: 0;
  margin-top: 8px;
  font-size: 0.78rem;
  line-height: 1.42;
  color: rgba(248, 249, 250, 0.72);
}

.wallet-demo-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2);
  margin-top: 4px;
}

.wallet-demo-action {
  width: 100%;
  min-height: 48px;
  font-weight: 600;
}

.wallet-demo-actions__note {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.4;
  color: rgba(248, 249, 250, 0.65);
}

.wallet-token-card {
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2dvh, 12px);
  padding: clamp(12px, 1.6dvh, 16px);
  border-radius: var(--radius-lg);
}

.wallet-token-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-light);
}

.wallet-token-card__text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(248, 249, 250, 0.86);
}

.wallet-token-card__pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: 2px;
}

.wallet-token-card__pill {
  font-size: 0.74rem;
  font-weight: 600;
  min-height: 32px;
  padding: 6px 11px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.wallet-daily-winner-card {
  padding: clamp(14px, 2dvh, 18px);
  border-radius: var(--radius-lg);
  border-color: rgba(255, 106, 0, 0.55);
  box-shadow:
    0 14px 36px rgba(6, 8, 20, 0.42),
    0 0 24px rgba(255, 106, 0, 0.34),
    0 0 38px rgba(138, 63, 252, 0.24);
}

.wallet-daily-winner-card__layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2dvh, 18px);
}

.wallet-daily-winner-card__asset {
  display: flex;
  justify-content: center;
  align-items: center;
}

.wallet-daily-winner-card__img {
  width: min(78vw, 260px);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.45));
}

.wallet-daily-winner-card__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1dvh, 10px);
  min-width: 0;
  width: 100%;
  text-align: center;
}

.wallet-daily-winner-card__eyebrow {
  margin: 0;
}

.wallet-daily-winner-card__title {
  margin: 0;
  font-size: clamp(1rem, 3.2vw, 1.12rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-light);
}

.wallet-daily-winner-card__text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: rgba(248, 249, 250, 0.88);
}

.wallet-daily-winner-card__pill {
  align-self: center;
  margin-top: 2px;
  font-size: 0.76rem;
  font-weight: 600;
  border-color: rgba(138, 63, 252, 0.38);
  background: linear-gradient(135deg, rgba(138, 63, 252, 0.18), rgba(255, 255, 255, 0.06));
}

.wallet-daily-winner-card__amount {
  margin: 0;
  margin-top: 4px;
  font-size: clamp(1.2rem, 4vw, 1.45rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--color-text-light);
  text-shadow: 0 0 14px rgba(255, 106, 0, 0.28);
}

.wallet-daily-winner-card__potline {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: rgba(248, 249, 250, 0.78);
}

.wallet-pot-overview-card {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.4dvh, 14px);
  padding: clamp(12px, 1.6dvh, 16px);
  border-radius: var(--radius-lg);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 22px rgba(6, 8, 20, 0.28);
}

.wallet-pot-overview-card__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-light);
}

.wallet-pot-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.wallet-pot-item {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wallet-pot-item__title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(248, 249, 250, 0.58);
}

.wallet-pot-item__value {
  margin: 0;
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(248, 249, 250, 0.94);
}

.wallet-pot-item__sub {
  margin: 0;
  margin-top: 4px;
  font-size: 0.76rem;
  line-height: 1.35;
  color: rgba(248, 249, 250, 0.62);
}

.wallet-preview-note {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 16px rgba(6, 8, 20, 0.22);
}

.wallet-preview-note__intro {
  margin: 0;
  margin-bottom: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
  color: rgba(248, 249, 250, 0.88);
}

.wallet-preview-note__legal {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(248, 249, 250, 0.74);
}

.wallet-preview-actions {
  flex: 0 0 auto;
  width: 100%;
  max-width: 390px;
  margin-inline: auto;
  padding-top: 2px;
  box-sizing: border-box;
}

@media (min-width: 380px) {
  .wallet-demo-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 400px) {
  .wallet-pot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-2);
  }

  .wallet-pot-item {
    padding: var(--space-2) var(--space-3);
  }

  .wallet-pot-item__value {
    font-size: 0.92rem;
  }

  .wallet-pot-item__sub {
    font-size: 0.7rem;
  }
}

@media (max-height: 720px) {
  .wallet-preview-screen {
    padding: clamp(10px, 1.4dvh, 14px) var(--space-3) var(--space-3);
    gap: clamp(8px, 1.2dvh, 12px);
  }

  .wallet-preview-content {
    gap: clamp(8px, 1.2dvh, 11px);
  }

  .wallet-summary-card,
  .wallet-daily-winner-card {
    padding: clamp(11px, 1.4dvh, 14px);
  }

  .wallet-preview-hero__sub {
    font-size: clamp(0.76rem, 1.45dvh, 0.84rem);
    line-height: 1.32;
  }

  .wallet-preview-hero__icon,
  .community-preview-hero__icon,
  .challenge-leaderboard-hero__icon,
  .challenge-settings-modal__icon {
    width: 44px;
    height: 44px;
  }

  .wallet-preview-hero__icon img,
  .community-preview-hero__icon img,
  .challenge-leaderboard-hero__icon img,
  .challenge-settings-modal__icon img {
    width: 26px;
    height: 26px;
  }
}

/* --- /Wallet Preview Screen ----------------------------------------------- */
