/* Vendor Portal Wizard: a just-for-fun scene. The characters themselves are styled by ../toons.css. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #1a1033;
  color: #f4f1ea;
  font: 16px/1.45 "Comic Sans MS", "Chalkboard SE", system-ui, sans-serif;
  overflow-x: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 16px 0;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 27% 42%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 44% 12%, #fff6c9 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 63% 30%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 78% 10%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90% 36%, #fff6c9 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 58%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 55% 55%, #fff 50%, transparent 51%),
    radial-gradient(ellipse at 50% 0%, #3b2370 0%, #1a1033 60%);
}

.top { width: 100%; max-width: 1240px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.top h1 { margin: 0; font-size: 28px; letter-spacing: .04em; color: #f2c230; text-shadow: 3px 3px 0 #000; }
.top h1 span { font-size: 15px; color: #d9cdf5; letter-spacing: .02em; text-shadow: none; margin-left: 6px; }
.back { color: #d9cdf5; font-size: 14px; }

.summon {
  margin-top: 18px;
  font: inherit; font-size: 22px; font-weight: 800;
  padding: 14px 28px; border-radius: 999px; cursor: pointer;
  color: #1b1b1b; background: #f2c230; border: 3px solid #000; box-shadow: 5px 5px 0 #000;
  transition: transform .08s ease;
}
.summon:hover { transform: translate(-1px, -1px); }
.summon:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 #000; }
.summon:disabled { opacity: .6; cursor: progress; transform: none; }
.summon:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* ---------- the ground everyone stands on ---------- */
.floor {
  margin-top: auto;
  width: 100%;
  max-width: 1240px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 8px 28px;
  padding: 150px 0 18px; /* headroom for the speech bubble */
  position: relative;
}
.stage::after { /* floor band */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46px;
  background: linear-gradient(#2b1b52, #140c27); border-top: 3px solid #000; z-index: 0;
}
.cast, .portal-wrap { position: relative; z-index: 1; display: flex; align-items: flex-end; }
.boys { gap: 8px; }
.vendors { gap: 10px; min-height: 10px; }
.actor { position: relative; width: clamp(84px, 14vw, 190px); }
.vendor { width: clamp(72px, 11vw, 150px); visibility: hidden; }
.vendor.here { visibility: visible; }
.tag {
  position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); white-space: nowrap;
  font-size: 12px; font-weight: 800; padding: 1px 8px; border-radius: 999px;
  background: #f4f1ea; color: #1b1b1b; border: 2px solid #000;
}

/* ---------- the portal ---------- */
.portal-wrap { width: clamp(150px, 20vw, 280px); flex-direction: column; align-items: center; }
.sign { width: 112%; margin-bottom: -6px; opacity: 0; transform: translateY(-14px) scale(.9); transition: opacity .4s ease .35s, transform .5s cubic-bezier(.34, 1.56, .64, 1) .35s; }
.portal {
  position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: 50%; overflow: hidden;
  border: 4px solid #000; box-shadow: 0 0 36px 10px rgba(160, 100, 255, .65), inset 0 0 30px rgba(0, 0, 0, .6);
  transform: scale(0); transition: transform .75s cubic-bezier(.34, 1.56, .64, 1);
}
.swirl {
  position: absolute; inset: -30%;
  background: conic-gradient(from 0deg, #7b2ff7, #1fd1f9, #b621fe, #f2c230, #7b2ff7, #1fd1f9, #7b2ff7);
  animation: spin 2.2s linear infinite;
}
.core {
  position: absolute; inset: 14%; border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #e9ddff 18%, #8a5cf6 45%, rgba(40, 10, 90, .9) 72%, transparent 74%);
  animation: pulse 1.4s ease-in-out infinite;
}
.open .portal { transform: scale(1); }
.open .sign { opacity: 1; transform: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { transform: scale(1.08); } }

/* ---------- speech bubble (positioned over the speaker by vpw.js) ---------- */
.bubble {
  position: absolute; z-index: 5; width: min(320px, calc(100% - 24px));
  background: #fffdf5; color: #1b1b1b; border: 3px solid #000; border-radius: 18px;
  padding: 10px 14px 8px; box-shadow: 4px 4px 0 #000; font-size: 15px;
}
.bubble::after {
  content: ""; position: absolute; bottom: -24px; left: var(--tail, 40px);
  border: 10px solid transparent; border-top: 14px solid #000;
}
.bubble .who { font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: #c8102e; }
.bubble p { margin: 2px 0 4px; min-height: 1.4em; }

/* ---------- Cope-y's sparkles ---------- */
.sparkles { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.sparkles span {
  position: absolute; font-size: 22px; animation: fly 1s ease-in forwards;
  text-shadow: 0 0 8px #f2c230;
}
@keyframes fly { to { transform: translate(var(--dx), var(--dy)) rotate(260deg) scale(.4); opacity: 0; } }

@media (max-width: 720px) {
  .top h1 { font-size: 22px; }
  .top h1 span { display: block; margin: 0; }
  .summon { font-size: 18px; padding: 12px 22px; }
  .portal-wrap { order: 2; }
  .vendors { order: 3; width: 100%; justify-content: center; padding-top: 28px; }
  .floor { padding-top: 160px; }
}

@media (prefers-reduced-motion: reduce) {
  .swirl, .core, .sparkles span { animation: none; }
  .portal, .sign { transition: none; }
}
