:root {
  --night: #1c0f08;
  --wood: #5a2e16;
  --wood-2: #3a1c0c;
  --gold: #e3b341;
  --gold-2: #f6d77a;
  --cream: #fff7e6;
  --paper: #fffaf0;
  --ink: #3b2412;
  --muted: #7a5a3c;
  --ok: #2e9e5b;
  --bad: #d64545;
  --radius: 20px;
  --batik: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23e3b341' stroke-opacity='.13' stroke-width='1.5'%3E%3Cellipse cx='30' cy='15' rx='7' ry='13'/%3E%3Cellipse cx='30' cy='45' rx='7' ry='13'/%3E%3Cellipse cx='15' cy='30' rx='13' ry='7'/%3E%3Cellipse cx='45' cy='30' rx='13' ry='7'/%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  color: var(--cream);
  background: var(--batik), radial-gradient(circle at 50% -10%, #6b3a1c 0%, #2a160c 55%, var(--night) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

button {
  font: inherit;
}

[hidden] {
  display: none !important;
}

/* ---------- Layar ---------- */

.screen {
  display: none;
  position: relative;
  min-height: 100vh;
  padding: 16px 16px 120px;
}

.screen.active {
  display: block;
  animation: screenIn 0.45s ease both;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1160px;
  margin: 0 auto 14px;
  padding: 8px 12px;
  background: linear-gradient(180deg, #7a4120, #4a2410);
  border: 2px solid var(--gold);
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.topbar h2 {
  margin: 0;
  flex: 1;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold-2);
  text-shadow: 0 2px 0 #2a1208;
}

.back-btn {
  font-weight: 800;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: 0 3px 0 #8a5a12;
  cursor: pointer;
  transition: transform 0.12s;
}

.back-btn:hover {
  transform: translateY(-2px);
}

.back-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #8a5a12;
}

.pill {
  display: inline-block;
  min-width: 1px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--cream);
  border: 2px solid var(--gold);
  border-radius: 999px;
}

.pill:empty {
  visibility: hidden;
}

.hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 0.92rem;
  color: #f0d9b0;
}

/* ---------- Tombol kartu ---------- */

.menu-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  text-align: left;
  color: var(--ink);
  background: linear-gradient(180deg, var(--paper), #fbe3b5);
  border: 3px solid var(--gold);
  border-radius: 22px;
  box-shadow: 0 6px 0 #9a6a1c, 0 14px 26px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  animation: cardIn 0.5s ease both;
}

.menu-card:hover:not(:disabled) {
  transform: translateY(-4px);
  box-shadow: 0 10px 0 #9a6a1c, 0 18px 30px rgba(0, 0, 0, 0.4);
}

.menu-card:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #9a6a1c, 0 6px 12px rgba(0, 0, 0, 0.35);
}

.menu-card:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.6;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.menu-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff6d8, #f2c14e 70%, #c98a2a);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.15), 0 3px 8px rgba(0, 0, 0, 0.2);
}

.menu-icon svg {
  width: 40px;
  height: 40px;
}

.level-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: #7a3b12;
}

.menu-text {
  display: grid;
  gap: 3px;
}

.big-title {
  font-weight: 800;
  font-size: 1.25rem;
}

.big-sub {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 500;
}

.level-card.done {
  border-color: #3ec46d;
}

.primary-btn {
  justify-self: center;
  min-width: 220px;
  padding: 14px 26px;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border: 0;
  border-radius: 999px;
  box-shadow: 0 5px 0 #8a5a12, 0 10px 20px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.12s;
}

.primary-btn:hover {
  transform: translateY(-2px);
}

.primary-btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #8a5a12;
}

.primary-btn.ghost {
  color: var(--cream);
  background: transparent;
  border: 2px solid var(--gold);
  box-shadow: none;
}

.link-btn {
  justify-self: center;
  margin-top: 4px;
  font-weight: 600;
  color: #f0d9b0;
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- Beranda ---------- */

.screen-home {
  padding: 0;
  overflow: hidden;
}

.home-stage {
  position: absolute;
  inset: 0;
}

.home-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(20, 10, 5, 0.6) 0%, rgba(20, 10, 5, 0) 32%, rgba(20, 10, 5, 0) 52%, rgba(20, 10, 5, 0.8) 100%);
}

