/* =========================================================
   INTERACTIVE BASE
   ========================================================= */

.interactive-page section {
  padding-top: 88px;
  padding-bottom: 88px;
}

.interactive-page .section-head {
  text-align: center;
  max-width: 920px;
  margin: 0 auto 40px;
}

/* =========================================================
   BLUR GAME
   ========================================================= */

.blur-game {
  text-align: center;
}

.blur-image-wrap {
  max-width: 520px;
  margin: 0 auto 20px;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}

.blur-image-wrap img {
  width: 100%;
  max-height: 390px;
  object-fit: cover;
  display: block;
  transition: filter 0.3s ease;
}

/* reveal button */
.blur-game .btn {
  margin-top: 10px;
}

/* result section */
.blur-result {
  margin-top: 24px;
  animation: fadeIn 0.4s ease;
}

.blur-result h3 {
  margin-bottom: 6px;
}

.blur-result p {
  color: var(--muted);
  margin-bottom: 12px;
}

/* hidden helper */
.is-hidden {
  display: none;
}

.blur-choices {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.choice-btn {
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.choice-btn:hover {
  border-color: rgba(213,179,106,0.55);
  background: rgba(213,179,106,0.12);
}

.choice-btn.is-correct {
  color: #111;
  background: var(--accent);
  border-color: var(--accent);
}

.choice-btn.is-wrong {
  opacity: 0.45;
  text-decoration: line-through;
}

.choice-btn:disabled {
  cursor: default;
}

#focusBtn {
  margin: 18px auto 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid rgba(255,230,160,0.85);
  background: linear-gradient(135deg, #f4c542 0%, #ff9f2f 100%);
  color: #111;
  font-weight: 900;
  box-shadow:
    0 12px 30px rgba(0,0,0,0.32),
    0 0 24px rgba(244,197,66,0.22);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#focusBtn:hover,
#focusBtn:focus {
  transform: translateY(-2px);
  box-shadow:
    0 18px 38px rgba(0,0,0,0.38),
    0 0 32px rgba(244,197,66,0.32);
}

.blur-game-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 10px;
}

.blur-game-stats span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #f4f5f7;
  font-size: 0.88rem;
  font-weight: 800;
}

.blur-restart-btn {
  margin-left: 10px;
}

.blur-correct-title {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 1.7rem;
  font-weight: 900;
  text-shadow: 0 0 18px rgba(213,179,106,0.18);
}

.blur-result-line,
.blur-gallery-line {
  margin: 6px 0;
  font-weight: 900;
  line-height: 1.5;
}

.blur-label-white {
  color: #f4f5f7;
  font-weight: 900;
}

.blur-value-gold {
  color: var(--accent);
  font-weight: 900;
  text-shadow: 0 0 18px rgba(213,179,106,0.18);
}

.blur-inline-space {
  display: inline-block;
  width: 18px;
}

.blur-rules-list {
  margin: 18px 0 20px;
  display: grid;
  gap: 10px;
}

.blur-rule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 10px 14px;
  border-radius: 14px;

  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);

  font-weight: 800;
  line-height: 1.35;
}

.blur-rule-points {
  min-width: 110px;
  font-weight: 900;
}

.blur-rule-minus .blur-rule-points {
  color: #ff8f8f;
}

.blur-rule-plus .blur-rule-points {
  color: var(--accent);
}

.blur-rule-text {
  color: #f4f5f7;
  text-align: right;
}

.blur-actions.is-hidden,
.blur-choices.is-hidden,
#focusBtn.is-hidden,
#leaderboardListFinish.is-hidden,
#leaderboardLockedMessage.is-hidden,
#tileViewGalleryBtn.is-hidden,
#blurViewGalleryBtn.is-hidden,
#memoryLeaderboardLocked.is-hidden,
#leaderboardList.is-hidden,
#puzzleAfterActions.is-hidden,
#puzzleViewGalleryBtn.is-hidden,
#puzzleLeaderboardLocked.is-hidden,
#leaderboardList.is-hidden,
#cancelBlurGame.is-hidden,
#cancelTileGame.is-hidden,
#cancelMemoryGame.is-hidden,
#memoryAfterActions.is-hidden {
  display: none !important;
}

.leaderboard-locked-message {
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #f5d36b;
  text-align: center;
  font-weight: 700;
}


/* =========================================================
   INTERACTIVE INDEX CARDS
   ========================================================= */

.interactive-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 260px));
  justify-content: center;
  gap: 18px;
}

.interactive-game-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel), #11161c);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.interactive-game-card.active:hover {
  transform: translateY(-4px);
  border-color: rgba(213,179,106,0.45);
  box-shadow: 0 26px 60px rgba(0,0,0,0.34);
}

.interactive-game-image {
  height: 150px; /* smaller banner */
  overflow: hidden;
  position: relative;
  background: #111;
}

.interactive-game-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.interactive-game-image .interactive-lock {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.38);
  font-size: 2rem;
}

/* Safety: never allow game lock outside game cards */
.hero .interactive-lock,
.hero-main .interactive-lock,
.home-hero .interactive-lock {
  display: none !important;
}

.interactive-game-image.is-blurred img {
  filter: blur(7px);
  transform: scale(1.04);
}

.interactive-game-content {
  padding: 14px;
}

.interactive-game-content h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.interactive-game-content p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
   margin-bottom: 10px;
}

.interactive-game-card.is-locked {
  opacity: 0.72;
  cursor: default;
}

.interactive-lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.38);
  font-size: 2rem;
}

/* =========================================================
   BLUR REVEAL GAME
   ========================================================= */

.blur-image {
  filter: blur(24px);
  transform: scale(1.04);
}

.blur-pathway {
  color: var(--accent);
  font-weight: 800;
}
.blur-click-result {
  color: var(--accent);
  font-weight: 800;
  margin-top: 8px;
}

/* =========================================================
   BLUR ACTION BUTTONS
   ========================================================= */

.blur-actions {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
}

/* MAIN BUTTON */
.blur-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 12px 22px;
  border-radius: 14px;

  font-size: 0.98rem;
  font-weight: 900;
  text-decoration: none;

  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

