:root {
  --paper: rgba(255, 255, 255, 0.9);
  --paper-strong: rgba(255, 255, 255, 0.96);
  --ink: #1f2a37;
  --font-display: 'Chewy', 'Baloo 2', cursive;
  --font-kids: 'Fredoka', 'Nunito', sans-serif;
  --accent-blue: #2e81ff;
  --accent-green: #2cb77c;
  --accent-gold: #ffc83d;
  --accent-coral: #ff7b54;
  --shadow-soft: 0 14px 30px rgba(16, 38, 61, 0.25);
  --shadow-pop: 0 10px 0 #d88e1a;
}

body.festival-bg {
  --festival-bg-image: url('../img/backgrounds/mathadventur.jpeg');
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: 'Nunito', sans-serif;
  background: none;
  position: relative;
  isolation: isolate;
}

body.festival-bg::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    var(--festival-bg-image) center center / cover no-repeat,
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.35), transparent 35%),
    linear-gradient(180deg, rgba(252, 255, 225, 0.32) 0%, rgba(218, 234, 255, 0.45) 100%);
  transform: translateZ(0);
  z-index: -1;
}

body.festival-bg::after {
  content: '';
  position: fixed;
  top: -45px;
  left: 50%;
  width: min(62vw, 420px);
  aspect-ratio: 1152 / 795;
  transform: translateX(-50%);
  transform-origin: 50% 6%;
  background: url('../img/backgrounds/papan.png') center top / contain no-repeat;
  filter: drop-shadow(0 14px 18px rgba(36, 23, 8, 0.32));
  pointer-events: none;
  z-index: 0;
  animation: hangingBoardSwing 4.6s ease-in-out infinite;
}

.sound-control {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.welcome-card .sound-control {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
}

.sound-toggle-btn {
  cursor: pointer;
}

.sound-slider-panel {
  display: none;
  align-items: center;
  gap: 0.45rem;
  min-width: 220px;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 2px solid rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(17, 41, 67, 0.25);
  backdrop-filter: blur(2px);
}

.sound-slider-panel.is-open {
  display: inline-flex;
}

.sound-slider-panel input[type='range'] {
  width: 120px;
  accent-color: #2e81ff;
}

.sound-mark {
  font-size: 0.95rem;
}

.festival-bg .container {
  position: relative;
  z-index: 1;
}

.flow-shell {
  position: relative;
  width: 100%;
}

.flow-screen {
  width: min(100%, 1100px);
  display: none;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.flow-screen.is-active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.flow-screen.flow-menu {
  width: 100%;
}

.flow-screen .welcome-card,
.flow-screen .dialog-card {
  margin-left: auto;
  margin-right: auto;
}

.welcome-card,
.dialog-card {
  position: relative;
  max-width: 760px;
  width: min(92vw, 760px);
  background: linear-gradient(165deg, var(--paper-strong) 0%, rgba(247, 252, 255, 0.9) 100%);
  border: 3px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(3px);
}

.welcome-card {
  padding: 2rem;
  overflow: hidden;
  border-radius: 1.45rem;
  border: 3px solid rgba(255, 255, 255, 0.88);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(234, 246, 255, 0.92) 100%),
    repeating-linear-gradient(90deg, rgba(75, 145, 232, 0.06) 0 10px, transparent 10px 20px);
  animation: slideDownEnter 0.8s ease-out both;
}

@keyframes slideDownEnter {
  from {
    opacity: 0;
    transform: translateY(-60px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hangingBoardSwing {
  0% {
    transform: translateX(-50%) rotate(0deg);
  }

  20% {
    transform: translateX(-50%) rotate(2.2deg);
  }

  50% {
    transform: translateX(-50%) rotate(0deg);
  }

  80% {
    transform: translateX(-50%) rotate(-2.2deg);
  }

  100% {
    transform: translateX(-50%) rotate(0deg);
  }
}

.welcome-card::before,
.welcome-card::after {
  content: '';
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  pointer-events: none;
}

.welcome-card::before {
  top: -88px;
  right: -75px;
  background: radial-gradient(circle, rgba(255, 211, 64, 0.25) 0%, rgba(255, 211, 64, 0) 72%);
}

.welcome-card::after {
  bottom: -92px;
  left: -72px;
  background: radial-gradient(circle, rgba(46, 129, 255, 0.22) 0%, rgba(46, 129, 255, 0) 72%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(46, 129, 255, 0.12);
  color: #1456b3;
  border: 1px solid rgba(46, 129, 255, 0.3);
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-weight: 800;
  margin-bottom: 0.9rem;
}

.hero-title,
.dialog-title,
.menu-title {
  font-family: 'Baloo 2', cursive;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.hero-title {
  line-height: 1.05;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.35);
  color: #1f2f46;
}

.hero-subtitle,
.dialog-subtitle,
.menu-subtitle {
  font-size: 1.12rem;
  color: #314a63;
}

.icon-btn {
  width: 3.05rem;
  height: 3.05rem;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #fff5b8 0%, #ffd43f 55%, #f1b200 100%);
  border: 4px solid #ffffff;
  box-shadow: 0 0 0 2px #d39a00, 0 8px 0 #c48400, 0 12px 18px rgba(80, 50, 8, 0.35);
  color: #ffffff;
  font-size: 1.25rem;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.icon-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px #d39a00, 0 10px 0 #c48400, 0 15px 22px rgba(80, 50, 8, 0.35);
}

.sound-value {
  min-width: 2.9rem;
  text-align: center;
  font-size: 0.84rem;
  font-weight: 900;
  color: #174f96;
}

.next-btn,
.ghost-btn {
  border-radius: 999px;
  border: 3px solid #ffffff;
  padding: 0.62rem 1.35rem;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #ffffff;
  background: linear-gradient(180deg, #59beff 0%, #3aa5ef 55%, #2c8fd7 100%);
  box-shadow: inset 0 0 0 2px #7cd4ff, 0 0 0 2px #2a8dd5, 0 8px 0 #2479b5;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.next-btn:hover,
.ghost-btn:hover {
  transform: translateY(-3px);
  box-shadow: inset 0 0 0 2px #7cd4ff, 0 0 0 2px #2a8dd5, 0 11px 0 #2479b5;
  color: #ffffff;
}

.next-btn:active,
.ghost-btn:active,
.icon-btn:active {
  transform: translateY(1px);
}

.start-btn.play-btn {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 6px solid #ffffff;
  background: radial-gradient(circle at 30% 25%, #fff4a6 0%, #ffcf29 54%, #f0b300 100%);
  box-shadow: inset 0 0 0 4px #ffd84d, 0 0 0 3px #cb9000, 0 14px 0 #b27800, 0 20px 28px rgba(80, 50, 8, 0.35);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.start-btn.play-btn::before {
  content: '';
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-left: 24px solid #ffffff;
  margin-left: 8px;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.25));
}

.start-btn.play-btn:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: inset 0 0 0 4px #ffd84d, 0 0 0 3px #cb9000, 0 17px 0 #b27800, 0 23px 30px rgba(80, 50, 8, 0.38);
}

.level-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  color: #fff;
  background: linear-gradient(180deg, #ff7e5f 0%, #f05d3f 100%);
  box-shadow: 0 0 0 2px #da4e31, 0 6px 0 #b33a22;
  padding: 0.3rem 0.8rem;
  font-weight: 900;
  font-size: 0.85rem;
}

.quest-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 1rem auto 0.95rem;
  max-width: 620px;
}

.quest-item {
  background: rgba(255, 255, 255, 0.82);
  border: 2px solid rgba(46, 129, 255, 0.18);
  border-radius: 0.85rem;
  padding: 0.55rem 0.65rem;
  font-weight: 800;
  color: #255189;
  box-shadow: 0 7px 12px rgba(25, 63, 107, 0.1);
}

.xp-panel {
  max-width: 620px;
  margin: 0 auto 1rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid rgba(46, 129, 255, 0.18);
  border-radius: 0.9rem;
  padding: 0.55rem 0.75rem;
}

.xp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 900;
  color: #215389;
  margin-bottom: 0.45rem;
}

.xp-track {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background: #dceeff;
  border: 1px solid #b5d8ff;
  overflow: hidden;
}

.xp-fill {
  width: 68%;
  height: 100%;
  background: linear-gradient(90deg, #35c16f 0%, #7ddf69 100%);
  box-shadow: inset 0 -2px 0 rgba(22, 130, 61, 0.4);
}

.start-wrap {
  display: grid;
  justify-items: center;
  gap: 0.35rem;
}

.play-hint {
  font-weight: 800;
  color: #476283;
  margin: 0;
}

.menu-shell {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

.menu-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.93) 0%, rgba(244, 251, 255, 0.93) 100%);
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 1.15rem;
  padding: 1rem 1.2rem;
  margin-bottom: 1.4rem;
  box-shadow: var(--shadow-soft);
}

.menu-card {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96) 0%, rgba(239, 249, 255, 0.96) 100%);
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 11px 20px rgba(26, 56, 90, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-card:hover {
  transform: translateY(-7px);
  box-shadow: 0 15px 26px rgba(26, 56, 90, 0.28);
}

.menu-icon {
  width: 58px;
  height: 58px;
  margin: 0 auto 0.7rem;
  display: grid;
  place-items: center;
  border-radius: 18px;
  font-size: 1.7rem;
  background: linear-gradient(140deg, #ffe99f 0%, #ffd158 100%);
  box-shadow: inset 0 -5px 0 rgba(192, 127, 24, 0.28);
}

.menu-label {
  color: var(--accent-blue);
  font-family: 'Baloo 2', cursive;
  font-size: 1.7rem;
  font-weight: 700;
}

@media (max-width: 768px) {
  body.festival-bg {
    --festival-bg-image: url('../img/backgrounds/bg mobile.jpeg');
  }

  .container {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .flow-screen {
    width: 100%;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .hero-subtitle,
  .dialog-subtitle,
  .menu-subtitle {
    font-size: 1rem;
  }

  .menu-label {
    font-size: 1.45rem;
  }

  body.festival-bg::after {
    top: -64px;
    width: min(86vw, 390px);
    opacity: 0.96;
  }

  .level-badge {
    position: static;
    display: inline-flex;
    margin-bottom: 0.75rem;
  }

  .quest-strip {
    grid-template-columns: 1fr;
    max-width: 330px;
  }

  .toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .menu-toolbar .ghost-btn,
  .menu-toolbar .icon-btn {
    transform: scale(0.95);
    transform-origin: left center;
  }

  .sound-control {
    top: 0.7rem;
    left: 0.7rem;
  }

  .sound-slider-panel {
    min-width: 175px;
    padding: 0.38rem 0.5rem;
  }

  .sound-slider-panel input[type='range'] {
    width: 90px;
  }
}

@media (max-width: 480px) {
  body.festival-bg::after {
    top: -52px;
    width: min(92vw, 360px);
  }

  .page-shell {
    padding-top: 3.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .welcome-card {
    animation: none;
  }

  body.festival-bg::after {
    animation: none;
  }

  .player-ui *,
  .player-ui *::before,
  .player-ui *::after {
    animation: none !important;
    transition: none !important;
  }
}

.page-shell {
  padding-top: 2.25rem;
  padding-bottom: 2.25rem;
}

.page-toolbar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(245, 252, 255, 0.93) 100%);
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 1.15rem;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-soft);
}

.toolbar-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-card {
  height: 100%;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96) 0%, rgba(239, 249, 255, 0.96) 100%);
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 1.1rem;
  padding: 1.2rem;
  box-shadow: 0 11px 20px rgba(26, 56, 90, 0.2);
}

.section-title {
  font-family: 'Baloo 2', cursive;
  color: #1e4f9a;
  font-size: 2rem;
}

.section-subtitle {
  color: #35506c;
}

.topic-list {
  margin: 0;
  padding-left: 1rem;
  color: #284666;
  list-style: none;      /* menghilangkan titik/bullet */
  padding-left: 0; 
}

.topic-list li {
  margin-bottom: 0.35rem;
  text-align: justify; 
}

.atp-page .atp-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  width: min(100%, 760px);
  margin-left: auto;
  margin-right: auto;
}

