/* Rx Jump — pharmacy runner */

.rx-jump {
  --rx-ink: var(--ink, #0a1628);
  --rx-teal: var(--teal, #0d5c63);
  --rx-teal-b: var(--teal-bright, #147a82);
  --rx-brass: var(--brass, #8b7355);
  --rx-paper: var(--paper, #f0f3f6);
  --rx-danger: #b42318;
  --rx-ok: #1b7a4a;
  height: calc(100vh - var(--nav-h, 4.5rem));
  height: calc(100dvh - var(--nav-h, 4.5rem));
  min-height: 0;
  max-height: calc(100vh - var(--nav-h, 4.5rem));
  max-height: calc(100dvh - var(--nav-h, 4.5rem));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(13, 92, 99, 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 100%, rgba(139, 115, 85, 0.1), transparent 50%),
    linear-gradient(180deg, #e8eef2 0%, var(--rx-paper) 40%, #dfe7ee 100%);
}

.rx-jump__stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.rx-jump__hud {
  position: absolute;
  z-index: 3;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  pointer-events: none;
}

.rx-jump__scores {
  pointer-events: none;
  color: var(--rx-ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.rx-jump__scores[data-sick="true"] .rx-jump__hint {
  color: var(--rx-danger);
  font-weight: 600;
}

.rx-jump__title {
  margin: 0;
  font-family: var(--font-display, "Newsreader", Georgia, serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.rx-jump__hint {
  margin: 0.15rem 0 0;
  font-size: 0.75rem;
  color: var(--muted, #5a6b7c);
  max-width: 16rem;
}

.rx-jump__scoreline {
  margin: 0.4rem 0 0;
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.rx-jump__scoreline strong {
  font-weight: 600;
}

.rx-jump__drugs {
  position: absolute;
  z-index: 5;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: stretch;
  gap: 0.65rem;
  width: min(52rem, calc(100% - 1.5rem));
  pointer-events: auto;
}

.rx-jump__drug {
  appearance: none;
  border: 2px solid rgba(10, 22, 40, 0.18);
  background: rgba(255, 255, 255, 0.94);
  color: var(--rx-ink);
  border-radius: 0.7rem;
  padding: 0.7rem 0.85rem;
  font: 500 0.7rem/1.2 var(--font-sans, "IBM Plex Sans", sans-serif);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  transition: border-color 0.15s var(--ease, ease), background 0.15s, transform 0.12s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(10, 22, 40, 0.1);
}

.rx-jump__drug:disabled {
  opacity: 0.45;
  cursor: default;
}

.rx-jump__drug:not(:disabled):hover {
  border-color: var(--rx-teal);
  background: #fff;
}

.rx-jump__drug:not(:disabled):active {
  transform: translateY(1px);
}

.rx-jump__drug[data-active="true"] {
  opacity: 1;
  border-color: var(--rx-teal-b);
  box-shadow: 0 0 0 2px rgba(20, 122, 130, 0.25);
}

.rx-jump__drug[data-wrong="true"] {
  border-color: var(--rx-danger);
  background: #fdecea;
  animation: rx-jump-shake 0.35s ease;
}

.rx-jump__drug[data-hint="true"] {
  animation: rx-jump-pulse 1.2s ease-in-out infinite;
}

.rx-jump__drug-key {
  display: inline-block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--rx-teal);
  letter-spacing: 0.04em;
}

.rx-jump__drug-name {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.15;
}

.rx-jump__canvas {
  display: block;
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.rx-jump__overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(10, 22, 40, 0.28);
  backdrop-filter: blur(2px);
  transition: opacity 0.2s ease;
}

.rx-jump__overlay[data-state="playing"],
.rx-jump__overlay[data-state="sick"] {
  opacity: 0;
  pointer-events: none;
}

.rx-jump__panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(10, 22, 40, 0.12);
  border-radius: 0.75rem;
  padding: 1.5rem 1.75rem;
  max-width: 26rem;
  text-align: center;
  box-shadow: 0 24px 60px rgba(10, 22, 40, 0.18);
  color: var(--rx-ink);
}

.rx-jump__panel h1,
.rx-jump__panel h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display, "Newsreader", Georgia, serif);
  font-weight: 600;
  letter-spacing: -0.02em;
}

.rx-jump__panel p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--muted, #5a6b7c);
}

.rx-jump__btn {
  appearance: none;
  border: 0;
  background: var(--rx-teal);
  color: #fff;
  font: 600 0.95rem/1.2 var(--font-sans, "IBM Plex Sans", sans-serif);
  padding: 0.7rem 1.35rem;
  border-radius: 0.45rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s;
}

.rx-jump__btn:hover {
  background: var(--rx-teal-b);
}

.rx-jump__btn:active {
  transform: translateY(1px);
}

/* Home floating launcher */
.rx-jump-fab {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem 0.7rem 0.75rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--teal, #0d5c63), var(--ink-soft, #1a2d42));
  color: #fff;
  text-decoration: none;
  font: 600 0.85rem/1 var(--font-sans, "IBM Plex Sans", sans-serif);
  box-shadow:
    0 10px 28px rgba(10, 22, 40, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition: transform 0.2s var(--ease, ease), box-shadow 0.2s;
}

.rx-jump-fab:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 32px rgba(10, 22, 40, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  color: #fff;
}

.rx-jump-fab:focus-visible {
  outline: 2px solid var(--brass, #8b7355);
  outline-offset: 3px;
}

.rx-jump-fab__icon {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  line-height: 1;
}

.rx-jump-fab__label {
  padding-right: 0.15rem;
}

.rx-jump-fab__sub {
  display: block;
  font-size: 0.65rem;
  font-weight: 500;
  opacity: 0.75;
  margin-top: 0.2rem;
}

@keyframes rx-jump-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

@keyframes rx-jump-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(20, 122, 130, 0.35);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(20, 122, 130, 0.15);
  }
}

@media (max-width: 640px) {
  .rx-jump__drugs {
    top: 26%;
    gap: 0.35rem;
    width: calc(100% - 1rem);
  }

  .rx-jump__drug {
    padding: 0.5rem 0.35rem;
  }

  .rx-jump__drug-key {
    font-size: 0.95rem;
  }

  .rx-jump__drug-name {
    font-size: 0.72rem;
  }

  .rx-jump-fab__sub {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rx-jump__drug[data-hint="true"],
  .rx-jump__drug[data-wrong="true"],
  .rx-jump-fab {
    animation: none;
  }

  .rx-jump-fab:hover {
    transform: none;
  }
}
