/* =========================================================
   REFERENCE LAYOUT — mengikuti board UI Timbangan Ajaib Raja
   Overrides tipis di atas theme.css.
   ========================================================= */

/* ---------- Tombol putih kecil seperti board ---------- */
.fantasy-btn.primary,
.fantasy-btn.cream,
.fantasy-btn.exit,
.fantasy-btn.gold,
.fantasy-btn.white {
  width: auto !important;
  height: auto !important;
  min-height: 38px !important;
  max-height: none !important;
  flex: 0 0 auto !important;
  padding: 0 18px !important;
  border: 2px solid var(--ink) !important;
  border-radius: 10px !important;
  background: #FFF8E5 !important;
  background-image: none !important;
  color: var(--ink) !important;
  box-shadow: 0 3px 0 rgba(43, 30, 22, 0.24) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}
.fantasy-btn.primary.press {
  width: auto !important;
  height: auto !important;
  min-height: 38px !important;
  padding: 0 18px !important;
  background: #FFF8E5 !important;
  background-image: none !important;
  color: var(--ink) !important;
  font-size: 15px !important;
  border-radius: 10px !important;
  box-shadow: 0 3px 0 rgba(43, 30, 22, 0.24) !important;
}

.fantasy-btn.primary:hover,
.fantasy-btn.cream:hover,
.fantasy-btn.exit:hover,
.fantasy-btn.gold:hover,
.fantasy-btn.white:hover {
  background: var(--gold-light) !important;
  filter: none !important;
  transform: none;
}
.fantasy-btn.primary:active,
.fantasy-btn.cream:active,
.fantasy-btn.exit:active,
.fantasy-btn.gold:active,
.fantasy-btn.white:active {
  transform: translateY(2px) !important;
  box-shadow: 0 1px 0 rgba(43, 30, 22, 0.24) !important;
}

/* ---------- Menu utama ---------- */
.menu-actions .fantasy-btn,
.menu-actions #btnPlay {
  width: 220px !important;
  min-height: 38px !important;
  font-size: 15px !important;
  justify-content: center;
}

@media (orientation: landscape) and (max-height: 500px) {
  .menu-plaque {
    display: block !important;
    position: absolute !important;
    left: 50% !important;
    top: 0 !important;
    width: min(430px, 60vw) !important;
    padding: 7px 16px 9px !important;
    transform: translateX(-50%) rotate(-0.4deg) !important;
    border-width: 3px !important;
    border-radius: 14px !important;
    box-shadow: 0 5px 0 #2B1E16 !important;
  }
  .menu-plaque::before,
  .plaque-star {
    display: none !important;
  }
  .plaque-crown {
    display: block !important;
    top: -22px !important;
    font-size: 28px !important;
  }
  .plaque-line1 {
    font-size: 17px !important;
  }
  .plaque-line2 {
    font-size: 23px !important;
  }
  .menu-actions {
    position: absolute !important;
    left: 50% !important;
    top: 46% !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: auto !important;
    gap: 8px !important;
    transform: translate(-50%, -50%) !important;
  }
  .menu-actions .fantasy-btn {
    width: 205px !important;
    min-height: 36px !important;
    font-size: 14px !important;
  }
  .menu-side {
    display: flex !important;
    position: absolute !important;
    right: 2% !important;
    bottom: 2% !important;
    width: 145px !important;
    margin: 0 !important;
    align-items: center;
  }
  .menu-cat {
    display: block !important;
    position: static !important;
    width: 100px !important;
    margin-top: -4px !important;
  }
  .name-card {
    width: 112px !important;
    padding: 2px 8px 4px !important;
  }
  .name-card input {
    font-size: 17px !important;
  }
  .menu-foot {
    display: none !important;
  }
}