.atp-page .atp-actions .ghost-btn,
.atp-page .atp-actions .next-btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
}

.atp-page .atp-toolbar {
  row-gap: 0.65rem;
}

.atp-page .page-shell {
  position: relative;
  padding-top: 4.9rem;
}

.atp-page .page-shell .sound-control {
  position: absolute;
  top: 0.8rem;
  left: 0.8rem;
  z-index: 20;
}

.atp-page .page-shell .sound-slider-panel {
  max-width: min(60vw, 240px);
}

.atp-page .atp-top-back {
  white-space: nowrap;
}

@media (max-width: 768px) {
  .atp-page .page-shell {
    padding-top: 4.25rem;
  }

  .atp-page .page-shell .sound-control {
    top: 0.55rem;
    left: 0.55rem;
  }

  .atp-page .page-shell .sound-slider-panel {
    min-width: 170px;
  }

  .atp-page .atp-toolbar {
    flex-direction: column;
    align-items: flex-start !important;
  }

  .atp-page .atp-top-back {
    width: min(100%, 320px);
    justify-content: center;
  }

  .atp-page .atp-actions {
    width: 100%;
    gap: 0.7rem;
  }

  .atp-page .atp-actions .ghost-btn,
  .atp-page .atp-actions .next-btn {
    width: 100%;
    font-size: 0.95rem;
    padding: 0.58rem 0.9rem;
  }
}

.chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.88rem;
  font-weight: 800;
  background: rgba(44, 183, 124, 0.17);
  color: #0f7f52;
}

.chip.warn {
  background: rgba(255, 200, 61, 0.24);
  color: #946305;
}

.chip.info {
  background: rgba(46, 129, 255, 0.17);
  color: #1258b9;
}

.qa-card {
  background: rgba(255, 255, 255, 0.92);
  border: 2px dashed rgba(46, 129, 255, 0.25);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 0.9rem;
}

.qa-title {
  font-weight: 800;
  color: #193f75;
}

.quiz-choice {
  display: block;
  width: 100%;
  border: 2px solid rgba(46, 129, 255, 0.25);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0.8rem;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.55rem;
  text-align: left;
  color: #1b3f70;
  font-weight: 700;
}

.quiz-choice input[type='radio'] {
  margin-right: 0.45rem;
  accent-color: #2e81ff;
}

.quiz-choice:hover {
  border-color: rgba(46, 129, 255, 0.55);
}

@keyframes gameHudPop {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.96);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

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

@keyframes sparkleDrift {
  0% {
    transform: translateY(0) scale(1);
    opacity: 0.36;
  }

  50% {
    transform: translateY(-14px) scale(1.04);
    opacity: 0.6;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 0.36;
  }
}

@keyframes badgePulse {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-2px) scale(1.04);
  }
}

@keyframes sheenMove {
  0% {
    transform: translateX(-30%) rotate(-8deg);
  }

  100% {
    transform: translateX(30%) rotate(-8deg);
  }
}

@keyframes tilePop {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.94);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes coinPulse {
  0%,
  100% {
    transform: scale(1);
  }

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

body.player-ui.festival-bg::before {
  background:
    var(--festival-bg-image) center center / cover no-repeat,
    radial-gradient(circle at 14% 14%, rgba(255, 245, 173, 0.45), transparent 33%),
    radial-gradient(circle at 88% 20%, rgba(146, 232, 255, 0.35), transparent 38%),
    linear-gradient(180deg, rgba(255, 241, 179, 0.24) 0%, rgba(178, 227, 255, 0.38) 100%);
}

body.player-ui.festival-bg::after {
  z-index: 0;
  opacity: 0.97;
}

.player-ui .menu-shell,
.player-ui .page-shell {
  animation: gameHudPop 0.52s ease both;
}

.player-ui .welcome-card,
.player-ui .dialog-card {
  border: 4px solid #fff7d4;
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 255, 255, 0.5) 0 9%, transparent 11%),
    radial-gradient(circle at 92% 88%, rgba(255, 255, 255, 0.45) 0 10%, transparent 12%),
    linear-gradient(150deg, rgba(255, 247, 207, 0.95) 0%, rgba(255, 230, 242, 0.92) 48%, rgba(223, 243, 255, 0.95) 100%);
  box-shadow: 0 0 0 3px rgba(75, 147, 232, 0.45), 0 16px 0 #3f84cc, 0 24px 36px rgba(27, 58, 95, 0.34);
  animation: gameHudPop 0.78s cubic-bezier(0.16, 1, 0.3, 1) both, gentleFloat 5.2s ease-in-out infinite 1s;
}

.player-ui .hero-badge {
  background: linear-gradient(180deg, rgba(84, 183, 255, 0.2) 0%, rgba(35, 127, 238, 0.2) 100%);
  border: 2px solid rgba(53, 133, 236, 0.44);
  color: #0f5dbf;
  box-shadow: 0 4px 0 rgba(35, 105, 195, 0.34);
  animation: badgePulse 2.2s ease-in-out infinite;
}