/* PRIMARY: View in Gallery */
.blur-btn-primary {
  background: linear-gradient(135deg, #f4c542 0%, #ff9f2f 100%);
  color: #111;
  border: 1px solid rgba(255,230,160,0.9);

  box-shadow:
    0 14px 34px rgba(0,0,0,0.35),
    0 0 28px rgba(244,197,66,0.25);
}

.blur-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow:
    0 18px 40px rgba(0,0,0,0.42),
    0 0 36px rgba(244,197,66,0.35);
}

/* SECONDARY: Play Again */
.blur-btn-secondary {
  background: rgba(255,255,255,0.08);
  color: #f4f5f7;
  border: 1px solid rgba(255,255,255,0.18);
}

.blur-btn-secondary:hover {
  transform: translateY(-2px);
  border-color: rgba(213,179,106,0.45);
  background: rgba(213,179,106,0.10);
}

/* =========================================================
   PHOTO PUZZLE
   ========================================================= */

.puzzle-game {
  display: grid;
  grid-template-columns: minmax(320px, 620px) minmax(260px, 1fr);
  gap: 28px;
  align-items: start;
}

.puzzle-board-wrap {
  display: flex;
  justify-content: center;
}

.puzzle-board {
  --cols: 5;
  --rows: 4;

  width: min(620px, 100%);
  aspect-ratio: 5 / 4;

  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: repeat(var(--rows), 1fr);

  border-radius: 18px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 2px dashed rgba(255,255,255,0.22);
  box-shadow: 0 24px 64px rgba(0,0,0,0.35);
}

.puzzle-slot {
  position: relative;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.16);
}

.puzzle-slot.is-hovered {
  background: rgba(244,197,66,0.16);
}

.puzzle-slot.is-filled {
  border-color: rgba(244,197,66,0.22);
}

.puzzle-pieces {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 18px 44px rgba(0,0,0,0.25);
}

.puzzle-piece {
  aspect-ratio: 1 / 1;
  background-repeat: no-repeat;
  background-position: center;
  cursor: grab;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 8px 18px rgba(0,0,0,0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  touch-action: none;
  user-select: none;
}

.puzzle-piece:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.35);
}

.puzzle-piece.is-dragging {
  opacity: 0.55;
}

.puzzle-piece.is-wrong {
  animation: puzzleWrong 0.35s ease;
}

.puzzle-slot .puzzle-piece {
  width: 100%;
  height: 100%;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  cursor: default;
}

.puzzle-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.puzzle-stats span {
  display: inline-flex;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #f4f5f7;
  font-size: 0.88rem;
  font-weight: 800;
}

.puzzle-result {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: 12px;
  animation: fadeIn 0.35s ease;
}

.puzzle-board.is-complete {
  border-style: solid;
  border-color: rgba(244,197,66,0.65);
  box-shadow:
    0 24px 64px rgba(0,0,0,0.38),
    0 0 34px rgba(244,197,66,0.25);
}

.puzzle-card-preview {
  position: relative;
  height: 150px;
  background: #111;
  overflow: hidden;
}

.mini-puzzle-piece {
  position: absolute;
  width: 34%;
  height: 34%;
  background-image: url("/images/hero/hero-main.jpg");
  background-size: 300% 300%;
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
  border-radius: 6px;
}

.mini-puzzle-piece.p1 { left: 4%;  top: 10%; background-position: 50% 100%; transform: rotate(-4deg); }
.mini-puzzle-piece.p2 { left: 36%; top: 5%;  background-position: 0% 50%; transform: rotate(3deg); }
.mini-puzzle-piece.p3 { left: 68%; top: 13%; background-position: 100% 0%; transform: rotate(-2deg); }

.mini-puzzle-piece.p4 { left: 8%;  top: 39%; background-position: 100% 100%; transform: rotate(5deg); }
.mini-puzzle-piece.p5 { left: 37%; top: 35%; background-position: 0% 0%; transform: rotate(-3deg); }
.mini-puzzle-piece.p6 { left: 65%; top: 43%; background-position: 50% 0%; transform: rotate(4deg); }

.mini-puzzle-piece.p7 { left: 5%;  top: 68%; background-position: 100% 50%; transform: rotate(2deg); }
.mini-puzzle-piece.p8 { left: 39%; top: 65%; background-position: 0% 100%; transform: rotate(-5deg); }
.mini-puzzle-piece.p9 { left: 70%; top: 69%; background-position: 50% 50%; transform: rotate(3deg); }

/* =========================================================
   PUZZLE MODAL CLOSE BUTTONS
   ========================================================= */

.puzzle-page #puzzleStartModal .tile-result-card,
.puzzle-page #puzzleResult .tile-result-card {
  position: relative;
}

.puzzle-page #puzzleStartModal .game-modal-close,
.puzzle-page #puzzleResult .game-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 50;
  pointer-events: auto;
}

#cancelPuzzleGame {
  display: flex;
  justify-content: center;
  margin: 18px auto 10px;
}

#cancelPuzzleGame.is-hidden,
#puzzleAfterActions.is-hidden,
#puzzleViewGalleryBtn.is-hidden {
  display: none !important;
}


/* =========================================================
   GALLERY QUIZ
   ========================================================= */

.quiz-app {
  max-width: 980px;
  margin: 0 auto;
}

.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 18px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.10);
}

.quiz-topbar div {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.quiz-mini-btn {
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 800;
  cursor: pointer;
}

.quiz-card {
  display: grid;
  grid-template-columns: minmax(260px, 420px) 1fr;
  gap: 22px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--panel), #11161c);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: var(--shadow);
}

.quiz-image-wrap {
  border-radius: 18px;
  overflow: hidden;
  background: #111;
}

.quiz-image-wrap img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
}

.quiz-content h3 {
  margin-top: 0;
  font-size: 1.35rem;
}

