/* ================================================================
   MALING KEBUN PAK RT — Stylesheet v7
   Player Profile Management, Bouncy Dialogs & Upgraded Leaderboard
   ================================================================ */

/* ── Custom Properties ─────────────────────────────────────── */
:root {
  --clr-bg: #08140c;
  --clr-bg2: #0f1f14;
  --clr-surface: rgba(255, 255, 255, 0.05);
  --clr-border: rgba(255, 255, 255, 0.08);
  --clr-green-dim: #1e4620;
  --clr-green: #4caf50;
  --clr-yellow: #ffd700;
  --clr-orange: #ff8c00;
  --clr-red: #ff3b3b;
  --clr-ice: #80deea;
  --clr-text: #eaf7ea;
  --clr-text2: #a2c7a2;
  --clr-text3: #5c825c;
  --bar-safe: #4caf50;
  --bar-warn: #ff9800;
  --bar-danger: #f44336;
  --grid-size: 450px;
  --ff-title: 'Fredoka One', cursive;
  --ff-body: 'Nunito', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17.5px;
}

@media (max-width: 600px) {
  html {
    font-size: 16px;
  }
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--ff-body);
  background: var(--clr-bg);
  color: var(--clr-text);
}

/* ── Screen Base ───────────────────────────────────────────── */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.screen.active {
  display: flex;
}

.hidden {
  display: none !important;
}

/* ── Global Settings Floating Button (Present on all pages) ── */
.btn-global-settings {
  position: fixed;
  bottom: 24px;
  left: 26px;
  z-index: 990;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(8, 24, 12, 0.9);
  border: 2.5px solid var(--clr-yellow);
  color: var(--clr-yellow);
  font-size: 1.6rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 18px rgba(255, 215, 0, 0.35);
  backdrop-filter: blur(6px);
  transition: transform .18s cubic-bezier(0.175, 0.885, 0.32, 1.275), background .2s, box-shadow .2s;
}

.btn-global-settings svg {
  width: 28px;
  height: 28px;
  stroke-width: 2.4;
}

.btn-global-settings:hover {
  transform: scale(1.15);
  background: rgba(20, 50, 26, 0.95);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.6), 0 6px 20px rgba(0, 0, 0, 0.8);
}

.btn-global-settings:active {
  transform: scale(0.92);
}

@media (max-width: 600px) {
  .btn-global-settings {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
    bottom: 12px;
    left: 16px;
  }
}

/* ── Coin Display (Non-clickable status text) ──────────────── */
.coin-pill {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  background: rgba(14, 38, 20, 0.92);
  border: 2px solid rgba(255, 215, 0, 0.55);
  border-radius: 50px;
  color: var(--clr-yellow);
  font-family: var(--ff-title);
  font-size: 1.22rem;
  padding: .38rem 1.05rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  cursor: default;
  user-select: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.coin-pill svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.coin-display {
  font-family: var(--ff-title);
  font-size: .88rem;
  color: var(--clr-yellow);
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  font-family: var(--ff-body);
  font-weight: 800;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: transform .15s, filter .15s, box-shadow .15s;
  user-select: none;
}

.btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

.btn:active {
  transform: translateY(0);
  filter: brightness(.95);
}

.btn-primary {
  background: linear-gradient(135deg, var(--clr-orange), var(--clr-yellow));
  color: #1a0a00;
  padding: .75rem 1.6rem;
  font-size: .95rem;
  box-shadow: 0 4px 18px rgba(255, 165, 0, .4);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.07);
  color: var(--clr-text);
  padding: .5rem 1.1rem;
  font-size: .85rem;
  border: 1px solid var(--clr-border);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-escape {
  background: linear-gradient(135deg, #e53935, #ff7043);
  color: #fff;
  padding: .45rem 1.1rem;
  font-size: .85rem;
  box-shadow: 0 3px 12px rgba(229, 57, 53, .4);
}

.btn-danger-sm {
  background: rgba(244, 67, 54, .15);
  color: #ff6b6b;
  border: 1px solid rgba(244, 67, 54, .3);
  padding: .4rem .9rem;
  font-size: .8rem;
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--ff-body);
  font-weight: 700;
}

/* ================================================================
   SCREEN 1 — INTRO & BOUNCY COMIC DIALOG
   ================================================================ */
/* ================================================================
   SCREEN 1: HOME / MAIN SCREEN (NIGHT BACKYARD SCENERY)
   ================================================================ */
#homeScreen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #0d2818 0%, #07160c 60%, #030805 100%);
}

#homeScreen.active {
  display: flex;
}

.home-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

/* Night Sky & Moon */
.home-sky {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60%;
}

.home-moon {
  position: absolute;
  top: 25px;
  right: 12%;
  font-size: 3.5rem;
  filter: drop-shadow(0 0 25px rgba(255, 235, 150, 0.75));
  animation: moonGlow 4s ease-in-out infinite alternate;
}

@keyframes moonGlow {
  from {
    filter: drop-shadow(0 0 18px rgba(255, 235, 150, 0.6));
    transform: scale(1);
  }

  to {
    filter: drop-shadow(0 0 32px rgba(255, 245, 180, 0.9));
    transform: scale(1.04);
  }
}

.home-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 15% 15%, #fff 0%, transparent 100%),
    radial-gradient(2px 2px at 28% 30%, #ffd 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 45% 12%, #fff 0%, transparent 100%),
    radial-gradient(1px 1px at 62% 25%, #fff 0%, transparent 100%),
    radial-gradient(2px 2px at 78% 18%, #ffd 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 90% 35%, #fff 0%, transparent 100%);
  animation: starTwinkle 3s ease-in-out infinite alternate;
}

@keyframes starTwinkle {
  from {
    opacity: .4
  }

  to {
    opacity: .9
  }
}

/* Landscape Elements */
.home-landscape {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55%;
  pointer-events: none;
}

.home-fence {
  position: absolute;
  bottom: 85px;
  left: 0;
  right: 0;
  height: 35px;
  background: repeating-linear-gradient(90deg,
      rgba(30, 50, 32, 0.45) 0px,
      rgba(30, 50, 32, 0.45) 12px,
      transparent 12px,
      transparent 20px);
  border-top: 2px solid rgba(50, 90, 55, 0.4);
}

.home-ground-bushes {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(180deg, rgba(8, 28, 12, 0.7) 0%, #040d07 100%);
  border-radius: 40px 40px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 40, 10, 0.5);
}

/* Floating Fruit layer in backyard */
.home-fruits-layer {
  position: absolute;
  top: 10%;
  left: 5%;
  right: 5%;
  bottom: 30%;
  pointer-events: none;
}

.fruit-float {
  position: absolute;
  font-size: 1.8rem;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
  animation: fruitSway 4s ease-in-out infinite alternate;
}

.fruit-float.f1 {
  top: 15%;
  left: 8%;
  animation-delay: 0s;
  font-size: 2.2rem;
}

.fruit-float.f2 {
  top: 38%;
  left: 16%;
  animation-delay: 0.8s;
}

.fruit-float.f3 {
  top: 8%;
  right: 28%;
  animation-delay: 1.4s;
  font-size: 2rem;
}

.fruit-float.f4 {
  top: 32%;
  right: 8%;
  animation-delay: 0.4s;
  font-size: 2.1rem;
}

.fruit-float.f5 {
  top: 52%;
  left: 24%;
  animation-delay: 1.8s;
}

.fruit-float.f6 {
  top: 48%;
  right: 22%;
  animation-delay: 2.2s;
  font-size: 2rem;
}

.fruit-float.f7 {
  top: 20%;
  right: 40%;
  animation-delay: 1.1s;
}

@keyframes fruitSway {
  0% {
    transform: translateY(0) rotate(-4deg);
  }

  100% {
    transform: translateY(-12px) rotate(5deg);
  }
}

/* Characters */
.home-character {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

/* Pak RT Sleeping (Above the fence line) */
.pakrt-sleeping {
  bottom: 122px;
  left: max(5%, 24px);
}

.char-sprite {
  font-size: 3.2rem;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.8));
  transition: transform .2s;
}

.char-prop {
  font-size: 2rem;
  margin-top: -15px;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
}

.char-name-tag {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--clr-border);
  color: var(--clr-text2);
  font-size: .68rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 20px;
  margin-top: 4px;
}

/* Floating Sleep Zzz */
.sleep-zzz {
  position: absolute;
  top: -24px;
  right: -10px;
  display: flex;
  gap: 2px;
}

.sleep-zzz span {
  font-family: var(--ff-title);
  color: #80deea;
  font-weight: 900;
  animation: zzzFloat 2.4s ease-in-out infinite;
  opacity: 0;
}

.sleep-zzz span:nth-child(1) {
  font-size: .75rem;
  animation-delay: 0s;
}

.sleep-zzz span:nth-child(2) {
  font-size: 1rem;
  animation-delay: 0.6s;
}

.sleep-zzz span:nth-child(3) {
  font-size: 1.3rem;
  animation-delay: 1.2s;
}

@keyframes zzzFloat {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.6);
  }

  50% {
    opacity: 0.9;
    transform: translate(6px, -14px) scale(1.1);
  }

  100% {
    opacity: 0;
    transform: translate(14px, -28px) scale(1.3);
  }
}

/* Si Maling Sneaking (Above the fence line) */
.maling-sneaking {
  bottom: 122px;
  right: max(5%, 24px);
  animation: malingSneak 3s ease-in-out infinite alternate;
}

@keyframes malingSneak {
  0% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-4px) rotate(-3deg);
  }

  100% {
    transform: translateY(0) rotate(2deg);
  }
}

.maling-char {
  font-size: 3.4rem;
}

.loot-sack {
  font-size: 1.8rem;
  margin-top: -12px;
}

/* Center Content on Home Screen */
.home-content {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  padding: 1.5rem;
  text-align: center;
  max-width: 680px;
  width: 92%;
}

.home-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}

.home-badge-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.4));
  animation: fruitBounce 2s ease-in-out infinite alternate;
}

@keyframes fruitBounce {
  from {
    transform: translateY(0) scale(1);
  }

  to {
    transform: translateY(-6px) scale(1.08);
  }
}

.home-main-title {
  font-family: var(--ff-title);
  font-size: clamp(3.6rem, 11vw, 5.4rem);
  line-height: 1.02;
  color: var(--clr-yellow);
  text-shadow:
    0 5px 0 #8c4a00,
    0 10px 28px rgba(0, 0, 0, 0.85),
    0 0 38px rgba(255, 215, 0, 0.45);
  letter-spacing: 1.5px;
}

.home-tagline {
  font-size: clamp(1rem, 3.2vw, 1.2rem);
  font-weight: 700;
  color: var(--clr-text2);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  margin-top: .2rem;
}

/* Big Hero Play Button */
.btn-play-main {
  width: auto;
  min-width: 220px;
  max-width: 260px;
  margin: 0 auto;
  font-size: 1.35rem;
  padding: 0.95rem 2.8rem;
  border-radius: 50px;
  box-shadow: 0 0 35px rgba(76, 175, 80, 0.6), 0 8px 25px rgba(0, 0, 0, 0.6);
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  animation: playPulse 2.2s ease-in-out infinite alternate;
}

@keyframes playPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 25px rgba(76, 175, 80, 0.5);
  }

  100% {
    transform: scale(1.06);
    box-shadow: 0 0 45px rgba(255, 215, 0, 0.65), 0 8px 25px rgba(0, 0, 0, 0.7);
  }
}

.play-icon {
  font-size: 1.4rem;
}

/* Home Bottom Bar (Settings & Credits) */
.home-bottom-bar {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: flex-end;
  padding: 0 24px;
  z-index: 10;
  pointer-events: none;
}

.btn-circle-action {
  pointer-events: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(8, 24, 12, 0.85);
  border: 2px solid var(--clr-yellow);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 16px rgba(255, 215, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .2s cubic-bezier(.175, .885, .32, 1.275), background .2s, box-shadow .2s;
  backdrop-filter: blur(6px);
}

.btn-circle-action:hover {
  transform: scale(1.15);
  background: rgba(20, 50, 26, 0.95);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.6), 0 6px 20px rgba(0, 0, 0, 0.8);
}

.circle-icon {
  font-size: 1.5rem;
}

/* ================================================================
   SCREEN 2: PURE STORY SCREEN
   ================================================================ */
#storyScreen {
  background: radial-gradient(ellipse at 50% 40%, #0d2818 0%, #06130b 70%, #030805 100%);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#storyScreen.active {
  display: flex;
}

.story-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 95%;
  max-width: 680px;
  animation: fadeIn .3s ease forwards;
}

.story-header-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.btn-story-nav {
  padding: .45rem 1rem;
  font-size: .88rem;
  font-weight: 800;
  border-radius: 50px;
  background: rgba(0, 0, 0, 0.45);
  border: 1.5px solid var(--clr-border);
  color: var(--clr-text);
  cursor: pointer;
  transition: all .2s ease;
}

.btn-story-nav:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--clr-yellow);
  color: #fff;
  transform: translateY(-1px);
}

.btn-story-nav:active {
  transform: scale(0.96);
}