.home {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 28px 16px 120px;
  pointer-events: none;
}

.home > * {
  pointer-events: auto;
}

.home,
.home-shade {
  transition: opacity 0.6s;
}

/* Selama layar pembuka (gong), konten beranda disembunyikan; hanya pendopo 3D yang terlihat. */
.screen-home.intro .home,
.screen-home.intro .home-shade {
  opacity: 0;
}

.home-title {
  text-align: center;
  animation: cardIn 0.7s ease both;
}

.kicker {
  margin: 0;
  color: var(--gold-2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.85rem;
  font-weight: 800;
}

h1 {
  margin: 4px 0 6px;
  font-size: clamp(2.2rem, 7vw, 3.6rem);
  font-weight: 800;
  line-height: 1.05;
  color: var(--cream);
  filter: drop-shadow(0 3px 0 #3a1a08) drop-shadow(0 10px 18px rgba(0, 0, 0, 0.55));
}

h1 span {
  background: linear-gradient(180deg, #fff3c4, #e3b341 60%, #b07a1c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  margin: 0;
  color: #fbe9c8;
  font-weight: 600;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

/* Menu utama: tombol bulat dengan ikon di tengah dan tulisan melingkar */
.round-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(12px, 3.2vw, 32px);
}

.round-btn {
  position: relative;
  width: clamp(78px, 20vw, 128px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff6d0, #e3b341 52%, #a8741c 100%);
  box-shadow: 0 6px 0 #7a4a10, 0 14px 26px rgba(0, 0, 0, 0.45), inset 0 0 0 3px rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  animation: floaty 3.6s ease-in-out infinite, cardIn 0.6s ease both;
}

.round-btn:nth-child(2) {
  animation-delay: 0.4s, 0.08s;
}

.round-btn:nth-child(3) {
  animation-delay: 0.8s, 0.16s;
}

.round-btn:nth-child(4) {
  animation-delay: 1.2s, 0.24s;
}

.round-btn:hover {
  transform: translateY(-4px) scale(1.07);
  box-shadow: 0 10px 0 #7a4a10, 0 0 28px rgba(246, 215, 122, 0.7);
}

.round-btn:active {
  transform: translateY(3px) scale(0.97);
  box-shadow: 0 2px 0 #7a4a10, 0 6px 12px rgba(0, 0, 0, 0.4);
}

.round-btn svg {
  display: block;
  width: 100%;
  height: 100%;
}

.rb-text {
  font: 800 14px 'Plus Jakarta Sans', 'Trebuchet MS', sans-serif;
  letter-spacing: 2px;
  fill: #4a2410;
}

.rb-core {
  fill: #4a2410;
  stroke: #f6d77a;
  stroke-width: 3;
}

.rb-dot {
  fill: #7a4a10;
}

.rb-lock {
  position: absolute;
  top: -4px;
  right: -4px;
  display: none;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 16px;
  background: #4a2410;
  border: 2px solid var(--gold);
  border-radius: 50%;
}

.round-btn.locked .rb-lock {
  display: grid;
}

@keyframes floaty {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -6px;
  }
}

.start {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(circle, rgba(30, 15, 8, 0.55), rgba(15, 8, 4, 0.88));
  transition: opacity 0.5s;
}

.start.gone {
  opacity: 0;
}

.start-box {
  text-align: center;
}

.start-box p {
  margin: 0 0 10px;
  color: #fbe9c8;
  font-weight: 600;
}

/* Tombol mulai berbentuk gong: diketuk, tabuh memukul, gong berayun dan memancarkan gelombang bunyi. */
.gong-btn {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 0 auto;
  padding: 0;
  color: var(--cream);
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.gong-btn:focus-visible {
  outline: 3px solid var(--gold-2);
  outline-offset: 6px;
  border-radius: 16px;
}

.gong-svg {
  width: min(260px, 64vw);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.55));
}

.gong-disc {
  transform-box: view-box;
  transform-origin: 100px 30px;
  animation: gongIdle 3.2s ease-in-out infinite;
}

.gong-btn:hover .gong-disc {
  filter: brightness(1.12);
}

.gong-mallet {
  transform-box: view-box;
  transform-origin: 228px 204px;
  animation: malletIdle 2.4s ease-in-out infinite;
}

.gong-wave {
  fill: none;
  stroke: #ffe08a;
  stroke-width: 4;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}

.gong-text {
  font: 800 18px 'Plus Jakarta Sans', sans-serif;
  letter-spacing: 3px;
  fill: #5a3208;
}

.gong-label {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold-2);
  animation: labelPulse 1.6s ease-in-out infinite;
}

.gong-btn.struck .gong-disc {
  animation: gongHit 1.6s ease-out;
}

.gong-btn.struck .gong-mallet {
  animation: malletHit 0.55s ease-out;
}

.gong-btn.struck .gong-wave {
  animation: gongWave 1.1s ease-out;
}

.gong-btn.struck .gong-wave.w2 {
  animation-delay: 0.25s;
}

.gong-btn.struck .gong-label {
  animation: none;
  opacity: 0;
}

@keyframes gongIdle {
  0%,
  100% {
    transform: rotate(-1.5deg);
  }
  50% {
    transform: rotate(1.5deg);
  }
}

@keyframes gongHit {
  0% {
    transform: rotate(0);
  }
  8% {
    transform: rotate(-6deg);
  }
  22% {
    transform: rotate(5deg);
  }
  40% {
    transform: rotate(-3deg);
  }
  60% {
    transform: rotate(2deg);
  }
  80% {
    transform: rotate(-1deg);
  }
  100% {
    transform: rotate(0);
  }
}

@keyframes malletIdle {
  0%,
  100% {
    transform: rotate(0);
  }
  50% {
    transform: rotate(4deg);
  }
}

@keyframes malletHit {
  0% {
    transform: rotate(0);
  }
  18% {
    transform: translate(-46px, -14px) rotate(-14deg);
  }
  100% {
    transform: rotate(0);
  }
}

@keyframes gongWave {
  0% {
    opacity: 0.9;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.9);
  }
}

