/* Shell Challenge — phone (remote) styles.
   Extracted from shell_remote.html. Edit this file AND regenerate
   shell_remote.min.css: the page loads the .min version.

   Everything is scoped under .shell-page so nothing here can leak into the
   other modules that share quiz_remote.min.css / global.min.css. */

.shell-page {
  /* Font stack for any string that may carry accents — the AgencyFB brand
     font has broken GPOS and mangles them. shell.guess is "Où est-elle ?"
     in French and shell.correct is "Bien joué !", so both live here. */
  --safe-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ---------------- Layout ----------------
   Bottom-weighted so the buttons land under the thumb rather than in the
   middle of the screen where they need a second hand. */
.shell-page .shell-remote {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  row-gap: 2rem;
  /* No horizontal padding: the parent .remote.show already contributes 40px
     a side (quiz_remote.css). Doubling it starves the buttons on a 320px
     phone. */
  padding: 20px 0 2vh;
  width: 100%;
  min-height: 54vh;
  box-sizing: border-box;
}

.shell-page .shell-remote .question {
  font-size: clamp(1.25rem, 5.5vw, 1.8rem);
  line-height: 1.25;
  text-align: center;
  font-family: var(--safe-font);
  font-weight: 700;
  color: var(--secondary-color, #fff);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 auto;
  max-width: 22ch;
}

/* ---------------- Choice buttons ----------------
   Themed from the per-game JSON rather than a fixed rainbow, so the module
   matches the client's palette like every other ScreenUp surface. All three
   share one treatment and are told apart by their letter — which also keeps
   them legible whatever the client's colours turn out to be. */
.shell-page .shell-remote .choices {
  display: flex;
  flex-direction: row;
  gap: clamp(0.6rem, 3.5vw, 1.25rem);
  width: 100%;
  justify-content: center;
}

/* Sized by flex against the real container rather than by vw arithmetic —
   vw can't see the parent's padding, and got this wrong at 320px. The three
   buttons split whatever width is actually available; aspect-ratio keeps
   them circular and max-width stops them ballooning on a tablet. */
.shell-page .shell-remote .choices button {
  flex: 1 1 0;
  min-width: 0;
  max-width: 122px;
  aspect-ratio: 1;
  height: auto;
  padding: 0;
  border-radius: 50%;
  /* quiz_remote.css sets corner-shape:squircle on .remote button, which
     turns a 50% radius into a rounded square. Reset it to get real circles. */
  corner-shape: round;
  border: 3px solid var(--primary-color, #fff);
  /* !important is required: quiz_remote.css carries a second
     `.remote button { background: 0 0 !important }` rule that otherwise
     strips every background off these buttons. */
  background: radial-gradient(circle at 50% 30%,
      rgba(255, 255, 255, 0.16) 0%,
      rgba(255, 255, 255, 0.04) 45%,
      rgba(0, 0, 0, 0.28) 100%) !important;
  color: var(--primary-color, #fff);
  font-family: var(--secondary-font-family, "Oswald", sans-serif);
  font-size: clamp(2.1rem, 10vw, 3.4rem);
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  transition:
    transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 220ms ease,
    opacity 220ms ease,
    background 220ms ease,
    border-color 220ms ease;
}

/* quiz_remote.css forces `.remote button b { color/background: … !important }`,
   which is why the letter ignored the theme. Inherit from the button so the
   letter follows every state below (idle, picked, correct, wrong). */
.shell-page .remote .shell-remote button b {
  background: none !important;
  color: inherit !important;
  width: auto;
}

/* Idle invitation — a slow breath so it reads as tappable. */
.shell-page .shell-remote .choices button:not(:disabled) {
  animation: shellBtnBreath 2.6s ease-in-out infinite;
}

.shell-page .shell-remote .choices button:nth-child(2):not(:disabled) {
  animation-delay: 0.2s;
}

.shell-page .shell-remote .choices button:nth-child(3):not(:disabled) {
  animation-delay: 0.4s;
}

@keyframes shellBtnBreath {

  0%,
  100% {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  }

  50% {
    box-shadow: 0 6px 26px rgba(0, 0, 0, 0.45);
  }
}

.shell-page .shell-remote .choices button:active {
  transform: scale(0.9);
  animation: none;
}

/* ---------------- Locked in ----------------
   The old styling faded the chosen button to 0.4 opacity, which reads as
   "rejected". The pick is now the brightest thing on screen and the others
   recede — the fan should be able to glance and see what they committed to. */
.shell-page .shell-remote .choices button.picked {
  background: var(--primary-color, #fff) !important;
  border-color: var(--primary-color, #fff);
  color: var(--background-color, #111);
  text-shadow: none;
  transform: scale(1.1);
  opacity: 1 !important;
  animation: none;
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.16),
    0 10px 30px rgba(0, 0, 0, 0.45);
}

/* The non-picked ones. (.selected is applied to the buttons NOT chosen —
   the name is inherited from the original markup.) */
.shell-page .shell-remote .choices button.selected:not(.picked) {
  opacity: 0.32;
  transform: scale(0.9);
  filter: grayscale(0.6);
  pointer-events: none;
  animation: none;
}

/* Game-state status line shown on the waiting screen ("get ready" /
   "watch the screen"). Accented in several locales, so it stays off the
   brand font like the other copy here. */
.shell-page .shell-status {
  font-family: var(--safe-font);
  font-size: clamp(1.15rem, 5vw, 1.55rem);
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: center;
  color: var(--secondary-color, #fff);
  margin: 0.25rem auto 0;
  max-width: 20ch;
  min-height: 1.4em;
}

/* ---------------- Result ---------------- */
.shell-page .shell-remote .choices button.correct-answer {
  background: linear-gradient(135deg, #2ecc71, #27ae60) !important;
  border-color: #6ff0a8 !important;
  color: #06301a !important;
  opacity: 1 !important;
  transform: scale(1.16) !important;
  filter: none !important;
  text-shadow: none;
  box-shadow: 0 0 34px rgba(46, 204, 113, 0.65) !important;
  animation: shellPulseCorrect 0.6s ease-in-out 2;
}

.shell-page .shell-remote .choices button.wrong-answer {
  background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
  border-color: #ff9a8f !important;
  color: #fff !important;
  opacity: 1 !important;
  transform: scale(0.92) !important;
  filter: none !important;
  box-shadow: 0 0 22px rgba(231, 76, 60, 0.55) !important;
  animation: shellShakeWrong 0.5s ease-in-out;
}

.shell-page .shell-remote .choices button.dimmed {
  opacity: 0.22 !important;
  transform: scale(0.82) !important;
  filter: grayscale(1) !important;
  animation: none !important;
}

@keyframes shellPulseCorrect {

  0%,
  100% {
    transform: scale(1.16);
  }

  50% {
    transform: scale(1.26);
  }
}

@keyframes shellShakeWrong {

  0%,
  100% {
    transform: translateX(0) scale(0.92);
  }

  20% {
    transform: translateX(-8px) scale(0.92);
  }

  40% {
    transform: translateX(8px) scale(0.92);
  }

  60% {
    transform: translateX(-6px) scale(0.92);
  }

  80% {
    transform: translateX(6px) scale(0.92);
  }
}

.shell-page .result-message {
  font-size: clamp(1.5rem, 7vw, 2.1rem);
  line-height: 1.2;
  font-weight: 800;
  text-align: center;
  font-family: var(--safe-font);
  text-transform: uppercase;
  min-height: 2.4rem;
  margin: 0 auto;
  max-width: 22ch;
}

.shell-page .result-message.correct {
  color: #2ecc71;
}

.shell-page .result-message.wrong {
  color: #e74c3c;
}

/* ---------------- Waiting ----------------
   Replaces the generic bouncing spinner with three shells trading places —
   it tells the fan what is happening on the jumbotron right now, and tells
   them to look up. */
.shell-page .wait .spinner {
  display: none;
}

.shell-page .shell-wait {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 14px;
  height: 64px;
  margin: 0 auto 1.5rem;
}

.shell-page .shell-wait span {
  width: 26px;
  height: 30px;
  border-radius: 50% 50% 22% 22% / 68% 68% 22% 22%;
  background: var(--primary-color, #fff);
  opacity: 0.85;
}

.shell-page .shell-wait span:nth-child(1) {
  animation: shellWaitA 1.6s ease-in-out infinite;
}

.shell-page .shell-wait span:nth-child(2) {
  animation: shellWaitB 1.6s ease-in-out infinite;
}

.shell-page .shell-wait span:nth-child(3) {
  animation: shellWaitC 1.6s ease-in-out infinite;
}

/* 40px = shell width + gap, so the two outer shells trade places and the
   middle one bobs out of their way. */
@keyframes shellWaitA {

  0%,
  100% {
    transform: translateX(0) translateY(0);
  }

  25% {
    transform: translateX(20px) translateY(-16px);
  }

  50% {
    transform: translateX(40px) translateY(0);
  }

  75% {
    transform: translateX(20px) translateY(-16px);
  }
}

@keyframes shellWaitB {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes shellWaitC {

  0%,
  100% {
    transform: translateX(0) translateY(0);
  }

  25% {
    transform: translateX(-20px) translateY(16px);
  }

  50% {
    transform: translateX(-40px) translateY(0);
  }

  75% {
    transform: translateX(-20px) translateY(16px);
  }
}

@media (prefers-reduced-motion: reduce) {

  .shell-page .shell-remote .choices button,
  .shell-page .shell-wait span {
    animation: none !important;
  }

  .shell-page .shell-remote .choices button {
    transition: none;
  }
}
