
/* FILE: css/RandomGenerator.css */

/* =========================================================
   RANDOM GENERATOR
   Independent styling for the FeaturedGames trivia tile
   ========================================================= */

.collage-item.random-generator {
  background: #000;
  color: #fff;
  border: 3px double #fff;
  border-radius: 15px;
  padding: 10px;
  box-sizing: border-box;
  overflow: hidden;
  text-align: center;

  font-family: 'Montserrat', Arial, sans-serif;
  height: auto;

  transform: none;
}

/* =========================================================
   HEADER
   ========================================================= */

.random-generator-title {
  font-family:
    'Montserrat', 'League Spartan', Arial, sans-serif;

  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.2;
  color: #fff;
  text-align: center;

  margin: 0 0 12px;
}

/* =========================================================
   CONTENT STAGE
   ========================================================= */

/*
 * The stage now takes its height from the question
 * rather than forcing an empty 420px area.
 *
 * !important overrides the inline height currently
 * assigned by RandomGenerator.js.
 */

.random-generator-stage {
  position: relative;

  width: 100%;
  height: auto !important;
  min-height: 270px;

  overflow: hidden;
  box-sizing: border-box;
}

/* =========================================================
   SLIDE TRANSITIONS
   ========================================================= */

.random-generator-slide {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;
  box-sizing: border-box;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 450ms ease,
    visibility 0s linear 450ms;
}

.random-generator-slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transition:
    opacity 450ms ease,
    visibility 0s;
}

/* =========================================================
   QUESTION SLIDE
   ========================================================= */

/*
 * Unlike the preview slide, the question slide
 * remains in the normal layout flow.
 *
 * Its actual content determines the stage height.
 * Even when invisible, it holds that space for
 * the preview slide.
 */

.random-generator-question-slide {
  position: relative;
  inset: auto;

  display: flex;
  flex-direction: column;
  gap: 12px;

  width: 100%;
  height: auto;

  min-height: 0;

  overflow: visible;
}

/* =========================================================
   QUESTION TEXT
   ========================================================= */

.random-generator-question {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.25;

  text-align: center;
  color: #fff;

  margin: 0;
  overflow-wrap: break-word;
}

/* =========================================================
   ANSWER BUTTONS
   Match original DailyVault appearance
   ========================================================= */

.random-generator-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;

  width: 100%;
  margin: 0;
  padding: 0;
}

.random-generator-choice {
  display: block;
  width: 100%;
  max-width: 100%;

  box-sizing: border-box;
  flex-shrink: 0;

  background: #000;
  color: #fff;

  border: 1px solid #fff;
  border-radius: 10px;

  padding: 10px 12px;

  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.25;
  text-align: center;

  cursor: pointer;

  transition:
    background-color 200ms ease,
    border-color 200ms ease,
    color 200ms ease;
}

.random-generator-choice:not(:disabled):hover {
  background: #fff;
  color: #000;
}

.random-generator-choice:disabled {
  cursor: default;
}

/* Selected but not yet graded */

.random-generator-choice.is-selected {
  border-color: #fff;
  background: #222;
  color: #fff;
}

/* Eliminated incorrect alternative */

.random-generator-choice.is-eliminated {
  border-color: #d22;
  background: #000;
  color: #fff;
}

/* Player's incorrect choice */

.random-generator-choice.is-wrong {
  border-color: #d22;
  background: #d22;
  color: #fff;
}

/* Correct answer */

.random-generator-choice.is-correct {
  border-color: #0b3;
  background: #0b3;
  color: #fff;
}

/* Card border feedback */

.collage-item.random-generator.is-correct {
  border-color: #0b3 !important;
}

.collage-item.random-generator.is-wrong {
  border-color: #d22 !important;
}

/* =========================================================
   PREVIEW SLIDE
   ========================================================= */

/*
 * The preview overlays the question slide.
 * It never contributes additional height to the card.
 */

.random-generator-preview-slide {
  position: absolute;
  inset: 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;

  overflow: hidden;
}

