/* Entrasol Game - style.css */

@font-face {
  font-family: 'Noto Sans';
  src: url('../fonts/NotoSans-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans';
  src: url('../fonts/NotoSans-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --entrasol-white: #FFFFFF;
  --entrasol-green: #8BC34A;
  --entrasol-blue-light: #A7D8F0;
  --entrasol-blue-dark: #141A8C;
  --entrasol-gold: #E8B339;
  --body-bg: #EAF5F2;
  --app-max-width: 430px;
}

html, body { height: 100%; }

body {
  font-family: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--entrasol-blue-dark);
  background-color: var(--body-bg);
  font-size: 16px;
}

/* Container tampilan mobile: lebar maksimum 430px, tetap terlihat seperti mobile di desktop */
.home-hero {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% 35%, #FFFFFF 0%, #FFFFF8 38%, transparent 75%),
    radial-gradient(ellipse at 0% 75%, #E9F9D9 0%, transparent 55%),
    linear-gradient(180deg, #F0F8F5 0%, #F5F8EC 45%, #DDF3F4 100%);
  box-shadow: 0 0 40px rgba(20, 26, 140, 0.08);
}

/* Background wave di dasar container */
.home-hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  aspect-ratio: 390 / 120;
  background: url('../assets/background-wave.svg') no-repeat bottom center / 100% 100%;
}

.hero-content { position: relative; z-index: 1; }

.brand-logo { max-width: 240px; width: 60%; height: auto; }
.footer-logo { width: 140px; max-width: 75%; height: auto; }

.game-title { font-size: 2rem; font-weight: 700; color: var(--entrasol-blue-dark); letter-spacing: 0.5px; }
.game-subtitle { font-size: 1rem; color: var(--entrasol-blue-dark); opacity: 0.85; }

.btn-entrasol {
  background-color: var(--entrasol-blue-dark);
  border: 2px solid var(--entrasol-blue-dark);
  color: var(--entrasol-white);
  font-weight: 700;
  font-size: 1.15rem;
  padding: 0.75rem 2.75rem;
  border-radius: 50rem;
  min-height: 48px;
  min-width: 48px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  box-shadow: 0 6px 16px rgba(20, 26, 140, 0.25);
}

.btn-entrasol:hover, .btn-entrasol:focus {
  background-color: #0f1570;
  border-color: #0f1570;
  color: var(--entrasol-white);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(20, 26, 140, 0.35);
}

.btn-entrasol:active { transform: translateY(0); }

/* Daftar game - tiap item kartu putih: ikon (30% lebar) | separator | nomor | nama (rata kiri) */
.game-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 auto;
  padding: 0;
}
.game-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 90px;
  padding: 0.4rem 0.75rem 0.4rem 0.4rem;
  background-color: var(--entrasol-white);
  border-radius: 1rem;
  border: 2px solid transparent;
  box-shadow: 0 4px 14px rgba(20, 26, 140, 0.08);
}
.game-item--flip { border-color: var(--entrasol-blue-dark); }
.game-item--recall { border-color: var(--entrasol-green); }
.game-item--memorize { border-color: var(--entrasol-blue-light); }
.game-item__icon {
  flex: 0 0 30%;
  width: 30%;
  align-self: stretch;
  min-height: 0;
  object-fit: contain;
}
.game-item__sep {
  flex: 0 0 auto;
  width: 3px;
  height: 2.2rem;
  border-radius: 50rem;
}
.game-item__sep--flip { background-color: var(--entrasol-blue-dark); }
.game-item__sep--recall { background-color: var(--entrasol-green); }
.game-item__sep--memorize { background-color: var(--entrasol-blue-light); }
.game-item__num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 1.6rem;
  padding: 0 0.5rem;
  border-radius: 50rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--entrasol-white);
}
.game-item__num--flip { background-color: var(--entrasol-blue-dark); }
.game-item__num--recall { background-color: var(--entrasol-green); }
.game-item__num--memorize { background-color: var(--entrasol-blue-light); color: var(--entrasol-blue-dark); }
.game-item__name {
  text-align: left;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
  font-size: 1.05rem;
  line-height: 1.25;
}


/* ==========================================================================
   Memory Flip (game-1) - semua kelas berprefix .flip-
   ========================================================================== */

body.flip-body { background-color: rgba(20, 26, 140, 0.15); }

.flip-page {
  position: relative;
  justify-content: flex-start;
  overflow: hidden;
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  background: linear-gradient(
  180deg,
  #FFFFFF 0%,
  #F3F8FC 55%,
  #E7F1FA 100%
);
  box-shadow: 0 0 40px rgba(20, 26, 140, 0.08);
}


.flip-intro,
.flip-game {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.flip-intro[hidden],
.flip-game[hidden],
.flip-result[hidden] { display: none; }

/* Layar hitung mundur 3-2-1: overlay di depan Game_Screen (papan tertutup terlihat samar) */
.flip-countdown {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  text-align: center;
}
.flip-countdown[hidden] { display: none; }
.flip-countdown__label {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
}
.flip-countdown__number {
  font-size: 8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--entrasol-blue-dark);
  animation: flip-countdown-pulse 1s ease-in-out infinite;
}
@keyframes flip-countdown-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .flip-countdown__number { animation: none; }
}

/* Layar permainan: judul, HUD, progress bar, papan */
.flip-game {
  min-width: 0;
  min-height: 0;
  margin-top: 0;
  /*padding: 0 0.75rem 1.5rem;*/
  justify-content: flex-start;
}

.flip-game-title {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--entrasol-blue-dark);
}

.flip-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--entrasol-blue-dark);
}

.flip-title {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
}

.flip-subtitle {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  color: var(--entrasol-blue-dark);
  opacity: 0.85;
}

.flip-instruction {
  width: 100%;
  margin-bottom: 1.25rem;
  padding: 1rem;
  text-align: left;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--entrasol-blue-dark);
  background-color: var(--entrasol-white);
  border: 1px solid var(--entrasol-blue-dark);
  border-radius: 1rem;
  box-shadow: 0 4px 14px rgba(20, 26, 140, 0.08);
}
.flip-instruction p { margin: 0 0 0.75rem; }
.flip-instruction p:last-child { margin-bottom: 0; }

.flip-icon {
  display: block;
  width: 160px;
  max-width: 60%;
  height: auto;
  margin: 0.25rem 0 1rem;
  border-radius: 1rem;
}

