/* ============================================================
   THE URGE DECIDER — visual system
   Palette:  deep-space indigo bg, neon pink (JERK OFF),
             electric green (DON'T), arcade yellow (accent)
   Type:     Bungee (display) + Inter (body)
   ============================================================ */

:root {
  --bg: #0b0a14;
  --bg-2: #141128;
  --panel: rgba(24, 20, 44, 0.72);
  --panel-edge: rgba(255, 255, 255, 0.09);

  --pink: #ff2e88;
  --pink-soft: #ff7ab8;
  --green: #2bff88;
  --green-soft: #7dffbe;
  --yellow: #ffe14d;

  --text: #f4f1ff;
  --muted: #a29ac0;
  --dim: #6f6890;

  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 10px;

  --font-display: "Bungee", "Arial Black", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --glow-pink: 0 0 18px rgba(255, 46, 136, 0.55), 0 0 60px rgba(255, 46, 136, 0.25);
  --glow-green: 0 0 18px rgba(43, 255, 136, 0.5), 0 0 60px rgba(43, 255, 136, 0.22);
  --glow-yellow: 0 0 18px rgba(255, 225, 77, 0.45), 0 0 60px rgba(255, 225, 77, 0.2);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(255, 46, 136, 0.14), transparent 60%),
    radial-gradient(900px 600px at 85% 110%, rgba(43, 255, 136, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- atmospheric layers --- */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 100%);
}

.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, 0.16) 3px,
    rgba(0, 0, 0, 0.16) 4px
  );
  mix-blend-mode: multiply;
}

/* --- layout --- */
.stage {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 40px) clamp(16px, 5vw, 28px) 28px;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.masthead { text-align: center; position: relative; }

.logo {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 7vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin: 0;
  color: var(--text);
  text-shadow: 0 0 22px rgba(255, 46, 136, 0.35);
  position: relative;
}

/* subtle glitch on the title */
.logo__base { position: relative; z-index: 1; }
.logo__glitch {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.logo__glitch--a { color: var(--pink); animation: glitchA 4.5s infinite steps(1); }
.logo__glitch--b { color: var(--green); animation: glitchB 4.5s infinite steps(1); }

@keyframes glitchA {
  0%, 88%, 100% { opacity: 0; transform: none; }
  89% { opacity: 0.7; transform: translate(-2px, -1px); }
  92% { opacity: 0; transform: none; }
  94% { opacity: 0.6; transform: translate(2px, 1px); }
  96% { opacity: 0; }
}
@keyframes glitchB {
  0%, 90%, 100% { opacity: 0; transform: none; }
  91% { opacity: 0.7; transform: translate(2px, 1px); }
  93% { opacity: 0; }
  95% { opacity: 0.6; transform: translate(-2px, 1px); }
  97% { opacity: 0; }
}

.tagline {
  margin: 10px auto 0;
  max-width: 34ch;
  color: var(--muted);
  font-size: clamp(0.95rem, 3.4vw, 1.1rem);
  line-height: 1.45;
}
.tagline em { color: var(--yellow); font-style: normal; font-weight: 600; }

.badge-18 {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--yellow);
  border: 1px solid rgba(255, 225, 77, 0.45);
  border-radius: 999px;
  background: rgba(255, 225, 77, 0.08);
}

/* --- the machine --- */
.machine {
  margin: clamp(20px, 4vh, 34px) 0 auto;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 5vw, 32px) clamp(16px, 5vw, 28px) 26px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* --- mascot orb --- */
.orb {
  width: clamp(96px, 26vw, 128px);
  height: clamp(96px, 26vw, 128px);
  margin-bottom: 14px;
  border-radius: 50%;
  position: relative;
  animation: float 4.5s ease-in-out infinite;
}
.orb__face {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 0 16px rgba(120, 90, 255, 0.28));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