/* ---------- Pilih kelas & mapel ---------- */
@media (orientation: landscape) {
  .subject-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 8px 0 !important;
  }
  .subject-card {
    flex-direction: column !important;
    justify-content: center !important;
    text-align: center !important;
    min-height: 78px !important;
    padding: 7px 8px !important;
    gap: 3px !important;
    border: 2px solid var(--ink) !important;
    border-radius: 12px !important;
    background: #FFF8E5 !important;
    box-shadow: 0 3px 0 #C98A2C !important;
  }
  .subject-card:hover {
    background: var(--gold-light) !important;
  }
  .subject-card.is-selected {
    background: var(--gold) !important;
    box-shadow: 0 3px 0 #6B431E !important;
  }
  .subject-icon {
    width: 38px !important;
    height: 38px !important;
    border: 2px solid var(--ink) !important;
    border-radius: 9px !important;
  }
  .subject-copy strong {
    font-size: 13px !important;
  }
  .subject-copy span {
    display: none !important;
  }
  .subject-card.is-selected::after {
    display: none !important;
  }
  .class-tab {
    min-height: 30px !important;
    padding: 0 13px !important;
    border: 2px solid var(--ink) !important;
    border-radius: 999px !important;
    background: #FFF8E5 !important;
    box-shadow: 0 3px 0 #B9772E !important;
    font-size: 12px !important;
  }
  .class-tab.is-selected {
    background: var(--gold) !important;
    box-shadow: 0 3px 0 #6B431E !important;
  }
  .select-bottom .fantasy-btn {
    width: auto !important;
    min-width: 160px !important;
    min-height: 38px !important;
    font-size: 15px !important;
  }
  .select-board {
    padding: 10px 14px !important;
  }
  .select-top {
    margin-bottom: 6px !important;
  }
  .select-heading h1 {
    font-size: clamp(20px, 2.7vw, 24px) !important;
  }
  .select-summary {
    font-size: 16px !important;
  }
}