.flip-icon--game {
  width: 96px;
  margin: 0 0 0.5rem;
}
.flip-icon--result {
  width: 140px;
  margin: 0;
}
.flip-instruction__title {
  margin: 0 0 0.75rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
}

.flip-time-alert {
  width: 100%;
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
  background-color: #F1F5FC;
  border: 1px solid rgba(20, 26, 140, 0.25);
  border-radius: 0.5rem;
}

/* HUD: timer + skor */
.flip-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, calc(4 * 100px + 3 * 8px));
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
}

.flip-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  min-height: 44px;
  padding: 0 0.9rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
  background-color: var(--entrasol-white);
  border: 2px solid var(--entrasol-blue-dark);
  border-radius: 50rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.flip-timer { gap: 0.4rem; }
.flip-timer__icon {
  flex: 0 0 auto;
  width: 1.1em;
  height: 1.1em;
  display: block;
}

.flip-timer--warning {
  color: #D32F2F;
  border-color: #D32F2F;
}

.flip-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #141A8C;
  background-color: #E4F3E9;
  font-weight: 700;
}

.flip-score #scoreText {
  display: inline-block;
  color: #141A8C;
}

.flip-progress {
  width: min(100%, calc(4 * 100px + 3 * 8px));
  height: 10px;
  margin-bottom: 1rem;
  background-color: rgba(20, 26, 140, 0.12);
  border-radius: 50rem;
}
.flip-progress .progress-bar {
  width: 100%;
  background-color: var(--entrasol-blue-dark);
  transition: width 1s linear, background-color 0.2s ease;
}

/* Papan 4x4 */
.flip-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: min(100%, calc(4 * 100px + 3 * 8px));
  margin: 0 auto;
}

.flip-card {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  width: 100%;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(20, 26, 140, 0.18);
  perspective: 600px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.flip-card:focus-visible {
  outline: 3px solid var(--entrasol-blue-dark);
  outline-offset: 2px;
}

.flip-card__inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  transform-style: preserve-3d;
  transition: transform 0.3s;
}

.flip-card.is-open .flip-card__inner { transform: rotateY(180deg); }

.flip-card__face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border:1px solid var(--entrasol-blue-light);
}

.flip-card__front { transform: rotateY(180deg); }

.flip-card--matched {
  box-shadow: 0 0 0 2px var(--entrasol-blue-dark),
              0 2px 10px rgba(20, 26, 140, 0.18);
}

/* Atur posisi judul dan jarak ke timer */
.flip-game .flip-game-title {
  margin-top: -0.5rem;
  margin-bottom: 2rem;
}

/* Layar hasil */
.flip-result {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
  min-width: 0;
  min-height: 60vh;
  min-height: 60svh;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--entrasol-blue-dark);
}
.flip-result[hidden] { display: none; }

.flip-result__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.flip-result__score {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}

.flip-result__number {
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--entrasol-blue-dark);
}

.flip-result__unit,
.flip-result__max {
  font-size: 1.125rem;
  color: var(--entrasol-blue-dark);
}

@media (min-width: 576px) {
  .flip-page { padding: 2rem 1.5rem; }
  .flip-title { font-size: 2.25rem; }
}


/* =========================================
   GAME 1 - HEADER BARU
========================================= */

.flip-game {
  min-width: 0;
  /*padding: 0 0.75rem 1.5rem;*/
}

/* Panel header keseluruhan */
.flip-game-header {
  width: min(100%, 424px);
  margin-bottom: 1rem;
  overflow: hidden;
  background: #FFFFFF;
  border-radius: 0 0 1.25rem 1.25rem;
  box-shadow: 0 6px 18px rgba(20, 26, 140, 0.08);
}

/* Bagian atas: biru tua */
.flip-game-header__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  background-color: #141A8C;
}

/* Ikon game */
.flip-game-header .flip-icon--game {
  width: 82px;
  max-width: 100%;
  height: 82px;
  margin: 0;
  object-fit: contain;
  border-radius: 0.75rem;
}

/* Judul */
.flip-game-header .flip-game-title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 700;
  color: #FFFFFF;
  text-align: center;
}

/* Bagian bawah: timer dan poin */
.flip-game-header__bottom {
  padding: 0.75rem 0.9rem 0.85rem;
  background-color: #FFFFFF;
}

.flip-game-header .flip-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin: 0 0 0.65rem;
}

/* Timer */
.flip-game-header .flip-timer {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0.35rem 0.5rem;
  gap: 0.4rem;
  font-size: 1.25rem;
  color: #141A8C;
  background-color: #FFFFFF;
  border: 1.5px solid #DCE8F5;
  border-radius: 0.85rem;
}

/* Ikon timer */
.flip-game-header .flip-timer__icon {
  width: 1.25em;
  height: 1.25em;
}

/* Poin */
.flip-game-header .flip-score {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.35rem 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #141A8C;
  background-color: #E5F5E9;
  border-radius: 0.85rem;
  white-space: nowrap;
}

/* Progress bar */
.flip-game-header .flip-progress {
  width: 100%;
  height: 8px;
  margin: 0;
  background-color: #E7EDEF;
  border-radius: 50rem;
}

.flip-game-header .flip-progress .progress-bar {
  background-color: #141A8C;
}


/* Game 1: gameplay selalu mulai dari atas */

.flip-game {
  margin-top: 0;
}


/* ==========================================================================
   Memory Recall (game-2) - semua kelas berprefix .recall- (tema hijau muda)
   ========================================================================== */

body.recall-body { background-color: rgba(139, 195, 74, 0.2); }

.recall-page {
  position: relative;
  justify-content: flex-start;
  overflow: hidden;
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  background: linear-gradient(180deg,#F9FFF6 0%,#F6FCF1 50%,#F1FCEB 100%);
  box-shadow: 0 0 40px rgba(20, 26, 140, 0.08);
}

.recall-intro,
.recall-game,
.recall-result {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  min-width: 0;
  color: var(--entrasol-blue-dark);
}

.recall-intro[hidden],
.recall-game[hidden],
.recall-result[hidden],
.recall-countdown[hidden] { display: none; }

/* Intro */
.recall-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--entrasol-blue-dark);
}

.recall-icon {
  display: block;
  width: 160px;
  max-width: 60%;
  height: auto;
  margin: 0.25rem 0 1rem;
  border-radius: 1rem;
}

.recall-title {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
}

.recall-subtitle {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  color: var(--entrasol-blue-dark);
  opacity: 0.85;
}

