/* ---------- sponsor us: an arcade cabinet ("Player 2 wanted") whose Start button emails us ---------- */
/* sizes follow the section's width (cqi), so the cabinet fits however wide the section is */
#sponsor {
  container: sponsor / inline-size;
}

/* the cabinet: purple, a hard shadow by day, none at night */
.sp-cab {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(12px, 2.2cqi, 22px);
  background: var(--purple);
  color: var(--on-purple);
  border: 3px solid #1a1714;
  border-radius: 24px;
  box-shadow: 8px 8px 0 #1a1714;
}
[data-mode="night"] .sp-cab {
  border-color: var(--purple);
  box-shadow: none;
}

/* the screen stays dark in both modes, with faint scanlines */
.sp-screen {
  position: relative;
  overflow: hidden;
  display: grid;
  /* minmax(0, ...): a plain 1fr column can't get narrower than its widest line, which pushed the console (and the
     whole page) wider than a phone zoomed to 200%. With the wrapping below, the lines fold instead. */
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(14px, 2cqi, 22px);
  justify-items: center;
  padding: clamp(18px, 4.5cqi, 52px) clamp(14px, 4cqi, 48px);
  background: #14171b;
  color: #f0ebff;
  text-align: center;
  border: 3px solid #1a1714;
  border-radius: 16px;
  box-shadow: inset 0 0 0 2px rgba(240, 235, 255, 0.08);
}
.sp-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(240, 235, 255, 0.05) 0 1px, transparent 1px 3px);
}
.sp-hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sp-credit {
  color: #35e08b;
}
.sp-insert {
  color: #ff5b52;
}
.sp-blink {
  animation: sp-blink 1s steps(1) infinite;
}
@keyframes sp-blink {
  50% {
    opacity: 0;
  }
}
.sp-kick {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  color: #ffd731;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.sp-kick svg {
  width: 18px;
  height: 18px;
  shape-rendering: crispEdges;
}
/* bold, part of the arcade screen */
.sp-title {
  font: 700 clamp(2.4rem, 0.6rem + 8cqi, 6rem) / 0.95 var(--font-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #ffd731;
  text-shadow: 0.06em 0.06em 0 #ff5b52;
}
.sp-copy {
  max-width: 40ch;
  color: #d9d1f5;
  font-size: clamp(1rem, 0.9rem + 0.4cqi, 1.2rem);
  line-height: 1.5;
  text-wrap: pretty;
}

/* player slots, with pixel borders drawn by four hard shadows. Side by side while each slot has room for the badge
   and a whole word (7.5em, so it follows the text size); on very narrow phones they stack instead of splitting words */
.sp-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5em), 1fr));
  gap: clamp(14px, 2.4cqi, 28px);
  width: 100%;
  max-width: 560px;
  padding: 3px;
}
.sp-slot {
  --sc: #35e08b;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  text-align: left;
  box-shadow:
    0 -3px 0 0 var(--sc),
    0 3px 0 0 var(--sc),
    -3px 0 0 0 var(--sc),
    3px 0 0 0 var(--sc);
}
.sp-slot.is-p2 {
  --sc: #ff5b52;
}
.sp-badge {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  background: var(--sc);
  color: #0b0717;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
/* the name and status: a flex item only shrinks below its text with min-width: 0; on narrow phones the name
   wraps onto two lines instead of spilling out of the box */
.sp-slot-t {
  min-width: 0;
}
.sp-slot b {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.sp-slot small {
  display: block;
  margin-top: 2px;
  color: var(--sc);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sp-press {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.sp-press svg {
  width: 14px;
  height: 14px;
  color: #ffd731;
  shape-rendering: crispEdges;
}

/* the control panel: joystick, Start button, two buttons, and the email address */
.sp-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 18px 28px;
  padding: clamp(18px, 2.6cqi, 26px) clamp(6px, 2cqi, 22px) clamp(6px, 1cqi, 10px);
}
.sp-controls {
  display: flex;
  align-items: center;
  gap: clamp(22px, 4cqi, 44px);
}
.sp-stick {
  flex: none;
  width: 62px;
  height: 62px;
  transform-origin: 50% 85%;
  transition: transform 300ms var(--boing);
}
.sp-cab:hover .sp-stick {
  transform: rotate(-12deg);
}
/* Start doesn't go anywhere: it lights up the email box (js/sponsor.js) */
.sp-start {
  display: grid;
  justify-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.sp-btn {
  width: clamp(78px, 9cqi, 96px);
  height: clamp(78px, 9cqi, 96px);
  border-radius: 50%;
  background: #ff5b52;
  border: 3px solid #1a1714;
  box-shadow:
    0 7px 0 #1a1714,
    inset 0 -7px 0 rgba(0, 0, 0, 0.2),
    inset 0 7px 0 rgba(255, 255, 255, 0.35);
  transition:
    transform 150ms var(--boing),
    box-shadow 150ms var(--boing);
}
.sp-start:hover .sp-btn,
.sp-start:focus-visible .sp-btn {
  transform: translateY(-4px) rotate(-6deg);
  box-shadow:
    0 11px 0 #1a1714,
    inset 0 -7px 0 rgba(0, 0, 0, 0.2),
    inset 0 7px 0 rgba(255, 255, 255, 0.35);
}
.sp-start:active .sp-btn {
  transform: translateY(6px);
  box-shadow:
    0 1px 0 #1a1714,
    inset 0 -3px 0 rgba(0, 0, 0, 0.2),
    inset 0 5px 0 rgba(255, 255, 255, 0.3);
}
.sp-label {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.sp-dots {
  display: grid;
  grid-template-columns: repeat(2, 32px);
  gap: 10px;
}
.sp-dots span {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid #1a1714;
  box-shadow: 0 4px 0 #1a1714;
}
.sp-dots span:first-child {
  background: #4fa6ff;
}
.sp-dots span:last-child {
  background: #ffd731;
}
/* the email box: outlined, with a copy button beside the address */
.sp-mail {
  flex: 0 1 auto;
  display: grid;
  gap: 6px;
  padding: 12px 14px 12px 18px;
  text-align: center;
  border: 2px solid #1a1714;
  border-radius: 14px;
  background: rgba(20, 23, 27, 0.12);
}
.sp-mail-k {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.sp-mail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
}
.sp-mail a {
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
}
/* pressing Start: the box's outline turns white and pulses twice */
.sp-mail.is-lit {
  border-color: #ffffff;
  animation: sp-lit 1.4s ease-out;
}
@keyframes sp-lit {
  0%,
  45% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.9);
  }
  15% {
    transform: scale(1.04);
  }
  30% {
    transform: none;
  }
  44%,
  100% {
    box-shadow: 0 0 0 14px rgba(255, 255, 255, 0);
  }
}
.sp-copy-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #1a1714;
  color: #ffffff;
  cursor: pointer;
  transition:
    transform 150ms var(--boing),
    background-color 0.2s;
}
.sp-copy-btn:hover {
  transform: translateY(-2px) rotate(-4deg);
}
.sp-copy-btn:active {
  transform: scale(0.92);
}
.sp-copy-btn .i {
  width: 18px;
  height: 18px;
}
.sp-copy-ok,
.sp-copy-btn.is-done .sp-copy-ic {
  display: none;
}
.sp-copy-btn.is-done .sp-copy-ok {
  display: block;
}
/* a moment of green once the address is on the clipboard (the label above says "Copied!") */
.sp-copy-btn.is-done {
  background: #35e08b;
  color: #0b0717;
}
@container sponsor (min-width: 720px) {
  .sp-panel {
    justify-content: space-between;
  }
  .sp-mail {
    text-align: right;
  }
  .sp-mail-row {
    justify-content: flex-end;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sp-blink,
  .sp-mail.is-lit {
    animation: none;
  }
  .sp-stick,
  .sp-btn,
  .sp-copy-btn {
    transition: none;
  }
}