/* ---------- Gameplay: dock gelap ringkas ---------- */
.dock-panel {
  background:
    radial-gradient(ellipse at 50% 0%, rgba(246, 200, 76, 0.12), transparent 55%),
    linear-gradient(180deg, #3E2A18 0%, #241710 100%) !important;
  border: 3px solid var(--ink) !important;
  border-top: 3px solid var(--gold) !important;
  border-radius: 12px !important;
  padding: 7px 10px !important;
}
.dock-head,
.dock-hint,
.dock-kicker {
  display: none !important;
}
.dock-fill {
  grid-template-columns: minmax(0, 1fr) auto !important;
  grid-template-areas: "fill pad" !important;
  gap: 8px !important;
}
.fill-row {
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px !important;
}
.numpad {
  display: none !important;
}
.answer-input {
  height: 40px !important;
  color: var(--ink) !important;
  border: 2px solid var(--ink) !important;
  background: #FFF8E5 !important;
  font-size: 19px !important;
  box-shadow: none !important;
}
.btn-weigh {
  min-height: 40px !important;
  padding: 0 16px !important;
  border: 2px solid var(--ink) !important;
  border-radius: 10px !important;
  background: var(--green) !important;
  color: #FFF8E4 !important;
  box-shadow: 0 3px 0 #1E5A33 !important;
  font-size: 13px !important;
}
.stones {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 8px !important;
}
.stone {
  min-height: 40px !important;
  padding: 4px 8px !important;
  border: 2px solid var(--ink) !important;
  border-radius: 9px !important;
  background: #FFF8E5 !important;
  color: var(--ink) !important;
  box-shadow: 0 3px 0 #7A4D00 !important;
  font-size: 14px !important;
}
.stone::before {
  display: none !important;
}
.dock-mc .dock-head {
  display: none !important;
}
.answer-dock {
  padding-bottom: 6px !important;
}

/* ---------- Pause: panel krem + emas ---------- */
.pause-card {
  position: relative !important;
  width: min(700px, 92vw) !important;
  max-width: 700px !important;
  max-height: none !important;
  padding: 42px 18px 14px !important;
  display: grid !important;
  grid-template-columns: 33% 67% !important;
  grid-template-rows: 1fr auto !important;
  gap: 8px 14px !important;
  overflow: hidden !important;
  border: 3px solid var(--ink) !important;
  border-radius: 16px !important;
  background:
    linear-gradient(90deg, #FDF0C8 0 33%, #B99236 33% 100%) !important;
  box-shadow: 0 8px 0 #6B431E, 0 22px 40px rgba(0, 0, 0, 0.38) !important;
}
.pause-head {
  position: absolute !important;
  left: 50% !important;
  top: -38px !important;
  z-index: 4 !important;
  justify-content: center !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 3px 16px !important;
  transform: translateX(-50%) !important;
  border: 2px solid var(--ink) !important;
  border-radius: 9px !important;
  background: #FFF8E5 !important;
  box-shadow: 0 3px 0 rgba(43, 30, 22, 0.22) !important;
}
.pause-symbol {
  width: 24px !important;
  height: 24px !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  font-size: 12px !important;
}
.pause-head h2 {
  color: var(--ink) !important;
  font-size: 18px !important;
}
.pause-body {
  display: contents !important;
}
.pause-profile {
  grid-column: 1 !important;
  grid-row: 1 / 3 !important;
  align-self: center !important;
  width: auto !important;
}
.pause-avatar {
  width: 80px !important;
  height: 80px !important;
  margin-bottom: 4px !important;
}
.pause-profile b {
  font-size: 26px !important;
}
.pause-profile span {
  font-size: 10px !important;
}
.pause-settings {
  display: flex !important;
  flex-direction: row !important;
  justify-content: center !important;
  align-self: stretch !important;
  gap: clamp(24px, 10%, 56px) !important;
  padding-top: 2px !important;
}
.pause-setting {
  flex-direction: column !important;
  justify-content: center !important;
  gap: 3px !important;
  padding: 0 !important;
  border-bottom: 0 !important;
  font-family: var(--font-hand) !important;
  font-size: clamp(13px, 1.6vw, 17px) !important;
  font-weight: 400 !important;
}
.setting-row {
  padding: 5px 0 !important;
  border-bottom: 1px dashed rgba(43, 30, 22, 0.24) !important;
  color: var(--ink) !important;
  font-size: 13px !important;
}
.setting-row:last-of-type {
  border-bottom: 0 !important;
}
.toggle {
  width: 75px !important;
  min-width: 75px !important;
  height: 34px !important;
  min-height: 34px !important;
}
.toggle b {
  font-size: 9px !important;
}
.pause-setting-note {
  display: none !important;
}
.pause-actions {
  grid-column: 2 !important;
  grid-row: 2 !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  margin: 0 !important;
}
.pause-actions .fantasy-btn,
.pause-actions .fantasy-btn.white,
.victory-actions .fantasy-btn,
.victory-actions .fantasy-btn.white {
  width: auto !important;
  height: auto !important;
  min-height: 34px !important;
  font-size: 14px !important;
}
.pause-actions .fantasy-btn,
.pause-actions .fantasy-btn.white {
  width: 180px !important;
}
.pause-actions .text-btn {
  display: block !important;
  color: var(--ink) !important;
  font-size: 14px !important;
  opacity: 0.8;
}

/* ---------- Round modal ---------- */
.round-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  width: min(390px, 90vw) !important;
  max-height: none !important;
  padding: 14px 18px 16px !important;
  gap: 2px !important;
  text-align: center !important;
  overflow: hidden !important;
}
.round-burst {
  width: 118px !important;
  height: 108px !important;
  margin: 0 auto !important;
}
.round-rays {
  width: 140px !important;
  height: 140px !important;
}
.round-lock {
  width: 70px !important;
  height: 62px !important;
}
.round-kicker {
  margin: 0 !important;
  font-size: 9px !important;
}
.round-card h2 {
  margin: 2px 0 3px !important;
  font-size: 27px !important;
}
.round-reward {
  justify-content: center !important;
  font-size: 14px !important;
}
.round-explanation {
  margin: 4px 0 8px !important;
  font-size: 11px !important;
  text-align: center !important;
}
.round-card .fantasy-btn {
  width: auto !important;
  min-width: 150px !important;
  min-height: 36px !important;
  margin: 0 auto !important;
  font-size: 14px !important;
}

/* ---------- Victory ---------- */
.victory-actions {
  justify-content: center !important;
  gap: 8px !important;
}
.victory-actions .fantasy-btn,
.victory-actions .fantasy-btn.white {
  width: 155px !important;
  min-width: 155px !important;
  min-height: 36px !important;
  font-size: 14px !important;
}
.victory-board {
  border-radius: 16px !important;
}

@media (orientation: landscape) {
  .menu-actions #btnPlay {
    width: 205px !important;
    min-height: 36px !important;
  }
  .subject-card {
    min-height: 60px !important;
    padding: 4px 6px !important;
    gap: 2px !important;
  }
  .subject-icon {
    width: 34px !important;
    height: 34px !important;
  }
  .subject-copy strong {
    font-size: 12.5px !important;
  }
  .subject-card:nth-child(4):last-child {
    grid-column: 2;
  }
}

/* =========================================================
   PAUSE — amplop + profile dengan animasi berurutan
   ========================================================= */

