/* Find The Ball Challenge Styles */

.find-ball-section {
  max-width: 500px;
  margin: 10px auto 0 auto;
  padding: 32px 24px;
  background: #f5d9ba;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.74);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.find-ball-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0) 40%);
  pointer-events: none;
  opacity: 0.55;
}

/* Fun animated prompt: popping / drop-in with playful styling */
.ftb-top-prompt {
  margin-bottom: 16px;
  text-align: center;
  color: #7c4b01;
  font-family: "Clash";
  font-weight: 500;
  font-size: 1rem;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

@keyframes ftb-pop-drop {
  0% {
    transform: translateY(-28px) scale(0.92);
    opacity: 0;
    filter: blur(2px);
  }

  60% {
    transform: translateY(8px) scale(1.08);
    opacity: 1;
    filter: blur(0);
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.ftb-prompt-animate {
  animation: ftb-pop-drop 640ms cubic-bezier(.2, .9, .3, 1.2) both;
}

/* Subtle emphasis when shuffling / important prompts */
.ftb-top-prompt.shuffling {
  box-shadow: 0 24px 64px rgba(255, 120, 120, 0.14), 0 8px 28px rgba(0, 0, 0, 0.12);
  transform: translateZ(0);
}

.ftb-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 14, 22, 0.68);
  backdrop-filter: blur(8px);
  z-index: 30;
}

.ftb-overlay-card {
  width: min(420px, calc(100% - 48px));
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 22px;
  padding: 22px 22px 20px;
  text-align: center;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
}

/* Game Over card: slightly tighter so it doesn't feel oversized */
#ftb-Challenge-over-overlay .ftb-overlay-card {
  width: min(380px, calc(100% - 56px));
  padding: 18px 18px 16px;
  border-radius: 20px;
}

#ftb-Challenge-over-overlay .ftb-overlay-title {
  font-size: 1.95rem;
}

#ftb-Challenge-over-overlay .ftb-score-label {
  margin-top: 12px;
}

#ftb-Challenge-over-overlay .ftb-score {
  font-size: 3.2rem;
}

#ftb-Challenge-over-overlay .ftb-score-small {
  font-size: 2rem;
}

#ftb-Challenge-over-overlay .ftb-overlay-btn {
  margin-top: 14px;
  padding: 11px 38px;
}

.ftb-overlay-title {
  font-size: 2.1rem;
  font-weight: 900;
  color: #0d1020;
  letter-spacing: 0.01em;
}

.ftb-overlay-subtitle {
  margin-top: 6px;
  font-size: 1.02rem;
  font-weight: 600;
  color: rgba(13, 16, 32, 0.75);
}

.ftb-score-label {
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(13, 16, 32, 0.55);
}

.ftb-score-label-tight {
  margin-top: 12px;
}

.ftb-score {
  margin-top: 6px;
  font-size: 4.1rem;
  font-weight: 900;
  line-height: 1;
  color: #0d1020;
}

.ftb-score-small {
  font-size: 2.4rem;
  opacity: 0.9;
}

.ftb-overlay-btn {
  margin-top: 18px;
  padding: 12px 42px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  background: linear-gradient(90deg, #111 0%, #2a2f4a 100%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
  font-family: 'Poppins', sans-serif;
}

.ftb-overlay-btn:hover {
  transform: translateY(-2px);
  filter: saturate(1.1);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.28);
}

.ftb-overlay-btn:active {
  transform: translateY(0px) scale(0.99);
}

.cups-container {
  display: flex;
  justify-content: center;
  gap: 38px;
  margin: 32px 0 24px 0;
  position: relative;
  padding-bottom: 22px;
  z-index: 1;
}

.status-display {
  text-align: center;
  line-height: 1.2;
}

.status-display .difficulty-tag {
  font-size: 0.95rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: inline-block;
  margin-top: 0;
}

/* Difficulty colors (reusing existing site colors) */
.status-display.diff-easy .difficulty-tag {
  background: rgba(0, 137, 123, 0.14);
  color: #00897b;
}

.status-display.diff-medium .difficulty-tag {
  background: rgba(255, 152, 0, 0.18);
  color: #ff9800;
}