.recall-instruction {
  width: 100%;
  margin-bottom: 1.25rem;
  padding: 1rem;
  text-align: left;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--entrasol-blue-dark);
  background-color: var(--entrasol-white);
  border: 1px solid var(--entrasol-green);
  border-radius: 1rem;
  box-shadow: 0 4px 14px rgba(20, 26, 140, 0.08);
}
.recall-instruction p { margin: 0 0 0.75rem; }
.recall-instruction p:last-child { margin-bottom: 0; }

.recall-instruction__title {
  margin: 0 0 0.75rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
}

.recall-time-alert {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
  background-color: rgba(139, 195, 74, 0.2);
  border: 1px solid rgba(139, 195, 74, 0.6);
  border-radius: 0.5rem;
}

/* Countdown 3-2-1: overlay di depan Game_Screen */
.recall-countdown {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  text-align: center;
}
.recall-countdown__label {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
}
.recall-countdown__number {
  font-size: 8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--entrasol-blue-dark);
  animation: recall-countdown-pulse 1s ease-in-out infinite;
}
@keyframes recall-countdown-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .recall-countdown__number { animation: none; }
}

/* Game */
.recall-game {
  --recall-img: min(calc(50% - 8px), 280px);
  --recall-opt: min(55%, 190px);
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  align-self: stretch;
  gap: 0.5rem;
  padding: 0 0 1.5rem;
}

/* Ikon game di bagian paling atas layar permainan dan hasil */
.recall-top-icon {
  display: block;
  width: auto;
  height: 96px;
  max-width: 40%;
  margin: 0 auto;
  object-fit: contain;
}

.recall-game-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
}

.recall-badge {
  display: inline-block;
  padding: 0.25rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 50rem;
}
.recall-badge--memorize {
  color: var(--entrasol-blue-dark);
  background-color: var(--entrasol-blue-light);
}
.recall-badge--answer {
  color: var(--entrasol-white);
  background-color: var(--entrasol-blue-dark);
}

.recall-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  min-height: 44px;
  padding: 0 0.9rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
  background-color: var(--entrasol-white);
  border: 2px solid var(--entrasol-blue-dark);
  border-radius: 50rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.recall-timer__icon {
  display: block;
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  margin-right: 0.4em;
  object-fit: contain;
}
.recall-timer--warning {
  color: #D32F2F;
  border-color: #D32F2F;
}

.recall-progress {
  width: 100%;
  height: 8px;
  margin: 0;
  background-color: rgba(139, 195, 74, 0.25);
  border-radius: 50rem;
}
.recall-progress .progress-bar {
  background-color: var(--entrasol-blue-dark);
  transition: width 1s linear, background-color 0.2s ease;
}

.recall-prompt {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
}


/* Gambar */
.recall-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.recall-frame,
.recall-option {
  display: block;
  box-sizing: border-box;
  width: var(--recall-img);
  min-width: 44px;
  min-height: 44px;
  aspect-ratio: 1 / 1;
  margin: 4px;
  padding: 0;
  overflow: hidden;
  background-color: var(--entrasol-white);
  border: 3px solid var(--entrasol-green);
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(20, 26, 140, 0.18);
}
.recall-frame--empty { background-color: rgba(255, 255, 255, 0.6); }

.recall-option {
  display: block;
  box-sizing: border-box;
  width: min(34vw, 125px);
  min-width: 44px;
  min-height: 44px;
  aspect-ratio: 1 / 1;
  margin: 3px;
  padding: 0;
  overflow: hidden;
  background-color: var(--entrasol-white);
  border: 3px solid var(--entrasol-green);
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(20, 26, 140, 0.18);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.recall-option:focus-visible {
  outline: 3px solid var(--entrasol-blue-dark);
  outline-offset: 2px;
}

.recall-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recall-pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.recall-row {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}


/* =================================
   MEMORY RECALL - GAME HEADER
================================= */

.recall-game-header {
  width: 100%;
  overflow: hidden;
  background-color: #FFFFFF;
  border-radius: 0 0 1.5rem 1.5rem;
  box-shadow: 0 8px 24px rgba(20, 26, 140, 0.08);
  margin-bottom: 1.5rem;
}

.recall-game-header__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  background-color: #141A8C;
}

.recall-game-header .recall-top-icon {
  display: block;
  width: 76px;
  height: 76px;
  object-fit: contain;
  margin: 0;
}

.recall-game-header .recall-game-title {
  margin: 0;
  color: #FFFFFF;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.recall-game-header__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem 0.85rem;
  background-color: #FFFFFF;
}

.recall-game-header .recall-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 90px;
  min-height: 44px;
  padding: 0 1rem;
  margin: 0;
  color: #141A8C;
  background-color: #FFFFFF;
  border: 2px solid #141A8C;
  border-radius: 50rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.recall-game-header .recall-timer__icon {
  width: 1.1em;
  height: 1.1em;
  flex: 0 0 auto;
}

.recall-game-header .recall-progress {
  width: 100%;
  height: 10px;
  margin: 0;
  background-color: #E7F0E9;
  border-radius: 50rem;
  overflow: hidden;
}

.recall-game-header .recall-progress .progress-bar {
  background-color: #31AA70;
  border-radius: 50rem;
}

/* Prompt permainan */
.recall-game > .recall-prompt {
  margin: 0 0 1rem;
  color: #141A8C;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
}

/* Hilangkan badge fase lama jika masih digunakan */
.recall-badge[hidden] {
  display: none !important;
}

/* Layar hasil */
.recall-result {
  justify-content: center;
  gap: 1rem;
  min-height: 60vh;
  min-height: 60svh;
  padding: 2rem 1rem;
}

.recall-result__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.recall-result__icon {
  display: block;
  width: 96px;
  max-width: 40%;
  height: auto;
}

.recall-result__choice {
  display: block;
  width: 180px;
  max-width: 50%;
  aspect-ratio: 1 / 1;
  border: 3px solid var(--entrasol-green);
  border-radius: 12px;
  background: #FFFFFF;
  box-shadow: 0 3px 8px rgba(20, 26, 140, 0.18);
  overflow: hidden;
}
.recall-result__choice--empty {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: none;
}

.recall-result__score {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}

.recall-result__number {
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--entrasol-blue-dark);
}

.recall-result__unit,
.recall-result__max {
  font-size: 1.125rem;
  color: var(--entrasol-blue-dark);
}

@media (min-width: 576px) {
  .recall-page { padding: 2rem 1.5rem; }
  .recall-title { font-size: 2.25rem; }
}