.quiz-choices {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.quiz-choice-btn {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.quiz-choice-btn:hover {
  border-color: rgba(213,179,106,0.50);
  background: rgba(213,179,106,0.10);
}

.quiz-choice-btn.is-correct {
  background: linear-gradient(135deg, #f4c542 0%, #ff9f2f 100%);
  color: #111;
  border-color: rgba(255,230,160,0.9);
}

.quiz-choice-btn.is-wrong {
  background: rgba(255,80,80,0.16);
  border-color: rgba(255,80,80,0.45);
  color: #ffd7d7;
}

.quiz-feedback {
  min-height: 28px;
  margin-top: 14px;
  font-weight: 900;
}

.quiz-feedback.is-correct {
  color: var(--accent);
}

.quiz-feedback.is-wrong {
  color: #ff7373;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.quiz-result {
  text-align: center;
  padding: 28px;
  border-radius: 22px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.10);
}

.quiz-floating-btn {
  position: fixed !important;
  right: 22px;
  bottom: 92px;
  z-index: 9999;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,230,160,0.9);

  background: linear-gradient(135deg, #f4c542 0%, #ff9f2f 100%);
  color: #111;

  font-weight: 900;
  cursor: pointer;

  box-shadow:
    0 12px 30px rgba(0,0,0,0.34),
    0 0 24px rgba(244,197,66,0.22);
}

.quiz-floating-btn.is-hidden {
  display: none !important;
}

.quiz-app.is-minimized {
  display: none;
}

.quiz-image-wrap.is-hidden {
  display: none;
}

.quiz-card.is-written-only {
  grid-template-columns: 1fr;
}

.quiz-image-choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  align-items: stretch;
}

.quiz-image-choice-btn {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.16);
  background: #111;
  cursor: pointer;
}

.quiz-image-choice-btn img {
  width: 100%;
  height: 320px;           /* 🔥 bigger height */
  object-fit: cover;
  display: block;
}

.quiz-image-choice-btn span {
  display: none;
}

.quiz-image-choice-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.35);
}

.quiz-image-choice-btn.is-correct {
  transform: scale(1.08);
  z-index: 5;
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px rgba(213,179,106,0.75),
    0 0 26px rgba(213,179,106,0.55),
    0 18px 36px rgba(0,0,0,0.45);
}

/* smooth animation */
.quiz-image-choice-btn img {
  transition: transform 0.25s ease;
}

.quiz-image-choice-btn.is-wrong {
  border-color: rgba(255,80,80,0.9);
  box-shadow:
    0 0 0 2px rgba(255,80,80,0.6),
    0 0 18px rgba(255,60,60,0.45);
  opacity: 0.9;
}

.quiz-image-choice-btn {
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.quiz-return-btn {
  position: fixed;
  right: 22px;
  top: 92px;
  z-index: 9999;

  padding: 12px 18px;
  border-radius: 999px;

  background: linear-gradient(135deg, #f4c542 0%, #ff9f2f 100%);
  color: #111;

  font-weight: 900;
  text-decoration: none;

  box-shadow:
    0 12px 30px rgba(0,0,0,0.34),
    0 0 24px rgba(244,197,66,0.22);
}

.quiz-return-btn.is-hidden {
  display: none;
}

.quiz-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--accent);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.quiz-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.quiz-page #quizAfterActions.is-hidden,
.quiz-page #quizGalleryLink.is-hidden,
.quiz-page #quizNextBtn.is-hidden {
  display: none !important;
}

/* =========================================================
   QUIZ PREVIEW (big question mark)
   ========================================================= */

.quiz-preview {
  position: relative;
  overflow: hidden;
}

/* subtle dark overlay so ? stands out */
.quiz-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
}

/* BIG question mark */
.quiz-preview-mark {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: clamp(5rem, 12vw, 9rem);
  font-weight: 900;
  color: #0000FF; /* blue */

  text-shadow:
    0 0 18px rgba(125,179,255,0.8),
    0 0 36px rgba(80,150,255,0.5),
    0 8px 20px rgba(0,0,0,0.6);

  z-index: 2;
  pointer-events: none;
}

@keyframes puzzleWrong {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}


/* animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes quizPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.quiz-preview-mark {
  animation: quizPulse 3s ease-in-out infinite;
}

/* =========================================================
   TILE REVEAL GAME
   ========================================================= */
   
/* Tile Reveal preview card */
.tile-preview {
  position: relative;
  overflow: hidden;
}

.tile-preview img {
  filter: brightness(0.85);
}

.tile-preview-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(4, 1fr);
  z-index: 2;
}

.tile-preview-grid span {
  border: 1px solid rgba(255,255,255,0.18);
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,0.10), transparent 42%),
    linear-gradient(135deg, rgba(60,60,60,0.86), rgba(10,10,10,0.88));
}

.tile-preview-grid span:nth-child(3),
.tile-preview-grid span:nth-child(7),
.tile-preview-grid span:nth-child(12),
.tile-preview-grid span:nth-child(18) {
  background: transparent;
}

/* Tile Reveal game setup */ 

.tile-reveal-page .tile-game {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
}

.tile-reveal-page .tile-game-area {
  display: grid;
  grid-template-columns: minmax(520px, 760px) minmax(260px, 1fr);
  gap: 28px;
  align-items: start;
}

.tile-reveal-page .tile-board-wrap {
  display: flex;
  justify-content: center;
}

.tile-reveal-page .tile-board {
  --cols: 5;
  --rows: 4;

  width: min(760px, 100%);
  aspect-ratio: 5 / 4;

  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: repeat(var(--rows), 1fr);

  background-size: cover;
  background-position: center;
  border-radius: 20px;
  overflow: hidden;

  border: 2px solid rgba(255,255,255,0.14);
  box-shadow: 0 24px 64px rgba(0,0,0,0.38);
}

.tile-reveal-page .tile-cover {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,0.12), transparent 42%),
    linear-gradient(135deg, #3a3a3a 0%, #111 100%);
  cursor: pointer;
  transition: opacity 0.25s ease, background 0.18s ease;
}