.status-display.diff-hard .difficulty-tag {
  background: rgba(255, 3, 3, 0.14);
  color: var(--main-color);
}

.status-display.diff-insanity .difficulty-tag {
  background: rgba(208, 2, 27, 0.14);
  color: #d0021b;
}

.status-display.diff-impossible .difficulty-tag {
  background: rgba(0, 0, 0, 0.12);
  color: #000;
}

.cup-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.cup-img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(.4, 2, .6, 1);
  cursor: pointer;
  user-select: none;
  z-index: 1;
}

.cup-wrap.selected .cup-img {
  /* outline: 3px solid #ff9800; */
  z-index: 2;
}

.cup-wrap.lifted .cup-img {
  transform: translateY(-40px) scale(1.08);
  z-index: 2;
}

.ball {
  width: 32px;
  height: 32px;
  background:
    /* Curved highlight (top) */
    radial-gradient(140% 120% at 35% 10%, rgba(70, 70, 70, 0.55), rgba(255, 255, 255, 0) 58%),
    /* Curved darken (bottom) */
    radial-gradient(140% 115% at 50% 120%, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0) 62%),
    #0B0B0B;
  box-shadow:
    inset 0 10px 18px rgba(255, 255, 255, 0.20),
    inset 0 -14px 24px rgba(0, 0, 0, 0.18);
  border-radius: 50%;
  position: absolute;
  left: 50%;
  bottom: 20%;
  transform: translateX(-50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  z-index: 0;
  display: none;
  pointer-events: none;
}

.find-ball-result {
  min-height: 32px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #000000;
  text-align: center;
  margin: 10px 0 0 0;
  position: relative;
  z-index: 1;
}

/* Old HUD/buttons removed; overlays handle flow now */
.find-ball-title {
  text-align: center;
  font-size: var(--big-font);
  font-weight: 700;
  color: var(--third-color);
  margin: 54px 0 8px 0;
  letter-spacing: 0.01em;
  font-family: 'Poppins', sans-serif;
  position: relative;
}

@media (max-width: 1000px) {
  .find-ball-section {
    max-width: 580px;
    margin: 36px auto 0 auto;
    padding: 20px 18px;
  }

  .cups-container {
    gap: 30px;
    margin: 28px 0 20px 0;
    padding-bottom: 20px;
  }

  .cup-img {
    width: 100px;
    height: 100px;
  }

  .cup-wrap.lifted .cup-img {
    transform: translateY(-36px) scale(1.07);
  }

  .ball {
    width: 30px;
    height: 30px;
    bottom: 20%;
  }

  .ftb-overlay-card {
    width: min(460px, calc(100% - 48px));
    padding: 16px 16px 14px;
    border-radius: 18px;
  }

  #ftb-Challenge-over-overlay .ftb-overlay-card {
    width: min(360px, calc(100% - 40px));
  }

  #ftb-Challenge-over-overlay .ftb-overlay-title {
    font-size: 1.5rem;
  }

  #ftb-Challenge-over-overlay .ftb-score-label {
    margin-top: 10px;
  }

  #ftb-Challenge-over-overlay .ftb-score {
    font-size: 3rem;
  }

  #ftb-Challenge-over-overlay .ftb-score-small {
    font-size: 1.8rem;
  }

  #ftb-Challenge-over-overlay .ftb-overlay-btn {
    margin-top: 12px;
    padding: 10px 35px;
  }

  .ftb-overlay-title {
    font-size: 1.9rem;
  }

  .ftb-overlay-subtitle {
    font-size: 1.02rem;
  }

  .ftb-score {
    font-size: 3.0rem;
  }

  .ftb-score-small {
    font-size: 1.9rem;
  }

  .ftb-overlay-btn {
    padding: 12px 30px;
    font-size: 1.04rem;
  }
}