.random-generator-preview-host {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;
  min-height: 0;

  overflow: hidden;
}

/* =========================================================
   CLICKABLE GAME PREVIEW
   No inner border or box
   ========================================================= */

.random-generator-game-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;
  min-height: 0;

  box-sizing: border-box;
  padding: 0;

  border: none;
  border-radius: 0;

  background: transparent;
  color: #fff;
  text-decoration: none;

  overflow: hidden;
  cursor: pointer;
}

/* No visual color changes on hover */

.random-generator-game-link:hover,
.random-generator-game-link:focus {
  background: transparent;
  color: #fff;
  border: none;
  text-decoration: none;
}

/* =========================================================
   PREVIEW IMAGE AREA
   ========================================================= */

/*
 * This area no longer expands to fill all
 * the unused vertical space.
 *
 * It hugs the actual preview image instead.
 */

.random-generator-game-image-area {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: auto;

  flex: 0 1 auto;
  min-height: 0;
  max-height: 175px;

  margin: 0;
  padding: 0;

  overflow: hidden;
}

/*
 * Images retain their natural proportions.
 * Maximum height prevents oversized previews.
 */

.collage-item.random-generator
.random-generator-game-image-area img {
  display: block;

  width: auto;
  height: auto;

  max-width: 100%;
  max-height: 175px;

  object-fit: contain;

  margin: 0;
  padding: 0;

  border-radius: 15px;
  flex-shrink: 1;
}

/* =========================================================
   GAME TITLE
   Match FeaturedGames preview typography
   ========================================================= */

.random-generator-game-title {
  flex-shrink: 0;
  width: 100%;

  font-family: 'League Spartan', sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;

  color: #fff;
  text-align: center;

  margin: 6px 0 0;
  padding: 0;
}

/* =========================================================
   GAME SUBTITLE
   ========================================================= */

.random-generator-game-subtitle {
  flex-shrink: 0;

  width: 100%;
  max-width: 100%;

  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;

  color: #aaa;
  opacity: 0.95;

  text-align: center;

  margin: 4px 0 0;
  padding: 0;
}

/* =========================================================
   PLAY FULL GAME
   ========================================================= */

.random-generator-game-action {
  flex-shrink: 0;

  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;

  color: #fff;
  text-align: center;

  margin: 8px 0 0;
  padding: 0;
}

/* Keep action text white on hover */

.random-generator-game-link:hover
.random-generator-game-action,
.random-generator-game-link:focus
.random-generator-game-action {
  color: #fff;
}

/* =========================================================
   INTERNAL SHUFFLE BUTTON
   ========================================================= */

/*
 * Shuffle now sits close to the question content.
 * The unnecessary 420px stage gap is gone.
 */

.random-generator-shuffle {
  display: block;

  margin: 12px auto 4px;
  padding: 9px 20px;

  background: #fff;
  color: #000;

  border: 2px solid transparent;
  border-radius: 5px;

  font-family: 'League Spartan', sans-serif;
  font-size: 20px;
  font-weight: 700;

  cursor: pointer;
  text-align: center;

  transition:
    background-color 200ms ease,
    color 200ms ease,
    border-color 200ms ease;
}

.random-generator-shuffle:not(:disabled):hover {
  background: #000;
  color: #fff;
  border-color: #fff;
}

.random-generator-shuffle:disabled {
  opacity: 0.5;
  cursor: default;
}

/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

  .random-generator-title {
    font-size: 26px;
  }

  .random-generator-question {
    font-size: 18px;
  }

  .random-generator-choice {
    font-size: 18px;
  }

  .random-generator-stage {
    min-height: 270px;
  }

  .random-generator-game-image-area {
    max-height: 175px;
  }

  .collage-item.random-generator
  .random-generator-game-image-area img {
    max-height: 175px;
  }
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */

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

  .random-generator-slide {
    transition: none;
  }

  .random-generator-slide.is-active {
    transition: none;
  }
}