.player-ui .menu-title,
.player-ui .dialog-title,
.player-ui .hero-title,
.player-ui .section-title {
  font-family: var(--font-display);
  letter-spacing: 0.7px;
  color: #113f76;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.62);
}

.player-ui {
  font-family: var(--font-kids);
  --game-panel-a: #fff7cf;
  --game-panel-b: #ffe6f2;
  --game-panel-c: #dff3ff;
  --game-panel-d: #dcffe9;
  --game-ink: #1d3f66;
}

.player-ui .hero-subtitle,
.player-ui .dialog-subtitle,
.player-ui .menu-subtitle,
.player-ui .section-subtitle,
.player-ui .topic-list,
.player-ui .qa-title,
.player-ui .quiz-choice {
  font-family: var(--font-kids);
  color: var(--game-ink);
}

.player-ui .menu-label {
  font-family: var(--font-display);
  letter-spacing: 0.5px;
}

.player-ui .hero-badge,
.player-ui .level-badge,
.player-ui .chip,
.player-ui .next-btn,
.player-ui .ghost-btn,
.player-ui .sound-value {
  font-family: var(--font-kids);
  letter-spacing: 0.35px;
}

.player-ui .menu-toolbar,
.player-ui .page-toolbar {
  position: relative;
  overflow: hidden;
  border: 3px solid #ffffff;
  background: linear-gradient(130deg, rgba(127, 205, 255, 0.9) 0%, rgba(145, 246, 220, 0.88) 55%, rgba(255, 224, 138, 0.92) 100%);
  box-shadow: 0 0 0 3px rgba(78, 156, 236, 0.35), 0 12px 0 #2f75bf, 0 20px 30px rgba(20, 57, 94, 0.28);
}

.player-ui .menu-toolbar::after,
.player-ui .page-toolbar::after {
  content: '';
  position: absolute;
  inset: -60% -16%;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 26px, rgba(255, 255, 255, 0.02) 26px 52px);
  pointer-events: none;
  animation: sheenMove 9s linear infinite;
}

.player-ui .menu-card,
.player-ui .page-card,
.player-ui .qa-card {
  position: relative;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.88);
  background:
    linear-gradient(155deg, rgba(255, 247, 207, 0.95) 0%, rgba(255, 230, 242, 0.92) 42%, rgba(223, 243, 255, 0.95) 76%, rgba(220, 255, 233, 0.95) 100%),
    repeating-linear-gradient(120deg, rgba(255, 255, 255, 0.2) 0 18px, rgba(255, 255, 255, 0) 18px 36px);
  box-shadow: 0 0 0 2px rgba(67, 142, 224, 0.24), 0 12px 20px rgba(18, 50, 86, 0.22);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.player-ui .menu-card::before,
.player-ui .page-card::before,
.player-ui .qa-card::before {
  content: '';
  position: absolute;
  width: 110px;
  height: 110px;
  left: -35px;
  bottom: -48px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0) 72%);
  pointer-events: none;
}

.player-ui .menu-card {
  animation: tilePop 0.55s ease both;
}

.player-ui .row > div:nth-child(1) .menu-card {
  animation-delay: 0.03s;
}

.player-ui .row > div:nth-child(2) .menu-card {
  animation-delay: 0.09s;
}

.player-ui .row > div:nth-child(3) .menu-card {
  animation-delay: 0.15s;
}

.player-ui .row > div:nth-child(4) .menu-card {
  animation-delay: 0.21s;
}

.player-ui .row > div:nth-child(5) .menu-card {
  animation-delay: 0.27s;
}

.player-ui .menu-card:hover,
.player-ui .page-card:hover,
.player-ui .qa-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow: 0 0 0 2px rgba(67, 142, 224, 0.31), 0 18px 30px rgba(18, 50, 86, 0.3);
}