@media (max-width: 800px) {
  .find-ball-section {
    max-width: 580px;
    margin: 28px auto 0 auto;
    padding: 18px 16px;
  }

  .cups-container {
    gap: 22px;
    margin: 22px 0 16px 0;
    padding-bottom: 16px;
  }

  .cup-img {
    width: 90px;
    height: 90px;
  }

  .cup-wrap.lifted .cup-img {
    transform: translateY(-32px) scale(1.06);
  }

  .ball {
    width: 28px;
    height: 28px;
    bottom: 18%;
  }

  .ftb-overlay-card {
    width: max(250px, calc(100% - 40px));
    padding: 14px 14px 12px;
    border-radius: 16px;
  }

  #ftb-Challenge-over-overlay .ftb-overlay-card {
    max-width: 400px;
    max-height: 200px;
  }

  #ftb-Challenge-over-overlay .ftb-overlay-title {
    font-size: 1.2rem;
  }

  #ftb-Challenge-over-overlay .ftb-score-label {
    margin-top: 8px;
  }

  #ftb-Challenge-over-overlay .ftb-score {
    font-size: 2.8rem;
  }

  #ftb-Challenge-over-overlay .ftb-score-small {
    font-size: 1.5rem;
  }

  #ftb-Challenge-over-overlay .ftb-overlay-btn {
    margin-top: 10px;
    padding: 8px 30px;
  }

  .ftb-overlay-title {
    font-size: 1.5rem;
  }

  .ftb-overlay-subtitle {
    font-size: 1rem;
  }

  .ftb-score {
    font-size: 2.8rem;
  }

  .ftb-score-small {
    font-size: 1.5rem;
  }

  .ftb-overlay-btn {
    padding: 10px 25px;
    font-size: 1rem;
  }
}

@media (max-width: 600px) {
  .find-ball-section {
    max-width: 90%;
    margin: 20px auto 0 auto;
    padding: 12px 14px;
  }

  .ftb-overlay-card {
    width: min(320px, calc(100% - 24px));
    padding: 12px 12px 10px;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
  }

  #ftb-Challenge-over-overlay .ftb-overlay-card {
    max-width: 300px;
    max-height: 180px;
  }

  #ftb-Challenge-over-overlay .ftb-overlay-title {
    font-size: 1rem;
  }

  #ftb-Challenge-over-overlay .ftb-score-label {
    margin-top: 6px;
  }

  #ftb-Challenge-over-overlay .ftb-score {
    font-size: 2rem;
  }

  #ftb-Challenge-over-overlay .ftb-score-small {
    font-size: 1rem;
  }

  #ftb-Challenge-over-overlay .ftb-overlay-btn {
    margin-top: 8px;
    padding: 6px 25px;
  }

  .ftb-overlay-title {
    font-size: 1rem;
  }

  .ftb-overlay-subtitle {
    font-size: 0.5rem;
  }

  .ftb-score {
    font-size: 1.2rem;
  }

  .ftb-score-small {
    font-size: 1.2rem;
  }

  .ftb-overlay-btn {
    padding: 8px 14px;
    font-size: 1rem;
  }

  /* Cups layout: reduce gap and cup size so three cups fit comfortably */
  .cups-container {
    gap: 14px;
    margin: 18px 0 12px 0;
    padding-bottom: 12px;
    min-height: 100px;
    /* Increase canvas height a bit */
  }

  .cup-img {
    width: 72px;
    height: 72px;
  }

  .cup-wrap.lifted .cup-img {
    transform: translateY(-28px) scale(1.05);
  }

  .ball {
    width: 22px;
    height: 22px;
    bottom: 18%;
  }

  .find-ball-title {
    margin: 28px 0 6px 0;
    font-size: 1.1rem;
  }

  .ftb-overlay-card {
    padding: 10px 10px 10px;
    width: min(360px, calc(100% - 32px));
  }

  .ftb-overlay-title {
    font-size: 1.2rem;
  }

  .ftb-overlay-subtitle {
    font-size: 0.8rem;
  }

  .ftb-overlay-btn {
    padding: 8px 25px;
    font-size: 0.8rem;
  }
}

/* @media (max-width: 420px) {
  #ftb-Challenge-over-overlay .ftb-overlay-card {
    width: min(360px, calc(100% - 40px));
  }
  #ftb-Challenge-over-overlay .ftb-score {
    font-size: 2.9rem;
  }
} */