/* blink (idle only) */
.orb[data-face="idle"] .eye { animation: blink 4s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes blink {
  0%, 46%, 52%, 100% { transform: scaleY(1); }
  49%, 50% { transform: scaleY(0.1); }
}

.orb[data-face="dizzy"] { animation: shake 0.35s linear infinite; }
@keyframes shake {
  0% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
  100% { transform: rotate(-4deg); }
}
.orb[data-face="dizzy"] .pupil { animation: spin 0.7s linear infinite; transform-box: fill-box; transform-origin: center; }
@keyframes spin { to { transform: rotate(360deg); } }

/* reveal pop for the orb */
.orb.is-revealed { animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes pop {
  0% { transform: scale(0.7); }
  100% { transform: scale(1); }
}

/* --- status line --- */
.status {
  font-family: var(--font-display);
  font-size: clamp(0.82rem, 3.2vw, 1rem);
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 16px;
  text-align: center;
  min-height: 1.2em;
}
.status.is-hot { color: var(--yellow); text-shadow: var(--glow-yellow); animation: pulse 0.9s ease-in-out infinite; }
.status.is-deliberating {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.02em;
}
@keyframes pulse { 50% { opacity: 0.55; } }

/* --- the two choices --- */
.choices {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.choice {
  --c: var(--pink);
  --c-soft: var(--pink-soft);
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.10);
  padding: clamp(12px, 3.4vw, 18px) 12px;
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  opacity: 0.42;
  transform: scale(0.97);
  background: rgba(255, 255, 255, 0.02);
}
.choice--dont { --c: var(--green); --c-soft: var(--green-soft); }

.choice__text {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 8.5vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--c);
  display: inline-block;
}

/* hot = the currently highlighted option while deciding */
.choice.is-hot {
  opacity: 1;
  transform: scale(1.03);
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 8%, transparent);
  box-shadow: 0 0 0 1px var(--c), var(--glow-pink);
  animation: hotjitter 0.09s linear infinite;
}
.choice--dont.is-hot { box-shadow: 0 0 0 1px var(--c), var(--glow-green); }
.choice.is-hot .choice__text { text-shadow: 0 0 16px var(--c), 0 0 42px var(--c); }

@keyframes hotjitter {
  0%, 100% { transform: scale(1.03) translate(0, 0) rotate(0deg); }
  25% { transform: scale(1.04) translate(-1px, 1px) rotate(-0.4deg); }
  75% { transform: scale(1.02) translate(1px, -1px) rotate(0.4deg); }
}

/* reveal states */
.choice.is-winner {
  opacity: 1;
  transform: scale(1.06);
  border-color: var(--c);
  background: color-mix(in srgb, var(--c) 10%, transparent);
  box-shadow: 0 0 0 2px var(--c), var(--glow-pink);
  animation: winnerPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.choice--dont.is-winner { box-shadow: 0 0 0 2px var(--c), var(--glow-green); }
.choice.is-winner .choice__text { text-shadow: 0 0 20px var(--c), 0 0 60px var(--c); }

@keyframes winnerPop {
  0% { transform: scale(0.72); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1.06); }
}

.choice.is-loser {
  opacity: 0.16;
  transform: scale(0.9);
  border-color: transparent;
  filter: saturate(0.3);
}
.choice.is-loser .choice__text { text-decoration: line-through; text-decoration-color: rgba(255,255,255,0.4); }

/* --- button --- */
.btn {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 5vw, 1.35rem);
  letter-spacing: 0.08em;
  color: #16100f;
  background: linear-gradient(180deg, var(--yellow), #ffc72e);
  border: none;
  border-radius: var(--radius-sm);
  padding: 16px 34px;
  cursor: pointer;
  width: 100%;
  max-width: 320px;
  box-shadow: 0 8px 0 #b98310, 0 16px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.06s ease, box-shadow 0.06s ease, filter 0.15s ease;
  position: relative;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(5px); box-shadow: 0 3px 0 #b98310, 0 8px 16px rgba(0, 0, 0, 0.35); }
.btn:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }
.btn:disabled { cursor: wait; filter: saturate(0.6) brightness(0.9); }