.tile-reveal-page .tile-cover:hover {
  background:
    radial-gradient(circle at 50% 35%, rgba(244,197,66,0.22), transparent 42%),
    linear-gradient(135deg, #4a4a4a 0%, #171717 100%);
}

.tile-reveal-page .tile-cover.is-revealed {
  opacity: 0;
  pointer-events: none;
}

.tile-reveal-page .tile-start-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,0.50);
  backdrop-filter: blur(4px);
  border-radius: 22px;
}

.tile-reveal-page .tile-start-card {
  width: min(520px, 100%);
  text-align: center;
  padding: 30px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(244,197,66,0.16), transparent 42%),
    linear-gradient(180deg, #2c2c2c 0%, #11161c 100%);
  border: 1px solid rgba(255,230,160,0.28);
  box-shadow:
    0 24px 64px rgba(0,0,0,0.45),
    0 0 30px rgba(244,197,66,0.12);
}

.tile-reveal-page .tile-limit-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.tile-reveal-page .tile-limit-btn {
  min-width: 96px;
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,230,160,0.85);
  background: linear-gradient(135deg, #f4c542 0%, #ff9f2f 100%);
  color: #111;
  font-weight: 900;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(0,0,0,0.30),
    0 0 20px rgba(244,197,66,0.22);
}

.tile-reveal-page .tile-side {
  display: grid;
  gap: 14px;
}

.tile-reveal-page .tile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tile-reveal-page .tile-stats span {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 9px 14px;
  border-radius: 999px;

  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.02em;

  color: #f4f5f7;

  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);

  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

#tilesLeft {
  border-color: rgba(213,179,106,0.45);
  color: var(--accent);
}

.tile-reveal-page .tile-choices {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tile-reveal-page .tile-choice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 42px;
  padding: 10px 16px;

  border-radius: 999px;

  font-size: 0.95rem;
  font-weight: 900;

  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: #f4f5f7;

  cursor: pointer;

  transition: transform 0.18s ease,
              background 0.18s ease,
              border-color 0.18s ease,
              box-shadow 0.18s ease;
}

.tile-reveal-page .tile-choice-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(213,179,106,0.55);
  background: rgba(213,179,106,0.12);
  box-shadow: 0 10px 22px rgba(0,0,0,0.28);
}

.tile-reveal-page .tile-choice-btn.is-correct {
  background: linear-gradient(135deg, #f4c542 0%, #ff9f2f 100%);
  color: #111;
  border-color: rgba(255,230,160,0.9);
  box-shadow:
    0 0 0 2px rgba(213,179,106,0.7),
    0 0 22px rgba(213,179,106,0.45);
}

.tile-reveal-page .tile-choice-btn.is-wrong {
  border-color: rgba(255,80,80,0.9);
  box-shadow:
    0 0 0 2px rgba(255,80,80,0.45),
    0 0 18px rgba(255,60,60,0.35);
  opacity: 0.7;
}

.tile-reveal-page .tile-feedback {
  min-height: 28px;
  font-weight: 900;
  text-align: center;
}

.tile-reveal-page .tile-feedback.is-correct {
  color: var(--accent);
}

.tile-reveal-page .tile-feedback.is-wrong {
  color: #ff7373;
}

.tile-reveal-page .tile-result {
  text-align: center;
  margin-top: 24px;
  padding: 24px;
  border-radius: 22px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.10);
}

.tile-reveal-page .tile-start-modal.is-hidden {
  display: none !important;
}

#tileChoices.is-hidden,
.tile-choices.is-hidden,
#cancelTileGame.is-hidden,
#tileAfterActions.is-hidden,
#tileViewGalleryBtn.is-hidden {
  display: none !important;
}


/* =========================================================
   MEMORY PAIRS GAME
   ========================================================= */

.memory-game {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
}

.memory-start-modal {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0,0,0,0.50);
  backdrop-filter: blur(4px);
  border-radius: 22px;
}

.memory-start-modal.is-hidden {
  display: none !important;
}

.memory-start-card {
  width: min(560px, 100%);
  text-align: center;
  padding: 30px;
  border-radius: 24px;
  position: relative;
  background:
    radial-gradient(circle at 50% 0%, rgba(244,197,66,0.16), transparent 42%),
    linear-gradient(180deg, #2c2c2c 0%, #11161c 100%);
  border: 1px solid rgba(255,230,160,0.28);
  box-shadow:
    0 24px 64px rgba(0,0,0,0.45),
    0 0 30px rgba(244,197,66,0.12);
}

.memory-start-card .game-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 50;
}

.memory-start-card h3 {
  margin-top: 0;
  font-size: 1.65rem;
}

.memory-start-card p {
  color: var(--muted);
}

.memory-size-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.memory-size-btn {
  min-width: 98px;
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,230,160,0.85);
  background: linear-gradient(135deg, #f4c542 0%, #ff9f2f 100%);
  color: #111;
  font-weight: 900;
  cursor: pointer;
  box-shadow:
    0 10px 24px rgba(0,0,0,0.30),
    0 0 20px rgba(244,197,66,0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.memory-size-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 30px rgba(0,0,0,0.36),
    0 0 28px rgba(244,197,66,0.32);
}

.memory-topbar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.memory-topbar span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: #f4f5f7;
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
}

#memoryScore {
  color: var(--accent);
  border-color: rgba(213,179,106,0.45);
}

.memory-board {
  --memory-cols: 4;

  display: grid;
  grid-template-columns: repeat(var(--memory-cols), 1fr);
  gap: 6px;

  max-width: 560px;
  margin: 0 auto;
}

.memory-board[data-size="6x6"] {
  max-width: 600px;
}

.memory-board[data-size="8x8"] {
  max-width: 650px;
}

.memory-card {
  aspect-ratio: 4 / 3;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  perspective: 900px;
}

.memory-card-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.35s ease;
}

.memory-card.is-flipped .memory-card-inner,
.memory-card.is-matched .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 14px;
  overflow: hidden;
  backface-visibility: hidden;
  box-shadow: 0 10px 24px rgba(0,0,0,0.30);
  border: 1px solid rgba(255,255,255,0.14);
}