.story-badge {
  font-family: var(--ff-title);
  font-size: 1.1rem;
  color: var(--clr-yellow);
  letter-spacing: 1.5px;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.story-box {
  cursor: pointer;
  min-height: 320px;
}

.story-actions {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

.player-select-header-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: .25rem;
}

.player-select-header-row.player-select-header-centered {
  justify-content: center;
}

.header-nav-spacer {
  width: 75px;
}

/* ================================================================
   SCREEN 3: SELECT PLAYER SCREEN
   ================================================================ */
#playerSelectScreen {
  background: radial-gradient(ellipse at 50% 50%, #133318 0%, #08140c 70%);
  display: none;
  align-items: center;
  justify-content: center;
}

#playerSelectScreen.active {
  display: flex;
}

.player-select-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
  width: 92%;
  max-width: 540px;
  text-align: center;
  animation: fadeIn .3s ease forwards;
}

.player-select-title {
  font-family: var(--ff-title);
  font-size: 2.25rem;
  color: var(--clr-yellow);
}

.player-select-subtitle {
  font-size: 1.05rem;
  color: var(--clr-text2);
  margin-top: -0.4rem;
}

.player-card-list {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  width: 100%;
  max-height: 310px;
  overflow-y: auto;
  padding-right: 4px;
}

.player-card-row {
  display: flex;
  align-items: center;
  gap: .95rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid var(--clr-border);
  border-radius: 18px;
  padding: .85rem 1.15rem;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}

.player-card-row:hover {
  background: rgba(76, 175, 80, 0.18);
  border-color: var(--clr-green);
  transform: translateX(4px);
}

.player-avatar-badge {
  font-size: 2.1rem;
  background: rgba(0, 0, 0, 0.4);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--clr-border);
  flex-shrink: 0;
}

.player-row-info {
  flex: 1;
  min-width: 0;
}

.player-row-name {
  font-family: var(--ff-title);
  font-size: 1.3rem;
  color: var(--clr-yellow);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-row-stats {
  font-size: .92rem;
  color: var(--clr-text2);
  margin-top: 3px;
}

.btn-select-chip {
  padding: .5rem 1.1rem;
  font-size: .95rem;
  flex-shrink: 0;
}

/* Add Player Section */
.add-player-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .7rem;
  margin-top: .45rem;
}

.btn-toggle-add {
  font-size: 1.02rem;
  padding: .65rem 1.65rem;
  border-radius: 50px;
}

.add-player-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .85rem;
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  padding: 1.2rem;
  border-radius: 18px;
  border: 1px solid var(--clr-border);
  animation: fadeIn .25s ease;
}

.add-player-input-wrap {
  display: flex;
  align-items: center;
  gap: .6rem;
  width: 100%;
  max-width: 360px;
}

.input-avatar-badge {
  font-size: 1.9rem;
}

.add-player-btn-row {
  display: flex;
  gap: .75rem;
  justify-content: center;
  width: 100%;
}

/* ================================================================
   SETTINGS & CREDITS MODALS
   ================================================================ */
.modal-settings-card,
.modal-credits-card {
  max-width: 480px;
  width: 92%;
  background: linear-gradient(145deg, #0d2814 0%, #06150b 100%);
  border: 2px solid var(--clr-yellow);
}

.modal-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid var(--clr-border);
  padding-bottom: .6rem;
  margin-bottom: .4rem;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--clr-text3);
  font-size: 1.2rem;
  cursor: pointer;
  padding: .2rem .4rem;
  transition: color .15s;
}

.btn-close-modal:hover {
  color: var(--clr-red);
}

/* Settings Items */
.setting-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  text-align: left;
}

.setting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setting-header-right {
  display: flex;
  align-items: center;
  gap: .65rem;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background-color: #243527;
  border: 1px solid var(--clr-border);
  border-radius: 24px;
  transition: all .2s ease;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #a0aec0;
  border-radius: 50%;
  transition: all .2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toggle-switch input:checked+.toggle-slider {
  background-color: var(--clr-green);
  border-color: #2ed573;
}

.toggle-switch input:checked+.toggle-slider:before {
  transform: translateX(20px);
  background-color: #ffffff;
}

.setting-control-row.disabled {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(0.7);
}

.setting-label {
  font-weight: 700;
  font-size: .92rem;
  color: var(--clr-text);
}

.setting-vol-badge {
  font-family: var(--ff-title);
  font-size: .9rem;
  color: var(--clr-yellow);
}

.setting-control-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
}

.btn-step-vol {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--clr-border);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}

.btn-step-vol:hover {
  background: rgba(255, 215, 0, 0.2);
  border-color: var(--clr-yellow);
  color: var(--clr-yellow);
}

.slider-vol {
  flex: 1;
  accent-color: var(--clr-yellow);
  cursor: pointer;
  height: 6px;
}

/* Credits Body */
.credits-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

.credits-game-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: .7rem;
  border: 1px solid var(--clr-border);
}

.credits-game-icon {
  font-size: 2.2rem;
}

.credits-game-title {
  font-family: var(--ff-title);
  font-size: 1.25rem;
  color: var(--clr-yellow);
}

.credits-game-ver {
  font-size: .75rem;
  color: var(--clr-text3);
}

.credits-list {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.credits-item {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  background: rgba(255, 255, 255, 0.04);
  padding: .5rem .75rem;
  border-radius: 8px;
}

.credits-label {
  font-size: .72rem;
  text-transform: uppercase;
  color: var(--clr-text3);
  font-weight: 800;
  letter-spacing: .5px;
}

.credits-val {
  font-size: .88rem;
  color: var(--clr-text);
  font-weight: 600;
  line-height: 1.4;
}

.credits-val.highlight {
  font-family: var(--ff-title);
  font-size: 1.05rem;
  color: var(--clr-yellow);
}

.intro-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  max-width: 500px;
  width: 100%;
  text-align: center;
}

.game-title {
  font-family: var(--ff-title);
  font-size: clamp(1.8rem, 6vw, 2.7rem);
  color: var(--clr-yellow);
  text-shadow: 0 0 24px rgba(255, 215, 0, .4), 3px 3px 0 rgba(0, 0, 0, .5);
  line-height: 1.15;
}

.title-highlight {
  color: var(--clr-orange);
}

/* Comic Dialogue Box */
.comic-box {
  background: rgba(3, 18, 9, 0.85);
  border: 2px solid var(--clr-green-dim);
  border-radius: 22px;
  padding: 1.25rem 1.35rem;
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.comic-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--clr-border);
  padding-bottom: .4rem;
}

.comic-badge {
  font-size: .85rem;
  font-weight: 800;
  color: var(--clr-yellow);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.btn-skip-comic {
  background: transparent;
  border: 1.5px solid var(--clr-border);
  color: var(--clr-text2);
  font-size: .82rem;
  font-weight: 700;
  padding: .3rem .8rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all .15s;
}

.btn-skip-comic:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: var(--clr-yellow);
}

.comic-dialog-list {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  max-height: 380px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .5rem .8rem .5rem .6rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 215, 0, 0.3) transparent;
}

.comic-dialog-list::-webkit-scrollbar {
  width: 6px;
}

.comic-dialog-list::-webkit-scrollbar-track {
  background: transparent;
}

.comic-dialog-list::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.3);
  border-radius: 4px;
}

/* Bouncy Pop Comic Bubble Container */
.comic-bubble {
  display: flex;
  gap: .9rem;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
  animation: bouncyPop .35s cubic-bezier(.175, .885, .32, 1.275) forwards;
}

.comic-bubble.bubble-left {
  flex-direction: row;
  justify-content: flex-start;
  transform-origin: center left;
}

.comic-bubble.bubble-right {
  flex-direction: row-reverse;
  justify-content: flex-start;
  transform-origin: center right;
}

@keyframes bouncyPop {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(16px);
  }

  70% {
    opacity: 1;
    transform: scale(1.02) translateY(-2px);
  }

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

.comic-avatar {
  font-size: 2.2rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid var(--clr-border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.comic-bubble.bubble-side .comic-avatar {
  border-color: #38bdf8;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.25) 0%, rgba(15, 30, 50, 0.85) 100%);
}

.comic-bubble.bubble-maling .comic-avatar {
  border-color: #2ecc71;
  background: radial-gradient(circle, rgba(46, 204, 113, 0.25) 0%, rgba(10, 35, 20, 0.85) 100%);
}

.comic-bubble.bubble-rt .comic-avatar {
  border-color: #f87171;
  background: radial-gradient(circle, rgba(248, 113, 113, 0.25) 0%, rgba(45, 20, 20, 0.85) 100%);
}

/* Chat Speech Bubble with Directional Arrow Pointer */
.comic-text-wrap {
  position: relative;
  border-radius: 18px;
  padding: .9rem 1.25rem;
  font-size: 1.08rem;
  line-height: 1.55;
  color: #f8fafc;
  max-width: 82%;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: break-word;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.comic-bubble.bubble-side .comic-text-wrap {
  --bubble-bg: #10263c;
  --bubble-border: #38bdf8;
  background: linear-gradient(135deg, rgba(16, 38, 60, 0.96) 0%, rgba(12, 28, 46, 0.96) 100%);
  border: 1.5px solid #38bdf8;
  border-top-left-radius: 4px;
}

.comic-bubble.bubble-maling .comic-text-wrap {
  --bubble-bg: #123722;
  --bubble-border: #2ecc71;
  background: linear-gradient(135deg, rgba(18, 55, 34, 0.96) 0%, rgba(12, 38, 24, 0.96) 100%);
  border: 1.5px solid #2ecc71;
  border-top-right-radius: 4px;
}

.comic-bubble.bubble-rt .comic-text-wrap {
  --bubble-bg: #381818;
  --bubble-border: #f87171;
  background: linear-gradient(135deg, rgba(56, 24, 24, 0.96) 0%, rgba(40, 16, 16, 0.96) 100%);
  border: 1.5px solid #f87171;
  border-top-left-radius: 4px;
}

/* Speech Bubble Left Tail (Points to left avatar) */
.comic-bubble.bubble-left .comic-text-wrap::before {
  content: "";
  position: absolute;
  top: 18px;
  left: -11px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 11px solid var(--bubble-border, #38bdf8);
}

.comic-bubble.bubble-left .comic-text-wrap::after {
  content: "";
  position: absolute;
  top: 19px;
  left: -9px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 9px solid var(--bubble-bg, #10263c);
}

/* Speech Bubble Right Tail (Points to right avatar) */
.comic-bubble.bubble-right .comic-text-wrap::before {
  content: "";
  position: absolute;
  top: 18px;
  right: -11px;
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 11px solid var(--bubble-border, #2ecc71);
}

.comic-bubble.bubble-right .comic-text-wrap::after {
  content: "";
  position: absolute;
  top: 19px;
  right: -9px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 9px solid var(--bubble-bg, #123722);
}

.comic-text {
  font-size: 1.08rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.55;
  letter-spacing: .2px;
}

.btn-comic-next {
  align-self: flex-end;
  padding: .75rem 1.6rem;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 50px;
}

/* Quick Player Chips */
.quick-player-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .35rem;
  margin-bottom: .4rem;
}

.quick-player-label {
  font-size: .78rem;
  color: var(--clr-text3);
  font-weight: 700;
}

.quick-player-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  justify-content: center;
  max-width: 380px;
}

.player-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
  font-size: .78rem;
  font-weight: 700;
  padding: .25rem .7rem;
  border-radius: 50px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.player-chip:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: var(--clr-yellow);
  color: var(--clr-yellow);
}

.name-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  width: 100%;
  animation: fadeIn .3s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0
  }

  to {
    opacity: 1
  }
}

.name-label {
  font-size: .88rem;
  color: var(--clr-text2);
  font-weight: 600;
}

.name-input {
  width: 100%;
  max-width: 300px;
  padding: .75rem 1.2rem;
  background: rgba(255, 255, 255, .08);
  border: 2px solid var(--clr-green-dim);
  border-radius: 50px;
  color: #fff;
  font-size: 1rem;
  font-family: var(--ff-body);
  text-align: center;
  outline: none;
  transition: border-color .25s;
}

.name-input:focus {
  border-color: var(--clr-yellow);
  box-shadow: 0 0 16px rgba(255, 215, 0, .28);
}

/* ================================================================
   SCREEN 2 — MODE SELECTION
   ================================================================ */
#modeScreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(ellipse 70% 50% at 50% 55%, #133318 0%, #08140c 75%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
}

#modeScreen.active {
  display: flex !important;
}

.mode-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  max-width: 860px;
  width: 90%;
  margin: 0 auto;
  text-align: center;
}

.greet-text {
  font-size: 1.05rem;
  color: var(--clr-text2);
  margin-bottom: -.5rem;
}

.mode-title {
  font-family: var(--ff-title);
  font-size: clamp(2rem, 6vw, 2.75rem);
  color: var(--clr-yellow);
  margin-bottom: .3rem;
}

.mode-subtitle {
  font-size: .95rem;
  color: var(--clr-text3);
}