.btn--ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  font-size: clamp(0.9rem, 4vw, 1.05rem);
  padding: 13px 20px;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.btn--ghost:active { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.btn--ghost:hover { filter: brightness(1.2); }

/* --- post-result actions --- */
.actions {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.actions .btn { flex: 1 1 auto; min-width: 104px; }

.verdict {
  min-height: 1.6em;
  margin: 16px 0 0;
  color: var(--text);
  font-size: clamp(0.95rem, 3.6vw, 1.1rem);
  font-weight: 600;
  text-align: center;
}
.roast {
  min-height: 1.4em;
  margin: 5px auto 0;
  max-width: 42ch;
  color: var(--muted);
  font-size: clamp(0.85rem, 3.2vw, 1rem);
  font-style: italic;
  text-align: center;
}
.confidence {
  min-height: 1em;
  margin: 10px 0 0;
  color: var(--yellow);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
}

.recent {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 14px;
  min-height: 0;
}
.recent__chip {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  opacity: 0.75;
}
.recent__chip--jerk { color: var(--pink); border: 1px solid rgba(255, 46, 136, 0.4); background: rgba(255, 46, 136, 0.08); }
.recent__chip--dont { color: var(--green); border: 1px solid rgba(43, 255, 136, 0.4); background: rgba(43, 255, 136, 0.08); }
.recent__chip--rare { color: var(--yellow); border: 1px solid rgba(255, 225, 77, 0.5); background: rgba(255, 225, 77, 0.08); }

/* --- wildcard (rare easter-egg result) --- */
.wildcard {
  --c: var(--yellow);
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: clamp(24px, 6vw, 38px) 12px;
  margin-bottom: 22px;
  border: 2px solid var(--c);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--c) 9%, transparent);
  box-shadow: 0 0 0 1px var(--c), 0 0 34px color-mix(in srgb, var(--c) 32%, transparent);
  animation: wildcardPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.wildcard__badge {
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: var(--c);
  border: 1px solid var(--c);
  padding: 3px 12px;
  border-radius: 999px;
}
.wildcard__text {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 9vw, 2.6rem);
  line-height: 1.05;
  text-align: center;
  color: var(--c);
  text-shadow: 0 0 18px var(--c), 0 0 46px var(--c);
}
@keyframes wildcardPop {
  0% { transform: scale(0.6) rotate(-3deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* --- footer --- */
.foot {
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.fineprint {
  margin: 0;
  max-width: 46ch;
  text-align: center;
  color: var(--dim);
  font-size: 0.72rem;
  line-height: 1.5;
}

.credit {
  margin: 0;
  color: var(--dim);
  font-size: 0.66rem;
  letter-spacing: 0.02em;
}
.credit__id {
  color: var(--muted);
  font-weight: 600;
}

/* --- toast --- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 20px);
  background: rgba(20, 17, 40, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 10;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* --- confetti particles --- */
.particle {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 5;
  animation: burst var(--dur, 0.9s) cubic-bezier(0.16, 0.84, 0.44, 1) forwards;
}
@keyframes burst {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
  100% {
    transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.4);
    opacity: 0;
  }
}

/* --- reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  .orb,
  .orb[data-face="dizzy"] { animation: none; }
  .logo__glitch { animation: none; }
  .choice.is-hot { animation: none; }
  .status.is-hot { animation: none; }
  .orb[data-face="idle"] .eyelid { animation: none; }
  .orb[data-face="dizzy"] .pupil { animation: none; }
  .btn, .choice { transition-duration: 0.01s; }
  .wildcard { animation: none; }
}

/* --- small screens --- */
@media (max-width: 380px) {
  .machine { padding: 18px 12px 20px; }
  .choice__text { font-size: 1.35rem; }
  .actions { flex-direction: column; }
}