@keyframes labelPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* ---------- Panggung 3D ---------- */

.stage {
  position: relative;
  width: 100%;
  height: 460px;
  overflow: hidden;
  background: var(--night);
  border: 4px solid var(--gold);
  border-radius: 22px;
  box-shadow: 0 0 0 4px #4a2410, 0 18px 34px rgba(0, 0, 0, 0.5);
}

.stage-play {
  height: min(66vh, 620px);
}

.stage-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

/* ---------- Area Belajar ---------- */

.learn-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  max-width: 1160px;
  margin: 0 auto;
}

.tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 0 0 14px;
}

.tab {
  padding: 10px 22px;
  font-weight: 800;
  color: var(--cream);
  background: rgba(58, 28, 12, 0.85);
  border: 2px solid var(--gold);
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.12s, background 0.2s;
}

.tab:hover {
  transform: translateY(-2px);
}

.tab.active {
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  box-shadow: 0 0 16px rgba(246, 215, 122, 0.5);
}

/* Kartu contoh musik daerah */
.music-card {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 14px;
  max-width: 1160px;
  margin: 0 auto 14px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(122, 65, 32, 0.96), rgba(74, 36, 16, 0.96));
  border: 2px solid var(--gold);
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.music-gong {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 40%, #fff6cc 0 14%, #d9a03a 15% 24%, #e8b54a 25% 62%, #8a5a12 63% 68%, #c99133 69% 88%, #5a3208 89%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.music-card.playing .music-gong {
  animation: hum 0.45s ease-in-out infinite alternate;
}

.music-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.music-time {
  margin-left: 6px;
  font-weight: 700;
  letter-spacing: 0;
  color: #f0d9b0;
}

.music-title {
  margin: 2px 0 7px;
  font-weight: 700;
  color: var(--cream);
}

.music-bar {
  height: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  cursor: pointer;
}

.music-bar span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #ffd56b);
  border-radius: inherit;
  transition: width 0.25s linear;
}

.eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 28px;
  opacity: 0.3;
}

.eq i {
  width: 5px;
  height: 30%;
  background: var(--gold-2);
  border-radius: 2px;
}

.music-card.playing .eq {
  opacity: 1;
}