.mode-cards {
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

.mode-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  width: 245px;
  min-height: 190px;
  padding: 2rem 1.5rem;
  background: var(--clr-surface);
  border: 2px solid var(--clr-border);
  border-radius: 24px;
  cursor: pointer;
  font-family: var(--ff-body);
  position: relative;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}

.mode-card:hover {
  transform: translateY(-5px);
  border-color: var(--clr-yellow);
  box-shadow: 0 10px 30px rgba(255, 215, 0, .18);
}

.mode-card.adventure-card:hover {
  border-color: var(--clr-green);
  box-shadow: 0 10px 30px rgba(76, 175, 80, .25);
}

.mode-card.urgent:hover {
  border-color: var(--clr-red);
  box-shadow: 0 10px 30px rgba(244, 67, 54, .2);
}

.mode-card-icon {
  font-size: 3.3rem;
}

.mode-card-name {
  font-family: var(--ff-title);
  font-size: 1.4rem;
  color: var(--clr-text);
}

.mode-card-desc {
  font-size: .78rem;
  color: var(--clr-text2);
  line-height: 1.45;
}

.mode-badge {
  position: absolute;
  top: -10px;
  right: 14px;
  background: var(--clr-green);
  color: #fff;
  font-size: .62rem;
  font-weight: 900;
  padding: .18rem .65rem;
  border-radius: 50px;
  text-transform: uppercase;
}

.mode-badge.danger {
  background: var(--clr-red);
  animation: badgePulse 1.2s ease-in-out infinite;
}

@keyframes badgePulse {

  0%,
  100% {
    transform: scale(1)
  }

  50% {
    transform: scale(1.12)
  }
}

.mode-top-bar {
  position: fixed;
  top: 22px;
  left: 24px;
  right: 24px;
  z-index: 950;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: auto;
  max-width: none;
  gap: .8rem;
  margin: 0;
}

.mode-top-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .5rem;
}

.btn-daily-gift {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(14, 38, 20, 0.92);
  border: 2.5px solid rgba(255, 215, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.btn-daily-gift:hover {
  transform: scale(1.1);
  border-color: var(--clr-yellow);
  box-shadow: 0 0 22px rgba(255, 215, 0, 0.65);
}

.btn-daily-gift .gift-icon {
  font-size: 2.3rem;
  line-height: 1;
}

.btn-daily-gift.unclaimed {
  border-color: var(--clr-yellow);
  background: radial-gradient(circle, rgba(255, 215, 0, 0.28) 0%, rgba(14, 38, 20, 0.95) 100%);
  box-shadow: 0 0 22px rgba(255, 215, 0, 0.65), 0 6px 18px rgba(0, 0, 0, 0.55);
  animation: giftWiggle 1.8s ease-in-out infinite;
}

@keyframes giftWiggle {

  0%,
  100% {
    transform: rotate(0deg) scale(1);
  }

  15% {
    transform: rotate(-12deg) scale(1.08);
  }

  30% {
    transform: rotate(12deg) scale(1.08);
  }

  45% {
    transform: rotate(-8deg) scale(1.05);
  }

  60% {
    transform: rotate(8deg) scale(1.05);
  }

  75% {
    transform: rotate(0deg) scale(1);
  }
}

.daily-gift-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 50px;
  background: #ff3b3b;
  border: 2px solid #fff;
  color: #fff;
  font-family: var(--ff-title);
  font-size: .88rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(255, 59, 59, 0.85);
  pointer-events: none;
}

/* ── Modal Daily Login Streak ── */
.modal-daily-card {
  max-width: 480px;
  width: 92%;
  background: linear-gradient(150deg, #0d2814 0%, #06150b 100%);
  border: 2px solid var(--clr-yellow);
  gap: 1rem;
}

.daily-streak-pill {
  background: rgba(255, 140, 0, 0.18);
  border: 1.5px solid var(--clr-yellow);
  color: var(--clr-yellow);
  font-family: var(--ff-title);
  font-size: 1rem;
  padding: .28rem 1.2rem;
  border-radius: 50px;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.25);
}

.daily-streak-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .65rem;
  width: 100%;
}

.daily-day-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid var(--clr-border);
  border-radius: 16px;
  padding: .75rem .45rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  transition: transform .15s ease, border-color .15s ease;
}

.daily-day-card.special-day7 {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(255, 140, 0, 0.12));
  border-color: rgba(255, 215, 0, 0.6);
}

.daily-day-card.claimed {
  background: rgba(46, 213, 115, 0.14);
  border-color: rgba(46, 213, 115, 0.5);
}

.daily-day-card.claimed .daily-day-reward {
  color: #69ff84;
}

.daily-day-card.today-target {
  background: rgba(255, 215, 0, 0.24);
  border: 2.5px solid var(--clr-yellow);
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.5);
  transform: scale(1.04);
  cursor: pointer;
}

.daily-day-label {
  font-size: .78rem;
  font-weight: 800;
  color: var(--clr-text2);
  text-transform: uppercase;
}

.daily-day-icon {
  font-size: 2.1rem;
  line-height: 1.1;
}

.daily-day-card.special-day7 .daily-day-icon {
  font-size: 2.75rem;
}

.daily-day-reward {
  font-family: var(--ff-title);
  font-size: 1.05rem;
  color: var(--clr-yellow);
}

.btn-claimed-disabled {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--clr-text2) !important;
  border: 1.5px solid var(--clr-border) !important;
  box-shadow: none !important;
  cursor: default !important;
}

@media (max-width: 600px) {
  .mode-top-bar {
    top: 14px;
    left: 16px;
    right: 16px;
  }
}

.btn-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  background: rgba(18, 48, 26, 0.92);
  border: 2.5px solid var(--clr-yellow);
  color: var(--clr-text1);
  padding: .5rem 1.35rem;
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--ff-body);
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 215, 0, 0.35);
  transition: all .18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-profile-badge:hover {
  transform: translateY(-2px) scale(1.04);
  background: rgba(28, 70, 38, 0.95);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.45);
}

.btn-profile-badge:active {
  transform: scale(0.96);
}

.profile-badge-avatar {
  font-size: 1.4rem;
  line-height: 1;
}

.profile-badge-name {
  color: var(--clr-yellow);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Modal Profile Card ── */
.modal-profile-card {
  max-width: 500px;
  width: 92%;
  background: linear-gradient(150deg, #0d2814 0%, #06150b 100%);
  border: 2px solid var(--clr-yellow);
}

.profile-modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  margin-top: .4rem;
  text-align: left;
}

.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  width: 100%;
}

.profile-avatar-big {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: rgba(255, 215, 0, 0.12);
  border: 3px solid var(--clr-yellow);
  font-size: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.35);
  transition: all .2s ease;
}

.profile-avatar-big.is-preview {
  border-style: dashed;
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.45);
  transform: scale(1.06);
}

.profile-avatar-preview-tag {
  font-size: .78rem;
  font-weight: 800;
  color: var(--clr-yellow);
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 50px;
  padding: .18rem .85rem;
}

.profile-avatar-preview-tag.is-preview {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.45);
}

.profile-avatar-preview-tag.is-locked {
  color: #fca5a5;
  background: rgba(244, 67, 54, 0.15);
  border-color: rgba(244, 67, 54, 0.4);
}

.profile-avatar-picker-label {
  font-size: .8rem;
  font-weight: 800;
  color: var(--clr-text3);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.avatar-picker-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: .65rem;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding: .35rem .25rem .65rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 215, 0, 0.45) rgba(0, 0, 0, 0.25);
}

.avatar-picker-grid::-webkit-scrollbar {
  height: 7px;
}

.avatar-picker-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
}

.avatar-picker-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.45);
  border-radius: 6px;
}

.avatar-picker-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 0, 0.75);
}

.avatar-choice-btn {
  flex: 0 0 78px;
  min-width: 78px;
  min-height: 68px;
  padding: .5rem .35rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.1);
  font-family: var(--ff-body);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  transition: all .15s ease;
}

.avatar-choice-btn .avatar-emoji {
  font-size: 1.65rem;
  line-height: 1;
}

.avatar-choice-btn .avatar-sub-badge {
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.1;
  padding: .15rem .42rem;
  border-radius: 6px;
  white-space: nowrap;
}

.avatar-choice-btn:hover {
  transform: translateY(-2px) scale(1.05);
  background: rgba(255, 215, 0, 0.16);
}

.avatar-choice-btn.selected {
  border-color: var(--clr-yellow);
  background: rgba(255, 215, 0, 0.26);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.55);
}

.avatar-choice-btn.selected .avatar-sub-badge {
  background: var(--clr-yellow);
  color: #1a0a00;
}

.avatar-choice-btn.owned .avatar-sub-badge {
  background: rgba(76, 175, 80, 0.25);
  color: #a5d6a7;
}

.avatar-choice-btn.buyable {
  border-color: rgba(255, 215, 0, 0.45);
  background: rgba(255, 215, 0, 0.08);
}

.avatar-choice-btn.buyable .avatar-sub-badge {
  background: rgba(255, 215, 0, 0.22);
  color: var(--clr-yellow);
}

.avatar-choice-btn.locked {
  opacity: .55;
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.08);
}

.avatar-choice-btn.locked .avatar-emoji {
  filter: grayscale(0.85);
}

.avatar-choice-btn.locked .avatar-sub-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--clr-text2);
}

.avatar-choice-btn.previewing {
  border-color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.2) !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.55);
  transform: scale(1.06);
  opacity: 1;
}

.avatar-choice-btn.previewing .avatar-sub-badge {
  background: #38bdf8;
  color: #041d29;
}

.avatar-buy-confirm-box {
  width: 100%;
  max-width: 300px;
  padding: .2rem 0 0;
  display: flex;
  justify-content: center;
  animation: fadeIn .18s ease;
}

.avatar-buy-confirm-actions {
  display: flex;
  gap: .6rem;
  width: 100%;
  justify-content: center;
}

.btn-buy-ava-confirm {
  flex: 1;
  padding: .5rem 1.1rem;
  font-size: .9rem;
}

.btn-buy-ava-cancel {
  flex: 1;
  padding: .5rem 1.1rem;
  font-size: .9rem;
}

.avatar-picker-msg {
  font-size: .8rem;
  font-weight: 700;
  padding: .4rem .8rem;
  border-radius: 10px;
  text-align: center;
  width: 100%;
  margin-top: .15rem;
}

.avatar-picker-msg.error {
  background: rgba(244, 67, 54, 0.16);
  border: 1px solid rgba(244, 67, 54, 0.4);
  color: #ff8a80;
}

.avatar-picker-msg.success {
  background: rgba(46, 213, 115, 0.16);
  border: 1px solid rgba(46, 213, 115, 0.4);
  color: #69ff84;
}

.profile-name-section {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  width: 100%;
}

.profile-name-input-wrap {
  display: flex;
  gap: .5rem;
  width: 100%;
}

.profile-name-input-wrap .name-input {
  flex: 1;
  min-width: 0;
}

.profile-name-error {
  font-size: .8rem;
  color: #ff5252;
  font-weight: 700;
}

.profile-name-success {
  font-size: .8rem;
  color: #2ed573;
  font-weight: 700;
}

.profile-stats-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  padding: .65rem .9rem;
  font-size: .85rem;
  line-height: 1.6;
  color: var(--clr-text2);
}

.profile-actions-row {
  display: flex;
  gap: .6rem;
  width: 100%;
  margin-top: .2rem;
}

.btn-primary-sm {
  font-family: var(--ff-body);
  padding: .55rem 1.1rem;
  background: linear-gradient(135deg, var(--clr-orange), var(--clr-yellow));
  color: #1a0a00;
  border: none;
  border-radius: 50px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  font-size: .88rem;
  box-shadow: 0 3px 12px rgba(255, 165, 0, 0.35);
  transition: transform .15s ease, filter .15s ease;
}

.btn-primary-sm:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.btn-primary-sm:active {
  transform: translateY(0);
}

.map-header-left {
  display: flex;
  gap: .5rem;
  align-items: center;
}

.story-header-right-nav {
  display: flex;
  gap: .4rem;
  align-items: center;
}

.record-board {
  font-size: .8rem;
  color: var(--clr-text3);
  background: rgba(0, 0, 0, .25);
  border-radius: 10px;
  padding: .5rem 1.2rem;
  border: 1px solid var(--clr-border);
  width: 100%;
  max-width: 440px;
  line-height: 1.7;
}

.menu-action-row {
  display: flex;
  gap: .6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: .4rem;
}

/* ================================================================
   SCREEN 2B — MAP / ADVENTURE LEVEL SELECTION
   ================================================================ */
.btn-screen-back-topleft,
.btn-nav-home {
  background: rgba(8, 24, 12, 0.94);
  border: 2.5px solid rgba(255, 215, 0, 0.6);
  color: #fff;
  padding: 0.78rem 1.7rem;
  font-size: 1.15rem;
  font-weight: 800;
  border-radius: 50px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 14px rgba(255, 215, 0, 0.25);
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.btn-screen-back-topleft {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 950;
}

.btn-screen-back-topleft:hover,
.btn-nav-home:hover {
  transform: translateY(-2px) scale(1.04);
  border-color: var(--clr-yellow);
  color: var(--clr-yellow);
  background: rgba(20, 50, 26, 0.96);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.65), 0 0 18px rgba(255, 215, 0, 0.45);
}

