
/* ==========================================
   JOY!'S WORLD — INTERACTIVE EXTRAS
   Hotline • Vending • Easter Eggs • Sounds
   ========================================== */

:root {
  --jx-pink: #ff43b5;
  --jx-hot: #f60091;
  --jx-baby: #ffe1f3;
  --jx-wine: #48002f;
  --jx-dark: #200018;
  --jx-chrome: linear-gradient(
    135deg,
    #fff 0%,
    #ffd3ed 14%,
    #a49aa7 28%,
    #fff 43%,
    #d9b4cf 61%,
    #fff 79%,
    #9d8496 100%
  );
}

#joy-extras-root,
#joy-extras-root * {
  box-sizing: border-box;
}

#joy-extras-root {
  font-family: "Trebuchet MS", Arial, sans-serif;
  color: white;
}

/* FLOATING FEATURE DOCK */

.jx-dock {
  position: fixed;
  right: 17px;
  bottom: 17px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.jx-dock-button {
  position: relative;
  border: 2px solid #fff3fb;
  border-radius: 999px;
  min-height: 48px;
  padding: 11px 17px;
  background: linear-gradient(
    145deg,
    #fff2fa,
    #ff70c4 30%,
    #eb0088 73%,
    #87004e
  );
  color: #fff;
  font: 900 12px "Trebuchet MS", sans-serif;
  letter-spacing: .07em;
  text-shadow: 0 1px 3px #5b003b;
  box-shadow:
    inset 0 2px 4px #fff9,
    0 5px 0 #780049,
    0 7px 24px #ff169b88;
  cursor: pointer;
  transition: transform .2s, filter .2s;
}

.jx-dock-button:hover {
  transform: translateY(-3px) rotate(-2deg);
  filter: brightness(1.12);
}

.jx-dock-button:focus-visible,
.jx-close:focus-visible,
.jx-option:focus-visible,
.jx-vend-button:focus-visible,
.jx-phone-key:focus-visible {
  outline: 3px solid white;
  outline-offset: 3px;
}

/* MODAL OVERLAY */

.jx-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(18, 0, 18, .83);
  backdrop-filter: blur(9px);
}

.jx-overlay.is-open {
  display: flex;
}

.jx-window {
  position: relative;
  width: min(100%, 470px);
  max-height: min(90dvh, 850px);
  overflow-y: auto;
  border: 3px solid #fff0fa;
  border-radius: 28px;
  padding: 22px;
  background:
    radial-gradient(
      circle at 30% 0%,
      #ff91d9,
      transparent 45%
    ),
    linear-gradient(
      145deg,
      #ff47b5,
      #9e005b 56%,
      #3c002b
    );
  box-shadow:
    0 0 0 5px #ff62c54a,
    0 0 55px #ff1caa88,
    inset 0 0 28px #ffffff30;
  animation: jx-pop .3s ease-out;
}

.jx-window::before {
  content: "✦ ✧ ✦ ✧ ✦";
  position: absolute;
  top: 9px;
  left: 18px;
  color: #fff5b5;
  font-size: 12px;
  letter-spacing: 8px;
}

.jx-close {
  position: absolute;
  top: 12px;
  right: 13px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 2px solid white;
  border-radius: 50%;
  background: #64003f;
  color: white;
  font-size: 20px;
  cursor: pointer;
}

.jx-title {
  margin: 24px 0 5px;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: clamp(25px, 7vw, 34px);
  font-weight: 900;
  text-align: center;
  text-shadow:
    2px 3px 0 #760049,
    0 0 18px #fff9;
}

