/* Psycho Friends Network add-ons: reading generator, spice test, touch-tone phone,
   hold music, crystal ball, testimonials, awards, commercial break, billing meter, disclaimers.
   Builds on the tokens in index.html; two extra tokens for the phone. */
:root {
  --lcd: #B8C9A3;
  --lcd-ink: #1F2A17;
  --go: #1E7A3C;
  --shadow: rgba(0, 0, 0, 0.35);
}

/* Shared */
.dark-panel { background: var(--night); color: var(--white); }
.dark-panel .wrap { padding-block: 56px; }
.kicker.on-dark { color: var(--yellow); }
.dk-h { font-family: var(--display); font-weight: 400; font-size: clamp(44px, 8vw, 84px); line-height: 1.02; text-transform: uppercase; margin-top: 6px; color: var(--white); text-wrap: balance; }
.lede.on-dark { color: var(--lav-ink); }
.hint { margin-top: 14px; font-family: var(--vcr); font-size: 24px; line-height: 1.2; color: var(--yellow); }
.big-btn { appearance: none; border: 0; cursor: pointer; min-height: 52px; padding: 10px 24px; background: var(--yellow); color: var(--night); font-family: var(--display); font-size: 24px; letter-spacing: 0.04em; text-transform: uppercase; align-self: flex-start; }
.big-btn:hover { background: var(--white); }
.ghost-btn { appearance: none; cursor: pointer; min-height: 44px; padding: 8px 16px; background: transparent; color: inherit; border: 2px solid currentColor; font: 700 16px var(--body); letter-spacing: 0.06em; text-transform: uppercase; }
.ghost-btn:hover { background: rgba(255, 255, 255, 0.12); }
.ghost-btn[hidden] { display: none; }
.big-btn:focus-visible, .ghost-btn:focus-visible, .key:focus-visible, .call-btn:focus-visible, .hang-btn:focus-visible,
.hotline:focus-visible, .ball-btn:focus-visible, .toast button:focus-visible, #spiceRange:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }

/* Testimonial lower third */
.lowerthird { background: var(--magenta); color: var(--white); overflow: hidden; }
.lt-inner { display: flex; align-items: center; gap: 16px; padding-block: 12px; min-height: 68px; }
.lt-tag { flex: none; display: flex; align-items: center; gap: 8px; background: var(--white); color: var(--magenta); font-family: var(--display); font-size: 18px; letter-spacing: 0.08em; padding: 4px 10px; }
.lt-tag b { width: 10px; height: 10px; border-radius: 50%; background: var(--magenta); animation: blink 0.8s steps(1) infinite; }
.lt-quote { min-width: 0; font-size: 20px; font-weight: 700; line-height: 1.3; }
.lt-quote strong { font-family: var(--display); font-weight: 400; letter-spacing: 0.04em; margin-right: 8px; }
.lt-quote.swap { animation: ltin 0.5s ease-out; }

/* Reading generator */
.fortune-form { display: flex; flex-direction: column; gap: 8px; margin-top: 22px; max-width: 420px; }
.fortune-form label, .ball-dlg label { font-size: 14px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.fortune-form input, .ball-dlg input { min-height: 48px; padding: 10px 14px; border: 3px solid var(--lav-ink); border-radius: 0; background: var(--night-2); color: var(--white); font: 500 20px var(--body); color-scheme: dark; }
.fortune-form input::placeholder, .ball-dlg input::placeholder { color: var(--lav-ink); }
.fortune-form input:focus-visible, .ball-dlg input:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-color: var(--yellow); }
.fortune-form input + label { margin-top: 8px; }
.fortune-form .big-btn { margin-top: 14px; }
.form-err { color: var(--yellow); font-weight: 700; font-size: 18px; }
.form-err[hidden] { display: none; }
.mini-tv { position: relative; aspect-ratio: 4 / 3; max-width: 100%; border: 6px solid var(--white); border-radius: 22px; background: var(--night-2); overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 36px 28px 28px; box-shadow: inset 0 0 60px rgba(108, 75, 216, 0.6); }
.mini-tv::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, rgba(27, 15, 59, 0) 0 3px, rgba(27, 15, 59, 0.25) 3px 4px); }
.mini-tv.tuning .static { opacity: 1; }
.mini-osd { position: absolute; left: 16px; top: 12px; font-family: var(--vcr); font-size: 24px; color: var(--white); }
.mini-tv.speaking .mini-osd::after { content: " \00B7  ON AIR"; color: var(--yellow); animation: blink 1s steps(1) infinite; }
.fortune { position: relative; z-index: 1; font-family: var(--vcr); font-size: clamp(24px, 3vw, 32px); line-height: 1.15; text-align: center; color: var(--white); text-wrap: balance; }
.fortune b { display: block; margin-bottom: 10px; color: var(--yellow); font-weight: 400; }
.tab-row { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; justify-content: space-between; margin-top: 16px; }
.tab { font-family: var(--vcr); font-size: 24px; line-height: 1.2; color: var(--yellow); font-variant-numeric: tabular-nums; }