/* ==========================================================================
   Memory Shuffle & Recall (game-3) - semua kelas berprefix .shuffle- (tema cyan lembut)
   ========================================================================== */

body.shuffle-body { background-color: #EAF8F8; }

.shuffle-page {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem 6rem;
  background: linear-gradient(
  180deg,
  #FAFFFF 0%,
  #F2FBFB 50%,
  #EAF7F8 100%
  );
  box-shadow: 0 0 40px rgba(20, 26, 140, 0.08);
}

.shuffle-screen-icon {
  display: block;
  width: auto;
  max-width: 40%;
  height: 96px;
  margin: 0 auto;
  object-fit: contain;
}

.shuffle-intro,
.shuffle-game,
.shuffle-result {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  min-width: 0;
  color: var(--entrasol-blue-dark);
}

.shuffle-intro[hidden],
.shuffle-game[hidden],
.shuffle-result[hidden],
.shuffle-countdown[hidden],
.shuffle-slots[hidden] { display: none; }

/* Tombol utama */
.shuffle-page .btn-entrasol {
  min-height: 48px;
  min-width: 44px;
}

/* Intro */
.shuffle-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--entrasol-blue-dark);
}

.shuffle-icon {
  display: block;
  width: 160px;
  max-width: 60%;
  height: auto;
  margin: 0.25rem 0 1rem;
  border-radius: 1rem;
}

.shuffle-title {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
  line-height: 0.8;
  margin-bottom: 0.25rem;
}

.shuffle-subtitle {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  color: var(--entrasol-blue-dark);
  opacity: 0.85;
}

.shuffle-instruction {
  width: 100%;
  margin-bottom: 1.25rem;
  padding: 1rem;
  text-align: left;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--entrasol-blue-dark);
  background-color: var(--entrasol-white);
  border: 1px solid var(--entrasol-blue-light);
  border-radius: 1rem;
  box-shadow: 0 4px 14px rgba(20, 26, 140, 0.08);
}
.shuffle-instruction p { margin: 0 0 0.75rem; }
.shuffle-instruction p:last-child { margin-bottom: 0; }

.shuffle-instruction__title {
  margin: 0 0 0.75rem;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
}

.shuffle-time-alert {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
  background-color: #EAF8F8;
  border: 1px solid #A9DDE5;
  border-radius: 0.5rem;
}

/* Countdown 3-2-1: overlay di depan Game_Screen */
.shuffle-countdown {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  text-align: center;
}
.shuffle-countdown__label {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
}
.shuffle-countdown__number {
  font-size: 8rem;
  font-weight: 700;
  line-height: 1;
  color: var(--entrasol-blue-dark);
  animation: shuffle-countdown-pulse 1s ease-in-out infinite;
}
@keyframes shuffle-countdown-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* Game */
.shuffle-game {
  --shuffle-card: min(calc((100% - 8px) / 3), 220px);
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  align-self: stretch;
  gap: 0.5rem;
  /*padding: 0 0.25rem 1.5rem;*/
}

.shuffle-game-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
}

.shuffle-badge {
  display: inline-block;
  padding: 0.25rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 50rem;
}
.shuffle-badge--memorize {
  color: var(--entrasol-blue-dark);
  background-color: var(--entrasol-blue-light);
}
.shuffle-badge--answer {
  color: var(--entrasol-white);
  background-color: var(--entrasol-blue-dark);
}

.shuffle-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3rem;
  min-height: 44px;
  padding: 0 0.9rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
  background-color: var(--entrasol-white);
  border: 2px solid var(--entrasol-blue-dark);
  border-radius: 50rem;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.shuffle-timer__icon {
  display: block;
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  margin-right: 0.4em;
  object-fit: contain;
}
.shuffle-timer--warning {
  color: #D32F2F;
  border-color: #D32F2F;
}

.shuffle-progress {
  width: min(100%, 280px);
  height: 10px;
  background-color: rgba(0, 188, 212, 0.25);
  border-radius: 50rem;
}
.shuffle-progress .progress-bar {
  background-color: var(--entrasol-blue-dark);
  transition: width 1s linear, background-color 0.2s ease;
}

.shuffle-prompt {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
}
/* Jarak Fase_Menyusun: Slot -> teks arahan 16px, teks arahan -> kartu 8px */
.shuffle-slots + .shuffle-prompt { margin-top: 16px; }
.shuffle-prompt + .shuffle-cards { margin-top: 0; }

/* Baris kartu */
.shuffle-slots,
.shuffle-cards,
.shuffle-result__slots {
  display: flex;
  justify-content: center;
  gap: 4px;
  width: 100%;
}

.shuffle-frame,
.shuffle-option,
.shuffle-slot {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: var(--shuffle-card);
  min-width: 44px;
  min-height: 44px;
  aspect-ratio: 1 / 1;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background-color: var(--entrasol-white);
  border: 2px solid var(--entrasol-blue-light);
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(20, 26, 140, 0.18);
}
.shuffle-memo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: var(--shuffle-card);
  min-width: 44px;
}
.shuffle-memo .shuffle-frame { width: 100%; }
.shuffle-memo__num {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: var(--entrasol-blue-dark);
}
.shuffle-frame--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
  background-color: rgba(255, 255, 255, 0.6);
}

.shuffle-slot {
  border-color: var(--entrasol-green);
  background-color: rgba(255, 255, 255, 0.6);
  box-shadow: none;
}
.shuffle-slot__num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--entrasol-blue-dark);
}
.shuffle-slot--filled { background-color: var(--entrasol-white); box-shadow: 0 3px 8px rgba(20, 26, 140, 0.18); }
.shuffle-slot--filled .shuffle-slot__num { display: none; }

.shuffle-option {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.shuffle-option:focus-visible {
  outline: 3px solid var(--entrasol-blue-dark);
  outline-offset: 2px;
}
.shuffle-option:disabled { opacity: 1; }
.shuffle-option--used { visibility: hidden; }
.shuffle-option--flying {
  z-index: 5;
  transition: transform 0.4s ease;
}

.shuffle-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}


/* =========================================
   GAME 3 - HEADER seperti Game 1 & Game 2
   ========================================= */

.shuffle-game-header {
  display: flex;
  flex-direction: column;
  width: calc(100% + 2rem);
  margin: 0 -1rem 1.25rem;
  overflow: hidden;
  background-color: #FFFFFF;
  border-radius: 0 0 1.5rem 1.5rem;
  box-shadow: 0 8px 24px rgba(20, 26, 140, 0.08);
}