.memory-card-back {
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,0.12), transparent 42%),
    linear-gradient(135deg, #3a3a3a 0%, #111 100%);
  color: var(--accent);
  font-size: clamp(1.4rem, 4vw, 2.6rem);
  font-weight: 900;
  text-shadow: 0 0 18px rgba(213,179,106,0.38);
}

.memory-card-front {
  transform: rotateY(180deg);
  background: #111;
}

.memory-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.memory-card.is-matched {
  cursor: default;
}

.memory-card.is-matched .memory-card-front {
  border-color: rgba(213,179,106,0.75);
  box-shadow:
    0 0 0 2px rgba(213,179,106,0.45),
    0 0 22px rgba(213,179,106,0.35);
}

.memory-result {
  text-align: center;
  margin-top: 24px;
  padding: 24px;
  border-radius: 22px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.10);
}

.memory-preview {
  background:
    radial-gradient(circle at 50% 0%, rgba(244,197,66,0.16), transparent 42%),
    linear-gradient(180deg, #2c2c2c 0%, #11161c 100%);
}

.memory-preview-grid {
  height: 100%;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}

.memory-preview-grid span {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 35%, rgba(255,255,255,0.12), transparent 42%),
    linear-gradient(135deg, #3a3a3a 0%, #111 100%);
  color: var(--accent);
  font-weight: 900;
  font-size: 1.3rem;
  box-shadow: 0 8px 18px rgba(0,0,0,0.28);
}

.memory-start-game-btn {
  margin: 18px auto 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 13px 24px;
  border-radius: 999px;
  border: 1px solid rgba(255,230,160,0.85);

  background: linear-gradient(135deg, #f4c542 0%, #ff9f2f 100%);
  color: #111;

  font-weight: 900;
  cursor: pointer;

  box-shadow:
    0 10px 24px rgba(0,0,0,0.30),
    0 0 20px rgba(244,197,66,0.22);

  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.memory-start-game-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 14px 30px rgba(0,0,0,0.36),
    0 0 28px rgba(244,197,66,0.32);
}

.memory-start-game-btn.is-hidden {
  display: none !important;
}

#memoryLeaderboardMini.is-hidden,
#memorySizeButtons.is-hidden {
  display: none !important;
}

#cancelMemoryGame {
  display: flex;
  justify-content: center;
  margin: 18px auto 0;
}

.score-save-box {
  margin: 22px auto 0;
  max-width: 460px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.10);
}

.score-save-box h4 {
  margin: 0 0 12px;
}

.score-save-box input {
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 700;
}

.score-save-box input::placeholder {
  color: rgba(255,255,255,0.62);
}

#saveScoreMessage {
  margin: 10px 0 0;
  color: var(--accent);
  font-weight: 800;
}

.leaderboard-box {
  margin: 22px auto 0;
  max-width: 620px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.10);
}

.leaderboard-box h4 {
  margin: 0 0 14px;
}

.leaderboard-list {
  margin: 0;
  padding-left: 20px;
}

.leaderboard-list li {
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.045);
}

.leaderboard-list strong {
  color: var(--accent);
  margin-right: 6px;
}

.leaderboard-list span {
  color: var(--muted);
  margin-right: 10px;
  white-space: nowrap;
}

.leaderboard-list em {
  display: inline;
  font-style: normal;
  color: var(--muted);
  font-size: 0.88rem;
}

.score-saved-message {
  margin: 0;
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(213,179,106,0.14);
  border: 1px solid rgba(213,179,106,0.45);
  color: var(--accent);
  font-weight: 900;
  text-align: center;
}

.leaderboard-mini {
  margin: 16px auto 18px;
  padding: 11px 14px;
  border-radius: 999px;
  background: rgba(213,179,106,0.14);
  border: 1px solid rgba(213,179,106,0.38);
  color: var(--accent);
  font-weight: 900;
  line-height: 1.35;
}

.tile-result-modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,0.56);
  backdrop-filter: blur(5px);
}

.tile-result-modal.is-hidden {
  display: none !important;
}

.tile-result-card {
  width: min(760px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  position: relative;
  text-align: center;
  padding: 24px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(244,197,66,0.16), transparent 42%),
    linear-gradient(180deg, #2c2c2c 0%, #11161c 100%);
  border: 1px solid rgba(255,230,160,0.28);
  box-shadow:
    0 24px 64px rgba(0,0,0,0.50),
    0 0 30px rgba(244,197,66,0.12);
}

.tile-result-card .leaderboard-box {
  margin-top: 18px;
}
.game-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 900;
  cursor: pointer;
  z-index: 5;
}

.game-modal-close:hover {
  background: rgba(213,179,106,0.20);
  border-color: rgba(213,179,106,0.55);
}
.tile-start-card {
  position: relative;
}

.tile-start-card .game-modal-close {
  top: 12px;
  right: 12px;
}

.vialens-trophy {
  margin: 14px auto 0;
  padding: 12px 18px;

  border-radius: 16px;

  text-align: center;
  font-weight: 900;
  font-size: 1rem;

  background: rgba(213,179,106,0.14);
  border: 1px solid rgba(213,179,106,0.42);

  color: var(--accent);

  box-shadow:
    0 10px 24px rgba(0,0,0,0.28),
    0 0 18px rgba(213,179,106,0.14);
}

.vialens-trophy-rank-1 {
  transform: scale(1.03);
}

.vialens-trophy-rank-2,
.vialens-trophy-rank-3 {
  opacity: 0.96;
}

.vialens-trophy-card {
  max-width: 520px;
}

.vialens-trophy-big-icon {
  font-size: clamp(4rem, 14vw, 7rem);
  line-height: 1;
  margin-bottom: 12px;
}

.vialens-rank-notice {
  margin: 14px auto 0;
  padding: 12px 18px;
  border-radius: 16px;
  text-align: center;
  font-weight: 900;
  background: rgba(213,179,106,0.14);
  border: 1px solid rgba(213,179,106,0.42);
  color: var(--accent);
}

.vialens-rank-top {
  font-size: 1.05rem;
  box-shadow:
    0 10px 24px rgba(0,0,0,0.28),
    0 0 18px rgba(213,179,106,0.14);
}