.player-ui .menu-icon {
  background: linear-gradient(160deg, #fff6b4 0%, #ffd35a 54%, #ffbe32 100%);
  box-shadow: inset 0 -6px 0 rgba(200, 129, 20, 0.34), 0 5px 10px rgba(142, 97, 20, 0.2);
  transition: transform 0.2s ease;
}

.player-ui .menu-card:hover .menu-icon {
  transform: rotate(-9deg) scale(1.08);
}

.player-ui .next-btn,
.player-ui .ghost-btn {
  border: 3px solid #ffffff;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.34), 0 0 0 2px #1f79cd, 0 8px 0 #1d67a8;
}

.player-ui .ghost-btn {
  background: linear-gradient(180deg, #62ce8e 0%, #42b46f 55%, #2d9756 100%);
}

.player-ui .next-btn:hover,
.player-ui .ghost-btn:hover {
  transform: translateY(-3px) scale(1.02);
}

.player-ui .start-btn.play-btn {
  animation: coinPulse 1.9s ease-in-out infinite;
}

.player-ui .sound-slider-panel {
  background: linear-gradient(180deg, rgba(255, 247, 207, 0.98) 0%, rgba(255, 230, 242, 0.96) 52%, rgba(223, 243, 255, 0.95) 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(63, 136, 219, 0.36), 0 8px 18px rgba(17, 41, 67, 0.25);
}

.player-ui .sound-value {
  color: #0f5dbf;
}

.player-ui .xp-panel,
.player-ui .quest-item {
  background: linear-gradient(145deg, rgba(255, 247, 207, 0.88) 0%, rgba(223, 243, 255, 0.88) 100%);
  border-color: rgba(68, 146, 227, 0.25);
}

/* Cozy game UI skin (settings-style panels) */
body.player-ui {
  --game-paper-main: #f7e8c9;
  --game-paper-panel: #efd2a6;
  --game-paper-soft: #fbf3df;
  --game-ink-deep: #4c2f1d;
  --game-line: #7a5436;
  --game-line-soft: #b58758;
}

body.player-ui.festival-bg::before {
  background:
    var(--festival-bg-image) center center / cover no-repeat,
    linear-gradient(180deg, rgba(255, 232, 186, 0.45) 0%, rgba(239, 214, 173, 0.28) 100%),
    radial-gradient(circle at 16% 12%, rgba(255, 255, 255, 0.28), transparent 36%);
}

body.player-ui.festival-bg::after {
  opacity: 0.97;
}

.player-ui .welcome-card,
.player-ui .dialog-card,
.player-ui .menu-toolbar,
.player-ui .page-toolbar,
.player-ui .menu-card,
.player-ui .page-card,
.player-ui .qa-card,
.player-ui .xp-panel,
.player-ui .quest-item {
  border: 3px solid var(--game-line-soft);
  border-radius: 22px;
  background: linear-gradient(165deg, var(--game-paper-soft) 0%, var(--game-paper-main) 48%, var(--game-paper-panel) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 248, 227, 0.9), 0 5px 0 #6a482e, 0 14px 24px rgba(65, 38, 18, 0.26);
}

.player-ui .menu-toolbar::after,
.player-ui .page-toolbar::after,
.player-ui .menu-card::before,
.player-ui .page-card::before,
.player-ui .qa-card::before {
  display: none;
}

.player-ui .menu-title,
.player-ui .dialog-title,
.player-ui .hero-title,
.player-ui .section-title,
.player-ui .hero-subtitle,
.player-ui .dialog-subtitle,
.player-ui .menu-subtitle,
.player-ui .section-subtitle,
.player-ui .topic-list,
.player-ui .qa-title,
.player-ui .menu-label,
.player-ui .play-hint,
.player-ui .sound-value {
  color: var(--game-ink-deep);
  text-shadow: none;
}

.player-ui .hero-badge,
.player-ui .chip,
.player-ui .level-badge {
  background: #d8ebff;
  color: #355174;
  border: 2px solid #95b0d1;
  box-shadow: 0 3px 0 #7f99ba;
  animation: none;
}

.player-ui .menu-card,
.player-ui .page-card,
.player-ui .qa-card {
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.player-ui .menu-card:hover,
.player-ui .page-card:hover,
.player-ui .qa-card:hover {
  transform: translateY(-4px);
  box-shadow: inset 0 0 0 2px rgba(255, 248, 227, 0.9), 0 7px 0 #6a482e, 0 16px 26px rgba(65, 38, 18, 0.3);
}

.player-ui .menu-icon {
  border: 3px solid var(--game-line);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffd348 0%, #ffb60a 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 239, 178, 0.75), 0 4px 0 #996718;
}

.player-ui .menu-card:hover .menu-icon {
  transform: translateY(-2px) rotate(-4deg) scale(1.03);
}

.player-ui .next-btn,
.player-ui .ghost-btn {
  border: 3px solid var(--game-line);
  border-radius: 16px;
  box-shadow: inset 0 0 0 2px rgba(255, 249, 233, 0.9), 0 4px 0 #62412a;
  text-shadow: none;
}

.player-ui .next-btn {
  color: #4b2c0f;
  background: linear-gradient(180deg, #ffd04d 0%, #ffbd1c 100%);
}

.player-ui .ghost-btn {
  color: #5a3221;
  background: linear-gradient(180deg, #fff6e9 0%, #f3ead8 100%);
}

.player-ui .next-btn:hover,
.player-ui .ghost-btn:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 2px rgba(255, 249, 233, 0.9), 0 6px 0 #62412a;
}

.player-ui .start-btn.play-btn {
  border: 5px solid #fff6df;
  box-shadow: inset 0 0 0 3px #ffe394, 0 0 0 3px #9f6b1e, 0 10px 0 #7b4d11, 0 16px 24px rgba(76, 47, 18, 0.3);
  animation: coinPulse 2.2s ease-in-out infinite;
}

.player-ui .sound-slider-panel {
  border: 3px solid var(--game-line-soft);
  background: linear-gradient(180deg, #fff4dc 0%, #efd9b8 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 248, 227, 0.9), 0 5px 0 #6a482e, 0 12px 18px rgba(65, 38, 18, 0.24);
}

.player-ui .sound-slider-panel input[type='range'] {
  accent-color: #a56027;
}

/* Menu-only gameboard polish */
.player-ui .menu-shell {
  max-width: 1140px;
}

.player-ui .menu-shell .menu-toolbar {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 4px solid #b58a5c;
  padding: 1.05rem 1.25rem;
  background: #e9ddc2;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 10px 26px rgba(84, 57, 32, 0.2);
}

.player-ui .menu-shell .menu-toolbar::before {
  content: none;
}

.player-ui .menu-shell .menu-toolbar::after {
  content: none;
}

.player-ui .menu-shell .row {
  --bs-gutter-x: 1rem;
  --bs-gutter-y: 1rem;
}

.player-ui .menu-shell .menu-grid {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

.player-ui .menu-shell .menu-grid > div {
  display: flex;
}

.player-ui .menu-shell .menu-grid > div > a {
  display: flex;
  width: 100%;
}

.materi-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1800;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(22, 20, 18, 0.55);
}

.materi-intro-overlay.is-open {
  display: flex;
}

.materi-intro-sheet {
  position: relative;
  width: min(900px, calc(100% - 1rem));
  border: 3px solid var(--game-line-soft);
  border-radius: 24px;
  background: linear-gradient(165deg, var(--game-paper-soft) 0%, var(--game-paper-main) 48%, var(--game-paper-panel) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 248, 227, 0.9), 0 6px 0 #6a482e, 0 16px 30px rgba(18, 13, 9, 0.44);
  padding: 1.25rem 1.1rem 1.1rem 9.75rem;
  text-align: center;
  overflow: visible;
  transform: translateY(110%);
  animation: materiSlideUp 0.45s ease forwards;
}

.materi-intro-layout {
  position: static;
}

.materi-intro-character {
  position: absolute;
  left: clamp(-98px, -4.6vw, -24px);
  bottom: -52px;
  z-index: 2;
}

.materi-intro-character img {
  width: clamp(170px, 17vw, 250px);
  height: auto;
  display: block;
  user-select: none;
  pointer-events: none;
}

.materi-intro-content {
  width: 100%;
  max-width: none;
  margin: 0;
}

.materi-intro-sheet .next-btn {
  animation: materiIntroNextPulse 2.8s ease-in-out infinite;
  transform-origin: center;
}

.materi-intro-sheet .next-btn:hover {
  animation: none;
  transform: translateY(-2px) scale(1.04);
}

.materi-intro-sheet .next-btn:active {
  animation: none;
  transform: translateY(1px) scale(0.98);
}

@keyframes materiIntroNextPulse {
  0%,
  100% {
    transform: scale(1);
  }

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

.materi-flow {
  max-width: none;
  margin: 0 auto;
}

.materi-menu-grid {
  margin-top: 0.85rem;
}

.materi-topic-card {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.materi-topic-card:focus-visible {
  outline: 3px solid rgba(64, 129, 211, 0.7);
  outline-offset: 3px;
  border-radius: 18px;
}

.materi-menu-grid .menu-card {
  min-height: 220px;
}

.materi-landing .arena-map {
  margin-top: 0.85rem;
}

.player-ui .materi-landing .menu-ride,
.materi-landing .menu-ride {
  min-height: 240px;
}

.player-ui .materi-landing .menu-ride.is-featured,
.materi-landing .menu-ride.is-featured {
  min-height: 258px;
}

.player-ui .materi-landing .menu-ride .menu-icon,
.materi-landing .menu-ride .menu-icon {
  width: 98px;
  height: 98px;
  font-size: 2.5rem;
}

.player-ui .materi-landing .menu-ride .menu-label,
.materi-landing .menu-ride .menu-label {
  font-size: clamp(1.95rem, 2.4vw, 2.45rem);
}

.player-ui .materi-landing .menu-ride .menu-desc,
.materi-landing .menu-ride .menu-desc {
  font-size: 1rem;
}

@media (max-width: 991px) {
  .player-ui .materi-landing .menu-ride,
  .player-ui .materi-landing .menu-ride.is-featured,
  .materi-landing .menu-ride,
  .materi-landing .menu-ride.is-featured {
    min-height: 220px;
  }
}

.materi-step {
  display: none;
}

.materi-step.is-active {
  display: block;
  animation: gameHudPop 0.36s ease both;
}

.materi-detail {
  display: none;
}

.materi-detail.is-active {
  display: block;
  animation: gameHudPop 0.36s ease both;
}

.bab1-part {
  display: none;
}

.bab1-part.is-active {
  display: block;
}

.materi-list-lg {
  font-size: 1.2rem;
  line-height: 1.65;
}

.materi-list-lg li strong {
  font-size: 2rem;
  line-height: 1.2;
  display: inline-block;
  margin-bottom: 0.3rem;
}

.materi-detail .section-title {
  font-size: clamp(2rem, 3.8vw, 3rem);
}

.materi-detail .section-subtitle,
.materi-detail .materi-list {
  font-size: 1.2rem;
  line-height: 1.65;
}

.materi-detail .materi-list li strong {
  font-size: 2rem;
  line-height: 1.2;
  display: inline-block;
  margin-bottom: 0.3rem;
}

.materi-actions-dual {
  justify-content: space-between;
  gap: 0;
  flex-wrap: wrap;
}

.materi-actions-dual .ghost-btn:first-child {
  margin-right: auto;
}

.materi-actions-dual .ghost-btn:last-child {
  margin-left: auto;
}

@media (max-width: 768px) {
  .materi-intro-overlay {
    align-items: flex-end;
  }

  .materi-intro-sheet {
    width: min(720px, 100%);
    padding: 1rem 0.95rem 1rem;
  }

  .materi-intro-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
  }

  .materi-intro-character {
    position: static;
  }

  .materi-intro-character img {
    width: min(190px, 52vw);
  }

  .materi-list-lg {
    font-size: 1.05rem;
  }

  .materi-list-lg li strong {
    font-size: 1.55rem;
  }

  .materi-actions-dual:not(.bab1-nav-actions) .ghost-btn {
    width: 100%;
  }

  .materi-detail .section-subtitle,
  .materi-detail .materi-list {
    font-size: 1.05rem;
  }

  .materi-detail .materi-list li strong {
    font-size: 1.55rem;
  }
}

.materi-list {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.materi-list li {
  margin-bottom: 0.9rem;
  line-height: 1.5;
}

.materi-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.bab1-nav-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
}

.bab1-nav-actions .ghost-btn {
  width: 100%;
  justify-content: center;
}

.bab1-nav-actions .next-btn {
  min-width: 130px;
  justify-content: center;
}

.bab1-back-actions {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.35fr);
  gap: 0.7rem;
  align-items: center;
  width: 100%;
}

.bab1-back-actions .ghost-btn {
  width: 100%;
  justify-content: center;
  padding-left: 0.9rem;
  padding-right: 0.9rem;
}

@media (max-width: 768px) {
  .bab1-nav-actions .next-btn {
    min-width: 108px;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .bab1-back-actions .ghost-btn {
    font-size: 0.96rem;
  }
}

@media (max-width: 430px) {
  .bab1-back-actions {
    grid-template-columns: 1fr;
  }
}

.diagram-board {
  margin-top: 0.9rem;
  padding: 0.9rem 0.9rem 0.7rem;
  border: 2px solid rgba(76, 57, 38, 0.5);
  border-radius: 12px;
  background: #efefef;
}

.diagram-title {
  text-align: center;
  font-weight: 800;
  margin-bottom: 0.55rem;
  color: #222;
}

.diagram-grid {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.55rem;
  align-items: stretch;
}

.diagram-grid .y-axis {
  height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-weight: 700;
  color: #1f1f1f;
  font-size: 0.9rem;
  padding-top: 0.05rem;
  padding-bottom: 0.3rem;
}

.diagram-grid .bars-wrap {
  position: relative;
  height: 320px;
  border-bottom: 2px solid #b9b9b9;
}

.diagram-grid .grid-lines {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(to top, #c5c5c5 0 1px, transparent 1px calc(12.5%));
}

.diagram-grid .bars {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 0 0.7rem;
}

.diagram-grid .bar-item {
  width: 18%;
  min-width: 70px;
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.diagram-grid .bar {
  width: 56%;
  min-width: 30px;
  margin: 0 auto;
  background: #4a73be;
  transform-origin: bottom center;
  transform: scaleY(0);
  opacity: 0;
  animation: diagramBarGrow 0.9s cubic-bezier(0.2, 0.75, 0.3, 1) forwards;
}

.diagram-grid .bar-item:nth-child(1) .bar {
  animation-delay: 0.08s;
}

.diagram-grid .bar-item:nth-child(2) .bar {
  animation-delay: 0.16s;
}

.diagram-grid .bar-item:nth-child(3) .bar {
  animation-delay: 0.24s;
}

.diagram-grid .bar-item:nth-child(4) .bar {
  animation-delay: 0.32s;
}

.diagram-grid .bar-item:nth-child(5) .bar {
  animation-delay: 0.4s;
}

.diagram-grid .bar-item span {
  display: block;
  margin-top: 0.5rem;
  font-weight: 700;
  color: #1d1d1d;
}

.diagram-legend {
  margin-top: 0.45rem;
  text-align: center;
  font-weight: 700;
  color: #1d1d1d;
}

.line-board,
.pie-board {
  background: #efefef;
}

.line-chart-wrap {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.6rem;
  align-items: stretch;
}

.line-y-axis {
  height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-weight: 700;
  color: #1f1f1f;
  font-size: 0.9rem;
  padding-bottom: 1.9rem;
}

.line-plot {
  position: relative;
  height: 320px;
  border-bottom: 2px solid #b9b9b9;
}

.line-grid {
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(to top, #c5c5c5 0 1px, transparent 1px calc(14.285%));
}

.line-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.line-path {
  fill: none;
  stroke: #416dbb;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: lineDraw 1.6s ease forwards;
}

.line-point {
  fill: #416dbb;
  opacity: 0;
  transform-origin: center;
  transform-box: fill-box;
  animation: linePointPop 0.32s ease forwards;
}

.line-point.p1 { animation-delay: 0.28s; }
.line-point.p2 { animation-delay: 0.5s; }
.line-point.p3 { animation-delay: 0.72s; }
.line-point.p4 { animation-delay: 0.94s; }
.line-point.p5 { animation-delay: 1.16s; }
.line-point.p6 { animation-delay: 1.38s; }

.line-x-axis {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -30px;
  display: flex;
  justify-content: space-around;
  font-weight: 700;
  color: #1d1d1d;
}

.pie-board .diagram-title {
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

.pie-chart-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0.4rem auto 0.8rem;
}

.pie-chart {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(#4a73be 0% 15%, #f49a4f 15% 40%, #b8b8b8 40% 85%, #eadb5a 85% 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6), 0 8px 16px rgba(24, 24, 24, 0.22);
  transform: scale(0.2) rotate(-110deg);
  opacity: 0;
  animation: pieReveal 1.05s cubic-bezier(0.2, 0.75, 0.3, 1) forwards;
}

.pie-label {
  position: absolute;
  font-weight: 700;
  color: #171717;
}

.pie-label.l1 { top: 20px; right: 48px; }
.pie-label.l2 { top: 92px; right: 14px; }
.pie-label.l3 { bottom: 52px; left: 30px; }
.pie-label.l4 { top: 20px; left: 48px; }

.pie-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.94rem;
  font-weight: 700;
  color: #1f1f1f;
}

.pie-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.pie-legend i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.pie-legend .c1 { background: #4a73be; }
.pie-legend .c2 { background: #f49a4f; }
.pie-legend .c3 { background: #b8b8b8; }
.pie-legend .c4 { background: #eadb5a; }

@media (max-width: 768px) {
  .diagram-grid {
    grid-template-columns: 35px 1fr;
  }

  .line-chart-wrap {
    grid-template-columns: 34px 1fr;
  }

  .diagram-grid .y-axis,
  .diagram-grid .bars-wrap,
  .line-y-axis,
  .line-plot {
    height: 250px;
  }

  .line-x-axis {
    bottom: -26px;
    font-size: 0.74rem;
  }

  .pie-chart-wrap {
    width: 180px;
    height: 180px;
  }

  .pie-legend {
    gap: 0.6rem;
    font-size: 0.82rem;
  }

  .diagram-grid .bar-item {
    min-width: 48px;
    width: 20%;
  }

  .diagram-grid .bar-item span {
    font-size: 0.78rem;
  }
}

@keyframes materiSlideUp {
  from {
    transform: translateY(110%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes diagramBarGrow {
  from {
    transform: scaleY(0);
    opacity: 0;
  }

  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes lineDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes linePointPop {
  from {
    opacity: 0;
    transform: scale(0.3);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pieReveal {
  to {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

@keyframes menuIconPulse {
  0%,
  100% {
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.75), 0 10px 0 rgba(179, 126, 27, 0.85), 0 14px 18px rgba(31, 41, 55, 0.22);
    filter: saturate(1) brightness(1);
  }

  50% {
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.82), 0 12px 0 rgba(179, 126, 27, 0.9), 0 18px 24px rgba(31, 41, 55, 0.28);
    filter: saturate(1.08) brightness(1.06);
  }
}

.player-ui .menu-shell .menu-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 172px;
  border-radius: 22px;
  border: 5px solid #b58a5c;
  background: #e9ddc2;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 12px 26px rgba(84, 57, 32, 0.18);
}

.player-ui .menu-shell .menu-card:hover {
  transform: translateY(-5px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52), 0 18px 34px rgba(19, 43, 68, 0.25);
}

.player-ui .menu-shell .row > div:nth-child(1) .menu-card {
  border-top: 5px solid #b58a5c;
}

.player-ui .menu-shell .row > div:nth-child(2) .menu-card {
  border-top: 5px solid #b58a5c;
}

.player-ui .menu-shell .row > div:nth-child(3) .menu-card {
  border-top: 5px solid #b58a5c;
}

.player-ui .menu-shell .row > div:nth-child(4) .menu-card {
  border-top: 5px solid #b58a5c;
}

.player-ui .menu-shell .row > div:nth-child(5) .menu-card {
  border-top: 5px solid #b58a5c;
}

.player-ui .menu-shell .menu-icon {
  width: 74px;
  height: 74px;
  margin: 0 auto 0.8rem;
  border-radius: 22px;
  font-size: 2.05rem;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 225, 120, 0.95) 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.75), 0 10px 0 rgba(179, 126, 27, 0.85), 0 14px 18px rgba(31, 41, 55, 0.22);
  animation: menuIconPulse 2.4s ease-in-out infinite;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.player-ui .menu-shell .row > div:nth-child(1) .menu-icon {
  animation-delay: 0s;
}

.player-ui .menu-shell .row > div:nth-child(2) .menu-icon {
  animation-delay: 0.18s;
}

.player-ui .menu-shell .row > div:nth-child(3) .menu-icon {
  animation-delay: 0.36s;
}

.player-ui .menu-shell .row > div:nth-child(4) .menu-icon {
  animation-delay: 0.54s;
}

.player-ui .menu-shell .row > div:nth-child(5) .menu-icon {
  animation-delay: 0.72s;
}

.player-ui .menu-shell .menu-card:hover .menu-icon {
  animation: none;
  transform: translateY(-2px) scale(1.05);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.78), 0 12px 0 rgba(179, 126, 27, 0.88), 0 18px 22px rgba(31, 41, 55, 0.24);
}

@media (prefers-reduced-motion: reduce) {
  .player-ui .menu-shell .menu-icon {
    animation: none;
  }
}

.player-ui .menu-shell .menu-label {
  font-size: clamp(1.08rem, 1.7vw, 1.38rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: 0.2px;
  color: #2a3f58;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.player-ui .menu-shell .ghost-btn {
  border-radius: 12px;
  padding: 0.46rem 0.95rem;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.68) 0%, rgba(225, 241, 255, 0.5) 100%);
  color: #2f4d6f;
  box-shadow: 0 8px 16px rgba(24, 40, 58, 0.16);
}

.cp-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.cp-actions .ghost-btn,
.cp-actions .next-btn {
  white-space: nowrap;
}

@media (max-width: 576px) {
  .cp-actions {
    gap: 0.55rem;
  }

  .cp-actions .ghost-btn,
  .cp-actions .next-btn {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    justify-content: center;
    padding: 0.52rem 0.5rem;
    font-size: 0.95rem;
  }

  .cp-actions .ghost-btn {
    margin-right: auto;
  }

  .cp-actions .next-btn {
    margin-left: auto;
  }
}

@media (max-width: 991px) {
  .player-ui .menu-shell .menu-card {
    min-height: 150px;
  }

  .player-ui .menu-shell .menu-icon {
    width: 66px;
    height: 66px;
    font-size: 1.85rem;
    border-radius: 19px;
  }

  .player-ui .menu-shell .menu-toolbar {
    border-radius: 18px;
  }

  .player-ui .menu-shell .menu-label {
    font-size: clamp(1rem, 4.8vw, 1.22rem);
  }
}

.admin-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  min-height: calc(100vh - 3rem);
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.admin-sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(244, 250, 255, 0.93));
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: var(--shadow-soft);
}

.admin-brand {
  font-family: 'Baloo 2', cursive;
  font-size: 1.65rem;
  color: #1852a3;
  margin-bottom: 1rem;
}

.admin-nav {
  display: grid;
  gap: 0.5rem;
}

.admin-nav a {
  display: block;
  text-decoration: none;
  color: #1e4a82;
  padding: 0.58rem 0.78rem;
  border-radius: 0.7rem;
  font-weight: 800;
  background: rgba(46, 129, 255, 0.1);
  border: 1px solid rgba(46, 129, 255, 0.2);
}

.admin-nav a:hover,
.admin-nav a.active {
  background: rgba(46, 129, 255, 0.22);
}

.contoh-flow-shell {
  padding: 1.1rem;
}

.contoh-slide {
  display: none;
}

.contoh-slide.is-active {
  display: block;
  animation: gameHudPop 0.35s ease both;
}

.contoh-photo-frame {
  background: #f1f1f1;
  border: 2px solid rgba(66, 66, 66, 0.55);
  border-radius: 4px;
  padding: clamp(1rem, 2.5vw, 2.1rem);
  color: #171717;
}

.contoh-photo-frame p,
.contoh-photo-frame li {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.36;
  color: #101010;
}

.contoh-title {
  font-family: var(--font-kids);
  font-size: clamp(1.4rem, 3.1vw, 2.2rem);
  margin-bottom: 0.6rem;
  color: #111;
}

.contoh-bullet {
  font-size: clamp(1.15rem, 2.2vw, 1.55rem);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.contoh-answer-grid {
  display: grid;
  grid-template-columns: minmax(220px, 260px) 1fr;
  gap: 1rem;
  align-items: end;
  margin-bottom: 0.6rem;
}

.contoh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.02rem;
  box-shadow: 0 0 0 1px rgba(120, 134, 170, 0.35) inset;
}

.contoh-table th,
.contoh-table td {
  border: 1px solid rgba(232, 234, 245, 0.92);
  padding: 0.3rem 0.5rem;
}

.contoh-table th {
  background: #426db8;
  color: #fff;
}

.contoh-table tbody tr:nth-child(odd) {
  background: #bac2d8;
}

.contoh-table tbody tr:nth-child(even) {
  background: #cfd3df;
}

.contoh-list {
  margin: 0;
  padding-left: 1.3rem;
}

.contoh-story-list {
  margin: 0;
  padding-left: 1.35rem;
  display: grid;
  gap: 0.95rem;
}

.contoh-story-list li {
  font-size: clamp(1.02rem, 2.2vw, 1.22rem);
  line-height: 1.36;
}

.contoh-inline-table-wrap {
  margin-top: 0.55rem;
  max-width: 320px;
}

.contoh-inline-table {
  font-size: 1.03rem;
}

.contoh-story-list-wide li {
  font-size: clamp(1.18rem, 2.7vw, 1.85rem);
  line-height: 1.3;
}

.contoh-step-eq {
  margin: 0.2rem 0 0.35rem 0.85rem;
  font-size: clamp(1.55rem, 3.7vw, 2.35rem);
  line-height: 1.1;
  color: #101010;
}

.contoh-percent-list {
  margin-top: 0.35rem;
  display: grid;
  gap: 0.35rem;
  padding-left: 0.85rem;
}

.contoh-percent-row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 34px 68px max-content 34px max-content;
  align-items: center;
  column-gap: 0.45rem;
  font-size: clamp(1.15rem, 2.8vw, 2.1rem);
  color: #101010;
}

.contoh-percent-row .item,
.contoh-percent-row .result {
  font-weight: 500;
}

.contoh-percent-row .eq,
.contoh-percent-row .times {
  font-weight: 600;
}

.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  min-width: 56px;
}

.frac span:first-child {
  padding: 0 0.2rem 0.08rem;
  border-bottom: 2px solid #151515;
}

.frac span:last-child {
  padding-top: 0.08rem;
}

.contoh-line-board {
  margin-top: 0.75rem;
  border: 2px solid rgba(66, 66, 66, 0.55);
  border-radius: 4px;
  background: #f1f1f1;
  padding: clamp(0.75rem, 2.2vw, 1.2rem);
}

.contoh-line-title {
  margin: 0 0 0.7rem;
  text-align: center;
  font-family: var(--font-kids);
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  color: #575757;
}

.contoh-line-chart {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.55rem;
  align-items: stretch;
}

.contoh-line-y-axis {
  height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.95rem;
  color: #666;
  text-align: right;
  padding-right: 0.2rem;
}

.contoh-line-plot-wrap {
  position: relative;
  border: 2px solid rgba(53, 53, 53, 0.52);
  background: #f1f1f1;
  height: 320px;
  overflow: hidden;
}

.contoh-line-grid {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent calc(12.5% - 1px),
    rgba(136, 136, 136, 0.36) calc(12.5% - 1px),
    rgba(136, 136, 136, 0.36) 12.5%
  );
}

.contoh-line-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.contoh-line-main {
  fill: none;
  stroke: #9c9c9c;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.contoh-day-fill {
  stroke: rgba(120, 120, 120, 0.25);
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke 0.2s ease;
}

.contoh-day-fill.is-correct {
  stroke: #2f8fff;
}

.contoh-day-fill.is-wrong {
  stroke: #e44c4c;
}

.contoh-line-inputs {
  margin-top: 0.75rem;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}

.contoh-line-input {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: center;
}

.contoh-line-input span {
  font-size: clamp(0.88rem, 1.9vw, 1rem);
  font-weight: 700;
  color: #4f4f4f;
}

.contoh-line-input input {
  width: 100%;
  border: 2px solid rgba(120, 120, 120, 0.58);
  border-radius: 10px;
  height: 42px;
  text-align: center;
  font-weight: 800;
  color: #313131;
  background: #fff;
  outline: none;
}

.contoh-line-input.is-correct input {
  border-color: #2f8fff;
  box-shadow: 0 0 0 2px rgba(47, 143, 255, 0.16);
}

.contoh-line-input.is-wrong input {
  border-color: #e44c4c;
  box-shadow: 0 0 0 2px rgba(228, 76, 76, 0.16);
}

.contoh-pie-board {
  margin-top: 0.65rem;
  border: 1px solid rgba(188, 188, 188, 0.45);
  background: #f3f3f3;
  padding: clamp(0.8rem, 2.2vw, 1.35rem);
}

.contoh-pie-chart {
  --bakso-color: #ffffff;
  --nasi-color: #ffffff;
  --sate-color: #ffffff;
  --mie-color: #ffffff;
  width: min(72vw, 350px);
  aspect-ratio: 1;
  margin: 0.75rem auto 0.5rem;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 10px 18px rgba(38, 38, 38, 0.2);
  background: conic-gradient(
    var(--bakso-color) 0deg 144deg,
    var(--nasi-color) 144deg 216deg,
    var(--sate-color) 216deg 252deg,
    var(--mie-color) 252deg 360deg
  );
}

.contoh-pie-chart::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  background: conic-gradient(
    transparent 0deg 143.2deg,
    rgba(96, 96, 96, 0.55) 143.2deg 144.8deg,
    transparent 144.8deg 215.2deg,
    rgba(96, 96, 96, 0.55) 215.2deg 216.8deg,
    transparent 216.8deg 251.2deg,
    rgba(96, 96, 96, 0.55) 251.2deg 252.8deg,
    transparent 252.8deg 359.2deg,
    rgba(96, 96, 96, 0.55) 359.2deg 360deg
  );
}

.contoh-pie-chart .pie-label {
  position: absolute;
  font-size: clamp(0.74rem, 1.45vw, 1rem);
  font-weight: 800;
  color: #1f1f1f;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
  white-space: nowrap;
}

.contoh-pie-chart .pie-label.p1 {
  right: 15%;
  top: 33%;
}

.contoh-pie-chart .pie-label.p2 {
  left: 44%;
  bottom: 11%;
}

.contoh-pie-chart .pie-label.p3 {
  left: 16%;
  bottom: 22%;
}

.contoh-pie-chart .pie-label.p4 {
  left: 9%;
  top: 31%;
}

.contoh-pie-inputs {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.contoh-pie-input {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.contoh-pie-input span {
  font-size: 0.96rem;
  font-weight: 700;
  color: #555;
}

.contoh-pie-input input {
  width: 100%;
  height: 42px;
  border-radius: 12px;
  border: 2px solid rgba(120, 120, 120, 0.55);
  background: #fff;
  text-align: center;
  font-weight: 800;
  color: #2f2f2f;
  outline: none;
}

.contoh-pie-input.is-correct input {
  border-color: #2f8fff;
  box-shadow: 0 0 0 2px rgba(47, 143, 255, 0.16);
}

.contoh-pie-input.is-wrong input {
  border-color: #e44c4c;
  box-shadow: 0 0 0 2px rgba(228, 76, 76, 0.16);
}

.contoh-nav-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.95rem;
  gap: 0.8rem;
}

.contoh-nav-between button[disabled] {
  opacity: 0.55;
  pointer-events: none;
}

@media (max-width: 900px) {
  .contoh-answer-grid {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .contoh-percent-row {
    grid-template-columns: minmax(115px, 165px) 24px 52px max-content 24px max-content;
    font-size: clamp(1.05rem, 4.9vw, 1.55rem);
    column-gap: 0.3rem;
  }

  .contoh-step-eq {
    margin-left: 0.25rem;
    font-size: clamp(1.3rem, 6.1vw, 1.8rem);
  }

  .contoh-line-inputs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contoh-pie-inputs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .contoh-photo-frame p,
  .contoh-photo-frame li {
    text-align: justify;
    text-justify: inter-word;
  }

  .contoh-flow-shell {
    padding: 0.65rem;
  }

  .contoh-photo-frame {
    padding: 0.72rem;
    overflow-x: hidden;
  }

  .contoh-photo-frame .diagram-board {
    padding: 0.6rem 0.45rem 0.5rem;
  }

  .contoh-photo-frame .diagram-title {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
  }

  .contoh-photo-frame .diagram-grid {
    grid-template-columns: 24px 1fr;
    gap: 0.35rem;
  }

  .contoh-photo-frame .diagram-grid .y-axis,
  .contoh-photo-frame .diagram-grid .bars-wrap {
    height: 190px;
  }

  .contoh-photo-frame .diagram-grid .y-axis {
    font-size: 0.64rem;
    padding-bottom: 0.15rem;
  }

  .contoh-photo-frame .diagram-grid .bars {
    padding: 0 0.15rem;
  }

  .contoh-photo-frame .diagram-grid .bar-item {
    min-width: 0;
    width: 20%;
  }

  .contoh-photo-frame .diagram-grid .bar {
    min-width: 13px;
    width: 56%;
  }

  .contoh-photo-frame .diagram-grid .bar-item span {
    margin-top: 0.35rem;
    font-size: 0.58rem;
  }

  .contoh-photo-frame .diagram-legend {
    font-size: 0.72rem;
    margin-top: 0.35rem;
  }

  .contoh-line-chart {
    grid-template-columns: 28px 1fr;
    gap: 0.36rem;
  }

  .contoh-line-y-axis,
  .contoh-line-plot-wrap {
    height: 220px;
  }

  .contoh-line-y-axis {
    font-size: 0.72rem;
  }

  .contoh-pie-chart {
    width: min(78vw, 295px);
  }

  .contoh-pie-chart .pie-label {
    font-size: 0.68rem;
  }

  .contoh-percent-list {
    padding-left: 0.2rem;
  }

  .contoh-percent-row {
    grid-template-columns: 1fr;
    row-gap: 0.15rem;
    justify-items: start;
    font-size: clamp(1.05rem, 6vw, 1.25rem);
  }

  .contoh-percent-row .eq,
  .contoh-percent-row .times {
    display: none;
  }

  .contoh-percent-row .frac {
    margin-left: 0;
  }

  .contoh-percent-row .result {
    font-weight: 800;
    color: #1e5eb8;
  }

  .contoh-line-inputs {
    grid-template-columns: 1fr;
  }

  .contoh-pie-inputs {
    grid-template-columns: 1fr;
  }

  .contoh-nav-between {
    flex-direction: column;
  }

  .contoh-nav-between .ghost-btn,
  .contoh-nav-between .next-btn {
    width: 100%;
  }
}

.admin-main {
  background: linear-gradient(165deg, var(--paper-strong) 0%, rgba(247, 252, 255, 0.9) 100%);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 1rem;
  box-shadow: var(--shadow-soft);
  padding: 1.1rem;
  overflow: hidden;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.admin-stat {
  background: rgba(255, 255, 255, 0.93);
  border: 2px solid rgba(255, 255, 255, 0.8);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 9px 16px rgba(20, 48, 79, 0.15);
}

.admin-stat h3 {
  margin: 0;
  color: #1f5cb6;
  font-family: 'Baloo 2', cursive;
}

.admin-table-wrap {
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 0.9rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid rgba(46, 129, 255, 0.17);
  padding: 0.72rem;
  color: #294764;
}

.admin-table th {
  background: rgba(46, 129, 255, 0.13);
  color: #154f9f;
}

.admin-form .form-control,
.admin-form .form-select {
  border-radius: 0.75rem;
  border: 1px solid rgba(46, 129, 255, 0.32);
}

.admin-form .next-btn,
.admin-form .ghost-btn {
  min-height: 44px;
}

.admin-main .alert {
  border-radius: 0.85rem;
}

@media (max-width: 992px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
}

/* Menu landing redesign: dynamic arena map */
.menu-landing.festival-bg::before {
  background:
    linear-gradient(180deg, rgba(74, 51, 31, 0.32) 0%, rgba(48, 31, 18, 0.28) 100%),
    radial-gradient(circle at 20% 10%, rgba(255, 245, 217, 0.3), transparent 35%);
}

.menu-landing .menu-shell {
  max-width: 1280px;
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

.menu-landing .menu-choice-panel {
  margin-top: 0.35rem;
  padding: 1rem;
}

.menu-landing .menu-choice-panel .arena-map {
  margin-top: 0;
}

.menu-landing .menu-hero {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 1rem;
  border: 4px solid #b58a5c;
  border-radius: 28px;
  background: #e9ddc2;
  box-shadow: 0 12px 28px rgba(82, 56, 33, 0.22);
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
}

.menu-landing .menu-title {
  font-size: clamp(2.2rem, 4.5vw, 3.6rem);
  line-height: 0.95;
  color: #4a2b16;
}

.menu-landing .menu-subtitle {
  margin-top: 0.35rem;
  color: #53331f;
  font-size: clamp(1.1rem, 1.9vw, 1.4rem);
  font-weight: 900;
}

.menu-landing .hero-mini {
  margin-top: 0.3rem;
  color: #6a462d;
  font-weight: 800;
}

.menu-landing .hero-status {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-radius: 18px;
  border: 3px solid #c49c6e;
  background: #f4ead1;
  padding: 0.7rem 0.8rem;
}

.menu-landing .status-avatar {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 1.9rem;
  background: linear-gradient(180deg, #ffe082 0%, #ffc130 100%);
  border: 2px solid #8d6334;
  box-shadow: 0 5px 0 #8d6334;
}

.menu-landing .status-meta {
  flex: 1;
}

.menu-landing .status-top {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 900;
  color: #5a3420;
}

.menu-landing .status-bar {
  height: 12px;
  margin-top: 0.25rem;
  border-radius: 999px;
  background: #e6d6b7;
  border: 2px solid #caa87d;
  overflow: hidden;
}

.menu-landing .status-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4fc86e 0%, #89e17c 100%);
}

.menu-landing .status-stars {
  margin-top: 0.3rem;
  font-weight: 800;
  color: #72472a;
}

.menu-landing .arena-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 0.9rem;
  padding: 0.4rem;
}

.menu-landing .arena-map::before {
  content: '';
  position: absolute;
  inset: 10% 10% 20%;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 28%, rgba(255, 211, 90, 0.35) 0 10px, transparent 11px),
    radial-gradient(circle at 45% 48%, rgba(255, 211, 90, 0.25) 0 9px, transparent 10px),
    radial-gradient(circle at 76% 30%, rgba(255, 211, 90, 0.35) 0 10px, transparent 11px),
    linear-gradient(110deg, transparent 0 8%, rgba(186, 144, 88, 0.45) 8% 9.2%, transparent 9.2% 100%),
    linear-gradient(72deg, transparent 0 46%, rgba(186, 144, 88, 0.38) 46% 47.2%, transparent 47.2% 100%);
  opacity: 0.75;
}

.menu-landing .arena-link {
  display: block;
}

.menu-landing .arena-link.pos-1 {
  grid-column: 1 / span 4;
  grid-row: 1;
}

.menu-landing .arena-link.pos-2 {
  grid-column: 5 / span 4;
  grid-row: 1;
}

.menu-landing .arena-link.pos-3 {
  grid-column: 9 / span 4;
  grid-row: 1;
}

.menu-landing .arena-link.pos-4 {
  grid-column: 3 / span 4;
  grid-row: 2;
}

.menu-landing .arena-link.pos-5 {
  grid-column: 7 / span 4;
  grid-row: 2;
}

.menu-landing .menu-ride {
  position: relative;
  isolation: isolate;
  min-height: 235px;
  border-radius: 28px;
  border: 4px solid #9d7448;
  background: #efe4cd;
  box-shadow: 0 12px 24px rgba(69, 45, 26, 0.24);
  padding-top: 1.05rem;
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.menu-landing .menu-ride.is-featured {
  min-height: 262px;
  transform: translateY(-8px) scale(1.03);
}

.menu-landing .menu-ride .ride-badge {
  position: absolute;
  top: 0.6rem;
  left: 0.7rem;
  padding: 0.23rem 0.62rem;
  border-radius: 999px;
  font-size: 0.74rem;
  letter-spacing: 0.3px;
  font-weight: 900;
  color: #fff8ec;
  background: #6c4a2c;
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.menu-landing .menu-ride .menu-icon {
  width: 108px;
  height: 108px;
  margin: 0.9rem auto 0.85rem;
  border-radius: 26px;
  font-size: 2.8rem;
  border: 3px solid rgba(255, 255, 255, 0.88);
  background: linear-gradient(165deg, #fff6cb 0%, #ffd24e 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.86), 0 8px 0 rgba(160, 108, 31, 0.92), 0 13px 18px rgba(38, 29, 19, 0.24);
  animation: arenaIconFloat 2.3s ease-in-out infinite;
}

.menu-landing .menu-ride .menu-label {
  color: #2d4b75;
  font-size: clamp(2.1rem, 2.7vw, 2.8rem);
  line-height: 1;
}

.menu-landing .menu-ride .menu-desc {
  margin-top: 0.38rem;
  color: #5f3a25;
  font-size: 1.06rem;
  font-weight: 800;
}

.menu-landing .menu-ride:hover {
  transform: translateY(-10px);
  box-shadow: 0 16px 30px rgba(69, 45, 26, 0.32);
  border-color: #e0ad4e;
}

.menu-landing .menu-ride:hover .menu-icon {
  animation: none;
  transform: translateY(-3px) scale(1.06);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.88), 0 11px 0 rgba(160, 108, 31, 0.94), 0 20px 24px rgba(38, 29, 19, 0.3);
}

.menu-landing .menu-ride.arena-explorer {
  border-top-color: #5ea06c;
}

.menu-landing .menu-ride.arena-materi {
  border-top-color: #4f92cb;
}

.menu-landing .menu-ride.arena-example {
  border-top-color: #8b74d8;
}

.menu-landing .menu-ride.arena-games {
  border-top-color: #f19442;
}

.menu-landing .menu-ride.arena-soal {
  border-top-color: #d36a49;
}

.menu-landing .arena-centerpiece {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: #ffe7af;
  border: 3px solid #b88951;
  box-shadow: 0 8px 0 #916132, 0 14px 20px rgba(49, 34, 21, 0.25);
  z-index: 0;
}

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

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

@media (max-width: 1199px) {
  .menu-landing .menu-hero {
    grid-template-columns: 1fr;
  }

  .menu-landing .menu-ride .menu-label {
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  }
}

@media (max-width: 991px) {
  .menu-landing .arena-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-landing .arena-link.pos-1,
  .menu-landing .arena-link.pos-2,
  .menu-landing .arena-link.pos-3,
  .menu-landing .arena-link.pos-4,
  .menu-landing .arena-link.pos-5 {
    grid-column: auto;
    grid-row: auto;
  }

  .menu-landing .menu-ride,
  .menu-landing .menu-ride.is-featured {
    min-height: 220px;
    transform: none;
  }

  .menu-landing .menu-ride .menu-icon {
    width: 94px;
    height: 94px;
    font-size: 2.5rem;
  }

  .menu-landing .arena-centerpiece {
    display: none;
  }
}

@media (max-width: 640px) {
  .menu-landing .arena-map {
    grid-template-columns: 1fr;
  }

  .menu-landing .menu-hero {
    border-width: 3px;
    border-radius: 20px;
  }

  .menu-landing .menu-ride {
    min-height: 205px;
    border-width: 3px;
  }

  .menu-landing .menu-ride .menu-icon {
    width: 84px;
    height: 84px;
    font-size: 2.2rem;
    border-radius: 22px;
  }

  .menu-landing .menu-ride .menu-label {
    font-size: clamp(1.6rem, 8vw, 2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .menu-landing .menu-ride,
  .menu-landing .menu-ride .menu-icon {
    transition: none;
    animation: none;
  }
}

/* Stronger override so arena style is not overridden by legacy menu-card rules */
.player-ui .menu-landing .menu-hero {
  grid-template-columns: 1fr auto;
}

.player-ui .menu-landing .hero-actions {
  justify-self: end;
  align-self: center;
}

.player-ui .menu-landing .menu-ride {
  min-height: 235px;
  border-radius: 28px;
  border: 4px solid #9d7448;
  background: #efe4cd;
  box-shadow: 0 12px 24px rgba(69, 45, 26, 0.24);
}

.player-ui .menu-landing .menu-ride.is-featured {
  min-height: 262px;
  transform: translateY(-8px) scale(1.03);
}

.player-ui .menu-landing .menu-ride .menu-icon {
  width: 108px;
  height: 108px;
  font-size: 2.8rem;
  border-radius: 26px;
}

.player-ui .menu-landing .menu-ride .menu-label {
  font-size: clamp(2.1rem, 2.7vw, 2.8rem);
  line-height: 1;
}

.player-ui .menu-landing .menu-ride .menu-desc {
  display: block;
}

.player-ui .menu-landing .menu-ride .ride-badge {
  display: inline-flex;
}

.player-ui .menu-landing .menu-ride.arena-explorer {
  border-top-color: #5ea06c;
}

.player-ui .menu-landing .menu-ride.arena-materi {
  border-top-color: #4f92cb;
}

.player-ui .menu-landing .menu-ride.arena-example {
  border-top-color: #8b74d8;
}

.player-ui .menu-landing .menu-ride.arena-games {
  border-top-color: #f19442;
}

.player-ui .menu-landing .menu-ride.arena-soal {
  border-top-color: #d36a49;
}

@media (max-width: 991px) {
  .player-ui .menu-landing .menu-hero {
    grid-template-columns: 1fr;
  }

  .player-ui .menu-landing .hero-actions {
    justify-self: start;
  }

  .player-ui .menu-landing .menu-ride,
  .player-ui .menu-landing .menu-ride.is-featured {
    min-height: 220px;
    transform: none;
  }

  .player-ui .menu-landing .menu-ride .menu-icon {
    width: 94px;
    height: 94px;
    font-size: 2.5rem;
  }
}

@media (max-width: 640px) {
  .player-ui .menu-landing .menu-ride {
    min-height: 205px;
    border-width: 3px;
  }

  .player-ui .menu-landing .menu-ride .menu-icon {
    width: 84px;
    height: 84px;
    font-size: 2.2rem;
    border-radius: 22px;
  }
}