.btn-screen-back-topleft:active,
.btn-nav-home:active {
  transform: scale(0.96);
}

@media (max-width: 600px) {
  .btn-screen-back-topleft {
    top: 14px;
    left: 16px;
  }

  .btn-screen-back-topleft,
  .btn-nav-home {
    padding: .45rem 1rem;
    font-size: .8rem;
  }
}

#mapScreen {
  background: radial-gradient(ellipse 80% 60% at 50% 50%, #15381d 0%, #07130a 80%);
}

.map-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  padding: 1.5rem;
  max-width: 520px !important;
  width: 90% !important;
  margin: 0 auto !important;
  max-height: 95vh;
  z-index: 20;
}

.map-header {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  text-align: center;
}

.map-title {
  font-family: var(--ff-title);
  font-size: clamp(1.8rem, 4.5vw, 2.3rem);
  color: var(--clr-yellow);
}

.map-subtitle {
  font-size: .92rem;
  color: var(--clr-text2);
  margin-top: -.45rem;
}

.map-nodes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  overflow: visible;
  padding: .3rem 0;
  box-sizing: border-box;
}

@media (max-width: 520px) {
  .map-nodes {
    grid-template-columns: repeat(2, 1fr);
  }
}

.map-node {
  background: rgba(14, 38, 20, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  aspect-ratio: 1 / 1;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: 0.8rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.map-node:hover:not(.locked) {
  transform: translateY(-5px) scale(1.05);
  border-color: var(--clr-yellow);
  background: rgba(22, 58, 30, 0.95);
  box-shadow: 0 10px 28px rgba(255, 215, 0, 0.25);
}

.map-node.locked {
  opacity: .5;
  cursor: not-allowed;
  filter: grayscale(1);
}

.map-node-num {
  font-family: var(--ff-title);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--clr-yellow);
  letter-spacing: 0.4px;
}

.map-node-stars {
  font-size: 1.15rem;
  letter-spacing: 3px;
}

.map-coming-soon {
  width: 100%;
  max-width: 520px;
  margin-top: .15rem;
  padding: .75rem 1.2rem;
  border-radius: 16px;
  border: 1.5px dashed rgba(255, 215, 0, 0.35);
  background: rgba(14, 38, 20, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .2rem;
  text-align: center;
  box-sizing: border-box;
}

.coming-soon-badge {
  font-family: var(--ff-title);
  font-size: .95rem;
  color: var(--clr-yellow);
  letter-spacing: 1px;
}

.coming-soon-text {
  font-size: .8rem;
  color: var(--clr-text2);
}

/* ================================================================
   SCREEN 3 — GAMEPLAY WITH SIDE REACTIONS
   ================================================================ */
#gameScreen {
  background:
    radial-gradient(ellipse 60% 50% at 30% 20%, rgba(25, 70, 25, .35) 0%, transparent 60%),
    linear-gradient(180deg, #08140c 0%, #0f1f14 50%, #08140c 100%);
  align-items: stretch;
}

.game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100vh;
  padding: .35rem .6rem;
  gap: .3rem;
  justify-content: center;
  overflow: hidden;
}

/* ── HUD ─────────────────────────────────────────────────── */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: calc(var(--grid-size) + 84px);
  background: rgba(0, 0, 0, .5);
  border: 1px solid var(--clr-border);
  border-radius: 14px;
  padding: .35rem .85rem;
  gap: .5rem;
  flex-shrink: 0;
}

.hud-left {
  display: flex;
  flex-direction: column;
  gap: .1rem;
  min-width: 85px;
}

.hud-center {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .1rem;
  min-width: 85px;
}

.hud-player {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .82rem;
}

.hud-name {
  font-weight: 800;
  color: var(--clr-yellow);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-level-badge {
  font-size: .62rem;
  font-weight: 800;
  color: var(--clr-green);
  text-transform: uppercase;
}

.hud-target-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, .06);
  padding: .2rem .7rem;
  border-radius: 8px;
  border: 1px solid var(--clr-border);
}

.hud-target-text {
  font-family: var(--ff-title);
  font-size: 1.05rem;
  color: #fff;
}

.hud-score-area {
  text-align: center;
}

.hud-label {
  font-size: .54rem;
  color: var(--clr-text3);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.hud-score {
  font-family: var(--ff-title);
  font-size: 1.55rem;
  color: var(--clr-yellow);
  line-height: 1;
}

.hud-best-score {
  font-size: .56rem;
  font-weight: 700;
  color: var(--clr-text2);
  opacity: .85;
  margin-top: .15rem;
  letter-spacing: .3px;
  white-space: nowrap;
}

.hud-limit-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hud-limit-val {
  font-family: var(--ff-title);
  font-size: 1.3rem;
  color: var(--clr-orange);
  line-height: 1;
}

.hud-limit-val.danger {
  color: var(--clr-red);
  animation: timerBlink .5s step-end infinite;
}

@keyframes timerBlink {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .3
  }
}

/* ── Middle Play Area Row ────────────────────────────────── */
.play-area-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  max-width: calc(var(--grid-size) + 84px);
}

.mascot-side-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  width: 70px;
  flex-shrink: 0;
}

.mascot-face {
  font-size: 2.8rem;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.6));
  transition: transform .2s cubic-bezier(.17, .67, .35, 1.2);
}

.mascot-speech {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--clr-border);
  border-radius: 10px;
  font-size: .68rem;
  font-weight: 700;
  color: var(--clr-text);
  text-align: center;
  padding: .2rem .4rem;
  line-height: 1.2;
  word-break: break-word;
  min-height: 24px;
}

/* ── Combo Floating Indicator (Center of Board) ───────────── */
.hud-combo {
  position: absolute;
  top: 50%;
  left: calc(84px + (var(--grid-size) / 2));
  transform: translate(-50%, -50%);
  z-index: 100;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(6, 20, 10, 0.9);
  border: 2px solid var(--clr-yellow);
  box-shadow: 0 0 26px rgba(255, 215, 0, 0.5), 0 8px 24px rgba(0, 0, 0, 0.7);
  border-radius: 18px;
  padding: .35rem 1.2rem;
  backdrop-filter: blur(6px);
  animation: comboPop .28s cubic-bezier(.17, .67, .35, 1.2);
}

.hud-combo.combo-pop {
  animation: comboPop .28s cubic-bezier(.17, .67, .35, 1.2);
}

.hud-combo .hud-combo-tag,
.hud-combo .hud-label {
  font-family: var(--ff-title);
  font-size: .75rem;
  font-weight: 700;
  color: var(--clr-orange);
  letter-spacing: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
  line-height: 1.1;
}

.hud-combo .hud-combo-val {
  font-family: var(--ff-title);
  font-size: 2.2rem;
  line-height: 1;
  color: var(--clr-yellow);
  text-shadow: 0 0 14px rgba(255, 215, 0, 0.8), 0 2px 4px rgba(0, 0, 0, 0.9);
}

@keyframes comboPop {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0;
  }

  60% {
    transform: translate(-50%, -50%) scale(1.15);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

/* ── Grid Board ───────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  width: var(--grid-size);
  height: var(--grid-size);
  flex-shrink: 0;
  background: rgba(4, 15, 6, 0.75);
  border: 2px solid rgba(76, 175, 80, .25);
  border-radius: 16px;
  padding: 5px;
  gap: 4px;
  box-shadow: 0 0 32px rgba(0, 60, 0, .25), inset 0 2px 6px rgba(0, 0, 0, .6);
  user-select: none;
}

/* ── Fruit Cells ─────────────────────────────────────────── */
.cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.25);
  cursor: grab;
  user-select: none;
  font-size: calc(var(--grid-size) / 8 * 0.62);
  line-height: 1;
  transition: transform .12s, background-color .15s, border-color .15s;
  will-change: transform;
}

.cell:hover:not([data-fruit=""]):not(.hole) {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 215, 0, 0.55);
  transform: scale(1.08);
  z-index: 2;
}

.cell:active:not(.hole) {
  cursor: grabbing;
}

/* Hole / Bolong */
.cell.hole {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: none;
}

/* Es / Beku 🧊 */
.cell.ice-layer {
  background: rgba(128, 222, 234, 0.28) !important;
  border: 2px solid var(--clr-ice) !important;
  box-shadow: inset 0 0 10px rgba(128, 222, 234, 0.6);
}

.cell.ice-layer::before {
  content: '🧊';
  position: absolute;
  font-size: .8rem;
  top: 1px;
  left: 1px;
  opacity: .85;
  pointer-events: none;
}

/* Trap / Ranjau 🪤 */
.cell.trap-layer {
  border: 2px dashed #ff5252 !important;
  background: rgba(255, 82, 82, 0.15) !important;
}

.cell.trap-layer::before {
  content: '🪤';
  position: absolute;
  font-size: .8rem;
  bottom: 1px;
  right: 1px;
  opacity: .9;
  pointer-events: none;
}

/* ⏳ Jam Pasir */
.cell.special-time {
  box-shadow: 0 0 14px #ffeb3b, inset 0 0 8px #ffeb3b;
  border: 2px solid #ffeb3b !important;
  animation: sandglassPulse 1.2s ease-in-out infinite alternate;
}

.cell.special-time::after {
  content: '+5s';
  position: absolute;
  bottom: 1px;
  right: 2px;
  font-size: .65rem;
  font-family: var(--ff-title);
  color: #fff;
  background: #f57f17;
  border-radius: 4px;
  padding: 0 2px;
}

@keyframes sandglassPulse {
  from {
    transform: scale(1)
  }

  to {
    transform: scale(1.08)
  }
}

/* Specials */
.cell.special-striped-h {
  box-shadow: 0 0 12px #ffd700, inset 0 0 8px #ffd700;
  border: 1.5px solid #ffd700;
  animation: stripedPulse 1s ease-in-out infinite alternate;
}

.cell.special-striped-v {
  box-shadow: 0 0 12px #00e5ff, inset 0 0 8px #00e5ff;
  border: 1.5px solid #00e5ff;
  animation: stripedPulse 1s ease-in-out infinite alternate;
}

@keyframes stripedPulse {
  from {
    filter: brightness(1)
  }

  to {
    filter: brightness(1.5)
  }
}

.cell.special-bomb {
  box-shadow: 0 0 14px #ff3d00, inset 0 0 10px #ff3d00;
  border: 2px solid #ff3d00;
  animation: bombPulse .8s ease-in-out infinite alternate;
}

@keyframes bombPulse {
  from {
    transform: scale(1)
  }

  to {
    transform: scale(1.08)
  }
}

.cell.special-bee {
  box-shadow: 0 0 14px #76ff03, inset 0 0 8px #76ff03;
  border: 2px solid #76ff03;
  animation: beeWiggle 1.2s ease-in-out infinite;
}

@keyframes beeWiggle {

  0%,
  100% {
    transform: rotate(0)
  }

  25% {
    transform: rotate(5deg)
  }

  75% {
    transform: rotate(-5deg)
  }
}

.cell.special-rainbow {
  background: linear-gradient(135deg, rgba(255, 0, 0, .2), rgba(0, 255, 0, .2), rgba(0, 0, 255, .2)) !important;
  box-shadow: 0 0 16px rgba(255, 255, 255, .8);
  border: 2px solid gold !important;
  animation: rainbowSpin 2s linear infinite;
}

@keyframes rainbowSpin {
  0% {
    filter: hue-rotate(0deg)
  }

  100% {
    filter: hue-rotate(360deg)
  }
}

/* Drag states */
.cell.is-dragging {
  opacity: .4;
  transform: scale(.88);
}

.cell.drag-over {
  background: rgba(255, 215, 0, 0.2);
  border-color: var(--clr-yellow);
  transform: scale(1.1);
}

/* Match animations */
.cell.matched {
  animation: cellMatch .28s cubic-bezier(.25, 1, .5, 1) forwards;
  pointer-events: none;
}

@keyframes cellMatch {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(1.35);
    filter: brightness(2.5);
  }

  100% {
    transform: scale(0);
    filter: brightness(2);
  }
}

.cell.shake {
  animation: cellShake .35s ease;
}

@keyframes cellShake {

  0%,
  100% {
    transform: translateX(0)
  }

  20% {
    transform: translateX(-6px)
  }

  40% {
    transform: translateX(6px)
  }

  60% {
    transform: translateX(-3px)
  }

  80% {
    transform: translateX(3px)
  }
}

.cell.falling {
  animation: cellFall .22s cubic-bezier(.17, .67, .35, 1.2);
}

@keyframes cellFall {
  from {
    transform: translateY(-20px);
    opacity: .5;
  }

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

/* ── Power-Up Booster Bar ─────────────────────────────────── */
.booster-bar {
  display: flex;
  gap: .7rem;
  justify-content: center;
  width: 100%;
  max-width: calc(var(--grid-size) + 84px);
  flex-shrink: 0;
}

.booster-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: rgba(255, 255, 255, .05);
  border: 1.5px solid var(--clr-border);
  border-radius: 12px;
  padding: .45rem .75rem;
  color: var(--clr-text);
  font-family: var(--ff-body);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}