/* =========================================================
   ZOOM OUT GAME
   ========================================================= */

.interactive-game-image.is-zoomed {
  overflow: hidden;
}

.interactive-game-image.is-zoomed img {
  transform: scale(2.7);
  transform-origin: center;
}

.zoom-image-wrap {
  width: min(100%, 420px);
  aspect-ratio: 4 / 3;
  margin: 0 auto 18px;
  overflow: hidden;

  border-radius: 22px;
  background: #05070a;
  border: 1px solid rgba(255,255,255,0.12);

  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;

  transform: scale(5.2);
  transform-origin: center;
  transition: transform 0.45s ease;
}

.zoom-game .blur-actions {
  margin-top: 18px;
}

.zoom-game {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.zoom-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;

  width: 100%;
  margin: 14px auto 16px;

  flex-wrap: wrap;
}

.zoom-stats span {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 8px 13px;
  border-radius: 999px;

  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);

  color: #f4f5f7;
  font-size: 0.85rem;
  font-weight: 900;
}

#zoomTime {
  color: var(--accent);
  border-color: rgba(213,179,106,0.45);
}

#zoomFeedback {
  width: 100%;
  text-align: center;
  margin: 12px auto;
}

#zoomResultStats {
  text-align: center;
  line-height: 1.6;
}

/* Correct / Place / Gallery line after finish */
.zoom-game #zoomSolvedInfo {
  width: 100%;
  margin: 14px auto 0;
  text-align: center;
}

.zoom-game #zoomSolvedInfo .blur-result-line,
.zoom-game #zoomSolvedInfo .blur-gallery-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  margin: 0 8px 0;
  line-height: 1.4;

  font-weight: 700;
}

.zoom-game #zoomSolvedInfo .blur-inline-space {
  width: 14px;
  display: inline-block;
}

.zoom-game #zoomSolvedInfo .blur-label-white,
.zoom-game #zoomSolvedInfo .blur-value-gold {
  font-weight: 700;
}

#zoomChoices.is-hidden,
#zoomOutBtn.is-hidden,
#cancelZoomGame.is-hidden,
#zoomAfterActions.is-hidden,
#zoomViewGalleryBtn.is-hidden,
#zoomSolvedInfo.is-hidden {
  display: none !important;
}

/* =========================================================
   TILE + PUZZLE SOLVED INFO CLEAN LAYOUT
   ========================================================= */

.tile-reveal-page #tileSolvedInfo,
.puzzle-page #puzzleSolvedInfo {
  width: 100%;
  margin: 16px auto 0;
  text-align: center;
}

.tile-reveal-page #tileSolvedInfo .blur-result-line,
.tile-reveal-page #tileSolvedInfo .blur-gallery-line,
.puzzle-page #puzzleSolvedInfo .blur-result-line,
.puzzle-page #puzzleSolvedInfo .blur-gallery-line {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;

  margin: 4px auto;
  line-height: 1.45;
}

.tile-reveal-page #tileSolvedInfo .blur-inline-space,
.puzzle-page #puzzleSolvedInfo .blur-inline-space {
  display: none;
}

/* Force Tile/Puzzle result info into separate neat lines */
.tile-reveal-page #tileSolvedInfo .blur-result-line,
.puzzle-page #puzzleSolvedInfo .blur-result-line {
  flex-direction: column;
  gap: 2px;
}

.tile-reveal-page #tileSolvedInfo .blur-gallery-line,
.puzzle-page #puzzleSolvedInfo .blur-gallery-line {
  flex-direction: column;
  gap: 2px;
}

.puzzle-page .puzzle-side.is-finished .puzzle-pieces {
  display: none;
}

.puzzle-page .puzzle-side.is-finished {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  min-height: 320px;
}

.puzzle-page .puzzle-side.is-finished + #puzzleAfterActions {
  margin-top: 0;
}

/* =========================================================
   LETTER REVEAL GAME
   ========================================================= */

.letter-game {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.letter-photo-wrap {
  width: min(100%, 360px);
  aspect-ratio: 4 / 3;
  margin: 0 auto 18px;
  overflow: hidden;

  border-radius: 20px;
  background: #05070a;
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 20px 54px rgba(0,0,0,0.34);
}

.letter-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.letter-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;

  width: 100%;
  margin: 14px auto 16px;

  flex-wrap: wrap;
}

.letter-stats span {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 8px 13px;
  border-radius: 999px;

  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);

  color: #f4f5f7;
  font-size: 0.85rem;
  font-weight: 900;
}

#letterScore {
  color: var(--accent);
  border-color: rgba(213,179,106,0.45);
}

.letter-hidden-words {
  width: min(100%, 760px);
  margin: 10px auto 18px;
  padding: 18px;

  border-radius: 20px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.10);

  text-align: center;
}

.letter-line {
  margin: 10px auto;
}

.letter-line-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 900;
}

.letter-word {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px 8px;
}

.letter-char {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 22px;
  min-height: 34px;

  color: var(--accent);
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1;

  border-bottom: 2px solid rgba(213,179,106,0.45);
}

.letter-char.letter-space {
  min-width: 18px;
  border-bottom: 0;
}

.letter-char.is-revealed {
  color: #f4f5f7;
  border-bottom-color: var(--accent);
}

.letter-alphabet {
  width: min(100%, 760px);
  margin: 12px auto;

  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 8px;
}

.letter-btn {
  min-height: 42px;

  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: #f4f5f7;

  font-weight: 900;
  cursor: pointer;
}

.letter-btn:hover {
  border-color: rgba(213,179,106,0.55);
  background: rgba(213,179,106,0.12);
}

.letter-btn.is-correct {
  background: linear-gradient(135deg, #f4c542 0%, #ff9f2f 100%);
  color: #111;
}

.letter-btn.is-wrong {
  opacity: 0.45;
  text-decoration: line-through;
}

.letter-btn:disabled {
  cursor: default;
}

#letterFeedback {
  width: 100%;
  text-align: center;
  margin: 12px auto;
}