.pause-asset {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: min(680px, 94vw);
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.36));
}
.pause-title-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.pause-profile-card {
  position: relative;
  z-index: 1;
  width: 60%;
  aspect-ratio: 650 / 440;
  margin-right: -25%;
  opacity: 0;
}
.pause-profile-card img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
}
.pause-profile-copy {
  position: absolute;
  left: 10.5%;
  top: 52.5%;
  width: 39%;
  z-index: 2;
  text-align: left;
}
.pause-profile-copy b {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: clamp(17px, 2.7vw, 27px);
  font-weight: 400;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pause-profile-copy span {
  display: block;
  margin-top: 2px;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: clamp(8px, 0.9vw, 10px);
  font-weight: 800;
}
.pause-envelope {
  position: relative;
  z-index: 2;
  width: 62%;
  aspect-ratio: 652 / 479;
  opacity: 0;
}
.pause-envelope > img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
}
.pause-envelope-content {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 18%;
  bottom: 8%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.pause-settings {
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
}
.pause-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(43, 30, 22, 0.24);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(10px, 1.25vw, 13px);
  font-weight: 900;
}
.pause-setting:last-child {
  border-bottom: 0;
}
.pause-setting .toggle {
  width: 72px !important;
  min-width: 72px !important;
  height: 32px !important;
  min-height: 32px !important;
}
.pause-setting .toggle b {
  font-size: 9px !important;
}
.pause-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0;
}
.pause-controls .fantasy-btn {
  width: min(180px, 68%) !important;
  min-height: 32px !important;
  font-size: 13px !important;
}
.pause-controls .text-btn {
  color: var(--ink) !important;
  font-size: 12px !important;
  opacity: 0.8;
}