.music-card.playing .eq i {
  animation: eq 0.7s ease-in-out infinite alternate;
}

.music-card.playing .eq i:nth-child(2) {
  animation-delay: 0.15s;
}

.music-card.playing .eq i:nth-child(3) {
  animation-delay: 0.3s;
}

.music-card.playing .eq i:nth-child(4) {
  animation-delay: 0.1s;
}

.music-card.playing .eq i:nth-child(5) {
  animation-delay: 0.25s;
}

.music-btn {
  padding: 11px 18px;
  font-weight: 800;
  white-space: nowrap;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border: 0;
  border-radius: 999px;
  box-shadow: 0 4px 0 #8a5a12;
  cursor: pointer;
  transition: transform 0.12s;
}

.music-btn:hover {
  transform: translateY(-2px);
}

.music-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #8a5a12;
}

.music-card.playing .music-btn {
  color: #fff;
  background: linear-gradient(180deg, #ff9a6b, #e0562a);
  box-shadow: 0 4px 0 #8a2a0c;
}

@keyframes eq {
  from {
    height: 20%;
  }
  to {
    height: 100%;
  }
}

@keyframes hum {
  from {
    transform: scale(0.96) rotate(-3deg);
  }
  to {
    transform: scale(1.04) rotate(3deg);
  }
}

.inst-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.inst-card {
  position: relative;
  padding: 6px;
  color: var(--ink);
  background: radial-gradient(circle at 50% 40%, #fffdf6, #f3dcae);
  border: 3px solid #e9cf96;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
  animation: cardIn 0.4s ease both;
}

.inst-card:hover {
  transform: translateY(-3px) rotate(-1deg);
}

.inst-card.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px #f6d77a, 0 0 18px rgba(246, 215, 122, 0.7);
}

.inst-card img {
  display: block;
  width: 100%;
  height: 70px;
  object-fit: contain;
}

.inst-card .name {
  display: block;
  font-weight: 800;
  font-size: 0.85rem;
}

.inst-card .badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  background: var(--ok);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.info {
  margin-top: 14px;
  padding: 16px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--paper), #fbe9c6);
  border: 3px solid var(--gold);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.info.pop {
  animation: pop 0.45s ease;
}

.info h3 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
}

.info p {
  margin: 6px 0;
  line-height: 1.55;
}

.chip {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: var(--wood);
  border-radius: 999px;
}

.keys {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.key-btn {
  --key: #b5651d;
  min-width: 62px;
  min-height: 56px;
  padding: 0 12px;
  font-weight: 800;
  font-size: 1.15rem;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  background: var(--key);
  border: 3px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3), inset 0 -6px 0 rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: transform 0.1s;
}

.key-btn:hover {
  transform: translateY(-2px) scale(1.04);
}

.key-btn:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
}

/* ---------- Menu permainan ---------- */

.menu {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.menu h3 {
  margin: 10px 0 0;
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold-2);
}

.level-list {
  display: grid;
  gap: 12px;
}

.status {
  margin: 0;
  padding: 10px 14px;
  text-align: center;
  font-weight: 700;
  background: rgba(58, 28, 12, 0.7);
  border: 2px dashed rgba(227, 179, 65, 0.6);
  border-radius: 14px;
}

/* ---------- Kuis ---------- */

.quiz {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
  text-align: center;
}

.replay-btn {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px 12px 14px;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  background: radial-gradient(circle at 30% 30%, #ff8a5c, #c2410c);
  border: 3px solid #ffd9a8;
  border-radius: 999px;
  box-shadow: 0 5px 0 #7a2a08, 0 12px 22px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.replay-btn svg {
  width: 40px;
  height: 40px;
}

.replay-btn.pop {
  animation: pop 0.5s ease;
}

.choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.choice {
  padding: 10px;
  background: radial-gradient(circle at 50% 40%, #fffdf6, #f3dcae);
  border: 4px solid #e9cf96;
  border-radius: 22px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.15s;
  animation: cardIn 0.45s ease both;
}

.choice:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.03);
}

.choice img {
  display: block;
  width: 100%;
  height: auto;
}