#letterChoices.is-hidden,
#letterAlphabet.is-hidden,
#letterHiddenWords.is-hidden,
#cancelLetterGame.is-hidden,
#letterAfterActions.is-hidden,
#letterViewGalleryBtn.is-hidden,
#letterSolvedInfo.is-hidden {
  display: none !important;
}

.letter-reveal-page #letterSolvedInfo {
  width: 100%;
  margin: 14px auto 0;
  text-align: center;
}

.interactive-game-image.letter-preview {
  position: relative;
  overflow: hidden;
}

.interactive-game-image.letter-preview img {
  filter: brightness(0.62) contrast(1.08);
  transform: scale(1.04);
}

.letter-preview-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.letter-preview-overlay span {
  position: absolute;
  display: grid;
  place-items: center;

  width: 34px;
  height: 34px;
  border-radius: 50%;

  background: rgba(244,197,66,0.9);
  color: #111;

  font-weight: 900;
  font-size: 1rem;

  box-shadow:
    0 8px 18px rgba(0,0,0,0.42),
    0 0 18px rgba(244,197,66,0.25);
}

.letter-preview-overlay span:nth-child(1) { left: 8%;  top: 16%; transform: rotate(-12deg); }
.letter-preview-overlay span:nth-child(2) { left: 26%; top: 38%; transform: rotate(10deg); }
.letter-preview-overlay span:nth-child(3) { left: 48%; top: 18%; transform: rotate(-6deg); }
.letter-preview-overlay span:nth-child(4) { left: 72%; top: 34%; transform: rotate(14deg); }
.letter-preview-overlay span:nth-child(5) { left: 84%; top: 12%; transform: rotate(-10deg); }

.letter-preview-overlay span:nth-child(6) { left: 14%; top: 66%; transform: rotate(8deg); }
.letter-preview-overlay span:nth-child(7) { left: 36%; top: 72%; transform: rotate(-14deg); }
.letter-preview-overlay span:nth-child(8) { left: 56%; top: 58%; transform: rotate(12deg); }
.letter-preview-overlay span:nth-child(9) { left: 76%; top: 72%; transform: rotate(-8deg); }
.letter-preview-overlay span:nth-child(10) { left: 45%; top: 43%; transform: rotate(4deg); }


/* =========================================================
   NAME BUILDER GAME
   ========================================================= */

.name-builder-game {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.name-builder-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;

  width: 100%;
  margin-bottom: 10px;

  flex-wrap: wrap;
}

.name-builder-stats span {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 8px 13px;
  border-radius: 999px;

  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);

  color: #f4f5f7;
  font-size: 0.85rem;
  font-weight: 900;
}

#nameBuilderScore {
  color: var(--accent);
  border-color: rgba(213,179,106,0.45);
}

.name-builder-board {
  width: min(100%, 760px);
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.name-builder-rows {
  display: grid;
  gap: 10px;
}

.name-builder-row {
  padding: 12px;
  border-radius: 20px;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.10);
  text-align: center;
}

.name-builder-row h4 {
  margin: 0 0 8px;
  color: var(--accent);
}

.name-builder-slots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}

.name-builder-slot,
.name-builder-token {
  min-height: 36px;
  padding: 7px 11px;

  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);

  background: rgba(255,255,255,0.08);
  color: #f4f5f7;

  font-weight: 0.86rem;
  font-weight: 900;
  cursor: pointer;
}

.name-builder-slot {
  min-width: 76px;
  background: rgba(0,0,0,0.26);
}

.name-builder-slot.is-filled {
  border-color: rgba(213,179,106,0.38);
}

.name-builder-slot.is-correct {
  background: linear-gradient(135deg, #f4c542 0%, #ff9f2f 100%);
  color: #111;
  border-color: rgba(255,230,160,0.9);
}

.name-builder-slot.is-wrong {
  background: rgba(255,80,80,0.16);
  border-color: rgba(255,80,80,0.65);
  color: #ffd7d7;
}

.name-builder-slot.is-locked {
  box-shadow:
    0 0 0 2px rgba(213,179,106,0.45),
    0 0 22px rgba(213,179,106,0.25);
}

.name-builder-slot.is-given {
  background: rgba(213,179,106,0.20);
  color: var(--accent);
  border-color: rgba(213,179,106,0.65);
  cursor: default;
}

.name-builder-bank-wrap {
  padding: 12px;
  border-radius: 22px;
  background: rgba(0,0,0,0.24);
  border: 1px solid rgba(255,255,255,0.10);
  text-align: center;
  margin-top: 4px;
}

.name-builder-bank-wrap h4 {
  margin-bottom: 9px;
  font-size: 0.95rem;
}

.name-builder-bank {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
}

.name-builder-token:hover {
  border-color: rgba(213,179,106,0.55);
  background: rgba(213,179,106,0.12);
}

.name-builder-token.is-selected {
  background: linear-gradient(135deg, #f4c542 0%, #ff9f2f 100%);
  color: #111;
  transform: translateY(-2px);
}

.name-builder-token.is-used {
  opacity: 0.35;
}

.name-builder-token:disabled {
  cursor: default;
}

.name-builder-controls {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

#nameBuilderFeedback {
  width: 100%;
  text-align: center;
  margin: 12px auto;
}

#nameBuilderBoard.is-hidden,
#nameBuilderControls.is-hidden,
#cancelNameBuilderGame.is-hidden,
#nameBuilderAfterActions.is-hidden,
#nameBuilderSolvedInfo.is-hidden,
#nameBuilderLeaderboardList.is-hidden,
#nameBuilderLeaderboardLocked.is-hidden {
  display: none !important;
}

.name-builder-page #nameBuilderSolvedInfo {
  width: min(100%, 980px);
  margin: 14px auto 0;
  text-align: center;
}

.name-builder-page #nameBuilderSolvedTitles {
  display: inline-block;
  max-width: 100%;
  line-height: 1.5;
}

.interactive-game-image.name-builder-preview {
  position: relative;
  overflow: hidden;
}

