/*
  Dance Party page styles.
  /styles.css is loaded first so this page shares the Hoodie Frens colors,
  background, type stack, terminal UI, and menu styling.
*/

:root {
  /* Single knob for the space between the DanceParty terminal and Fren title. */
  --dance-stage-gap: 20px;
}


/* Optional full-page strobe mode. JS changes --strobe-color on its own 330ms clock. */
body.strobe-active {
  background-image: none;
  background-color: var(--strobe-color, #33ccff);
}

/* When strobe mode is active, let the color show through the top terminal
   at the same translucent strength as the secondary Export GIF button. */
body.strobe-active .dance-terminal {
  background: rgba(0, 0, 0, .18);
  box-shadow: none;
}

body.strobe-active .dance-terminal .terminal-bar,
body.strobe-active .dance-terminal .dance-lookup-zone {
  background: transparent;
}

.dance-page {
  width: min(880px, calc(100% - 28px));
  padding-top: 10px;
  padding-bottom: 28px;
}

/* Use the same terminal treatment as the Fren Lab, but keep this page compact. */
.dance-terminal {
  width: 100%;
}

.dance-lookup-zone {
  padding: 12px 18px 10px;
  border-bottom: 0;
}

.dance-error {
  min-height: 0;
  margin-top: 6px;
}

.dance-error:empty {
  display: none;
}

.dance-stage {
  width: min(700px, 100%);
  margin: 0 auto;
  padding: var(--dance-stage-gap) 14px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dance-identity {
  margin: 0 auto;
  text-align: center;
}

.dance-identity h1 {
  margin: 0;
  color: var(--cream);
  font-size: clamp(23px, 6vw, 40px);
  line-height: 1;
  letter-spacing: -.055em;
}

.dance-fren-title {
  color: inherit;
  text-decoration: none;
  transition: color 120ms ease;
}

.dance-fren-title:hover,
.dance-fren-title:focus-visible {
  color: var(--lime);
}

.dance-owner-line {
  min-height: 20px;
  margin-top: 5px;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: .04em;
}

.dance-owner-line a {
  margin-left: 5px;
  color: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.dance-owner-line a[href]:hover,
.dance-owner-line a[href]:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.dance-button {
  position: relative;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

#danceCanvas {
  display: block;
  width: min(400px, calc(100vw - 34px));
  height: auto;
  aspect-ratio: 1 / 1;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.dance-button:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 6px;
}

.dance-button.boost #danceCanvas {
  animation: fren-bonk 130ms steps(2, end);
}

@keyframes fren-bonk {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.035); }
  100% { transform: scale(1); }
}

.turbo-hint {
  margin: 2px 0 0;
  color: rgba(247, 228, 205, .38);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .10em;
}

.strobe-toggle {
  margin-top: 10px;
  user-select: none;
}

.dance-export-zone {
  width: min(330px, 100%);
  margin-top: 12px;
}

.gif-export-button {
  width: 100%;
  min-height: 44px;
}

.gif-export-button:disabled {
  opacity: .55;
  cursor: wait;
}

.dance-status {
  min-height: 1.4em;
  margin: 7px 0 0;
  color: var(--dim);
  text-align: center;
  font-size: 10px;
  line-height: 1.4;
}

@media (max-width: 740px) {
  .dance-page {
    width: min(100% - 20px, 880px);
    padding-top: 22px;
  }

  .dance-stage {
    padding-inline: 10px;
  }

  #danceCanvas {
    width: min(390px, calc(100vw - 28px));
  }
}

@media (max-width: 560px) {
  .dance-lookup-zone {
    padding: 12px 13px 9px;
  }

  /* Override the homepage mobile rule that normally drops RANDOM to row 2. */
  .dance-terminal .find-row {
    grid-template-columns: 30px minmax(0, 1fr) 58px auto;
  }

  .dance-terminal .find-row .inline-random {
    grid-column: auto;
    min-width: 78px;
    min-height: 0;
    border-top: 0;
    border-left: 1px solid var(--line);
    padding-inline: 10px;
  }

  .dance-stage {
    padding-inline: 8px;
  }

  .dance-identity h1 {
    font-size: clamp(25px, 8vw, 36px);
  }

  #danceCanvas {
    width: min(370px, calc(100vw - 24px));
  }

  .dance-export-zone {
    width: min(320px, calc(100vw - 48px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .dance-button.boost #danceCanvas {
    animation: none;
  }
}