.choice.correct {
  border-color: var(--ok);
  background: radial-gradient(circle at 50% 40%, #f1fff6, #bfeccf);
  animation: pop 0.45s ease;
}

.choice.wrong {
  border-color: var(--bad);
  animation: shake 0.4s;
}

.choice:disabled {
  cursor: default;
}

.feedback {
  min-height: 3.2em;
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.result {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--paper), #fbe9c6);
  border: 3px solid var(--gold);
  border-radius: var(--radius);
  animation: pop 0.5s ease;
}

.trophy {
  font-size: 4rem;
  line-height: 1;
  animation: bounce 1.2s ease-in-out infinite;
}

/* ---------- Mainkan gamelan ---------- */

.play {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.dots {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(58, 28, 12, 0.8);
  border: 2px solid var(--gold);
  border-radius: 999px;
}

.dot {
  width: 26px;
  height: 26px;
  background: #6b4a2a;
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.dot.done {
  background: var(--gold-2);
  animation: pop 0.5s ease;
}

.dot.current {
  background: #f2c14e;
  animation: twinkle 0.9s ease-in-out infinite alternate;
}

.message {
  flex: 1;
  min-height: 2.4em;
  margin: 0;
  padding: 10px 16px;
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  color: var(--ink);
  background: linear-gradient(180deg, var(--paper), #fbe9c6);
  border: 3px solid var(--gold);
  border-radius: 18px;
}

.message.pop {
  animation: pop 0.4s ease;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 10, 5, 0.6);
  animation: fadeIn 0.3s ease;
}

.overlay-box {
  width: 100%;
  max-width: 440px;
  padding: 26px;
  text-align: center;
  color: var(--ink);
  background: linear-gradient(180deg, var(--paper), #fbe3b5);
  border: 4px solid var(--gold);
  border-radius: 26px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: pop 0.5s ease;
}

.overlay-box h2 {
  margin: 8px 0 4px;
  font-size: 1.7rem;
  font-weight: 800;
}

.stars span {
  display: inline-block;
  font-size: 2rem;
  animation: pop 0.6s ease both;
}

.stars span:nth-child(2) {
  animation-delay: 0.15s;
}

.stars span:nth-child(3) {
  animation-delay: 0.3s;
}

.overlay-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.overlay-actions .ghost {
  color: var(--ink);
}

/* ---------- Maskot pemandu ---------- */

.guide {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.guide-face {
  position: relative;
  width: 82px;
  height: 88px;
  padding: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #fff4d6, #f3c46b 70%, #c98a2a);
  border: 3px solid var(--gold);
  border-radius: 50% 50% 46% 46%;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  pointer-events: auto;
  animation: bob 3.2s ease-in-out infinite;
}

.guide-face svg {
  display: block;
  width: 100%;
  height: 100%;
}

.guide-toggle {
  position: absolute;
  left: 56px;
  bottom: -4px;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 15px;
  color: #fff;
  background: #4a2410;
  border: 2px solid var(--gold);
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
}

/* Tombol volume dan layar penuh di samping Kak Laras */
.guide-tools {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 4px;
  pointer-events: auto;
}

.tool-btn {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  padding: 0;
  color: var(--gold-2);
  background: radial-gradient(circle at 40% 30%, #7a4120, #3a1d0c);
  border: 3px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.12s;
}

.tool-btn:hover {
  transform: scale(1.08);
}

.tool-btn svg {
  width: 26px;
  height: 26px;
}

#vol-btn .w1,
#vol-btn .w2,
#vol-btn .mute {
  display: none;
}

#vol-btn[data-level='1'] .w1,
#vol-btn[data-level='2'] .w1,
#vol-btn[data-level='2'] .w2,
#vol-btn[data-level='0'] .mute {
  display: inline;
}

#fs-btn .fs-out,
#fs-btn.is-full .fs-in {
  display: none;
}

#fs-btn.is-full .fs-out {
  display: inline;
}

.vol-wrap {
  position: relative;
}

.vol-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--paper);
  border: 3px solid var(--gold);
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  animation: pop 0.25s ease;
}

.vol-step {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border: 0;
  border-radius: 50%;
  box-shadow: 0 3px 0 #8a5a12;
  cursor: pointer;
}

.vol-step:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #8a5a12;
}

#vol-range {
  width: 130px;
  accent-color: #b5651d;
}