.booster-btn:hover {
  background: rgba(255, 255, 255, .12);
  border-color: var(--clr-yellow);
  transform: translateY(-2px);
}

.booster-btn.active {
  background: rgba(255, 215, 0, .2);
  border-color: var(--clr-yellow);
  box-shadow: 0 0 12px rgba(255, 215, 0, .4);
}

.booster-icon {
  font-size: 1.25rem;
}

.booster-name {
  font-size: .92rem;
  font-weight: 700;
}

.booster-cost {
  font-size: .88rem;
  font-weight: 800;
  color: var(--clr-yellow);
}

/* ── Pak RT Pressure Bar ─────────────────────────────────── */
.pakrt-section {
  width: 100%;
  max-width: calc(var(--grid-size) + 84px);
  flex-shrink: 0;
}

.pakrt-label-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .2rem;
}

.pakrt-icon {
  font-size: 1.25rem;
}

.pakrt-msg {
  font-size: .78rem;
  font-weight: 700;
  color: var(--clr-text2);
}

.pakrt-track {
  height: 9px;
  background: rgba(0, 0, 0, .45);
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .07);
}

.pakrt-fill {
  height: 100%;
  width: 0%;
  border-radius: 50px;
  background: var(--bar-safe);
  transition: width .35s linear, background-color .4s;
}

.pakrt-fill.warn {
  background: var(--bar-warn);
}

.pakrt-fill.danger {
  background: var(--bar-danger);
  animation: dangerFlash .35s ease infinite alternate;
}

@keyframes dangerFlash {
  from {
    filter: brightness(1)
  }

  to {
    filter: brightness(1.6)
  }
}

/* ── Dialog Box ─────────────────────────────────────────── */
.dialog-box {
  width: 100%;
  max-width: calc(var(--grid-size) + 84px);
  background: rgba(0, 0, 0, .4);
  border: 1px solid var(--clr-border);
  border-left: 3px solid var(--clr-green);
  border-radius: 10px;
  padding: .35rem .9rem;
  font-size: .78rem;
  color: var(--clr-text2);
  font-style: italic;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  min-height: 28px;
}

.dialog-box.urgent {
  border-left-color: var(--clr-red);
  color: #ffaaaa;
}

/* ── Footer ─────────────────────────────────────────────── */
.game-footer {
  display: flex;
  gap: .6rem;
  justify-content: center;
  flex-shrink: 0;
}

/* ================================================================
   MODAL OVERLAY (Player Account Confirm & Continue)
   ================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-card {
  background: linear-gradient(135deg, #133318 0%, #091a0d 100%);
  border: 2px solid var(--clr-yellow);
  border-radius: 22px;
  padding: 1.75rem 2rem;
  max-width: 460px;
  width: 92%;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
}

.modal-icon {
  font-size: 2.8rem;
}

.modal-title {
  font-family: var(--ff-title);
  font-size: 1.35rem;
  color: var(--clr-yellow);
}

.modal-desc {
  font-size: .86rem;
  color: var(--clr-text);
  line-height: 1.5;
}

.modal-price {
  font-family: var(--ff-title);
  color: var(--clr-yellow);
  font-size: 1.05rem;
}

.modal-actions {
  display: flex;
  gap: .8rem;
  margin-top: .3rem;
}

.modal-actions-stacked {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  width: 100%;
  margin-top: .4rem;
}

.player-stats-preview {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  padding: .6rem .8rem;
  width: 100%;
  font-size: .8rem;
  color: var(--clr-text2);
  line-height: 1.6;
  text-align: left;
}

/* ================================================================
   JUICY POPUPS & LEVEL BANNER
   ================================================================ */
.score-pop {
  position: fixed;
  font-family: var(--ff-title);
  color: var(--clr-yellow);
  text-shadow: 0 0 10px rgba(255, 215, 0, .8);
  pointer-events: none;
  z-index: 900;
  animation: scoreFly 1.1s cubic-bezier(.2, .8, .4, 1) forwards;
  white-space: nowrap;
}

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

  60% {
    opacity: 1;
    transform: translateY(-45px) scale(1.25);
  }

  100% {
    opacity: 0;
    transform: translateY(-65px) scale(1.1);
  }
}

.juice-pop {
  position: fixed;
  font-family: var(--ff-title);
  color: #fff;
  text-shadow: 0 0 16px var(--clr-orange), 0 2px 4px #000;
  pointer-events: none;
  z-index: 910;
  animation: juiceFly 1.2s cubic-bezier(.17, .67, .35, 1.2) forwards;
  white-space: nowrap;
}

@keyframes juiceFly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }

  25% {
    opacity: 1;
    transform: translate(-50%, -70%) scale(1.3);
  }

  70% {
    opacity: 1;
    transform: translate(-50%, -85%) scale(1.15);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -100%) scale(0.9);
  }
}

.level-banner {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(20, 50, 20, 0.95), rgba(10, 25, 10, 0.95));
  border: 2px solid var(--clr-yellow);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 215, 0, 0.4);
  padding: .9rem 1.8rem;
  border-radius: 20px;
  text-align: center;
  z-index: 999;
  animation: bannerIn 2.8s ease forwards;
  pointer-events: none;
}

.banner-title {
  font-family: var(--ff-title);
  font-size: 1.4rem;
  color: var(--clr-yellow);
}

.banner-desc {
  font-size: .85rem;
  color: var(--clr-text);
  margin-top: .2rem;
}

@keyframes bannerIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -20px) scale(0.85);
  }

  15% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.05);
  }

  85% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -30px) scale(0.9);
  }
}

/* ================================================================
   SCREEN FLASH
   ================================================================ */
.screen-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 800;
  opacity: 0;
}

.screen-flash.flash-red {
  animation: fRed .4s ease;
}

.screen-flash.flash-green {
  animation: fGreen .3s ease;
}

@keyframes fRed {

  0%,
  100% {
    opacity: 0
  }

  40% {
    opacity: 1;
    background: rgba(244, 67, 54, .35)
  }
}

@keyframes fGreen {

  0%,
  100% {
    opacity: 0
  }

  40% {
    opacity: 1;
    background: rgba(76, 175, 80, .22)
  }
}

/* ================================================================
   SCREEN 4 — UPGRADED LEADERBOARD
   ================================================================ */
#lboardScreen {
  background: radial-gradient(ellipse 70% 55% at 50% 45%, #133318 0%, #08140c 70%);
  z-index: 100;
}

.lboard-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.8rem;
  max-width: 500px;
  width: 100%;
  max-height: 95vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.lboard-title {
  font-family: var(--ff-title);
  font-size: 1.8rem;
  color: var(--clr-yellow);
}

.lboard-tabs {
  display: flex;
  gap: .5rem;
}

.lboard-tab {
  padding: .45rem 1.1rem;
  border: 2px solid var(--clr-border);
  background: var(--clr-surface);
  color: var(--clr-text2);
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: .82rem;
}

.lboard-tab.active {
  border-color: var(--clr-yellow);
  color: var(--clr-yellow);
}

.lboard-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  min-height: 180px;
}

.lboard-row {
  display: flex;
  align-items: center;
  gap: .8rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--clr-border);
  border-radius: 14px;
  padding: .65rem 1rem;
}

.lboard-rank {
  font-family: var(--ff-title);
  font-size: 1.25rem;
  min-width: 32px;
  text-align: center;
}

.lboard-rank.gold {
  color: #ffd700;
}

.lboard-rank.silver {
  color: #c0c0c0;
}

.lboard-rank.bronze {
  color: #cd7f32;
}

.lboard-rank.other {
  color: var(--clr-text3);
  font-size: .95rem;
}

.lboard-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .1rem;
  text-align: left;
}

.lboard-name {
  font-weight: 800;
  color: var(--clr-text);
  font-size: .92rem;
}

.lboard-level-tag {
  font-size: .7rem;
  font-weight: 700;
  color: var(--clr-green);
}

.lboard-score-wrap {
  text-align: right;
}

.lboard-score-val {
  font-family: var(--ff-title);
  font-size: 1.25rem;
  color: var(--clr-yellow);
  line-height: 1.1;
}

.lboard-score-label {
  font-size: .55rem;
  color: var(--clr-text3);
  text-transform: uppercase;
}

.lboard-score-label.lboard-sub-yellow {
  font-size: .74rem;
  font-weight: 800;
  color: var(--clr-yellow);
  opacity: 0.9;
  text-transform: none;
  margin-top: .15rem;
}

.lboard-empty {
  text-align: center;
  color: var(--clr-text3);
  font-style: italic;
  padding: 2rem;
}

.lboard-footer {
  display: flex;
  gap: .8rem;
  align-items: center;
  margin-top: .4rem;
}

/* ================================================================
   SCREENS 5 & 6 — POLISHED RESULT CARDS (WIN / LOSE)
   ================================================================ */
#winScreen {
  background: radial-gradient(ellipse 80% 65% at 50% 45%, #184220 0%, #07130a 75%);
}

#loseScreen {
  background: radial-gradient(ellipse 80% 65% at 50% 45%, #421515 0%, #07130a 75%);
}

.result-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
  background: linear-gradient(180deg, rgba(20, 50, 25, 0.88) 0%, rgba(10, 25, 12, 0.96) 100%);
  border: 2px solid rgba(255, 215, 0, 0.4);
  border-radius: 28px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.85), inset 0 1px 2px rgba(255, 255, 255, 0.2);
  padding: 1.9rem 2.2rem;
  max-width: 500px;
  width: 92%;
  text-align: center;
  backdrop-filter: blur(8px);
  animation: cardEntrance .4s cubic-bezier(.17, .67, .35, 1.2) forwards;
}

.lose-card {
  background: linear-gradient(180deg, rgba(60, 20, 20, 0.88) 0%, rgba(20, 8, 8, 0.96) 100%);
  border-color: rgba(255, 82, 82, 0.4);
}

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

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

.result-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
}

.result-mascot {
  font-size: 3.2rem;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
  animation: mascotFloat 2.2s ease-in-out infinite;
}

.result-heading {
  font-family: var(--ff-title);
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}

.result-green {
  color: var(--clr-yellow);
}

.result-red {
  color: #ff5252;
}

.win-stars {
  font-size: 2.2rem;
  letter-spacing: .35rem;
  filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.5));
  margin-top: .1rem;
}

.win-stars.win-mode-subtitle {
  font-size: .78rem;
  letter-spacing: .4px;
  color: var(--clr-text2);
  font-weight: 700;
  filter: none;
  margin-top: .1rem;
}

.result-story {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--clr-border);
  border-left: 3px solid var(--clr-green);
  border-radius: 14px;
  padding: .75rem 1rem;
  font-size: .84rem;
  color: var(--clr-text2);
  font-style: italic;
  text-align: left;
  white-space: pre-line;
  width: 100%;
  line-height: 1.5;
}

.lose-card .result-story {
  border-left-color: #ff5252;
}

.result-stat-grid {
  display: flex;
  gap: .75rem;
  width: 100%;
}

.stat-cell {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--clr-border);
  border-radius: 14px;
  padding: .65rem .8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
}

.stat-cell.full-width {
  flex: 1 1 100%;
}

.stat-cell-label {
  font-size: .62rem;
  font-weight: 800;
  color: var(--clr-text3);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.stat-cell-value {
  font-family: var(--ff-title);
  font-size: 1.8rem;
  color: var(--clr-yellow);
  line-height: 1.1;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.stat-cell-value.coin-val {
  color: #ffd700;
  font-size: 1.5rem;
}

.rating-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  background: rgba(255, 215, 0, 0.08);
  border: 1.5px solid rgba(255, 215, 0, 0.3);
  border-radius: 50px;
  padding: .35rem 1.2rem;
  width: fit-content;
}

.rating-emoji {
  font-size: 1.35rem;
}

.rating-title {
  font-family: var(--ff-title);
  font-size: .95rem;
  color: var(--clr-yellow);
}

.new-record {
  background: linear-gradient(135deg, var(--clr-orange), var(--clr-yellow));
  color: #1a0a00;
  font-weight: 900;
  font-size: .78rem;
  padding: .2rem .9rem;
  border-radius: 50px;
}

.record-note {
  font-size: .78rem;
  color: var(--clr-text3);
}

.result-actions-structured {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  width: 100%;
  margin-top: .4rem;
}

.btn-hero {
  width: 100%;
  padding: .85rem 1.5rem;
  font-size: 1.05rem;
  box-shadow: 0 6px 20px rgba(255, 140, 0, 0.45);
}

.action-sub-row {
  display: flex;
  gap: .5rem;
  width: 100%;
  justify-content: center;
}

.action-sub-row .btn {
  flex: 1;
  padding: .55rem .7rem;
  font-size: .8rem;
  white-space: nowrap;
}

/* ================================================================
   RESPONSIVE OVERRIDES
   ================================================================ */
@media (max-width: 600px) {
  .mascot-side-panel {
    display: none;
  }

  .hud-combo {
    left: 50%;
  }

  .hud {
    max-width: var(--grid-size);
  }

  .booster-bar {
    max-width: var(--grid-size);
  }

  .pakrt-section {
    max-width: var(--grid-size);
  }

  .dialog-box {
    max-width: var(--grid-size);
  }

  .home-character {
    opacity: 0.85;
    transform: scale(0.85);
    bottom: 15px;
  }

  .pakrt-sleeping {
    left: 8px;
  }

  .maling-sneaking {
    right: 8px;
  }

  .home-bottom-bar {
    bottom: 12px;
    padding: 0 16px;
  }

  .btn-circle-action {
    width: 44px;
    height: 44px;
  }

  .circle-icon {
    font-size: 1.25rem;
  }
}

@media (max-height: 700px) {
  .result-card {
    padding: 1.2rem 1.4rem;
    gap: .6rem;
  }

  .result-mascot {
    font-size: 2.5rem;
  }

  .result-heading {
    font-size: 1.5rem;
  }

  .win-stars {
    font-size: 1.8rem;
  }

  .stat-cell-value {
    font-size: 1.4rem;
  }

  .btn-hero {
    padding: .65rem 1.2rem;
    font-size: .95rem;
  }
}


/* ================================================================
   NEW UX: RESULT CARD CLOSE BUTTON, BUTTONS ROW, STAMP, CONFETTI
   ================================================================ */

/* Win/Lose Card relative positioning */
.result-card {
  position: relative;
}

/* Close (✖) button top-right on Result Cards */
.btn-card-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 5;
}