.overlay.is-open .pause-envelope {
  animation: pauseEnvelopeIn 0.62s cubic-bezier(0.18, 0.9, 0.28, 1.12) both;
}
.overlay.is-open .pause-profile-card {
  animation: pauseProfileIn 0.38s cubic-bezier(0.2, 0.9, 0.3, 1.1) 0.48s both;
}
.overlay.is-open .pause-settings {
  animation: pauseContentIn 0.3s ease-out 0.72s both;
}
.overlay.is-open .pause-controls {
  animation: pauseContentIn 0.3s ease-out 0.9s both;
}
@keyframes pauseEnvelopeIn {
  0% { opacity: 0; transform: translateX(-14%) scale(0.9); }
  55% { opacity: 1; transform: translateX(-14%) scale(1); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes pauseProfileIn {
  0% { opacity: 0; transform: translateX(18%); }
  100% { opacity: 1; transform: translateX(0); }
}
@keyframes pauseContentIn {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .overlay.is-open .pause-envelope,
  .overlay.is-open .pause-profile-card,
  .overlay.is-open .pause-settings,
  .overlay.is-open .pause-controls {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* =========================================================
   VICTORY REVEAL — popup melebar, karakter, lalu kado
   ========================================================= */

.victory-head {
  position: relative;
  z-index: 4;
}
.victory-board-wrap {
  position: relative;
  z-index: 2;
  width: min(680px, 100vw);
}
.victory-board-wrap .victory-board {
  position: relative;
  z-index: 2;
  width: 100% !important;
  margin: 0 !important;
}
.victory-surprise {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 22px);
  z-index: 1;
  width: 220px;
  height: 170px;
  transform: translateX(-50%);
  pointer-events: none;
}
.victory-hero {
  position: absolute;
  left: 50%;
  bottom: 52px;
  z-index: 2;
  width: 112px;
  height: auto;
  opacity: 0;
  transform: translate(-50%, 70px) scale(0.9);
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.32));
}
.victory-gift {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 1;
  width: 112px;
  height: 82px;
  opacity: 0;
  transform: translate(-50%, 80px);
  border: 3px solid var(--ink);
  border-radius: 9px;
  background:
    linear-gradient(180deg, #FFE08A 0%, #F6C84C 48%, #D99B25 100%);
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, 0.35), 0 7px 0 #7A4D12;
}
.gift-lid {
  position: absolute;
  left: -9px;
  top: -20px;
  width: 124px;
  height: 24px;
  border: 3px solid var(--ink);
  border-radius: 7px;
  background: linear-gradient(180deg, #FFE9A8, #F6C84C 58%, #C98A2C);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.45);
}
.gift-ribbon {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 16px;
  transform: translateX(-50%);
  border-left: 2px solid rgba(43, 30, 22, 0.4);
  border-right: 2px solid rgba(43, 30, 22, 0.4);
  background: var(--red);
}
.gift-ribbon::before,
.gift-ribbon::after {
  content: "";
  position: absolute;
  top: -21px;
  width: 24px;
  height: 18px;
  border: 2px solid var(--ink);
  border-radius: 50% 50% 0 50%;
  background: var(--red);
}
.gift-ribbon::before {
  right: 50%;
  transform: rotate(-18deg);
}
.gift-ribbon::after {
  left: 50%;
  transform: rotate(18deg) scaleX(-1);
}
.victory-screen .victory-cat {
  display: none !important;
}

.victory-screen.is-active .victory-board {
  animation: victoryBoardOpen 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.05) 0.08s both;
}
.victory-screen.is-active .victory-hero {
  animation: victoryHeroRise 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.08) 0.62s both;
}
.victory-screen.is-active .victory-gift {
  animation: victoryGiftRise 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.08) 0.9s both;
}
@keyframes victoryBoardOpen {
  0% {
    opacity: 0.25;
    clip-path: inset(0 46% 0 46% round 8px);
  }
  55% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0 round 0);
  }
}
@keyframes victoryHeroRise {
  0% {
    opacity: 0;
    transform: translate(-50%, 70px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}
@keyframes victoryGiftRise {
  0% {
    opacity: 0;
    transform: translate(-50%, 80px);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .victory-screen.is-active .victory-board {
    animation: none;
    clip-path: none;
  }
  .victory-hero,
  .victory-gift {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  .victory-screen.is-active .victory-hero,
  .victory-screen.is-active .victory-gift {
    animation: none;
  }
}

/* =========================================================
   ASET TOMBOL & PARCHMENT FINAL
   ========================================================= */

/* Button state sheet: krem normal, emas saat hover/aktif. */
.fantasy-btn.primary,
.fantasy-btn.cream,
.fantasy-btn.exit,
.fantasy-btn.gold,
.fantasy-btn.white {
  width: auto !important;
  height: 52px !important;
  min-height: 0 !important;
  padding: 0 16px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent url("../assets/Buttons/cream-large.png") center / 100% 100% no-repeat !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  font-size: 14px !important;
}
.fantasy-btn.primary.press {
  width: auto !important;
  height: 52px !important;
  padding: 0 16px !important;
  background: transparent url("../assets/Buttons/cream-large.png") center / 100% 100% no-repeat !important;
  color: var(--ink) !important;
  font-size: 14px !important;
}
.fantasy-btn.primary:hover,
.fantasy-btn.cream:hover,
.fantasy-btn.exit:hover,
.fantasy-btn.gold:hover,
.fantasy-btn.white:hover,
.fantasy-btn.primary.press:hover {
  background-image: url("../assets/Buttons/gold-large.png") !important;
  filter: none !important;
  transform: none !important;
}
.fantasy-btn.primary:active,
.fantasy-btn.cream:active,
.fantasy-btn.exit:active,
.fantasy-btn.gold:active,
.fantasy-btn.white:active,
.fantasy-btn.primary.press:active {
  transform: translateY(2px) !important;
  box-shadow: none !important;
}

/* Menu utama memakai SVG yang dikirim pengguna. */
.menu-actions #btnPlay,
.menu-actions #btnChoose,
.menu-actions #btnExit {
  width: 205px !important;
  height: 70px !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent url("../assets/Button Menu.svg") center / 100% 100% no-repeat !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  font-size: 15px !important;
}
.menu-actions #btnPlay:hover,
.menu-actions #btnChoose:hover,
.menu-actions #btnExit:hover {
  background-image: url("../assets/Button Menu.svg") !important;
  filter: brightness(1.025);
  transform: none !important;
}
.menu-actions {
  top: 55% !important;
}
.menu-actions .fantasy-btn {
  width: 205px !important;
  height: 70px !important;
  min-height: 0 !important;
}

/* Tombol aksi kecil memakai proporsi aset sheet (3:1). */
.select-bottom .fantasy-btn,
.guide-done,
.round-card .fantasy-btn,
.victory-actions .fantasy-btn,
.pause-controls .fantasy-btn,
.exit-card .fantasy-btn {
  width: 150px !important;
  height: 51px !important;
  min-height: 0 !important;
  font-size: 13px !important;
}
.guide-done {
  background: transparent url("../assets/Buttons/cream-large.png") center / 100% 100% no-repeat !important;
  border: 0 !important;
  color: var(--ink) !important;
  box-shadow: none !important;
}
.victory-actions .fantasy-btn {
  width: 155px !important;
  height: 53px !important;
}
.pause-controls .fantasy-btn {
  width: 160px !important;
  height: 54px !important;
}
.exit-card .fantasy-btn {
  width: 170px !important;
  height: 58px !important;
}

/* TIMBANG juga memakai state emas dari sheet. */
.btn-weigh {
  width: 150px !important;
  height: 51px !important;
  min-height: 0 !important;
  padding: 0 12px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent url("../assets/Buttons/gold-large.png") center / 100% 100% no-repeat !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  font-size: 12px !important;
}
.btn-weigh:disabled {
  filter: grayscale(0.45) brightness(0.94);
}
.btn-weigh:hover {
  filter: brightness(1.04);
}

/* Tab kelas memakai state pill besar agar tidak ada potongan aset. */
.class-tab,
.class-tab.is-selected {
  width: 78px !important;
  height: 26px !important;
  min-height: 0 !important;
  padding: 0 4px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent url("../assets/Buttons/cream-large.png") center / 100% 100% no-repeat !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  font-size: 10px !important;
}
.class-tab.is-selected {
  background-image: url("../assets/Buttons/gold-large.png") !important;
}
.class-tab:hover {
  background-image: url("../assets/Buttons/gold-large.png") !important;
  filter: none !important;
}

/* Ikon HUD dari sheet ikon. */
.hud #btnPause {
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent url("../assets/Buttons/icon-pause.png") center / contain no-repeat !important;
  box-shadow: none !important;
}
.hud #btnPause svg {
  display: none !important;
}
.hud #btnHelp {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent url("../assets/Buttons/icon-help.png") center / contain no-repeat !important;
  box-shadow: none !important;
}
.hud #btnHelp .icon-glyph {
  display: none !important;
}
#btnSelectBack {
  width: 110px !important;
  height: 40px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent url("../assets/Buttons/cream-small.png") center / 100% 100% no-repeat !important;
  box-shadow: none !important;
  font-size: 12px !important;
}