.vol-value {
  min-width: 44px;
  font-weight: 800;
  text-align: right;
  color: var(--ink);
}

.guide-bubble {
  max-width: min(320px, calc(100vw - 240px));
  margin-bottom: 26px;
  padding: 7px 12px 9px;
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--gold);
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transform-origin: bottom left;
  transition: opacity 0.25s, transform 0.25s;
}

.guide.show .guide-bubble {
  opacity: 1;
  transform: none;
}

/* Di kuis dan permainan, pesan sudah tampil di layar; gelembung disembunyikan agar alat tidak tertutup. */
body[data-screen='play'] .guide-bubble,
body[data-screen='quiz'] .guide-bubble {
  display: none;
}

.guide-name {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #b5651d;
}

.guide-bubble p {
  margin: 2px 0 0;
  font-weight: 600;
  line-height: 1.35;
}

.guide.talking .guide-face {
  animation: bob 0.6s ease-in-out infinite;
}

.guide .eye,
.guide .mouth {
  transform-box: fill-box;
  transform-origin: center;
}

.guide .eye {
  animation: blink 4.5s infinite;
}

.guide.talking .mouth {
  animation: talk 0.18s ease-in-out infinite alternate;
}

/* ---------- Jendela Credit dan Pengembang ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(20, 10, 5, 0.65);
  animation: fadeIn 0.25s ease;
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px 22px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--paper), #fbe3b5);
  border: 4px solid var(--gold);
  border-radius: 26px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  animation: pop 0.4s ease;
}

.modal-box h2 {
  margin: 0 0 14px;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 800;
}

.modal-box .link-btn {
  display: block;
  margin: 16px auto 0;
  color: var(--muted);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 18px;
  color: #fff;
  background: #4a2410;
  border: 2px solid var(--gold);
  border-radius: 50%;
  cursor: pointer;
}

.credit-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.credit-list li {
  padding: 10px 12px;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.6);
  border: 2px solid #ecd6a6;
  border-radius: 14px;
}

.credit-list strong {
  display: block;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b5651d;
}

.dev-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  text-align: center;
}

.dev-photo {
  width: 180px;
  height: 180px;
  object-fit: cover;
  object-position: 58% 16%;
  border: 5px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 5px #4a2410, 0 12px 26px rgba(0, 0, 0, 0.35);
}

.dev-name {
  margin: 12px 0 0;
  font-size: 1.6rem;
  font-weight: 800;
}

.dev-card .chip {
  margin: 0;
}

.dev-school {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--muted);
}

.dev-note {
  margin: 8px 0 0;
  line-height: 1.5;
}

/* ---------- Pesan dan konfeti ---------- */

.toast {
  position: fixed;
  left: 50%;
  top: 20px;
  z-index: 60;
  padding: 12px 20px;
  font-weight: 800;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  transform: translateX(-50%);
  animation: pop 0.4s ease;
}

.confetti {
  position: fixed;
  top: -20px;
  z-index: 70;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  pointer-events: none;
  animation-name: fall;
  animation-timing-function: cubic-bezier(0.3, 0.6, 0.6, 1);
  animation-fill-mode: forwards;
}

@keyframes fall {
  to {
    transform: translate(var(--dx), 110vh) rotate(var(--rot));
  }
}

@keyframes pop {
  0% {
    transform: scale(0.85);
  }
  60% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-9px);
  }
  75% {
    transform: translateX(9px);
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes twinkle {
  from {
    transform: scale(0.9);
  }
  to {
    transform: scale(1.15);
  }
}

@keyframes blink {
  0%,
  93%,
  100% {
    transform: scaleY(1);
  }
  96% {
    transform: scaleY(0.1);
  }
}

@keyframes talk {
  from {
    transform: scaleY(0.35);
  }
  to {
    transform: scaleY(1.25);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

  .stage {
    height: 360px;
  }

  .stage-play {
    height: 58vh;
  }
}

@media (max-width: 640px) {
  .music-card {
    grid-template-columns: auto 1fr;
  }

  .eq {
    display: none;
  }

  .music-btn {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .choices {
    gap: 8px;
  }

  .inst-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .topbar h2 {
    font-size: 1.05rem;
  }

  .message {
    font-size: 1.05rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