.btn-card-close:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.1);
}

.btn-card-close-dark {
  background: rgba(255, 82, 82, 0.2);
  border-color: rgba(255, 82, 82, 0.5);
  color: #ff8a80;
}

.btn-card-close-dark:hover {
  background: rgba(255, 82, 82, 0.35);
  color: #fff;
}

/* Replay + Share button row */
.result-btn-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.2rem;
}

.btn-elongated {
  flex: 1;
  padding: 0.85rem 1.4rem;
  font-size: 1rem;
  border-radius: 50px;
  font-weight: 800;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 16px rgba(255, 140, 0, 0.35);
}

.btn-secondary-replay {
  background: rgba(76, 175, 80, 0.18);
  border: 2px solid rgba(76, 175, 80, 0.65);
  color: #e6f9e8;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.btn-secondary-replay:hover {
  background: rgba(76, 175, 80, 0.32);
  border-color: #69ff84;
  color: #ffffff;
}

.btn-circle-share {
  width: 50px;
  height: 50px;
  min-width: 50px;
  border-radius: 50%;
  border: 2px solid rgba(255, 215, 0, 0.65);
  background: rgba(255, 215, 0, 0.16);
  color: #ffd700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  padding: 0;
}

.btn-circle-share svg {
  width: 23px;
  height: 23px;
  display: block;
  stroke: #ffd700;
  color: #ffd700;
  transition: transform 0.2s ease, stroke 0.2s ease;
}

.btn-circle-share:hover {
  background: rgba(255, 215, 0, 0.32);
  border-color: #ffd700;
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(255, 215, 0, 0.4);
}

.btn-circle-share:hover svg {
  stroke: #fff;
  color: #fff;
  transform: scale(1.08);
}

.btn-circle-share:active {
  transform: scale(0.95);
}

/* New Record Stamp with Slam Animation */
.stamp-new-record {
  font-family: var(--ff-title);
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #ff3d00, #ff9100, #ffd600);
  border: 3px dashed #fff;
  border-radius: 10px;
  padding: 0.35rem 1.2rem;
  transform: rotate(-7deg) scale(0.6);
  opacity: 0;
  box-shadow: 0 6px 20px rgba(255, 109, 0, 0.65), inset 0 2px 4px rgba(255, 255, 255, 0.5);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  pointer-events: none;
  margin: 0.2rem 0;
}

.stamp-new-record.stamp-animate {
  animation: stampSlam 0.55s cubic-bezier(0.17, 0.67, 0.35, 1.35) forwards;
}

@keyframes stampSlam {
  0% {
    opacity: 0;
    transform: rotate(-15deg) scale(2.2);
  }

  60% {
    opacity: 1;
    transform: rotate(-5deg) scale(0.92);
  }

  80% {
    transform: rotate(-8deg) scale(1.05);
  }

  100% {
    opacity: 1;
    transform: rotate(-7deg) scale(1);
  }
}

/* Confetti Canvas Overlay */
.confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 99999;
  display: none;
}

/* Lose Screen UI Enhancements */
.lose-badge-pill {
  display: inline-block;
  background: rgba(255, 82, 82, 0.2);
  border: 1.5px solid rgba(255, 82, 82, 0.5);
  border-radius: 50px;
  padding: 0.2rem 1rem;
  font-size: 0.8rem;
  font-weight: 800;
  color: #ff8a80;
  letter-spacing: 0.5px;
  margin-top: 0.15rem;
}

.lose-mascot-tremble {
  animation: mascotTremble 0.35s ease-in-out infinite alternate;
}

@keyframes mascotTremble {
  0% {
    transform: rotate(-6deg) scale(1.05);
  }

  100% {
    transform: rotate(6deg) scale(0.95);
  }
}

.lose-bubble {
  background: rgba(0, 0, 0, 0.45);
  border: 1.5px solid rgba(255, 82, 82, 0.4);
  border-radius: 18px 18px 18px 4px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--clr-text2);
  font-style: italic;
  text-align: left;
  white-space: pre-line;
  width: 100%;
  line-height: 1.5;
}

/* Quit Confirm Modal & Surrender Danger Buttons (High Contrast) */
.btn-primary.btn-danger-action {
  background: linear-gradient(135deg, #ff5252 0%, #c62828 100%) !important;
  color: #ffffff !important;
  border: 1.5px solid #ff8a80 !important;
  box-shadow: 0 4px 18px rgba(244, 67, 54, 0.5) !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.btn-primary.btn-danger-action:hover {
  background: linear-gradient(135deg, #ff6b6b 0%, #d32f2f 100%) !important;
  color: #ffffff !important;
  filter: brightness(1.08);
}

.btn-outline.btn-danger-action {
  background: rgba(211, 47, 47, 0.25) !important;
  border: 1.5px solid #ff5252 !important;
  color: #ffffff !important;
}

.btn-outline.btn-danger-action:hover {
  background: rgba(229, 57, 53, 0.45) !important;
  color: #ffffff !important;
}

/* Quit Button in Game Footer */
.btn-quit-game {
  font-weight: 800;
  color: #ff8a80;
  border-color: rgba(255, 82, 82, 0.4);
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
}

.btn-quit-game:hover {
  background: rgba(255, 82, 82, 0.2);
  color: #fff;
  border-color: #ff5252;
}

/* Share Modal Styling */
.modal-share-card {
  max-width: 480px;
  gap: 1rem;
}

.share-card-preview {
  width: 100%;
  background: linear-gradient(135deg, #18331d 0%, #0d1e11 100%);
  border: 2px solid rgba(255, 215, 0, 0.45);
  border-radius: 20px;
  padding: 1.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.share-preview-avatar {
  font-size: 2.8rem;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

.share-preview-name {
  font-family: var(--ff-title);
  font-size: 1.3rem;
  color: var(--clr-yellow);
}

.share-preview-badge {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 50px;
  padding: 0.18rem 0.9rem;
  font-size: 0.78rem;
  color: var(--clr-text2);
  font-weight: 700;
}

.share-preview-score {
  font-family: var(--ff-title);
  font-size: 2.6rem;
  color: #fff;
  text-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
  line-height: 1.1;
  margin-top: 0.2rem;
}

.share-preview-label {
  font-size: 0.65rem;
  color: var(--clr-text3);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 800;
}

.share-preview-stars {
  font-size: 1.6rem;
  letter-spacing: 3px;
}

.share-preview-stars.share-mode-subtitle {
  font-size: 0.75rem;
  letter-spacing: 0.4px;
  color: var(--clr-text2);
  font-weight: 700;
  margin-top: 0.1rem;
}

#shareBadgeResultBox {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.35rem;
  width: 100%;
}

.share-badge-svg-wrap {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.15rem;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.45));
}

.share-badge-svg-wrap svg {
  width: 100%;
  height: 100%;
}

.share-badge-title {
  font-family: var(--ff-title);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.4px;
}

.share-badge-desc {
  font-family: var(--ff-body);
  font-size: 0.85rem;
  font-weight: 400; /* kecil ga bold */
  color: var(--clr-text2);
  text-align: center;
  line-height: 1.35;
  max-width: 280px;
}

.share-text-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--clr-text2);
  text-align: left;
  white-space: pre-line;
  width: 100%;
  line-height: 1.5;
}

.share-actions {
  display: flex;
  gap: 0.6rem;
  width: 100%;
}

.share-actions .btn {
  flex: 1;
}

.share-toast {
  font-size: 0.82rem;
  font-weight: 700;
  color: #69ff84;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(105, 255, 132, 0.4);
  border-radius: 50px;
  padding: 0.25rem 1rem;
}

/* ================================================================
   FUN UPGRADE: BARTLE 4 PLAYER TYPES + SVG ASSETS & CLEAN LAYOUT
   ================================================================ */

/* 1. Mode Screen Top Actions (Trophy Hub & Daily Gift) */
.mode-top-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.daily-gift-svg,
.daily-coin-svg,
.daily-check-svg {
  width: 44px;
  height: 44px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.daily-check-svg {
  width: 15px;
  height: 15px;
  display: inline-block;
  vertical-align: -2px;
  filter: none;
}

/* 2. 3-Card Mode Selection Grid with Custom SVG Illustrations */
#modeScreen .mode-content {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  max-width: 860px !important;
  width: 90% !important;
  margin: 0 auto !important;
  padding: 0 !important;
  text-align: center !important;
  gap: 1.6rem !important;
  z-index: 20 !important;
}

#modeScreen .greet-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--clr-text2);
  margin-bottom: -0.6rem;
  letter-spacing: 0.5px;
}

#modeScreen .mode-title {
  font-family: var(--ff-title);
  font-size: clamp(2.3rem, 4.5vw, 3.1rem);
  font-weight: 900;
  color: var(--clr-yellow);
  text-shadow: 0 4px 20px rgba(255, 215, 0, 0.4), 0 8px 30px rgba(0, 0, 0, 0.8);
  margin-bottom: 0.3rem;
}

#modeScreen .mode-cards {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 1.6rem !important;
  width: 100% !important;
  max-width: 860px !important;
  margin: 0 auto !important;
  justify-content: center !important;
  align-items: stretch !important;
}

#modeScreen .mode-card {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 1.1rem !important;
  width: 100% !important;
  min-height: 230px !important;
  padding: 2.2rem 1.4rem !important;
  background: rgba(14, 38, 20, 0.9) !important;
  border: 2.5px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 24px !important;
  cursor: pointer !important;
  font-family: var(--ff-body) !important;
  position: relative !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  transition: transform 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease !important;
}

#modeScreen .mode-card:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: var(--clr-yellow);
  background: rgba(22, 58, 30, 0.95);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 25px rgba(255, 215, 0, 0.35);
}

#modeScreen .mode-card-name {
  font-family: var(--ff-title);
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.mode-svg-wrap {
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.15rem;
  transition: transform 0.22s cubic-bezier(0.17, 0.67, 0.35, 1.3);
}

.mode-card:hover .mode-svg-wrap {
  transform: scale(1.15) translateY(-4px);
}

.mode-svg-art {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
}

.mode-card.boss-card {
  border-color: rgba(255, 82, 82, 0.45);
  background: linear-gradient(160deg, rgba(65, 16, 16, 0.72) 0%, rgba(22, 10, 12, 0.85) 100%);
}

.mode-card.boss-card:hover {
  border-color: #ff5252;
  box-shadow: 0 10px 28px rgba(255, 82, 82, 0.28);
}

.boss-tag {
  background: linear-gradient(135deg, #ff5252, #c62828) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 138, 128, 0.6);
}

/* 3. Avatar Passive Skill Tag in Profile Modal */
.profile-avatar-skill-tag {
  background: rgba(255, 215, 0, 0.14);
  border: 1.5px solid rgba(255, 215, 0, 0.45);
  color: var(--clr-yellow);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 0.25rem 0.9rem;
  border-radius: 50px;
  letter-spacing: 0.3px;
  text-align: center;
}

/* 4. Daily Quests & Trophy Badges Modal */
.modal-quest-card {
  max-width: 480px;
  width: 94%;
  padding: 1.3rem 1.4rem;
  gap: 0.9rem;
}

.quest-tabs {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.3rem;
  border-radius: 14px;
  border: 1px solid var(--clr-border);
}

.quest-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--clr-text2);
  font-family: var(--ff-body);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.quest-tab.active {
  background: linear-gradient(135deg, #ffd700 0%, #ffa000 100%);
  color: #102212;
  box-shadow: 0 3px 12px rgba(255, 215, 0, 0.3);
}

.quest-tab-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  width: 100%;
}