/* Panel bantuan, pilih kelas, modal, dan victory memakai parchment. */
.select-board,
.guide-card,
.round-card,
.victory-board,
.exit-card {
  border: 14px solid transparent !important;
  border-image: url("../assets/parchment-frame.jpg") 110 fill stretch !important;
  border-image-width: 14px !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: 0 8px 0 rgba(43, 30, 22, 0.28), 0 20px 34px rgba(0, 0, 0, 0.3) !important;
}
.select-board {
  padding: 6px 10px !important;
}
.guide-card {
  padding: 20px 24px !important;
}
.round-card {
  padding: 18px 20px !important;
}
.victory-board {
  min-height: 190px !important;
  padding: 18px !important;
}
.exit-card {
  padding: 20px !important;
}

/* Bubble kucing di menu utama. */
.menu-speech {
  position: relative;
  align-self: flex-end;
  width: 220px;
  margin: 10px 0 12px -75px;
}
.menu-bubble {
  position: relative;
  z-index: 4;
  width: 100%;
  padding: 26px 14px 10px;
  border: 3px solid #3A2313;
  border-radius: 18px;
  background: #FFF8E5;
  box-shadow: inset 0 0 0 3px #C98A2C, 0 4px 0 #8A5A1E;
  color: var(--ink);
  font-family: var(--font-hand);
  font-size: 15px;
  line-height: 1.08;
  text-align: center;
}
.menu-bubble::after {
  content: "";
  position: absolute;
  right: 46px;
  bottom: -9px;
  width: 19px;
  height: 19px;
  transform: rotate(45deg);
  border-right: 3px solid #3A2313;
  border-bottom: 3px solid #3A2313;
  background: #FFF8E5;
}
.menu-speech .name-card {
  position: absolute;
  left: -8px;
  top: -18px;
  z-index: 5;
  width: 126px;
  padding: 3px 10px 5px;
  border: 0;
  border-radius: 5px;
  background: #F5E3AE;
  box-shadow: 1px 3px 0 rgba(80, 52, 24, 0.3);
  transform: rotate(-1.5deg);
}
.menu-speech .name-card label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.menu-speech .name-input-wrap {
  margin: 0;
  padding-bottom: 1px;
  border-bottom: 2px solid #4A2C14;
}
.menu-speech .name-card input {
  padding: 0;
  font-size: 21px;
}
.menu-speech .name-pencil {
  display: none;
}