/* Bagian biru: ikon dan judul */
.shuffle-game-header__top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 1rem;
  background-color: #141A8C;
}

.shuffle-game-header .shuffle-screen-icon {
  display: block;
  width: 76px;
  height: 76px;
  max-width: none;
  margin: 0;
  object-fit: contain;
}

.shuffle-game-header .shuffle-game-title {
  margin: 0;
  color: #FFFFFF;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

/* Badge disembunyikan, tetapi elemen tetap ada */
.shuffle-game-header .shuffle-badge {
  display: none !important;
}

/* Bagian putih: timer dan progress */
.shuffle-game-header__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem 0.85rem;
  background-color: #FFFFFF;
}

.shuffle-game-header .shuffle-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-width: 90px;
  min-height: 44px;
  padding: 0 1rem;
  margin: 0;
  color: #141A8C;
  background-color: #FFFFFF;
  border: 2px solid #141A8C;
  border-radius: 50rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.shuffle-game-header .shuffle-timer__icon {
  width: 1.1em;
  height: 1.1em;
  flex: 0 0 auto;
  margin: 0;
}

/* Progress bar cyan */
.shuffle-game-header .shuffle-progress {
  display: block;
  width: 100%;
  height: 10px;
  margin: 0;
  overflow: hidden;
  background-color: #DDF2F3;
  border-radius: 50rem;
}

.shuffle-game-header .shuffle-progress .progress-bar {
  display: block;
  height: 100%;
  background-color: #55C5D0;
  border-radius: 50rem;
  transition: width 1s linear;
}

/* Instruksi tetap di bawah header */
.shuffle-game > .shuffle-prompt {
  width: 100%;
  margin: 0 0 0.75rem;
  color: #141A8C;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  /*white-space: nowrap;*/
}

/* Pastikan badge tersembunyi walau JS memperbarui isinya */
.shuffle-badge[hidden] {
  display: none !important;
}


/* Layar hasil */
.shuffle-result {
  justify-content: center;
  gap: 1rem;
  min-height: 60vh;
  min-height: 60svh;
  padding: 2rem 0.25rem;
}

.shuffle-result__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.shuffle-result {
  --shuffle-card: min(calc((100% - 8px) / 3), 220px);
}

.shuffle-result-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: var(--shuffle-card);
  min-width: 44px;
}
.shuffle-result-slot .shuffle-frame { width: 100%; }
.shuffle-result-slot__icon {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.shuffle-result__score {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}

.shuffle-result__number {
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--entrasol-blue-dark);
}

.shuffle-result__unit,
.shuffle-result__max {
  font-size: 1.125rem;
  color: var(--entrasol-blue-dark);
}