.quest-item-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 64px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 0.65rem 1rem;
  flex-shrink: 0;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.quest-item-row.ready {
  background: rgba(255, 215, 0, 0.09);
  border-color: rgba(255, 215, 0, 0.45);
}

.quest-item-row.claimed {
  opacity: 0.6;
}

.quest-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.quest-item-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}

.quest-item-title-text {
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quest-prog-pill {
  font-size: 0.76rem;
  color: var(--clr-yellow);
  font-weight: 800;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}

.quest-item-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.quest-prog-num {
  font-size: 0.78rem;
  color: var(--clr-yellow);
  font-weight: 800;
}

.quest-bar-track {
  width: 100%;
  height: 7px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.quest-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #69ff84, #00e676);
  border-radius: 50px;
  transition: width 0.3s ease;
}

.quest-bar-num {
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--clr-text2);
  min-width: 42px;
  text-align: right;
}

.quest-claim-btn {
  padding: 0.42rem 0.85rem !important;
  font-size: 0.78rem !important;
  border-radius: 10px !important;
  min-width: 82px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.quest-claimed-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.76rem;
  font-weight: 800;
  color: #69ff84;
  background: rgba(105, 255, 132, 0.14);
  border: 1px solid rgba(105, 255, 132, 0.35);
  padding: 0.3rem 0.7rem;
  border-radius: 50px;
}

.badge-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  width: 100%;
}

.badge-card-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.22rem;
  padding: 0.75rem 0.5rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 215, 0, 0.35);
}

.badge-card-item.locked {
  opacity: 0.42;
  filter: grayscale(1);
  border-color: rgba(255, 255, 255, 0.12);
}

.badge-card-svg svg {
  width: 46px;
  height: 46px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
}

.badge-card-title {
  font-family: var(--ff-title);
  font-size: 0.8rem;
  color: var(--clr-yellow);
}

.badge-card-desc {
  font-size: 0.68rem;
  color: var(--clr-text2);
  font-weight: 700;
}

/* 5. Compact Game Gauge Bar (Boss HP + Fever Bar + Pak RT Alert) */
.game-gauge-bar {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
  max-width: calc(var(--grid-size) + 84px);
  flex-shrink: 0;
}

.boss-bar-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(55, 10, 10, 0.75);
  border: 1.5px solid rgba(255, 82, 82, 0.55);
  border-radius: 10px;
  padding: 0.2rem 0.6rem;
}

.boss-bar-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--ff-title);
  font-size: 0.72rem;
  color: #ff8a80;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.boss-bar-svg {
  width: 16px;
  height: 16px;
}

.boss-bar-track {
  flex: 1;
  height: 10px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.boss-bar-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff1744, #ff9100);
  border-radius: 50px;
  transition: width 0.25s ease;
}

.boss-bar-hp {
  font-family: var(--ff-title);
  font-size: 0.75rem;
  color: #fff;
  min-width: 58px;
  text-align: right;
}

.stealth-fever-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

.pakrt-mini-wrap {
  flex: 1.25;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid var(--clr-border);
  border-radius: 10px;
  padding: 0.2rem 0.55rem;
}

.pakrt-mini-wrap .pakrt-track {
  flex: 1;
  height: 8px;
}

.pakrt-mini-wrap .pakrt-msg {
  font-size: 0.68rem;
  white-space: nowrap;
}

.fever-mini-wrap {
  flex: 0.95;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-radius: 10px;
  padding: 0.2rem 0.55rem;
}

.fever-tag {
  font-family: var(--ff-title);
  font-size: 0.66rem;
  color: var(--clr-yellow);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.fever-tag.active {
  color: #ffea00;
  text-shadow: 0 0 8px rgba(255, 234, 0, 0.8);
}

.fever-track {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 50px;
  overflow: hidden;
}

.fever-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd700, #ff6d00);
  border-radius: 50px;
  transition: width 0.25s ease;
}

.fever-fill.active {
  background: linear-gradient(90deg, #ffea00, #00e5ff, #ff4081);
  box-shadow: 0 0 10px #ffea00;
}

/* 6. Arcade Callout Banner & Fever Board Glow */
.arcade-banner {
  position: absolute;
  top: 18%;
  left: calc(84px + (var(--grid-size) / 2));
  transform: translate(-50%, -50%);
  z-index: 120;
  pointer-events: none;
  font-family: var(--ff-title);
  font-size: 1.35rem;
  letter-spacing: 1.5px;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 109, 0, 0.92), rgba(213, 0, 0, 0.92));
  border: 2px solid #ffd700;
  border-radius: 50px;
  padding: 0.28rem 1.2rem;
  box-shadow: 0 0 24px rgba(255, 215, 0, 0.7), 0 6px 18px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
  animation: arcadeBannerPop 0.25s cubic-bezier(0.17, 0.67, 0.35, 1.35);
}

.arcade-banner.tier-triple {
  background: linear-gradient(135deg, #aa00ff, #6200ea);
}

.arcade-banner.tier-mega,
.arcade-banner.tier-godlike {
  background: linear-gradient(135deg, #ffd600, #ff3d00);
  color: #1a0900;
  border-color: #fff;
}

.arcade-banner.tier-fever {
  background: linear-gradient(135deg, #00e676, #00b0ff);
  color: #041f0d;
  border-color: #ffea00;
}

@keyframes arcadeBannerPop {
  0% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
  }

  70% {
    transform: translate(-50%, -50%) scale(1.12);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.grid.fever-board {
  border-color: #ffea00 !important;
  box-shadow: 0 0 28px rgba(255, 234, 0, 0.55), inset 0 0 16px rgba(255, 215, 0, 0.25) !important;
}

/* 7. Custom SVG Booster Icons & Board Mystery Chest / Fog Overlays */
.booster-svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.booster-coin-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffd700;
  border: 1px solid #ffa000;
  margin-right: 3px;
  vertical-align: 1px;
}

.cell.special-chest {
  border: 2px solid #ffd700 !important;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.32) 0%, rgba(120, 70, 0, 0.35) 100%) !important;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.65);
}

.cell-svg-overlay {
  position: absolute;
  inset: 12%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.cell-svg-overlay svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55));
}

.cell.fog-layer {
  background: rgba(15, 23, 30, 0.92) !important;
  border: 1.5px dashed rgba(144, 164, 174, 0.55) !important;
}

/* 8. Compact Bottom Status + Quit Row & Leaderboard Badge Pill */
.game-bottom-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  max-width: calc(var(--grid-size) + 84px);
  flex-shrink: 0;
}

.game-bottom-row .dialog-box {
  flex: 1;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-bottom-row .btn-quit-game {
  padding: 0.5rem 1.25rem;
  font-size: 0.92rem;
  font-weight: 800;
  flex-shrink: 0;
}

.lboard-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: var(--clr-yellow);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.1rem 0.48rem;
  border-radius: 50px;
  margin-left: 0.4rem;
}

.lboard-mini-medal {
  width: 13px;
  height: 13px;
}

@media (max-width: 680px) {
  #modeScreen .mode-cards {
    grid-template-columns: 1fr;
  }

  .badge-grid-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ================================================================
   NEW ENHANCEMENTS: SCENERY BACKGROUND, MISI & LENCANA, DUEL MALING,
   AND DESKTOP FULLSCREEN SCALING
   ================================================================ */