@media (min-width: 721px) and (min-height: 501px) {
  .menu-actions #btnPlay,
  .menu-actions #btnChoose,
  .menu-actions #btnExit {
    width: 250px !important;
    height: 86px !important;
  }
  .menu-actions .fantasy-btn {
    width: 250px !important;
    height: 86px !important;
  }
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 700px) {
  .select-layer {
    padding-top: 1px !important;
    padding-bottom: 0 !important;
  }
  .select-board {
    border-width: 6px !important;
    border-image-width: 6px !important;
    padding: 1px 8px 0 !important;
  }
  .subject-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin: 4px 0 !important;
  }
  .subject-card {
    min-height: 42px !important;
    padding: 2px 3px !important;
    gap: 1px !important;
  }
  .subject-icon {
    width: 24px !important;
    height: 24px !important;
  }
  .subject-copy strong {
    font-size: 10.5px !important;
  }
  .class-tab,
  .class-tab.is-selected {
    width: 64px !important;
    height: 26px !important;
    font-size: 10px !important;
  }
  .select-bottom {
    padding-top: 4px !important;
  }
  .select-bottom .fantasy-btn {
    width: 130px !important;
    height: 44px !important;
    font-size: 12px !important;
  }
  .select-summary {
    font-size: 14px !important;
  }
  .select-heading h1 {
    font-size: 18px !important;
  }
  .select-top {
    margin-bottom: 3px !important;
  }
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 720px) {
  .menu-actions #btnPlay,
  .menu-actions #btnChoose,
  .menu-actions #btnExit,
  .menu-actions .fantasy-btn {
    width: 190px !important;
    height: 65px !important;
  }
  .menu-side {
    width: 140px !important;
  }
  .menu-bubble {
    font-size: 12px;
    padding: 6px 8px;
  }
  .select-board {
    padding: 8px 10px !important;
  }
  .guide-card {
    padding: 14px 16px !important;
  }
}

@media (max-width: 720px) and (orientation: landscape) {
  .pause-controls .fantasy-btn {
    width: 130px !important;
    height: 44px !important;
    font-size: 12px !important;
  }
  .pause-controls .text-btn {
    font-size: 10px !important;
  }
  .pause-asset {
    width: min(680px, 88vw);
  }
  .pause-profile-copy b {
    font-size: 19px;
  }
  .pause-setting {
    font-size: 11px;
  }
  .pause-setting .toggle {
    width: 64px !important;
    min-width: 64px !important;
    height: 29px !important;
    min-height: 29px !important;
  }
  .pause-controls .fantasy-btn {
    width: min(160px, 70%) !important;
    min-height: 29px !important;
    font-size: 12px !important;
  }
  .pause-controls .text-btn {
    font-size: 11px !important;
  }
}

@media (max-width: 720px) and (orientation: landscape) {
  .pause-card {
    width: min(700px, 96vw) !important;
    max-width: 96vw !important;
    padding: 40px 12px 10px !important;
    grid-template-columns: 32% 68% !important;
    gap: 6px 10px !important;
  }
  .pause-avatar {
    width: 62px !important;
    height: 62px !important;
  }
  .pause-profile b {
    font-size: 22px !important;
  }
  .pause-settings .setting-row {
    font-size: 12px !important;
  }
  .toggle {
    width: 70px !important;
    min-width: 70px !important;
    height: 32px !important;
    min-height: 32px !important;
  }
  .pause-actions .fantasy-btn {
    width: 160px !important;
    min-height: 32px !important;
    font-size: 13px !important;
  }
  .subject-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .subject-card {
    min-height: 68px !important;
  }
  .subject-icon {
    width: 32px !important;
    height: 32px !important;
  }
  .subject-copy strong {
    font-size: 12px !important;
  }
  .select-board {
    padding: 8px 10px !important;
  }
  .select-top {
    margin-bottom: 4px !important;
  }
  .select-heading h1 {
    font-size: 20px !important;
  }
  .select-bottom .fantasy-btn {
    min-width: 150px !important;
    min-height: 36px !important;
  }
  .menu-actions .fantasy-btn {
    width: 205px !important;
    min-height: 36px !important;
  }
  .menu-side {
    width: 140px !important;
  }
  .menu-cat {
    width: 92px !important;
  }
  .name-card input {
    font-size: 19px !important;
  }
}