.interactive-game-image.name-builder-preview img {
  filter: brightness(0.58) contrast(1.08);
  transform: scale(1.04);
}

.name-builder-preview-pills {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.name-builder-preview-pills span {
  position: absolute;
  padding: 7px 11px;
  border-radius: 999px;

  background: rgba(244,197,66,0.92);
  color: #111;

  font-weight: 900;
  font-size: 0.78rem;

  box-shadow:
    0 8px 18px rgba(0,0,0,0.42),
    0 0 18px rgba(244,197,66,0.25);
}

.name-builder-preview-pills span:nth-child(1) { left: 8%;  top: 16%; transform: rotate(-9deg); }
.name-builder-preview-pills span:nth-child(2) { left: 48%; top: 20%; transform: rotate(7deg); }
.name-builder-preview-pills span:nth-child(3) { left: 24%; top: 46%; transform: rotate(-4deg); }
.name-builder-preview-pills span:nth-child(4) { left: 60%; top: 58%; transform: rotate(10deg); }
.name-builder-preview-pills span:nth-child(5) { left: 15%; top: 72%; transform: rotate(-7deg); }

.name-builder-level-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px auto 0;
}


.name-builder-country-label {
  margin: 14px auto 8px;
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.name-builder-country-slot {
  min-width: 140px;
}

.name-builder-token.is-country-token {
  border-color: rgba(80,170,255,0.45);
  background: rgba(80,170,255,0.10);
}

.name-builder-token.is-country-token.is-selected {
  background: linear-gradient(135deg, #7db3ff 0%, #4f8cff 100%);
  color: #07111f;
}

#startNameBuilderGame.is-hidden {
  display: none !important;
}

.name-builder-country-label {
  margin: 8px auto 5px;
}

.name-builder-country-slot {
  min-width: 110px;
}

.name-builder-rules-list {
  display: grid;
  gap: 10px;
  margin: 16px auto 18px;
}

.name-builder-rules-list div {
  display: grid;
  gap: 4px;

  padding: 11px 14px;
  border-radius: 14px;

  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
}

.name-builder-rules-list strong {
  color: var(--accent);
  font-weight: 600;
}

.name-builder-rules-list span {
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}


.name-builder-meta-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 10px;
}

.name-builder-meta-group {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.name-builder-meta-label {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

.name-builder-gallery-slot {
  min-width: 140px;
}

.name-builder-token.is-gallery-token {
  border-color: rgba(140,255,180,0.45);
  background: rgba(140,255,180,0.10);
}

.name-builder-token.is-gallery-token.is-selected {
  background: linear-gradient(135deg, #93f0ad 0%, #42c86c 100%);
  color: #07150b;
}

.name-builder-subtitle-group {
  flex-basis: 100%;
  margin-top: 4px;
}

.name-builder-subtitle-slot {
  min-width: min(100%, 420px);
  max-width: 100%;
  white-space: normal;
  line-height: 1.35;
  border-radius: 16px;
}

.name-builder-token.is-subtitle-token {
  max-width: 360px;
  white-space: normal;
  line-height: 1.35;
  border-color: rgba(205,150,255,0.50);
  background: rgba(205,150,255,0.12);
  border-radius: 16px;
}

.name-builder-token.is-subtitle-token.is-selected {
  background: linear-gradient(135deg, #d8a8ff 0%, #9b5cff 100%);
  color: #14051f;
}

.name-builder-expert-group {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 9px;
}

.name-builder-expert-group .name-builder-meta-label {
  text-align: right;
}

.name-builder-expert-group .name-builder-slots {
  justify-content: flex-start;
}

.name-builder-expert-subtitle {
  align-items: start;
}

.name-builder-page .name-builder-row {
  max-width: 100%;
}


.name-builder-page .name-builder-slot {
  min-width: 72px;
  width: auto;
  padding: 7px 14px;
}

.name-builder-page .name-builder-slot:not(.is-filled) {
  min-width: 72px;
  max-width: 120px;
}

.name-builder-page .name-builder-subtitle-slot:not(.is-filled),
.name-builder-page .name-builder-gallery-slot:not(.is-filled) {
  min-width: 72px;
  max-width: 120px;
}

.name-builder-page .name-builder-slot.is-filled {
  min-width: fit-content;
  max-width: 100%;
}
.name-builder-page .name-builder-game.is-expert .name-builder-token,
.name-builder-page .name-builder-game.is-expert .name-builder-token.is-country-token,
.name-builder-page .name-builder-game.is-expert .name-builder-token.is-gallery-token,
.name-builder-page .name-builder-game.is-expert .name-builder-token.is-subtitle-token {
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: #f4f5f7;
}

.name-builder-page .name-builder-game.is-expert .name-builder-token.is-selected {
  background: linear-gradient(135deg, #f4c542 0%, #ff9f2f 100%);
  color: #111;
}

.name-builder-rules-list {
  display: grid;
  gap: 10px;
  margin: 16px auto 18px;
}

.name-builder-level-card {
  width: 100%;
  display: grid;
  gap: 4px;

  padding: 11px 14px;
  border-radius: 14px;

  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(244,197,66,0.55);

  color: #f4f5f7;
  text-align: left;
  cursor: pointer;

  box-shadow:
    0 8px 18px rgba(0,0,0,0.22),
    0 0 14px rgba(244,197,66,0.10);

  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.name-builder-level-card:hover {
  transform: translateY(-2px);
  background: rgba(244,197,66,0.12);
  border-color: rgba(244,197,66,0.85);
}

.name-builder-level-card strong {
  color: var(--accent);
  font-weight: 900;
}

.name-builder-level-card span {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

.name-builder-level-card.is-selected {
  background: linear-gradient(135deg, #f4c542 0%, #ff9f2f 100%);
  border-color: rgba(255,230,160,0.95);
  color: #111;
  text-align: center;
}

.name-builder-level-card.is-selected strong,
.name-builder-level-card.is-selected span {
  color: #111;
}

.name-builder-level-card.is-hidden {
  display: none !important;
}

.name-builder-rules-list.has-selection {
  margin-bottom: 8px;
}