/* ── 1. Global Atmospheric Night Scenery Background (.bg-scene) ── */
.bg-scene {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  background: radial-gradient(circle at 75% 20%, #102a18 0%, #08160c 45%, #040c06 100%);
}

.bg-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 15% 18%, #ffffff 100%, transparent),
    radial-gradient(1px 1px at 35% 28%, #e0ffe0 100%, transparent),
    radial-gradient(2px 2px at 55% 12%, #fff9c4 100%, transparent),
    radial-gradient(1.5px 1.5px at 70% 34%, #ffffff 100%, transparent),
    radial-gradient(1px 1px at 85% 15%, #ffffff 100%, transparent),
    radial-gradient(1.5px 1.5px at 92% 40%, #e8f5e9 100%, transparent),
    radial-gradient(1px 1px at 25% 45%, #ffffff 100%, transparent),
    radial-gradient(1.5px 1.5px at 48% 38%, #fff8e1 100%, transparent);
  opacity: 0.65;
}

.bg-moon {
  position: absolute;
  top: 6%;
  right: 12%;
  font-size: 3.8rem;
  filter: drop-shadow(0 0 26px rgba(255, 235, 59, 0.45));
  opacity: 0.9;
  user-select: none;
}

.bg-moon-glow {
  position: absolute;
  top: 3%;
  right: 9%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 235, 59, 0.18) 0%, rgba(76, 175, 80, 0.08) 50%, transparent 70%);
  filter: blur(8px);
}

.bg-layer-hills-far {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28vh;
  background: radial-gradient(ellipse at 30% 100%, #0d2815 0%, #091a0e 70%, transparent 100%);
  border-top-left-radius: 40% 60px;
  border-top-right-radius: 50% 80px;
  opacity: 0.75;
}

.bg-layer-hills-near {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 16vh;
  background: linear-gradient(180deg, #13351b 0%, #08180c 100%);
  border-top-left-radius: 65% 50px;
  border-top-right-radius: 35% 40px;
  opacity: 0.85;
}

.bg-fence {
  position: absolute;
  bottom: 8vh;
  left: 0;
  right: 0;
  height: 22px;
  background-image: repeating-linear-gradient(90deg, #1b3d22 0, #1b3d22 10px, transparent 10px, transparent 24px);
  border-top: 3px solid #234c2b;
  border-bottom: 2px solid #142f1a;
  opacity: 0.35;
}

.bg-bushes {
  position: absolute;
  bottom: 0;
  left: -20px;
  right: -20px;
  height: 70px;
  background: radial-gradient(ellipse at 15% 100%, #1f4a26 0%, #0e2413 70%),
    radial-gradient(ellipse at 45% 100%, #1b4221 0%, #0c2010 70%),
    radial-gradient(ellipse at 80% 100%, #183e1e 0%, #0a1b0e 70%);
  opacity: 0.9;
}

/* Drifting Glowing Fireflies */
.bg-fireflies {
  position: absolute;
  inset: 0;
}

.firefly {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffeb3b;
  box-shadow: 0 0 10px #ffeb3b, 0 0 20px #aeea00;
  opacity: 0.8;
  animation: fireflyFloat 10s infinite ease-in-out;
}

.firefly.f1 {
  top: 65%;
  left: 18%;
  animation-duration: 9s;
  animation-delay: 0s;
}

.firefly.f2 {
  top: 45%;
  left: 32%;
  animation-duration: 12s;
  animation-delay: 2s;
}

.firefly.f3 {
  top: 72%;
  left: 68%;
  animation-duration: 8s;
  animation-delay: 1.5s;
}

.firefly.f4 {
  top: 52%;
  left: 82%;
  animation-duration: 11s;
  animation-delay: 3s;
}

.firefly.f5 {
  top: 35%;
  left: 50%;
  animation-duration: 14s;
  animation-delay: 4.5s;
}

@keyframes fireflyFloat {
  0% {
    transform: translate(0, 0) scale(0.8);
    opacity: 0.2;
  }

  30% {
    transform: translate(18px, -24px) scale(1.1);
    opacity: 0.9;
  }

  60% {
    transform: translate(-14px, -45px) scale(0.9);
    opacity: 0.7;
  }

  85% {
    transform: translate(25px, -15px) scale(1.2);
    opacity: 0.95;
  }

  100% {
    transform: translate(0, 0) scale(0.8);
    opacity: 0.2;
  }
}

/* ── 2. Desktop Fullscreen Scaling & Spacing ── */
:root {
  --grid-size: min(540px, 66vh, 86vw);
}

@media (min-width: 900px) and (min-height: 680px) {
  :root {
    --grid-size: min(560px, 70vh, 88vw);
  }

  .btn-nav-home {
    padding: 0.8rem 1.8rem !important;
    font-size: 1.18rem !important;
    border-radius: 50px !important;
  }

  .btn-screen-back-topleft.btn-circle-nav {
    width: 66px !important;
    height: 66px !important;
    padding: 0 !important;
    border-radius: 50% !important;
  }

  .btn-profile-badge {
    padding: 0.6rem 1.5rem !important;
    font-size: 1.1rem !important;
  }

  .btn-global-settings {
    width: 66px !important;
    height: 66px !important;
    font-size: 1.8rem !important;
    bottom: 26px !important;
    left: 28px !important;
  }

  .mode-top-bar {
    top: 26px !important;
    left: 32px !important;
    right: 32px !important;
  }

  .hud {
    padding: 0.6rem 1.2rem !important;
    max-width: calc(var(--grid-size) + 90px) !important;
  }
}

/* ── 3. Top Mode Actions: Beranda, Leaderboard, Misi & Lencana ── */
.mode-top-left-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.65rem;
  pointer-events: auto;
}

.btn-circle-nav {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  padding: 0 !important;
  border-radius: 50% !important;
  background: rgba(14, 38, 20, 0.94);
  border: 2.5px solid rgba(255, 215, 0, 0.6);
  color: #ffd54f;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55), 0 0 14px rgba(255, 215, 0, 0.2);
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.btn-circle-nav svg {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  fill: #ffd54f;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
}

.btn-circle-nav:hover {
  transform: translateY(-2px) scale(1.08);
  border-color: var(--clr-yellow);
  background: rgba(22, 58, 30, 0.98);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 18px rgba(255, 215, 0, 0.45);
}

.btn-circle-nav:active {
  transform: translateY(0) scale(0.95);
}

.btn-circle-nav.btn-screen-back-topleft {
  position: fixed;
  top: 24px;
  left: 24px;
  z-index: 950;
  width: 64px !important;
  height: 64px !important;
  padding: 0 !important;
  border-radius: 50% !important;
}

.mode-top-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.55rem;
}

.mode-top-actions.vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0;
}

.btn-sub-action.icon-only {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  padding: 0;
  background: rgba(14, 38, 20, 0.94);
  border: 2.5px solid rgba(255, 215, 0, 0.6);
  border-radius: 18px;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.55), 0 0 14px rgba(255, 215, 0, 0.2);
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.btn-sub-action.icon-only svg {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
}

.btn-sub-action.icon-only:hover {
  transform: translateY(-2px) scale(1.06);
  border-color: var(--clr-yellow);
  background: rgba(22, 58, 30, 0.98);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 18px rgba(255, 215, 0, 0.45);
}

.btn-sub-action.icon-only:active {
  transform: translateY(0) scale(0.96);
}

.btn-sub-action .daily-gift-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #ff1744;
  color: #fff;
  font-family: var(--ff-body);
  font-size: 0.72rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  animation: pulseDot 1.4s infinite;
}

@keyframes pulseDot {

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

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

/* ── 4. Modal Misi (Harian & Mingguan) ── */
.modal-quest-card {
  max-width: 520px;
  width: 92%;
  height: 540px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #132f1a 0%, #0a1b0e 100%);
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 20px;
  padding: 1.4rem;
  box-sizing: border-box;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.75), 0 0 30px rgba(76, 175, 80, 0.2);
}

.quest-tabs {
  display: flex;
  gap: 0.6rem;
  margin: 0.6rem 0 0.9rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.quest-tab {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--clr-text2);
  font-family: var(--ff-title);
  font-size: 0.92rem;
  padding: 0.55rem 0.6rem;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-quest-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  background: #ff1744;
  color: #fff;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 900;
  margin-left: 6px;
  box-shadow: 0 0 8px rgba(255, 23, 68, 0.85);
  animation: pulseClaim 1.4s infinite;
}

.quest-tab:hover {
  color: #fff;
}

.quest-tab.active {
  background: linear-gradient(135deg, #ffb300, #ff8f00);
  color: #1a0f00;
  box-shadow: 0 3px 10px rgba(255, 179, 0, 0.45);
  font-weight: 800;
}

.quest-list-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 0.75rem;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.4rem 2px 0.4rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 215, 0, 0.35) transparent;
}

.quest-list-container::-webkit-scrollbar {
  width: 6px;
}

.quest-list-container::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.35);
  border-radius: 10px;
}

.quest-list-container::-webkit-scrollbar-track {
  background: transparent;
}

.quest-item-row {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  min-height: 64px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  padding: 0.7rem 1rem;
  flex-shrink: 0;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.quest-item-row.ready {
  background: rgba(255, 215, 0, 0.09);
  border-color: rgba(255, 215, 0, 0.45);
}

.quest-item-row.claimed {
  opacity: 0.6;
}

.quest-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.quest-item-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}

.quest-item-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.quest-prog-pill {
  font-size: 0.76rem;
  color: var(--clr-yellow);
  font-weight: 800;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}

.quest-bar-track {
  width: 100%;
  height: 7px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.quest-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #ffd54f);
  border-radius: 50px;
  transition: width 0.3s ease;
}

.btn-quest-claim {
  font-family: var(--ff-title);
  font-size: 0.82rem;
  padding: 0.42rem 0.85rem;
  border-radius: 10px;
  border: none;
  cursor: default;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.btn-quest-claim.locked {
  background: rgba(255, 255, 255, 0.1);
  color: var(--clr-text3);
}

.btn-quest-claim.active {
  background: linear-gradient(135deg, #00e676, #00b0ff);
  color: #002e14;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 230, 118, 0.45);
  font-weight: 800;
  animation: pulseClaim 1.5s infinite;
}

.btn-quest-claim.done {
  background: rgba(76, 175, 80, 0.2);
  color: #81c784;
}

@keyframes pulseClaim {

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

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

/* ── 5. Modal Lencana (Piala Maling) ── */
.modal-badge-card {
  max-width: 520px;
  width: 92%;
  height: 540px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #1a2717 0%, #0c170d 100%);
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 20px;
  padding: 1.4rem;
  box-sizing: border-box;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.75), 0 0 30px rgba(76, 175, 80, 0.2);
}

.badge-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem;
  margin-top: 0.8rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 6px 12px 6px;
  box-sizing: border-box;
}

.badge-item-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0.9rem 0.75rem;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  box-sizing: border-box;
}

.badge-item-card.unlocked {
  background: radial-gradient(circle at center, rgba(255, 215, 0, 0.12) 0%, rgba(20, 45, 22, 0.6) 100%);
  border-color: rgba(255, 215, 0, 0.55);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.badge-item-card.unlocked:hover {
  transform: translateY(-3px);
  border-color: var(--clr-yellow);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4);
}

.badge-item-card.locked {
  opacity: 0.45;
  filter: grayscale(0.8);
}

.badge-svg-wrap {
  width: 44px;
  height: 44px;
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-svg-wrap svg {
  width: 100%;
  height: 100%;
}

.badge-item-title {
  font-family: var(--ff-title);
  font-size: 0.88rem;
  color: #fff;
  margin-bottom: 0.2rem;
}

.badge-item-desc {
  font-size: 0.73rem;
  color: var(--clr-text2);
  line-height: 1.25;
}

.badge-card-footer {
  margin-top: 0.6rem;
  width: 100%;
  display: flex;
  justify-content: center;
}

.btn-badge-claim {
  font-family: var(--ff-title);
  font-size: 0.82rem;
  padding: 0.42rem 0.95rem;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #00c853, #00b0ff);
  color: #002e14;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(0, 200, 83, 0.45);
  animation: pulseClaim 1.5s infinite;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.btn-badge-claim:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(0, 230, 118, 0.65);
}

.badge-claim-status {
  font-size: 0.74rem;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
  font-weight: 700;
}

.badge-claim-status.claimed {
  background: rgba(76, 175, 80, 0.2);
  color: #a5d6a7;
  border: 1px solid rgba(76, 175, 80, 0.35);
}

.badge-claim-status.locked {
  background: rgba(0, 0, 0, 0.3);
  color: var(--clr-text3);
}

/* ── 6. Mode Duel Maling (Turn & Score Bar) ── */
.duel-score-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: calc(var(--grid-size) + 84px);
  background: rgba(8, 24, 12, 0.9);
  border: 2px solid rgba(255, 215, 0, 0.35);
  border-radius: 16px;
  padding: 0.55rem 0.9rem;
  margin-bottom: 0.45rem;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
  gap: 0.6rem;
}

.duel-player-box {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
  flex: 1;
}

.duel-player-box.active {
  background: radial-gradient(circle, rgba(255, 215, 0, 0.18) 0%, rgba(20, 50, 26, 0.8) 100%);
  border-color: var(--clr-yellow);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.45);
}

.duel-player-tag {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--clr-text2);
  letter-spacing: 0.5px;
}

.duel-player-box.active .duel-player-tag {
  color: var(--clr-yellow);
}

.duel-avatar {
  font-size: 1.45rem;
  line-height: 1;
}

.duel-score-val {
  font-family: var(--ff-title);
  font-size: 1.15rem;
  color: #fff;
  margin-left: auto;
}

.duel-center-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}

.duel-turn-pill {
  font-family: var(--ff-title);
  font-size: 0.76rem;
  background: linear-gradient(135deg, #ffb300, #ff8f00);
  color: #1a0f00;
  padding: 0.2rem 0.65rem;
  border-radius: 50px;
  font-weight: 800;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 8px rgba(255, 179, 0, 0.5);
}

.duel-moves-sub {
  font-size: 0.7rem;
  color: var(--clr-text2);
  font-weight: 700;
}

.duel-timer-badge {
  font-family: var(--ff-title);
  font-size: 0.84rem;
  background: rgba(0, 0, 0, 0.6);
  border: 1.5px solid #00e676;
  color: #69f0ae;
  padding: 0.15rem 0.65rem;
  border-radius: 50px;
  font-weight: 800;
  letter-spacing: 0.4px;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.35);
  margin-top: 0.15rem;
  transition: all 0.2s ease;
}

.duel-timer-badge.urgent {
  border-color: #ff1744;
  color: #ff5252;
  box-shadow: 0 0 14px rgba(255, 23, 68, 0.9);
  animation: pulseClaim 0.8s infinite;
}

.duel-vs-text {
  display: inline-block;
  font-family: var(--ff-title);
  font-size: 0.76rem;
  font-weight: 900;
  color: #ffd54f;
  background: rgba(230, 81, 0, 0.45);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  margin: 0 0.35rem;
  border: 1px solid rgba(255, 179, 0, 0.5);
}

/* ── Landscape Stage Extender (16:9, 16:10, 3:2, 4:3) ── */
.screen {
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 60% at 50% 50%, rgba(18, 54, 28, 0.4) 0%, transparent 80%),
    linear-gradient(180deg, #051208 0%, #0a1f0f 50%, #051208 100%);
}

.home-content,
.game-wrapper,
.lboard-card {
  max-width: min(96vw, calc(96vh * (16 / 9)));
  max-height: 96vh;
}

/* ── 7. Modal Persiapan Duel Maling (1 Perangkat) ── */
.modal-duel-setup-card {
  max-width: 480px;
  width: 92%;
  background: linear-gradient(180deg, #162a1b 0%, #0d1910 100%);
  border: 2px solid rgba(255, 215, 0, 0.5);
  border-radius: 20px;
  padding: 1.4rem;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.75), 0 0 30px rgba(255, 215, 0, 0.2);
}

.duel-setup-subtitle {
  font-size: 0.86rem;
  color: var(--clr-text2);
  text-align: center;
  margin: 0.3rem 0 1.2rem;
}

.duel-matchup-row {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 1.1rem;
}

.duel-setup-player-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0.9rem 0.6rem;
  min-height: 185px;
  box-sizing: border-box;
}

.duel-setup-tag {
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffca28;
  letter-spacing: 0.5px;
  margin-bottom: 0.3rem;
}

.duel-setup-avatar-big {
  font-size: 2.8rem;
  line-height: 1;
  margin: 0.3rem 0 0.5rem;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

.duel-setup-player-name {
  font-family: var(--ff-title);
  font-size: 1rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.duel-setup-vs-badge {
  font-family: var(--ff-title);
  font-size: 1.3rem;
  font-weight: 900;
  color: #ffd54f;
  background: radial-gradient(circle, #e65100 0%, #bf360c 100%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  border: 2px solid #ffe082;
  box-shadow: 0 4px 12px rgba(230, 81, 0, 0.6);
  flex-shrink: 0;
}

.duel-p2-select {
  width: 100%;
  max-width: 150px;
  height: 40px;
  box-sizing: border-box;
  background: #0d2314;
  color: #fff;
  border: 1.5px solid #4caf50;
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font-family: var(--ff-body);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  text-align: center;
}

.duel-p2-select option {
  background: #0d2314;
  color: #fff;
}

.duel-add-p2-section {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1rem;
}

.duel-add-p2-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.duel-h2h-card {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  text-align: center;
  margin-bottom: 0.9rem;
}

.duel-h2h-title {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--clr-text2);
  letter-spacing: 0.5px;
  margin-bottom: 0.2rem;
}

.duel-h2h-text {
  font-family: var(--ff-title);
  font-size: 0.98rem;
  color: #ffe082;
}

/* ── 8. Real-time Badge Unlock Toast Notification ── */
.badge-unlock-toast {
  position: fixed;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: linear-gradient(135deg, #1b5e20 0%, #0a260f 100%);
  border: 2px solid #ffd54f;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 25px rgba(255, 215, 0, 0.45);
  border-radius: 16px;
  padding: 0.85rem 1.4rem;
  color: #fff;
  min-width: 290px;
  max-width: 90vw;
  pointer-events: none;
  opacity: 0;
  transition: top 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.35s ease;
}

.badge-unlock-toast.visible {
  top: 24px;
  opacity: 1;
}

.badge-toast-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.badge-toast-icon svg {
  width: 100%;
  height: 100%;
}

.badge-toast-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.badge-toast-tag {
  font-size: 0.72rem;
  font-weight: 900;
  color: #ffd54f;
  letter-spacing: 0.6px;
}

.badge-toast-title {
  font-family: var(--ff-title);
  font-size: 1rem;
  color: #fff;
}

.badge-toast-desc {
  font-size: 0.78rem;
  color: #c8e6c9;
}