@media (orientation: landscape) and (min-width: 701px) and (max-height: 500px) {
  .select-layer {
    padding-top: 3px !important;
    padding-bottom: 4px !important;
  }
  .select-top {
    margin-bottom: 4px !important;
  }
}

@media (orientation: landscape) {
  .pause-envelope-content {
    bottom: 10% !important;
  }
  .pause-controls {
    gap: 2px !important;
  }
  .pause-controls .fantasy-btn {
    width: 150px !important;
    height: 50px !important;
    min-height: 0 !important;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .victory-layer {
    justify-content: flex-start;
    gap: 0;
    padding: 2px 8px 4px;
  }
  .victory-head {
    display: block !important;
    margin: 0;
  }
  .victory-head .kicker,
  .victory-sub {
    display: none !important;
  }
  .victory-head h1 {
    margin: 0;
    font-size: 26px !important;
    line-height: 0.95;
  }
  .selesai-banner {
    margin: 3px 0 0;
    padding: 2px 14px;
    font-size: 20px;
  }
  .victory-board-wrap {
    margin-top: 108px;
    width: min(680px, 100vw);
  }
  .victory-board {
    min-height: 0 !important;
    padding: 6px 10px !important;
    border-width: 10px !important;
    border-image-width: 10px !important;
  }
  .victory-surprise {
    width: 190px;
    height: 130px;
    bottom: calc(100% - 10px);
  }
  .victory-hero {
    width: 80px;
    bottom: 30px;
  }
  .victory-gift {
    width: 88px;
    height: 64px;
  }
  .gift-lid {
    left: -9px;
    top: -18px;
    width: 100px;
    height: 20px;
  }
  .gift-ribbon {
    width: 13px;
  }
  .gift-ribbon::before,
  .gift-ribbon::after {
    top: -18px;
    width: 19px;
    height: 15px;
  }
  .victory-badges {
    gap: 4px;
  }
  .victory-lock-badge,
  .victory-star-badge {
    padding: 3px 8px;
    font-size: 9px;
  }
  .victory-stats {
    margin: 4px 0;
    gap: 4px;
  }
  .victory-stats .stat {
    padding: 4px 3px;
  }
  .stat-label {
    font-size: 7px;
  }
  .stat-value {
    font-size: 14px;
  }
  .victory-actions {
    gap: 6px;
  }
  .victory-actions .fantasy-btn {
    width: 132px !important;
    height: 44px !important;
    min-height: 0 !important;
    font-size: 12px !important;
  }
  .victory-recap-wrap,
  .victory-foot,
  .victory-cat {
    display: none !important;
  }
}

@media (orientation: landscape) and (max-height: 500px) and (max-width: 720px) {
  .pause-controls .fantasy-btn {
    width: 130px !important;
    height: 44px !important;
  }
}

@media (orientation: landscape) and (max-width: 720px) {
  .menu-speech {
    width: 188px;
  }
  .menu-speech .name-card {
    left: -4px;
    top: -16px;
    width: 102px;
    padding: 2px 7px 3px;
  }
  .menu-speech .name-card input {
    font-size: 15px !important;
  }
  .menu-bubble {
    padding: 21px 10px 8px;
    font-size: 13px;
  }
  .menu-cat {
    width: 86px !important;
  }
}

/* Ukuran tombol menu utama: lebih ringkas, teks ikut seimbang. */
.menu-actions #btnPlay,
.menu-actions #btnChoose,
.menu-actions #btnExit,
.menu-actions .fantasy-btn {
  width: 174px !important;
  height: 60px !important;
  font-size: 15px !important;
}

@media (min-width: 721px) and (min-height: 501px) {
  .menu-actions #btnPlay,
  .menu-actions #btnChoose,
  .menu-actions #btnExit,
  .menu-actions .fantasy-btn {
    width: 214px !important;
    height: 73px !important;
    font-size: 16px !important;
  }
}

/* Judul memakai aset Judul.png di kiri atas. */
.menu-top {
  justify-content: flex-end;
}
.menu-logo {
  position: absolute;
  left: 50%;
  top: 4px;
  z-index: 9;
  width: clamp(190px, 30vw, 340px);
  height: auto;
  transform: translateX(-50%);
  pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.35));
}

.menu-title-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