.jx-subtitle {
  margin: 0 0 18px;
  text-align: center;
  color: #ffe0f2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}

.jx-panel {
  border: 2px solid #ffc8e9;
  border-radius: 16px;
  padding: 14px;
  background: #390027b8;
  box-shadow: inset 0 0 16px #ff5db529;
}

.jx-option {
  display: block;
  width: 100%;
  margin: 9px 0;
  border: 2px solid #fff;
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(#ffb9e3, #ff45ac);
  color: #5c0038;
  font: 900 13px "Trebuchet MS", sans-serif;
  text-align: left;
  cursor: pointer;
}

.jx-option:hover {
  background: #fff0f9;
}

.jx-message {
  min-height: 58px;
  margin: 12px 0;
  border: 1px dashed #ffc3e8;
  border-radius: 12px;
  padding: 12px;
  background: #21001988;
  color: #fff3fa;
  font-size: 14px;
  line-height: 1.6;
  text-align: center;
}

.jx-small {
  color: #ffe1f1;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
}

/* FLIP PHONE */

.jx-phone {
  width: min(100%, 265px);
  margin: 0 auto 16px;
  filter: drop-shadow(0 12px 15px #260019a8);
}

.jx-phone-top,
.jx-phone-bottom {
  border: 5px solid #f9d9ee;
  background: linear-gradient(
    125deg,
    #fff3fc,
    #ff69c2 20%,
    #ec008a 65%,
    #8e0055
  );
  box-shadow:
    inset 3px 3px 7px #fff8,
    inset -4px -4px 8px #580038;
}

.jx-phone-top {
  border-radius: 28px 28px 13px 13px;
  padding: 20px 14px 12px;
  transform-origin: bottom center;
  animation: jx-flip .55s ease-out both;
}

.jx-phone-screen {
  min-height: 116px;
  border: 7px solid #65003c;
  border-radius: 12px;
  padding: 13px 8px;
  background: linear-gradient(
    145deg,
    #ffc2e8,
    #ff7dc9,
    #c90077
  );
  color: #530035;
  text-align: center;
  box-shadow: inset 0 0 12px #fff8;
}

.jx-phone-screen strong {
  display: block;
  margin-bottom: 10px;
  font-size: 19px;
}

.jx-phone-screen span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .1em;
}

.jx-hinge {
  height: 13px;
  margin: 0 12px;
  border-radius: 8px;
  background: var(--jx-chrome);
}

.jx-phone-bottom {
  border-radius: 12px 12px 32px 32px;
  padding: 18px 14px 22px;
}

.jx-phone-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.jx-phone-key {
  border: 2px solid #fff;
  border-radius: 50%;
  aspect-ratio: 1.35;
  background: var(--jx-chrome);
  color: #7a004d;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 #a60068;
}

.jx-phone-key:active {
  transform: translateY(3px);
  box-shadow: none;
}

/* VENDING MACHINE */

.jx-machine {
  width: min(100%, 330px);
  margin: 0 auto;
  border: 8px solid #ffbfe7;
  border-radius: 23px 23px 13px 13px;
  padding: 12px;
  background:
    repeating-linear-gradient(
      135deg,
      transparent 0 18px,
      #ffffff0e 18px 22px
    ),
    linear-gradient(
      110deg,
      #fff0f8,
      #ff4db4 15%,
      #ee008e 55%,
      #770047
    );
  box-shadow:
    inset 5px 5px 10px #fff8,
    inset -5px -5px 10px #56002e,
    0 10px 0 #65003d,
    0 15px 30px #26001d;
}

.jx-machine-header {
  margin-bottom: 10px;
  border: 3px solid white;
  border-radius: 9px;
  padding: 8px 5px;
  background: #710044;
  color: #fff4bc;
  font: 900 16px Georgia, serif;
  text-align: center;
  text-shadow: 0 0 10px #ff8ad5;
}

.jx-machine-glass {
  position: relative;
  overflow: hidden;
  border: 7px solid #ded2df;
  border-radius: 10px;
  padding: 12px 8px;
  background:
    linear-gradient(
      110deg,
      #ffffff4d 0%,
      transparent 28%,
      #ffffff24 42%,
      transparent 53%
    ),
    linear-gradient(#350024, #7d004a);
  box-shadow: inset 0 0 18px #0009;
}

.jx-shelf {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 5px solid #d5b9cc;
  text-align: center;
}

.jx-product {
  font-size: 29px;
  filter: drop-shadow(0 3px 3px #0007);
}

.jx-machine-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 15px 0;
}

.jx-vend-button {
  border: 3px solid white;
  border-radius: 50%;
  width: 76px;
  height: 76px;
  background:
    radial-gradient(circle at 30% 20%, #fff, #ff88d0 25%, #e40084 75%);
  color: white;
  font-size: 13px;
  font-weight: 900;
  text-shadow: 0 2px 3px #80004b;
  box-shadow: 0 5px 0 #77004c;
  cursor: pointer;
}

.jx-vend-button:disabled {
  opacity: .65;
  cursor: wait;
}

.jx-vend-button:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 1px 0 #77004c;
}

.jx-machine-tray {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  border: 6px solid #d6c1d0;
  border-radius: 8px;
  background: #24001c;
  box-shadow: inset 0 6px 12px #000a;
  font-size: 35px;
}

.jx-machine.is-vending {
  animation: jx-shake .12s linear 5;
}

.jx-capsule-drop {
  animation: jx-drop .6s cubic-bezier(.2, .8, .4, 1.3);
}

.jx-collection {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.jx-charm {
  min-height: 67px;
  border: 1px solid #ffbde4;
  border-radius: 12px;
  padding: 7px 3px;
  background: #2b001f88;
  text-align: center;
}

.jx-charm-icon {
  display: block;
  font-size: 24px;
}

.jx-charm-name {
  display: block;
  margin-top: 4px;
  font-size: 9px;
  line-height: 1.3;
}

.jx-charm.locked {
  opacity: .42;
  filter: grayscale(1);
}

.jx-rare {
  color: #fff2a0;
}

/* EASTER EGG TOAST */

.jx-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 11000;
  width: min(90vw, 360px);
  border: 2px solid white;
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(135deg, #ff68c5, #740047);
  color: white;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 0 30px #ff39b9a0;
  transform: translateX(-50%);
  animation: jx-pop .3s ease-out;
}

.jx-secret-star {
  position: fixed;
  z-index: 8000;
  left: 12px;
  bottom: 18px;
  border: 0;
  padding: 8px;
  background: transparent;
  color: #ffb5df;
  font-size: 26px;
  opacity: .55;
  cursor: pointer;
  filter: drop-shadow(0 0 6px #ff4bb6);
}

.jx-secret-star:hover {
  opacity: 1;
  transform: rotate(20deg) scale(1.2);
}

/* ANIMATIONS */

@keyframes jx-pop {
  from {
    opacity: 0;
    transform: scale(.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes jx-flip {
  from {
    transform: rotateX(-65deg);
    opacity: .5;
  }
  to {
    transform: rotateX(0);
    opacity: 1;
  }
}

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

@keyframes jx-drop {
  from {
    opacity: 0;
    transform: translateY(-80px) rotate(-60deg);
  }
  75% {
    opacity: 1;
    transform: translateY(8px) rotate(10deg);
  }
  to {
    transform: translateY(0) rotate(0);
  }
}

/* MOBILE */

@media (max-width: 600px) {
  .jx-dock {
    right: 9px;
    bottom: 10px;
    gap: 7px;
  }

  .jx-dock-button {
    min-height: 42px;
    padding: 9px 12px;
    font-size: 10px;
  }

  .jx-window {
    padding: 16px;
    border-radius: 20px;
  }

  .jx-product {
    font-size: 25px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #joy-extras-root *,
  #joy-extras-root *::before,
  #joy-extras-root *::after {
    animation: none !important;
    transition: none !important;
  }
}