@media (min-width: 576px) {
  .shuffle-page { padding: 2rem 1.5rem 7rem; }
  .shuffle-title { font-size: 2.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .shuffle-countdown__number { animation: none; }
  .shuffle-option--flying { transition: none; }
  .shuffle-progress .progress-bar { transition: none; }
}

/* ==========================================================================
   Spasi halaman utama (menggantikan utility Bootstrap agar bisa diatur per tinggi layar)
   ========================================================================== */
.hero-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 3rem 1rem;
}
.brand-logo { margin-bottom: 1.5rem; object-fit: contain; }
.game-title { margin: 0 0 0.5rem; }
.game-subtitle { margin: 0 0 1.5rem; }
.game-list { width: 100%; margin: 0 auto 1.5rem; }
.hero-start { margin-bottom: 1.5rem; }
.hero-footer { display: flex; flex-direction: column; align-items: center; margin-top: 0.5rem; }
.hero-footer__label { margin-bottom: 0.5rem; font-size: 0.875rem; color: var(--bs-secondary-color, #6c757d); }

/* ==========================================================================
   Fit-to-viewport: tinggi layar >= 550px tidak ada scroll vertikal (memakai dvh).
   Di bawah 550px, halaman tetap boleh scroll vertikal seperti biasa.
   --dvh = 1dvh, fallback 1vh untuk browser yang belum mendukung dvh.
   ========================================================================== */
:root { --dvh: 1vh; }
@supports (height: 100dvh) {
  :root { --dvh: 1dvh; }
}

@media (min-height: 550px) {
  html, body { height: 100%; overflow: hidden; }

  /* Container setinggi layar. overflow-y: auto hanya jaring pengaman untuk layar sangat sempit. */
  .home-hero,
  .flip-page,
  .shuffle-page {
    height: calc(100 * var(--dvh));
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .btn-entrasol {
    padding-top: clamp(0.45rem, calc(1.3 * var(--dvh)), 0.75rem);
    padding-bottom: clamp(0.45rem, calc(1.3 * var(--dvh)), 0.75rem);
  }

  /* ---- Halaman utama (index) ---- */
  .hero-content {
    justify-content: center;
    justify-content: safe center;
    padding: calc(2 * var(--dvh)) 1rem;
  }
  .brand-logo {
    width: auto;
    max-width: 100%;
    height: clamp(52px, calc(10.5 * var(--dvh)), 110px);
    margin-bottom: calc(1.2 * var(--dvh));
  }
  .game-title {
    font-size: clamp(1.375rem, calc(4.2 * var(--dvh)), 2rem);
    margin-bottom: calc(0.8 * var(--dvh));
  }
  .game-subtitle {
    font-size: clamp(0.8125rem, calc(2.1 * var(--dvh)), 1rem);
    line-height: 1.35;
    margin-bottom: calc(1.8 * var(--dvh));
  }
  .game-list {
    gap: clamp(6px, calc(1.4 * var(--dvh)), 12px);
    margin-bottom: calc(1.8 * var(--dvh));
  }
  .game-item { height: clamp(56px, calc(11.5 * var(--dvh)), 90px); }
  .game-item__name { font-size: clamp(0.9rem, calc(2.4 * var(--dvh)), 1.05rem); }
  .hero-start { margin-bottom: calc(1.8 * var(--dvh)); }
  .hero-footer { margin-top: 0; }
  .hero-footer__label { margin-bottom: calc(0.6 * var(--dvh)); font-size: 0.75rem; }
  .footer-logo {
    width: auto;
    max-width: 30%;
    /* height: clamp(30px, calc(6.5 * var(--dvh)), 68px); */
    height: auto;
  }

  /* ---- Game 1 (Memory Flip): tiga layar berbagi tinggi yang sama ---- */
  .flip-page { padding: calc(2 * var(--dvh)) 1rem; }
  .flip-intro,
  .flip-result {
    flex: 1 1 auto;
    min-height: 0;
    justify-content: center;
    justify-content: safe center;
  }

  .flip-game {
    flex: 0 0 auto;
    min-height: 0;
    justify-content: flex-start;
  }

  /* Countdown */
  .flip-countdown__number { font-size: clamp(5rem, calc(20 * var(--dvh)), 8rem); }

  /* Intro */
  .flip-eyebrow { font-size: clamp(0.8125rem, calc(2 * var(--dvh)), 1rem); }
  .flip-icon {
    width: auto;
    max-width: 60%;
    height: clamp(48px, calc(11 * var(--dvh)), 120px);
    margin: 0 0 calc(1.2 * var(--dvh));
    object-fit: contain;
  }
  .flip-title {
    font-size: clamp(1.375rem, calc(4.2 * var(--dvh)), 2rem);
    margin-bottom: calc(0.8 * var(--dvh));
  }
  .flip-subtitle {
    font-size: clamp(0.8125rem, calc(2.1 * var(--dvh)), 1rem);
    margin-bottom: calc(1.5 * var(--dvh));
  }
  .flip-instruction {
    margin-bottom: calc(1.8 * var(--dvh));
    padding: clamp(0.6rem, calc(1.8 * var(--dvh)), 1rem);
    font-size: clamp(0.8125rem, calc(2 * var(--dvh)), 1rem);
    line-height: 1.4;
  }
  .flip-instruction p { margin-bottom: 0.5rem; }
  .flip-instruction__title {
    font-size: clamp(1rem, calc(2.8 * var(--dvh)), 1.25rem);
    margin-bottom: 0.5rem;
  }
  .flip-time-alert {
    margin-top: calc(1.2 * var(--dvh));
    padding: 0.5rem 0.75rem;
    font-size: clamp(0.8125rem, calc(2 * var(--dvh)), 1rem);
  }

  /* Permainan: lebar papan dibatasi tinggi layar supaya papan 4x4 + HUD selalu muat */
  .flip-game {
    --flip-icon-h: clamp(36px, calc(7 * var(--dvh)), 72px);
    --flip-board-w: min(100%, 424px, calc(100 * var(--dvh) - 168px - var(--flip-icon-h)));
    /*padding: 0 0.75rem;*/
  }
  .flip-icon--game {
    height: var(--flip-icon-h);
    margin: 0 0 calc(0.6 * var(--dvh));
  }
  .flip-icon--result { height: clamp(56px, calc(13 * var(--dvh)), 130px); margin: 0; }
  .flip-game-title {
    font-size: clamp(1.2rem, calc(3.4 * var(--dvh)), 1.5rem);
    margin-bottom: calc(1 * var(--dvh));
  }
  .flip-hud { width: var(--flip-board-w); margin-bottom: calc(0.8 * var(--dvh)); }
  .flip-timer { min-height: clamp(36px, calc(6 * var(--dvh)), 44px); }
  .flip-progress { width: var(--flip-board-w); margin-bottom: calc(1.4 * var(--dvh)); }
  .flip-board { width: var(--flip-board-w); }

  /* Hasil */
  .flip-result { gap: calc(2 * var(--dvh)); padding: 0 1rem; }
  .flip-result__number { font-size: clamp(3rem, calc(10 * var(--dvh)), 4.5rem); }

  /* ---- Game 2 (Memory Recall): tiga layar berbagi tinggi yang sama ---- */
  .recall-page {
    height: calc(100 * var(--dvh));
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: calc(2 * var(--dvh)) 1rem;
  }
  .recall-intro,
  .recall-result {
    flex: 1 1 auto;
    min-height: 0;
    justify-content: center;
    justify-content: safe center;
  }

  .recall-game {
    flex: 0 0 auto;
    min-height: 0;
    justify-content: flex-start;
  }

  /* Countdown */
  .recall-countdown__label { font-size: clamp(0.9375rem, calc(2.4 * var(--dvh)), 1.125rem); }
  .recall-countdown__number { font-size: clamp(5rem, calc(20 * var(--dvh)), 8rem); }

  /* Intro */
  .recall-eyebrow {
    margin-bottom: calc(0.4 * var(--dvh));
    font-size: clamp(0.8125rem, calc(2 * var(--dvh)), 1rem);
  }
  .recall-icon {
    width: auto;
    max-width: 60%;
    height: clamp(48px, calc(11 * var(--dvh)), 120px);
    margin: 0 0 calc(1.2 * var(--dvh));
    object-fit: contain;
  }
  .recall-title {
    font-size: clamp(1.375rem, calc(4.2 * var(--dvh)), 2rem);
    margin-bottom: calc(0.8 * var(--dvh));
  }
  .recall-subtitle {
    font-size: clamp(0.8125rem, calc(2.1 * var(--dvh)), 1rem);
    margin-bottom: calc(1.5 * var(--dvh));
  }
  .recall-instruction {
    margin-bottom: calc(1.8 * var(--dvh));
    padding: clamp(0.6rem, calc(1.8 * var(--dvh)), 1rem);
    font-size: clamp(0.8125rem, calc(2 * var(--dvh)), 1rem);
    line-height: 1.4;
  }
  .recall-instruction p { margin-bottom: 0.5rem; }
  .recall-time-alert {
    margin-top: calc(1.2 * var(--dvh));
    padding: clamp(0.35rem, calc(1.2 * var(--dvh)), 0.75rem) 0.75rem;
    font-size: clamp(0.8125rem, calc(2 * var(--dvh)), 1rem);
  }

  /* Permainan: ukuran gambar dibatasi tinggi layar agar bingkai/piramida 1+2 selalu muat */
  .recall-game {
    --recall-img: min(calc(50% - 8px), 280px, calc((100 * var(--dvh) - 247px) / 2));
    --recall-opt: min(55%, 190px, calc((100 * var(--dvh) - 267px) / 3));
    gap: calc(0.8 * var(--dvh));
    /*padding: 0 0.75rem;*/
  }
  .recall-top-icon { height: clamp(24px, calc(10 * var(--dvh)), 96px); }
  .recall-badge {
    padding: clamp(0.15rem, calc(0.6 * var(--dvh)), 0.25rem) clamp(0.75rem, calc(2 * var(--dvh)), 1rem);
    font-size: clamp(0.8125rem, calc(2.2 * var(--dvh)), 1rem);
  }
  .recall-timer {
    min-height: clamp(36px, calc(6 * var(--dvh)), 44px);
    font-size: clamp(1.125rem, calc(3.2 * var(--dvh)), 1.5rem);
  }
  .recall-progress { height: clamp(6px, calc(1.2 * var(--dvh)), 10px); }
  .recall-prompt { font-size: clamp(0.8125rem, calc(2.1 * var(--dvh)), 1rem); }

  /* Hasil */
  .recall-result { gap: calc(2 * var(--dvh)); padding: 0 1rem; }
  .recall-result__title { font-size: clamp(1.2rem, calc(3.4 * var(--dvh)), 1.5rem); }
  .recall-result__icon {
    width: auto;
    max-width: 40%;
    height: clamp(40px, calc(8 * var(--dvh)), 96px);
  }
  .recall-result__choice { width: clamp(72px, calc(24 * var(--dvh)), 180px); }
  .recall-result__number { font-size: clamp(3rem, calc(10 * var(--dvh)), 4.5rem); }
  .recall-result__unit,
  .recall-result__max { font-size: clamp(0.9375rem, calc(2.4 * var(--dvh)), 1.125rem); }

  /* ---- Game 3 (Memory Shuffle & Recall): tiga layar berbagi tinggi yang sama ---- */
  .shuffle-page { padding: calc(2 * var(--dvh)) 1rem; }
  .shuffle-intro,
  .shuffle-result {
    flex: 1 1 auto;
    min-height: 0;
    justify-content: center;
    justify-content: safe center;
  }

  .shuffle-game {
    flex: 0 0 auto;
    min-height: 0;
    justify-content: flex-start;
  }

  /* Countdown */
  .shuffle-countdown__label { font-size: clamp(0.9375rem, calc(2.4 * var(--dvh)), 1.125rem); }
  .shuffle-countdown__number { font-size: clamp(5rem, calc(20 * var(--dvh)), 8rem); }

  /* Intro */
  .shuffle-eyebrow {
    margin-bottom: calc(0.4 * var(--dvh));
    font-size: clamp(0.8125rem, calc(2 * var(--dvh)), 1rem);
  }
  .shuffle-icon {
    width: auto;
    max-width: 60%;
    height: clamp(48px, calc(11 * var(--dvh)), 120px);
    margin: 0 0 calc(1.2 * var(--dvh));
    object-fit: contain;
  }
  .shuffle-title {
    font-size: clamp(1.375rem, calc(4.2 * var(--dvh)), 2rem);
    margin-bottom: calc(0.8 * var(--dvh));
  }
  .shuffle-subtitle {
    font-size: clamp(0.8125rem, calc(2.1 * var(--dvh)), 1rem);
    margin-bottom: calc(1.5 * var(--dvh));
  }
  .shuffle-instruction {
    margin-bottom: calc(1.8 * var(--dvh));
    padding: clamp(0.6rem, calc(1.8 * var(--dvh)), 1rem);
    font-size: clamp(0.8125rem, calc(2 * var(--dvh)), 1rem);
    line-height: 1.4;
  }
  .shuffle-instruction p { margin-bottom: 0.5rem; }
  .shuffle-time-alert {
    margin-top: calc(1.2 * var(--dvh));
    padding: clamp(0.35rem, calc(1.2 * var(--dvh)), 0.75rem) 0.75rem;
    font-size: clamp(0.8125rem, calc(2 * var(--dvh)), 1rem);
  }

  /* Permainan dan hasil: lebar kartu dibatasi tinggi layar agar baris slot + kartu selalu muat */
  .shuffle-game,
  .shuffle-result {
    --shuffle-card: min(calc((100% - 8px) / 3), 220px, calc((100 * var(--dvh) - 290px) / 2));
  }
  .shuffle-game {
    gap: calc(0.8 * var(--dvh));
    /*padding: 0 0.75rem;*/
  }
  .shuffle-screen-icon { height: clamp(32px, calc(12 * var(--dvh)), 96px); }
  .shuffle-game-title { font-size: clamp(1.2rem, calc(3.4 * var(--dvh)), 1.5rem); }
  .shuffle-badge {
    padding: clamp(0.15rem, calc(0.6 * var(--dvh)), 0.25rem) clamp(0.75rem, calc(2 * var(--dvh)), 1rem);
    font-size: clamp(0.8125rem, calc(2.2 * var(--dvh)), 1rem);
  }
  .shuffle-timer {
    min-height: clamp(36px, calc(6 * var(--dvh)), 44px);
    font-size: clamp(1.125rem, calc(3.2 * var(--dvh)), 1.5rem);
  }
  .shuffle-progress { height: clamp(6px, calc(1.2 * var(--dvh)), 10px); }
  .shuffle-prompt { font-size: clamp(0.8125rem, calc(2.1 * var(--dvh)), 1rem); }
  .shuffle-slots + .shuffle-prompt { margin-top: clamp(8px, calc(2 * var(--dvh)), 16px); }
  .shuffle-memo__num { font-size: clamp(1rem, calc(3 * var(--dvh)), 1.25rem); }

  /* Hasil */
  .shuffle-result { gap: calc(2 * var(--dvh)); padding: 0 1rem; }
  .shuffle-result__title { font-size: clamp(1.2rem, calc(3.4 * var(--dvh)), 1.5rem); }
  .shuffle-result-slot__icon {
    width: clamp(20px, calc(4.5 * var(--dvh)), 28px);
    height: clamp(20px, calc(4.5 * var(--dvh)), 28px);
  }
  .shuffle-result__number { font-size: clamp(3rem, calc(10 * var(--dvh)), 4.5rem); }
  .shuffle-result__unit,
  .shuffle-result__max { font-size: clamp(0.9375rem, calc(2.4 * var(--dvh)), 1.125rem); }
}

/* ==========================================================================
   Halaman Total Result (result.html) - semua kelas berprefix .result-
   ========================================================================== */
:root {
  --result-green-dark: #2E7D32;
  --result-red: #C62828;
  --result-text-gray: #4A4A4A;
}

.result-page {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: var(--app-max-width);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% 35%, #FFFFFF 0%, #FFFFF8 38%, transparent 75%),
    radial-gradient(ellipse at 0% 75%, #E9F9D9 0%, transparent 55%),
    linear-gradient(180deg, #F0F8F5 0%, #F5F8EC 45%, #DDF3F4 100%);
  box-shadow: 0 0 40px rgba(20, 26, 140, 0.08);
}

.result-page::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  pointer-events: none;
  aspect-ratio: 390 / 120;
  background: url('../assets/background-wave.svg') no-repeat bottom center / 100% 100%;
}

.result-content {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  justify-content: safe center;
  align-items: center;
  text-align: center;
  padding: 2rem 1rem;
}

.result-icon {
  width: 70px;
  max-width: 60%;
  height: 120px;
  margin: 0 0 1rem;
  object-fit: contain;
}

.result-title {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--entrasol-blue-dark);
}

.result-subtitle {
  display: block;
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}
.result-subtitle--win { color: var(--result-green-dark); }
.result-subtitle--lose { color: var(--result-red); }

@keyframes result-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.result-title,
.result-subtitle { animation: result-pulse 1.6s ease-in-out infinite; }

/* Daftar skor: ikon 30% | separator | nama 40% | skor 20% */
.result-list { width: 100%; margin: 2rem 0 1.25rem; }
.result-item .game-item__icon { flex: 0 1 30%; width: 30%; }
.result-item__name {
  flex: 0 1 40%;
  min-width: 0;
  text-align: left;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
  color: var(--entrasol-blue-dark);
}
.result-item__score {
  flex: 0 1 20%;
  min-width: 0;
  text-align: right;
  font-weight: bold;
  font-size: 1.25rem;
  color: var(--entrasol-blue-dark);
}

.result-total__label {
  margin: 0;
  font-size: 1.05rem;
  color: var(--entrasol-blue-dark);
}
.result-total__value {
  margin: 0 0 1.25rem;
  font-size: 3.25rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--entrasol-blue-dark);
}

/* Status pencapaian setiap game */
/* Rapikan posisi status tepat di samping skor */
.result-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.result-item__name {
  flex: 1 1 auto;
  min-width: 0;
}

.result-item__status {
  display: inline-flex;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 28px;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.result-item__score {
  flex: 0 0 2.2rem;
  width: 2.2rem;
  min-width: 2.2rem;
  margin: 0;
  text-align: right;
}

.result-item__status--success {
  color: #4CAF50;
}

.result-item__status--fail {
  color: #E53935;
}

.result-footer { display: flex; flex-direction: column; align-items: center; }
.result-thanks {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  font-weight: 300;
  color: var(--result-text-gray);
}
.result-logo { width: auto; height: 48px; max-width: 60%; object-fit: contain; }

/* Confetti */
.result-confetti {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}
.result-confetti__piece {
  position: absolute;
  top: -5%;
  display: block;
  border-radius: 2px;
  opacity: 0.95;
  animation-name: result-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}
@keyframes result-fall {
  0%   { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(110vh) rotate(var(--spin, 360deg)); }
}

@media (prefers-reduced-motion: reduce) {
  .result-title,
  .result-subtitle { animation: none; }
  .result-confetti { display: none; }
}

/* Fit-to-viewport */
@media (min-height: 550px) {
  .result-page {
    height: calc(100 * var(--dvh));
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .result-content { padding: calc(2 * var(--dvh)) 1rem calc(3 * var(--dvh)); }
  .result-icon {
    height: clamp(48px, calc(13 * var(--dvh)), 120px);
    margin-bottom: calc(1 * var(--dvh));
  }
  .result-title {
    font-size: clamp(1.75rem, calc(7 * var(--dvh)), 3rem);
    margin-bottom: calc(0.5 * var(--dvh));
  }
  .result-subtitle { font-size: clamp(0.9rem, calc(2.6 * var(--dvh)), 1.15rem); }
  .result-list {
    gap: clamp(6px, calc(1.4 * var(--dvh)), 12px);
    margin: calc(3 * var(--dvh)) 0 calc(1.8 * var(--dvh));
  }
  .result-item__name { font-size: clamp(0.8rem, calc(2.2 * var(--dvh)), 1.05rem); }
  .result-item__score { font-size: clamp(1rem, calc(2.8 * var(--dvh)), 1.25rem); }
  .result-total__label { font-size: clamp(0.85rem, calc(2.4 * var(--dvh)), 1.05rem); }
  .result-total__value {
    font-size: clamp(2rem, calc(7 * var(--dvh)), 3.25rem);
    margin-bottom: calc(1.8 * var(--dvh));
  }
  .result-thanks {
    font-size: clamp(0.75rem, calc(2 * var(--dvh)), 0.875rem);
    margin-bottom: calc(0.8 * var(--dvh));
  }
  .result-logo { height: clamp(20px, calc(10 * var(--dvh)), 48px); }
}

/* Samakan lebar header Game 1, 2, dan 3 */
.flip-game-header,
.recall-game-header,
.shuffle-game-header {
  width: 100%;
  margin-left: -1rem;
  margin-right: -1rem;
}

/* Rounded header lebih kecil */
.flip-game-header,
.recall-game-header,
.shuffle-game-header {
  border-radius: 0 0 1rem 1rem;
}


/* TIMER GAME 2 — SAMAKAN DENGAN GAME 1 */
.recall-game #timerBox.recall-timer {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;

  width: 50% !important;
  max-width: 368px;
  min-width: 0 !important;
  height: 48px !important;
  min-height: 48px !important;

  padding: 0.35rem 0.5rem !important;
  gap: 0.4rem;
  margin: 0;

  font-size: 1.25rem !important;
  font-weight: 700;

  color: #141A8C;
  background: #FFFFFF;
  border: 1.5px solid #DCE8F5 !important;
  border-radius: 0.85rem !important;

  box-sizing: border-box;
}

.recall-game #timerBox .recall-timer__icon {
  width: 1.25em;
  height: 1.25em;
  margin: 0;
  flex: 0 0 auto;
}

/* TIMER GAME 3 — SAMAKAN DENGAN GAME 1 */
.shuffle-game #timerBox.shuffle-timer {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;

  width: 50% !important;
  max-width: 368px;
  min-width: 0 !important;
  height: 48px !important;
  min-height: 48px !important;

  padding: 0.35rem 0.5rem !important;
  gap: 0.4rem;
  margin: 0;

  font-size: 1.25rem !important;
  font-weight: 700;

  color: #141A8C;
  background: #FFFFFF;
  border: 1.5px solid #DCE8F5 !important;
  border-radius: 0.85rem !important;

  box-sizing: border-box;
}

.shuffle-game #timerBox .shuffle-timer__icon {
  width: 1.25em;
  height: 1.25em;
  margin: 0;
  flex: 0 0 auto;
}
/* Isi disembunyikan sementara sampai semua gambarnya siap (lihat revealWhenImagesReady di js/app.js) */
.asset-loading { visibility: hidden; }