/* Spice test */
.spice { margin-top: 26px; max-width: 720px; display: flex; flex-direction: column; gap: 10px; }
.spice-lbl { font-size: 14px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.spice-lbl strong { margin-left: 6px; color: var(--magenta); font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: 0.04em; }
#spiceRange { width: 100%; height: 44px; accent-color: var(--magenta); cursor: pointer; }
.spice-scale { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.drops { display: flex; gap: 10px; min-height: 44px; align-items: flex-end; }
.drops svg { width: 26px; height: 38px; animation: drip 1.1s ease-in infinite; }
.drops svg:nth-child(2) { animation-delay: -0.25s; }
.drops svg:nth-child(3) { animation-delay: -0.5s; }
.drops svg:nth-child(4) { animation-delay: -0.75s; }
.drops svg:nth-child(5) { animation-delay: -0.95s; }
.spice-say { font-size: 22px; font-weight: 700; line-height: 1.35; }
.spice.hot .spice-say { color: var(--magenta); }
.spice.max { animation: shake 0.22s linear infinite; }

/* Hotline box becomes a button */
button.hotline { appearance: none; border: 0; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--night); display: block; }
button.hotline:hover { background: var(--white); }
.hotline .lbl, .hotline .num { display: block; }
.hotline .tap { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 14px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

/* Touch-tone phone */
.phone { max-width: 340px; margin-inline: auto; background: var(--lav-2); color: var(--night); border: 6px solid var(--white); border-radius: 28px; padding: 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: 0 14px 0 var(--night-2); }
.phone-screen { background: var(--lcd); color: var(--lcd-ink); border-radius: 8px; padding: 10px 14px; min-height: 132px; font-family: var(--vcr); display: flex; flex-direction: column; gap: 4px; box-shadow: inset 0 2px 8px var(--shadow); }
.phone-status { font-size: 18px; letter-spacing: 0.08em; }
.phone-num { font-size: 34px; line-height: 1; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.phone-cap { font-size: 20px; line-height: 1.1; }
.phone.ringing .phone-screen { animation: ring 0.14s linear infinite; }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.key { appearance: none; border: 0; cursor: pointer; min-height: 60px; border-radius: 12px; background: var(--white); color: var(--night); box-shadow: 0 4px 0 var(--night-2); display: flex; flex-direction: column; align-items: center; justify-content: center; transition: transform 0.06s; }
.key b { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1; }
.key small { min-height: 13px; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; }
.key:active, .key.pressed { transform: translateY(3px); box-shadow: 0 1px 0 var(--night-2); background: var(--yellow); }
.phone-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.call-btn, .hang-btn { appearance: none; border: 0; cursor: pointer; min-height: 52px; border-radius: 999px; font-family: var(--display); font-size: 22px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--white); }
.call-btn { background: var(--go); }
.call-btn:disabled { opacity: 0.55; cursor: default; }
.hang-btn { background: var(--magenta); }

/* Crystal ball hotspot + dialog */
.ball-btn { position: absolute; z-index: 2; aspect-ratio: 1; border-radius: 50%; border: 0; padding: 0; background: transparent; cursor: pointer; }
.ball-btn span { position: absolute; left: 50%; top: -8px; transform: translate(-50%, -100%); white-space: nowrap; padding: 3px 8px; background: var(--magenta); color: var(--white); font-family: var(--vcr); font-size: 18px; line-height: 1; animation: bob 1.4s ease-in-out infinite alternate; }
.ball-btn:hover span { background: var(--yellow); color: var(--night); }
.tv.talking .ball-btn span, .tv.tuning .ball-btn span { display: none; }
.ball-dlg { border: 6px solid var(--white); border-radius: 18px; background: var(--night); color: var(--white); padding: 28px; width: min(92vw, 460px); }
.ball-dlg::backdrop { background: rgba(27, 15, 59, 0.82); }
.ball-dlg form { display: flex; flex-direction: column; gap: 10px; }
.ball-dlg h2 { font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1.05; text-transform: uppercase; }
.ball-orb { align-self: center; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #F4EEFF 0%, #B9A6FF 25%, #6C4BD8 60%, #2E1A66 100%); box-shadow: 0 0 40px rgba(185, 166, 255, 0.7); animation: pulse 2.4s ease-in-out infinite alternate; }
.ball-orb.thinking { animation: swirl 0.35s linear infinite; }
.ball-a { min-height: 2.4em; font-family: var(--vcr); font-size: 28px; line-height: 1.1; color: var(--yellow); text-align: center; }
.ball-a.reveal { animation: ltin 0.6s ease-out; }
.ball-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Awards */
.seals { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 24px; margin-top: 28px; justify-items: center; }
.seal { position: relative; width: 196px; max-width: 100%; aspect-ratio: 1; border-radius: 50%; background: var(--yellow); color: var(--night); display: flex; align-items: center; justify-content: center; padding: 22px; transition: transform 0.3s; }
.seal::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 3px dashed var(--night); animation: spin 18s linear infinite; }
.seal.alt { background: var(--magenta); color: var(--white); }
.seal.alt::before { border-color: var(--white); }
.seal:hover { transform: rotate(-8deg) scale(1.04); }
.seal-in { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.seal-in b { font-family: var(--display); font-weight: 400; font-size: 40px; line-height: 1; }
.seal-in span { font-size: 15px; font-weight: 700; line-height: 1.2; letter-spacing: 0.04em; text-transform: uppercase; }
.seal-in small { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

/* Hold overlay */
.hold { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(27, 15, 59, 0.94); padding-block: 24px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.hold[hidden] { display: none; }
.hold-card { max-width: 540px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.hold-card h2 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 6vw, 54px); line-height: 1.05; text-transform: uppercase; text-wrap: balance; }
.hold-wait { font-family: var(--vcr); font-size: 30px; line-height: 1.15; color: var(--yellow); }
.hold-sub { font-size: 18px; color: var(--lav-ink); }
.hold .big-btn { align-self: center; background: var(--magenta); color: var(--white); }
.hold .big-btn:hover { background: var(--white); color: var(--night); }
.hold-eq { display: flex; align-items: flex-end; gap: 6px; height: 48px; }
.hold-eq i { width: 10px; height: 10px; background: var(--yellow); animation: eqb 0.8s ease-in-out infinite alternate; }
.hold-eq i:nth-child(2) { animation-delay: -0.2s; }
.hold-eq i:nth-child(3) { animation-delay: -0.5s; }
.hold-eq i:nth-child(4) { animation-delay: -0.1s; }
.hold-eq i:nth-child(5) { animation-delay: -0.65s; }

/* Commercial break */
.bars { position: fixed; inset: 0; z-index: 55; display: flex; flex-direction: column; background: var(--night); cursor: pointer; }
.bars[hidden] { display: none; }
.bars-row { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.bars-row i:nth-child(1) { background: #C0C0C0; }
.bars-row i:nth-child(2) { background: #C0C000; }
.bars-row i:nth-child(3) { background: #00C0C0; }
.bars-row i:nth-child(4) { background: #00C000; }
.bars-row i:nth-child(5) { background: #C000C0; }
.bars-row i:nth-child(6) { background: #C00000; }
.bars-row i:nth-child(7) { background: #0000C0; }
.bars-text { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(90vw, 640px); padding: 20px 28px; background: var(--night); color: var(--white); text-align: center; }
.bars-text b { display: block; font-family: var(--display); font-weight: 400; font-size: clamp(36px, 7vw, 64px); line-height: 1.05; text-transform: uppercase; }
.bars-text span { display: block; margin-top: 6px; font-family: var(--vcr); font-size: 22px; line-height: 1.15; }

/* Billing meter */
.meter { position: fixed; right: calc(12px + env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 40; max-width: calc(100vw - 24px); padding: 8px 12px; background: var(--night); color: var(--white); border: 3px solid var(--yellow); font-family: var(--vcr); font-size: 18px; line-height: 1.15; box-shadow: 0 6px 0 var(--shadow); }
.m-top { display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.m-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--magenta); animation: blink 1s steps(1) infinite; }
.m-charge { font-variant-numeric: tabular-nums; }
.m-charge em { font-style: normal; color: var(--lav-ink); }
.m-msg { color: var(--yellow); }
.m-msg[hidden] { display: none; }
.meter.late { background: var(--magenta); border-color: var(--white); animation: flash 0.9s steps(1) infinite; }
.meter.late .m-dot { background: var(--white); }
.meter.late .m-charge em, .meter.late .m-msg { color: var(--white); }

/* Disclaimer toasts */
.toasts { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 45; width: min(92vw, 520px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 10px 8px 10px 14px; background: var(--white); color: var(--night); border: 3px solid var(--night); font-size: 16px; font-weight: 500; line-height: 1.35; box-shadow: 0 8px 24px var(--shadow); animation: toastin 0.3s ease-out; }
.toast > div { flex: 1; min-width: 0; }
.toast b { display: block; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--magenta); }
.toast button { flex: none; appearance: none; border: 0; background: transparent; cursor: pointer; width: 40px; height: 40px; font-size: 24px; line-height: 1; color: var(--night); }

@keyframes ltin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes drip { 0% { transform: translateY(-6px); opacity: 0.4; } 60% { opacity: 1; } 100% { transform: translateY(6px); opacity: 0.2; } }
@keyframes shake { 0% { translate: 0 0; } 25% { translate: -2px 1px; } 50% { translate: 2px -1px; } 75% { translate: -1px -1px; } 100% { translate: 1px 1px; } }
@keyframes ring { 0% { translate: 0 0; } 50% { translate: 2px 0; } 100% { translate: -2px 0; } }
@keyframes eqb { from { height: 8px; } to { height: 48px; } }
@keyframes flash { 0%, 55% { filter: none; } 56%, 100% { filter: brightness(1.35); } }
@keyframes toastin { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes swirl { from { transform: rotate(0deg) scale(1.04); filter: hue-rotate(0deg); } to { transform: rotate(360deg) scale(1.04); filter: hue-rotate(90deg); } }
@keyframes bob { from { translate: 0 0; } to { translate: 0 -4px; } }

/* "Only $0.00" starburst sits beside the TV, not on it, wherever there is room */
@media (min-width: 700px) {
  .tv-col { flex: 1 1 500px; max-width: 610px; display: flex; align-items: flex-end; gap: 16px; }
  .tv-col .tv { flex: 1 1 auto; min-width: 0; max-width: 440px; }
  .tv-col > .burst { position: relative; right: auto; bottom: auto; flex: none; margin-bottom: 40px; }
}
@media (min-width: 1060px) {
  .tv-col { max-width: 570px; }
}

@media (max-width: 560px) {
  .meter { font-size: 15px; padding: 6px 9px; }
  .lt-inner { flex-wrap: wrap; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .spice.max, .phone.ringing .phone-screen, .meter.late { animation: none !important; }
}
