:root {
  --green: #7ee36b;
  --green-dark: #2f9e2a;
  --yellow: #ffd23e;
  --pink: #ff5d8f;
  --cyan: #41b6ee;
  --purple: #c77dff;
  --ink: #232a33;
  --panel: #fff9ee;
  --font: "Comic Sans MS", "Chalkboard SE", "Comic Neue", "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #20242c;
  font-family: var(--font);
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}

canvas#game {
  position: fixed; inset: 0;
  display: block;
}

.hidden { display: none !important; }

.screen {
  position: fixed; inset: 0;
  display: flex;
  align-items: center; justify-content: center;
  z-index: 10;
  animation: screenIn 0.28s cubic-bezier(.2,.9,.3,1.3);
  /* Responsive safe-area padding so UI never sits flush against edges
     in non-fullscreen / embedded mode. Uses env() for notches and
     dynamic viewports, plus percentage-based minimum margins. */
  padding-top: max(calc(5vh + env(safe-area-inset-top)), 24px);
  padding-bottom: max(calc(4vh + env(safe-area-inset-bottom)), 18px);
}
@keyframes screenIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.screen.modal { background: rgba(24, 28, 38, 0.55); backdrop-filter: blur(3px); }

#menu { pointer-events: none; }
#menu > * { pointer-events: auto; }

/* ---------- logo ---------- */

.logoSvg { width: min(520px, 72vw); overflow: visible; }

.logoWord {
  font-family: var(--font);
  font-weight: bold;
  font-size: 96px;
  fill: #8ff07a;
  stroke: #1e5b1a;
  stroke-width: 4px;
  paint-order: stroke fill;
  letter-spacing: 6px;
}
.logoWord2 {
  font-family: var(--font);
  font-weight: bold;
  font-size: 54px;
  fill: var(--yellow);
  stroke: #7c5208;
  stroke-width: 4px;
  paint-order: stroke fill;
  letter-spacing: 8px;
}
.logoDrips ellipse { filter: drop-shadow(0 3px 0 rgba(20,60,15,0.35)); animation: dripWob 2.8s ease-in-out infinite; transform-origin: top center; }
.logoDrips ellipse:nth-child(2) { animation-delay: .6s; }
.logoDrips ellipse:nth-child(3) { animation-delay: 1.2s; }
@keyframes dripWob { 0%,100% { transform: scaleY(1);} 50% { transform: scaleY(1.18);} }

.logoEye { fill: #fff; stroke: #1e5b1a; stroke-width: 2.5; }
.logoPupil { fill: #20242c; animation: lookAround 5s ease-in-out infinite; }
@keyframes lookAround {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(3px); }
  65% { transform: translateX(-3px); }
}

.logoSvg.small { width: min(380px, 66vw); }
.logoSvg.small .logoWord { font-size: 84px; }
.logoSvg.small .logoWord2 { font-size: 46px; letter-spacing: 6px; }

.tagline {
  color: #fff;
  text-align: center;
  font-size: 19px;
  font-weight: bold;
  text-shadow: 0 2px 0 rgba(30,40,20,0.6);
  letter-spacing: 1px;
  margin-top: 2px;
}

/* ---------- menu ---------- */

.menuInner {
  display: flex; flex-direction: column; align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: min(520px, 72vw);
  height: 100%;
  gap: 14px;
  padding: 8px 0;
}

.menuNav { display: flex; flex-direction: column; gap: 11px; margin-top: 14px; align-items: center; }

.btn {
  font-family: var(--font);
  font-weight: bold;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(#67b7ff, #2e86d9);
  border: 3px solid rgba(20,50,80,0.55);
  border-radius: 16px;
  padding: 11px 34px;
  min-width: 250px;
  cursor: pointer;
  box-shadow: 0 5px 0 #1d5c99, 0 9px 14px rgba(0,0,0,0.35), inset 0 2px 0 rgba(255,255,255,0.45);
  text-shadow: 0 2px 0 rgba(0,40,70,0.4);
  transition: transform 0.09s ease, box-shadow 0.09s ease, filter 0.15s;
}
.btn:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.08); box-shadow: 0 7px 0 #1d5c99, 0 12px 18px rgba(0,0,0,0.4), inset 0 2px 0 rgba(255,255,255,0.45); }
.btn:active { transform: translateY(3px) scale(0.98); box-shadow: 0 1px 0 #1d5c99, 0 3px 6px rgba(0,0,0,0.35), inset 0 2px 0 rgba(255,255,255,0.45); }

.btn.primary {
  background: linear-gradient(#93ef6e, #46c02e);
  border-color: rgba(25,80,15,0.6);
  box-shadow: 0 5px 0 #2c8a17, 0 9px 14px rgba(0,0,0,0.35), inset 0 2px 0 rgba(255,255,255,0.5);
  text-shadow: 0 2px 0 rgba(20,90,10,0.5);
}
.btn.primary:hover { box-shadow: 0 7px 0 #2c8a17, 0 12px 18px rgba(0,0,0,0.4), inset 0 2px 0 rgba(255,255,255,0.5); }
.btn.primary:active { box-shadow: 0 1px 0 #2c8a17, 0 3px 6px rgba(0,0,0,0.35), inset 0 2px 0 rgba(255,255,255,0.5); }

.btn.big { font-size: 27px; padding: 14px 44px; }

.btn.back {
  min-width: 150px;
  background: linear-gradient(#ffd98a, #f0a41e);
  border-color: rgba(120,75,8,0.55);
  box-shadow: 0 5px 0 #b97a0a, 0 8px 12px rgba(0,0,0,0.3), inset 0 2px 0 rgba(255,255,255,0.5);
  color: #5c4200;
  text-shadow: none;
  margin-top: 14px;
}
.btn.back:hover { box-shadow: 0 7px 0 #b97a0a, 0 11px 16px rgba(0,0,0,0.32), inset 0 2px 0 rgba(255,255,255,0.5); }
.btn.back:active { box-shadow: 0 1px 0 #b97a0a; }

.btn.danger {
  background: linear-gradient(#ff9a8a, #e04f38);
  border-color: rgba(110,25,12,0.6);
  box-shadow: 0 4px 0 #a3301c, 0 8px 12px rgba(0,0,0,0.28), inset 0 2px 0 rgba(255,255,255,0.4);
  font-size: 16px;
  min-width: 200px;
  padding: 9px 22px;
}

.btn.reward {
  background: linear-gradient(#ffe27a, #f0a41e);
  border-color: rgba(120,75,8,0.6);
  color: #5c4200;
  text-shadow: 0 1px 0 rgba(255,255,255,0.45);
  box-shadow: 0 5px 0 #b97a0a, 0 9px 14px rgba(0,0,0,0.35), inset 0 2px 0 rgba(255,255,255,0.55);
  font-size: 18px;
  min-width: 250px;
  padding: 11px 26px;
  position: relative;
}
.btn.reward:hover { box-shadow: 0 7px 0 #b97a0a, 0 12px 18px rgba(0,0,0,0.4), inset 0 2px 0 rgba(255,255,255,0.55); }
.btn.reward:active { box-shadow: 0 1px 0 #b97a0a, 0 3px 6px rgba(0,0,0,0.3), inset 0 2px 0 rgba(255,255,255,0.55); }
.btn.reward.adLoading { filter: saturate(0.4) brightness(0.92); cursor: wait; }
.btn.reward.adError {
  background: linear-gradient(#ff9e8a, #e04f38);
  border-color: rgba(120,30,20,0.6);
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.4);
  box-shadow: 0 5px 0 #a3301c, 0 9px 14px rgba(0,0,0,0.35);
  font-size: 15px;
  cursor: default;
}

.btn:disabled, .btn.disabled {
  filter: saturate(0.35) brightness(0.85);
  cursor: default;
  transform: none !important;
  pointer-events: none;
}

.menuFooter {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center;
  margin-top: 6px;
  padding-bottom: 3px;
}

/* ---------- compact-height responsive menu ----------
| Short embedded Y8 viewports need progressively smaller logo,
| buttons, gaps, and safe-area margins so the whole menu fits. */
@media (max-height: 720px) {
  .screen {
    padding-top: max(4vh, 20px);
    padding-bottom: max(3vh, 14px);
  }
  .logoSvg { width: min(480px, 68vw); }
  .menuInner { gap: 10px; padding: 5px 0; }
  .menuNav { gap: 8px; margin-top: 8px; }
  .btn { font-size: 18px; padding: 8px 28px; min-width: 220px; }
  .btn.big { font-size: 23px; padding: 10px 36px; }
  .tagline { font-size: 16px; }
  .coinPill, .bestPill, .dailyChip { font-size: 13px; padding: 4px 10px; }
  .menuFooter { gap: 8px; margin-top: 5px; }
}

@media (max-height: 540px) {
  .screen {
    padding-top: max(3vh, 12px);
    padding-bottom: max(2.5vh, 8px);
  }
  .logoSvg { width: min(400px, 60vw); }
  .menuInner { gap: 6px; padding: 4px 0; }
  .menuNav { gap: 5px; margin-top: 5px; }
  .btn { font-size: 15px; padding: 6px 22px; min-width: 200px; }
  .btn.big { font-size: 19px; padding: 7px 28px; }
  .tagline { font-size: 14px; }
  .coinPill, .bestPill, .dailyChip { font-size: 12px; padding: 3px 7px; }
  .menuFooter { gap: 5px; margin-top: 3px; }
}

@media (max-height: 490px) {
  .screen {
    padding-top: max(2.5vh, 10px);
    padding-bottom: max(2vh, 7px);
  }
  .logoSvg { width: min(360px, 56vw); }
  .menuInner { gap: 5px; padding: 3px 0; }
  .menuNav { gap: 4px; margin-top: 4px; }
  .btn { font-size: 13px; padding: 5px 18px; min-width: 180px; }
  .btn.big { font-size: 17px; padding: 6px 24px; }
  .tagline { font-size: 12px; }
  .coinPill, .bestPill, .dailyChip { font-size: 10px; padding: 2px 5px; }
  .menuFooter { gap: 4px; margin-top: 2px; }
}

@media (max-height: 450px) {
  .screen {
    padding-top: max(2vh, 8px);
    padding-bottom: max(1.5vh, 5px);
  }
  .logoSvg { width: min(340px, 52vw); }
  .menuInner { gap: 4px; padding: 2px 0; }
  .menuNav { gap: 3px; margin-top: 2px; }
  .btn { font-size: 12px; padding: 4px 16px; min-width: 170px; }
  .btn.big { font-size: 15px; padding: 5px 20px; }
  .tagline { font-size: 11px; }
  .coinPill, .bestPill, .dailyChip { font-size: 9px; padding: 1px 4px; }
  .menuFooter { gap: 3px; margin-top: 1px; }
}

.coinPill, .bestPill, .dailyChip {
  background: rgba(20,26,20,0.62);
  color: #fff;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 15px;
  line-height: 1.2;
  font-weight: bold;
  border: 2px solid rgba(255,255,255,0.22);
  display: inline-flex; align-items: center; gap: 7px;
  text-shadow: 0 1px 0 rgba(0,0,0,0.5);
}
.coinIcon {
  width: 16px; height: 16px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe98a, #f0a41e 70%);
  border: 2px solid #a86e08;
  display: inline-block;
}
.dailyChip.done { border-color: var(--green); }
.dailyChip .dailyProg { color: var(--yellow); }
.dailyChip.done .dailyProg { color: var(--green); }

/* ---------- loading ---------- */

#loading { background: linear-gradient(#2c3348, #171a26); z-index: 100; flex-direction: column; }
.loadInner { display: flex; flex-direction: column; align-items: center; gap: 22px; }

.loadBar {
  width: min(340px, 60vw); height: 22px;
  background: rgba(0,0,0,0.45);
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,0.18);
  overflow: hidden;
}
#loadFill {
  height: 100%; width: 0%;
  background: repeating-linear-gradient(-45deg, #93ef6e 0 14px, #7ee36b 14px 28px);
  border-radius: 999px;
  transition: width 0.25s ease;
  box-shadow: inset 0 -4px 0 rgba(0,60,0,0.3);
}
#loadTip { color: rgba(255,255,255,0.85); font-size: 16px; font-weight: bold; }

.loaderSlime { position: relative; width: 74px; height: 52px; animation: loaderHop 0.7s cubic-bezier(.3,0,.6,1) infinite alternate; }
@keyframes loaderHop {
  from { transform: translateY(0) scale(1.08, 0.88); }
  to { transform: translateY(-26px) scale(0.94, 1.1); }
}
.lsBody {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 35% 30%, #b8f77e, #5ad938 60%, #2f9e2a);
  border-radius: 50% 50% 46% 46%;
  border: 3px solid #1e6b1c;
}
.lsEye { position: absolute; top: 14px; width: 10px; height: 13px; background: #fff; border-radius: 50%; }
.lsEye.l { left: 20px; } .lsEye.r { right: 20px; }
.lsMouth { position: absolute; bottom: 10px; left: 50%; width: 18px; height: 8px; margin-left: -9px; border-bottom: 3px solid #173a15; border-radius: 0 0 12px 12px; }

/* ---------- panels ---------- */

.panel {
  background:
    radial-gradient(circle at 20% 0%, rgba(126,227,107,0.14), transparent 42%),
    var(--panel);
  border: 4px solid #caa36a;
  border-radius: 26px;
  padding: 26px 34px;
  max-width: min(92vw, 480px);
  max-height: 88vh;
  overflow-y: auto;
  text-align: center;
  box-shadow: 0 14px 34px rgba(0,0,0,0.45), inset 0 3px 0 #fffdf7, inset 0 -5px 0 #ecd9b8;
  animation: panelIn 0.3s cubic-bezier(.2,.9,.3,1.35);
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(26px) scale(0.94); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.panel.wide { max-width: min(94vw, 720px); width: min(94vw, 720px); }

.panel h2 {
  font-size: 34px;
  color: #3c7a1e;
  letter-spacing: 2px;
  text-shadow: 0 2px 0 #d7ecc8, 0 4px 0 rgba(60,122,30,0.18);
  margin-bottom: 16px;
}

.panel p { color: #57452c; font-weight: bold; }

/* ---------- how to play ---------- */

.howGrid { display: flex; flex-direction: column; gap: 13px; text-align: left; }
.howRow { display: flex; align-items: center; gap: 14px; background: rgba(126,227,107,0.1); border: 2px solid #d9edcb; border-radius: 14px; padding: 10px 14px; }
.howRow p { flex: 1; font-size: 15.5px; color: #4c3b22; }
.howRow .key { white-space: nowrap; }

kbd {
  display: inline-block;
  background: linear-gradient(#fff, #e8ddc8);
  border: 2px solid #b09b74;
  border-bottom-width: 4px;
  border-radius: 8px;
  padding: 3px 9px;
  font-family: var(--font);
  font-weight: bold;
  font-size: 13px;
  color: #57452c;
  min-width: 30px;
  text-align: center;
}
kbd.wide { padding: 3px 12px; }

.glyph { display: inline-block; position: relative; width: 44px; height: 44px; flex-shrink: 0; }

.howBlob::before {
  content: ""; position: absolute; inset: 6px;
  background: radial-gradient(circle at 35% 30%, #ffe98a, #ffd23e 65%);
  border: 3px solid #a86e08; border-radius: 50%;
}
.howHeart::before {
  content: ""; position: absolute; inset: 9px 5px;
  background: #ff5d7d;
  clip-path: path("M12 21 C-4 10, 3 -2, 12 6 C 21 -2, 28 10, 12 21 Z");
  transform: scale(1.15);
}
.howCrown::before {
  content: ""; position: absolute; inset: 8px 4px;
  background: #ffd23e;
  clip-path: polygon(0 78%, 0 22%, 25% 48%, 50% 8%, 75% 48%, 100% 22%, 100% 78%);
}

/* ---------- shop ---------- */

.shopBalance { font-size: 17px; color: #57452c; margin-bottom: 10px; }
.shopBalance b { display: inline-flex; align-items: center; gap: 6px; }

.shopTabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 8px; }

.tierChips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.tierChip {
  --tc: #7ec850;
  font-family: var(--font);
  font-weight: bold;
  font-size: 11.5px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 2px solid var(--tc);
  background: #fff;
  color: #4c3b22;
  cursor: pointer;
  transition: all .13s;
}
.tierChip:hover { background: #fff3da; transform: translateY(-1px); }
.tierChip.active { background: var(--tc); color: #fff; box-shadow: 0 2px 0 rgba(0,0,0,0.25); }

.cellTier {
  --tc: #7ec850;
  font-size: 10px;
  font-weight: bold;
  letter-spacing: 1px;
  color: #fff;
  background: var(--tc);
  border-radius: 999px;
  padding: 1.5px 9px;
}
.cellSkill { font-size: 11px; color: #8d4fd4; font-weight: bold; min-height: 13px; }
.cellStats { font-size: 10.5px; color: #6a5a3c; font-weight: bold; letter-spacing: 0.5px; }

.cellBars { width: 100%; display: flex; flex-direction: column; gap: 2px; }
.cellBars .bar { display: flex; align-items: center; gap: 4px; }
.cellBars .bl { font-size: 8.5px; font-weight: bold; color: #8a6b3c; width: 22px; text-align: left; letter-spacing: 0.5px; }
.cellBars .track { flex: 1; height: 5px; background: rgba(0,0,0,0.1); border-radius: 999px; overflow: hidden; }
.cellBars .fill { display: block; height: 100%; border-radius: 999px; box-shadow: inset 0 -1.5px 0 rgba(0,0,0,0.2); }

.devIndicator {
  margin-top: 12px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 1.5px;
  color: #8a6b3c;
  opacity: 0.65;
}
.shopTab {
  font-family: var(--font); font-weight: bold; font-size: 15px;
  padding: 8px 20px;
  border-radius: 999px;
  border: 2.5px solid #caa36a;
  background: #fff;
  color: #8a6b3c;
  cursor: pointer;
  transition: all .15s;
}
.shopTab.active { background: linear-gradient(#93ef6e, #46c02e); color: #fff; border-color: #2c8a17; box-shadow: 0 3px 0 #2c8a17; }
.shopTab:hover:not(.active) { background: #fff3da; }

.shopScroll { max-height: 46vh; overflow-y: auto; padding: 4px; }
.shopGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px;
  justify-items: stretch;
}

.shopCell {
  font-family: var(--font);
  background: #fff;
  border: 3px solid #e3d2ae;
  border-radius: 18px;
  padding: 10px 8px 9px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform .12s, box-shadow .12s, border-color .12s;
  box-shadow: 0 3px 0 #d8c49b;
}
.shopCell:hover { transform: translateY(-3px); border-color: #7ec850; box-shadow: 0 7px 0 #c9b58a; }
.shopCell.equipped { border-color: var(--green-dark); background: #f0ffe8; }
.shopCell.locked { opacity: 0.82; }
.shopCell.locked .cellPreview { filter: grayscale(0.45) brightness(0.96); }

.cellPreview { width: 76px; height: 76px; }
.glyphPreview { display:flex; align-items:center; justify-content:center; }

.cellName { font-weight: bold; font-size: 13.5px; color: #4c3b22; }
.cellState { font-size: 12.5px; font-weight: bold; min-height: 18px; }
.price { color: #a86e08; }
.useTag { color: #2f9e2a; }
.equippedTag { color: #fff; background: var(--green-dark); border-radius: 999px; padding: 2px 10px; font-size: 11px; }
.lockNote { color: #8d4fd4; font-size: 11.5px; }

.glyph.noneGlyph { color:#b7a37c; font-weight:bold; font-size: 26px; }
.bubbleGlyph i { display:inline-block; width:12px; height:12px; margin: 2px; border-radius:50%; border:2px solid #8fdcff; background: rgba(190,235,255,.5); vertical-align: middle; }
.starGlyph { color: #ffd23e; font-size: 13px; letter-spacing: 2px; text-shadow: 0 0 6px rgba(255,210,62,.6); }
.rainbowGlyph { width: 54px; height: 14px; border-radius: 999px; background: linear-gradient(90deg, red, orange, yellow, lime, cyan, blue, violet); opacity: .8; }

.themeCell .themeSwatch {
  width: 76px; height: 56px; border-radius: 12px; border: 2px solid rgba(0,0,0,0.18);
  position: relative; overflow: hidden;
}
.themeSwatch span { position: absolute; width: 14px; height: 14px; border-radius: 50%; }
.themeSwatch span:first-child { top: 8px; left: 10px; }
.themeSwatch span:last-child { bottom: 8px; right: 12px; }

/* ---------- king completion reward (lab) ---------- */

.kingRequirement {
  display: flex; flex-direction: column; gap: 1px; align-items: center;
  line-height: 1.25;
}
.unlockedTag {
  color: #fff;
  background: linear-gradient(#ffd98a, #f0a41e);
  border: 2px solid #a86e08;
  border-radius: 999px;
  padding: 2px 11px;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-shadow: 0 1px 0 rgba(120,75,8,0.4);
}
.cellTrigger { font-size: 10px; color: #41b6ee; font-weight: bold; min-height: 12px; letter-spacing: 0.3px; }

/* ---------- encyclopedia (book / field guide) ---------- */

.bookPanel {
  width: min(94vw, 900px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 18% 0%, rgba(255,246,214,0.9), transparent 46%),
    repeating-linear-gradient(0deg, #fdf6e3 0 26px, #fbf1dc 26px 27px),
    #fdf6e3;
  border: 5px solid #8a5c28;
  outline: 3px solid #caa36a;
  outline-offset: -10px;
  border-radius: 14px 22px 22px 14px;
  box-shadow:
    0 20px 44px rgba(0,0,0,0.5),
    inset 14px 0 22px -14px rgba(90,55,15,0.35),
    inset -14px 0 22px -14px rgba(90,55,15,0.35);
  padding: 18px 30px 14px;
  animation: panelIn 0.3s cubic-bezier(.2,.9,.3,1.35);
}

.bookHead h2 {
  font-size: clamp(21px, 3vw, 30px);
  color: #5c4200;
  letter-spacing: 2px;
  text-shadow: none;
  margin-bottom: 8px;
}
.bookEmoji { filter: drop-shadow(0 2px 0 rgba(120,80,20,0.35)); margin-right: 4px; }
.bookSub {
  color: #9d4fd4;
  font-size: 0.72em;
  letter-spacing: 5px;
  vertical-align: middle;
}

.bookTabs { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.bookTab {
  font-family: var(--font); font-weight: bold; font-size: 13px;
  padding: 6px 15px;
  border-radius: 999px;
  border: 2px solid #b09b74;
  background: #fffbef;
  color: #57452c;
  cursor: pointer;
  transition: all .14s;
}
.bookTab:hover { background: #fff3da; transform: translateY(-1px); }
.bookTab.active {
  background: linear-gradient(#ffd98a, #f0a41e);
  color: #5c4200;
  border-color: #8a5c28;
  box-shadow: 0 3px 0 #8a5c28;
}

.bookPage {
  flex: 1;
  overflow-y: auto;
  column-gap: 26px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tierHeader {
  --tc: #7ec850;
  display: flex; align-items: center; gap: 10px;
  margin-top: 6px;
}
.tierHeader::before, .tierHeader::after {
  content: "";
  flex: 1; height: 2px;
  background: linear-gradient(90deg, transparent, #d9c79e);
}
.tierHeader::after { background: linear-gradient(90deg, #d9c79e, transparent); }
.tierHeader span {
  font-size: 14px; font-weight: bold; letter-spacing: 3px;
  color: var(--tc);
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}

.encyEntry {
  display: flex;
  gap: 14px;
  align-items: stretch;
  background: rgba(255,252,240,0.85);
  border: 2px solid #e3d2ae;
  border-left: 6px solid #caa36a;
  border-radius: 14px;
  padding: 10px 12px;
  break-inside: avoid;
}
.slimeEntry { border-left-color: #7ec850; }
.kingEntry {
  border-left-color: #ff5d8f;
  background: linear-gradient(120deg, #fff4f8, #fffdf2);
  box-shadow: 0 3px 0 rgba(255,93,143,0.25), inset 0 0 0 1px rgba(255,93,143,0.25);
}
.bossEntry { border-left-color: #9d4fd4; }
.finalBoss {
  border-left-color: #f0a41e;
  background: linear-gradient(120deg, #fff8e0, #fffdf2);
  box-shadow: 0 3px 0 rgba(240,164,30,0.3);
}
.worldEntry { flex-direction: column; border-left-color: #41b6ee; }

.encyPortrait {
  width: 96px; height: 96px;
  flex-shrink: 0;
  background: rgba(126,227,107,0.1);
  border-radius: 14px;
  border: 2px solid rgba(138,107,60,0.22);
  align-self: center;
}
.encyPortrait.big { width: 116px; height: 116px; }

.encyBody { flex: 1; text-align: left; min-width: 0; }
.encyBody.wide { text-align: center; }

.encyTitle {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.encyTitle b { font-size: 19px; color: #4c3b22; letter-spacing: 1px; }
.roleTag {
  font-size: 10.5px; font-weight: bold;
  color: #fff; background: #8aa2b8;
  border-radius: 999px; padding: 2px 10px;
  letter-spacing: 0.6px;
}
.finalTag {
  font-size: 11px; font-weight: bold;
  color: #5c4200;
  background: linear-gradient(#ffe27a, #f0a41e);
  border: 2px solid #a86e08;
  border-radius: 999px;
  padding: 2.5px 12px;
  letter-spacing: 1px;
  animation: finalGlow 1.6s ease-in-out infinite alternate;
}
@keyframes finalGlow {
  from { box-shadow: 0 0 4px rgba(240,164,30,0.4); }
  to { box-shadow: 0 0 14px rgba(240,164,30,0.85); }
}

.statRow {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  font-size: 11px; font-weight: bold; letter-spacing: 0.5px;
  color: #8a6b3c;
  margin-bottom: 6px;
}
.statRow b { color: #4c3b22; font-size: 12.5px; }

.skillBlock {
  font-size: 12px;
  color: #5c4a2e;
  line-height: 1.42;
  background: rgba(126,227,107,0.09);
  border: 1.5px solid #e0eccd;
  border-radius: 10px;
  padding: 7px 10px;
  margin-bottom: 5px;
}
.skillBlock i { color: #8a6b3c; font-style: normal; font-weight: bold; letter-spacing: 0.4px; }
.skillName {
  font-size: 13.5px; font-weight: bold;
  color: #8d4fd4;
  letter-spacing: 1.5px;
  margin-bottom: 3px;
}

.identity { font-size: 12px; color: #8a6b3c; font-style: italic; }

.priceTag {
  font-size: 11px; font-weight: bold;
  color: #a86e08;
  background: rgba(240,164,30,0.14);
  border: 1.5px solid #e0c37a;
  border-radius: 999px;
  padding: 2px 10px;
  letter-spacing: 0.4px;
}
.priceTag.reward {
  color: #5c4200;
  background: linear-gradient(#ffe27a, #f0a41e);
  border-color: #a86e08;
}
.requirementRow {
  font-size: 11.5px; font-weight: bold;
  color: #9d4fd4;
  margin-bottom: 5px;
  letter-spacing: 0.3px;
}

.bossSub { font-size: 12.5px; font-weight: bold; color: #8a6b3c; margin-bottom: 5px; }

.worldBanner {
  border-radius: 10px;
  padding: 9px 14px;
  display: flex; align-items: baseline; gap: 12px;
  border: 2px solid rgba(0,0,0,0.14);
}
.worldNum {
  font-size: 12px; font-weight: bold; letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 1.5px 0 rgba(0,0,0,0.35);
}
.worldBanner b { color: #fff; font-size: 17px; letter-spacing: 1.5px; text-shadow: 0 2px 0 rgba(0,0,0,0.3); }

.howRow {
  display: flex; align-items: baseline; gap: 12px;
  background: rgba(126,227,107,0.08);
  border: 1.5px dashed #cdbd93;
  border-radius: 10px;
  padding: 7px 12px;
}
.rowLabel {
  white-space: nowrap;
  font-size: 12px; font-weight: bold;
  color: #3c7a1e;
  letter-spacing: 0.6px;
  min-width: 118px;
}
.howRow p { flex: 1; font-size: 12.5px; color: #5c4a2e; font-weight: normal; }

.bookFoot {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin-top: 8px;
}
.folio {
  font-size: 12.5px; font-weight: bold; letter-spacing: 1px;
  color: #8a6b3c;
  background: rgba(202,163,106,0.16);
  border: 1.5px solid #d9c79e;
  border-radius: 999px;
  padding: 4px 16px;
}
.pageBtn {
  width: 38px; height: 38px;
  font-family: var(--font);
  font-size: 24px; font-weight: bold;
  line-height: 1;
  color: #5c4200;
  background: linear-gradient(#fff, #f0e2c2);
  border: 2.5px solid #b09b74;
  border-bottom-width: 5px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform .1s;
}
.pageBtn:hover:not(:disabled) { transform: scale(1.08); }
.pageBtn:active:not(:disabled) { transform: translateY(2px); border-bottom-width: 2.5px; }
.pageBtn:disabled { opacity: 0.35; cursor: default; }

.bookPanel .btn.back { margin-top: 10px; align-self: center; }

/* ---------- achievements ---------- */

.achList { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.achRow {
  display: flex; align-items: center; gap: 13px;
  background: #fff;
  border: 2.5px solid #e3d2ae;
  border-radius: 14px;
  padding: 9px 13px;
}
.achMedal {
  width: 44px; height: 44px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe98a, #f0a41e);
  border: 3px solid #c9922a;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  filter: grayscale(1) opacity(0.55);
  transition: filter .2s, transform .2s;
}
.achRow.got { border-color: #7ec850; background: #f4ffe9; }
.achRow.got .achMedal { filter: none; transform: rotate(-8deg) scale(1.06); }
.achBody b { display: block; color: #4c3b22; font-size: 15px; }
.achBody span { color: #8a6b3c; font-size: 12.5px; }
.achCheck { margin-left: auto; color: #2f9e2a; font-size: 24px; font-weight: bold; }

/* ---------- settings ---------- */

.setRow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 30px;
  background: rgba(126,227,107,0.1);
  border: 2px solid #d9edcb;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 10px;
  color: #4c3b22;
  font-weight: bold;
}
.setRow.small { justify-content: center; font-size: 13px; color: #8a6b3c; border-style: dashed; }

.toggle {
  width: 54px; height: 28px;
  border-radius: 999px;
  border: 2.5px solid #b09b74;
  background: #d9cdb4;
  cursor: pointer;
  position: relative;
  transition: background .18s, border-color .18s;
  flex-shrink: 0;
}
.toggle .knob {
  position: absolute; top: 2px; left: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 3px rgba(0,0,0,0.3);
  transition: transform .18s cubic-bezier(.2,.9,.3,1.4);
}
.toggle.on { background: linear-gradient(#93ef6e, #46c02e); border-color: #2c8a17; }

.dangerZone { margin-top: 16px; display: flex; justify-content: center; }

.checkRow {
  display: flex; align-items: center; gap: 9px;
  font-weight: bold; color: #4c3b22;
  margin-bottom: 10px;
  cursor: pointer;
}
.checkRow input { width: 18px; height: 18px; accent-color: #46c02e; }

.confirmPanel p { font-size: 18px; margin-bottom: 18px; }
.confirmRow { display: flex; gap: 12px; justify-content: center; }
.confirmRow .btn { min-width: 120px; }

/* ---------- HUD ---------- */

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; font-family: var(--font); }
#hud button { pointer-events: auto; }

.hudTopLeft { position: absolute; top: 14px; left: 16px; display: flex; align-items: center; gap: 10px; }
.lvlBadge {
  background: linear-gradient(#93ef6e, #46c02e);
  color: #fff;
  font-weight: bold;
  font-size: 17px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 3px solid rgba(25,80,15,0.55);
  box-shadow: 0 3px 0 #2c8a17, 0 5px 8px rgba(0,0,0,0.3);
  text-shadow: 0 1.5px 0 rgba(20,90,10,0.5);
  letter-spacing: 1px;
}
.xpBar {
  width: clamp(110px, 16vw, 220px); height: 16px;
  background: rgba(15,22,15,0.55);
  border-radius: 999px;
  border: 2.5px solid rgba(255,255,255,0.35);
  overflow: hidden;
}

.abilityChip {
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(15,22,15,0.6);
  border: 2px solid rgba(255,210,62,0.5);
  border-radius: 999px;
  padding: 4px 12px;
  width: max-content;
}
.abilityChip.ready { border-color: rgba(126,227,107,0.8); box-shadow: 0 0 12px rgba(126,227,107,0.35); }
.abilityChip #abilityName { color: #fff; font-size: 11.5px; font-weight: bold; letter-spacing: 1px; }
.abilityChip .abBar { width: 62px; height: 6px; background: rgba(0,0,0,0.5); border-radius: 999px; overflow: hidden; display: inline-block; }
.abilityChip .abBar span { display: block; height: 100%; background: #ffd23e; border-radius: 999px; transition: width .2s ease; }
.abilityChip #abilityLabel { color: rgba(255,255,255,0.9); font-size: 10.5px; font-weight: bold; }

.stageChip {
  margin-top: 3px;
  display: inline-block;
  background: rgba(15,22,15,0.55);
  color: rgba(255,255,255,0.92);
  font-size: 12.5px;
  font-weight: bold;
  letter-spacing: 1px;
  padding: 4px 14px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.22);
}
.stageChip.boss { border-color: rgba(255,93,93,0.7); color: #ff8a8a; box-shadow: 0 0 14px rgba(255,93,93,0.35); }
#xpFill {
  height: 100%; width: 0%;
  background: linear-gradient(#c8fa7d, #5ad938);
  border-radius: 999px;
  transition: width .18s ease-out;
  box-shadow: inset 0 -3px 0 rgba(0,70,0,0.35);
}

.hudTopCenter { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); text-align: center; }
.scoreVal {
  color: #fff;
  font-weight: bold;
  font-size: clamp(26px, 3.4vw, 40px);
  text-shadow: 0 3px 0 rgba(20,25,15,0.65), 0 0 18px rgba(255,255,255,0.18);
  letter-spacing: 1px;
}
.comboWrap { display: flex; flex-direction: column; align-items: center; gap: 2px; opacity: 0; transform: scale(0.7); transition: all .18s cubic-bezier(.2,.9,.3,1.5); }
.comboWrap.active { opacity: 1; transform: scale(1); }
.comboVal {
  color: var(--yellow);
  font-weight: bold;
  font-size: 24px;
  text-shadow: 0 2.5px 0 rgba(90,50,0,0.8);
  display: inline-block;
}
.comboVal.pop { animation: comboPop .22s cubic-bezier(.2,.9,.3,1.6); }
@keyframes comboPop { 0% {transform: scale(1.55);} 100% {transform: scale(1);} }
.comboBarWrap { display:block; width: 90px; height: 6px; background: rgba(0,0,0,0.45); border-radius: 999px; overflow: hidden; }
#comboBar { display:block; height: 100%; background: var(--yellow); transform-origin: left; border-radius: 999px; }

.hudTopRight { position: absolute; top: 14px; right: 16px; display: flex; align-items: center; gap: 12px; }
.bestHud {
  color: rgba(255,255,255,0.92);
  font-weight: bold; font-size: 15px;
  background: rgba(15,22,15,0.5);
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.22);
}
.pauseBtn {
  width: 42px; height: 42px;
  border-radius: 14px;
  border: 3px solid rgba(20,50,80,0.55);
  background: linear-gradient(#67b7ff, #2e86d9);
  box-shadow: 0 4px 0 #1d5c99, 0 6px 10px rgba(0,0,0,0.3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .1s;
}
.pauseBtn:hover { transform: scale(1.07); }
.pauseBtn:active { transform: translateY(2px); box-shadow: 0 2px 0 #1d5c99; }

.heartsRow { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 7px; }
.heart {
  width: 30px; height: 27px;
  display: inline-block;
  background: radial-gradient(circle at 35% 30%, #ff8ba3, #ff5d7d 70%);
  clip-path: path("M15 27 C-2 15, 2 -2, 15 7 C 28 -2, 32 15, 15 27 Z");
  filter: drop-shadow(0 2.5px 0 rgba(120,10,35,0.75));
  animation: heartBeat 1.4s ease-in-out infinite;
}
.heart:nth-child(2) { animation-delay: .15s; }
.heart:nth-child(3) { animation-delay: .3s; }
.heart:nth-child(n+4) { animation-delay: .45s; }
@keyframes heartBeat { 0%,100% { transform: scale(1);} 12% {transform: scale(1.12);} 24%{transform:scale(1);} }
.heart.lost { background: rgba(40,46,55,0.55); filter: drop-shadow(0 2.5px 0 rgba(0,0,0,0.4)); animation: none; }
.heart.armor {
  background: radial-gradient(circle at 35% 30%, #ffe98a, #ffc02e 70%);
  animation-duration: .9s;
}

.powerChips { position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 7px; align-items: flex-end; }
.chip {
  --pc: #fff;
  color: #fff;
  font-weight: bold; font-size: 13.5px;
  background: rgba(15,22,15,0.62);
  border: 2.5px solid var(--pc);
  border-radius: 999px;
  padding: 5px 13px;
  text-shadow: 0 1.5px 0 rgba(0,0,0,0.6);
  box-shadow: 0 0 12px color-mix(in srgb, var(--pc) 55%, transparent);
  animation: chipIn .22s cubic-bezier(.2,.9,.3,1.5);
}
@keyframes chipIn { from { transform: translateX(30px); opacity: 0;} to { transform: none; opacity: 1;} }

.bossWrap {
  position: absolute; top: 96px; left: 50%; transform: translateX(-50%);
  width: min(430px, 56vw);
  text-align: center;
}
.bossWrap span {
  color: var(--purple);
  font-weight: bold;
  font-size: 17px;
  letter-spacing: 2px;
  text-shadow: 0 2px 0 rgba(40,10,60,0.8);
}
.bossHp {
  margin-top: 4px;
  height: 18px;
  background: rgba(20,10,30,0.6);
  border-radius: 999px;
  border: 2.5px solid rgba(199,125,255,0.55);
  overflow: hidden;
}
#bossHpFill {
  height: 100%; width: 100%;
  background: linear-gradient(#e3a8ff, #8d4fd4);
  border-radius: 999px;
  transition: width .2s ease;
  box-shadow: inset 0 -4px 0 rgba(50,10,80,0.4);
}

.tutHint {
  position: absolute;
  left: 50%; bottom: 13vh;
  transform: translateX(-50%);
  background: rgba(15,22,15,0.72);
  color: #fff;
  font-weight: bold;
  font-size: 19px;
  padding: 12px 26px;
  border-radius: 999px;
  border: 2.5px solid rgba(126,227,107,0.7);
  text-shadow: 0 2px 0 rgba(0,0,0,0.5);
  animation: tutFloat 1.6s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes tutFloat { 0%,100% { transform: translate(-50%, 0);} 50% { transform: translate(-50%, -7px);} }

/* ---------- announce / toast ---------- */

#announce {
  position: fixed; top: 17vh; left: 0; right: 0;
  display: flex; justify-content: center;
  pointer-events: none; z-index: 20;
}
#announceText {
  font-weight: bold;
  font-size: clamp(30px, 4.4vw, 52px);
  letter-spacing: 3px;
  opacity: 0;
  transform: scale(0.6);
}
#announce.show #announceText { animation: announceIn 2.2s cubic-bezier(.2,.9,.3,1.3) forwards; }
@keyframes announceIn {
  0% { opacity: 0; transform: scale(0.5) translateY(-30px); }
  12% { opacity: 1; transform: scale(1.12) translateY(0); }
  20% { transform: scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.05) translateY(-8px); }
}

#toastWrap {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 40;
  display: flex; flex-direction: column-reverse; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  --tc: #ffd23e;
  background: rgba(18,24,18,0.88);
  color: var(--tc);
  font-weight: bold;
  font-size: 16px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 2.5px solid var(--tc);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4), 0 0 14px color-mix(in srgb, var(--tc) 40%, transparent);
  animation: toastIn .3s cubic-bezier(.2,.9,.3,1.5);
  transition: opacity .4s, transform .4s;
  white-space: nowrap;
}
.toast.out { opacity: 0; transform: translateY(-14px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.85);} to { opacity: 1; transform: none;} }

/* ---------- upgrade ---------- */

.upHead { text-align: center; margin-bottom: 20px; }
#upgradeScreen { flex-direction: column; gap: 6px; }
.levelUpTitle {
  font-size: clamp(38px, 5vw, 56px);
  color: var(--yellow);
  letter-spacing: 4px;
  text-shadow: 0 4px 0 rgba(120,70,0,0.75), 0 0 30px rgba(255,210,62,0.4);
  animation: titlePop .45s cubic-bezier(.2,.9,.3,1.6);
}
@keyframes titlePop { from { transform: scale(.4); opacity: 0;} to { transform: scale(1); opacity: 1;} }
.upHead p { color: rgba(255,255,255,0.9); font-weight: bold; text-shadow: 0 2px 0 rgba(0,0,0,0.5); margin-top: 4px; }

.upgradeCards { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; padding: 0 3vw; }

.card {
  --rarity: #7ec850;
  font-family: var(--font);
  width: 208px;
  background: linear-gradient(#fffdf6, #f4ead2);
  border: 4px solid var(--rarity);
  border-radius: 22px;
  padding: 18px 14px 16px;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: 0 8px 0 color-mix(in srgb, var(--rarity) 55%, #333), 0 14px 22px rgba(0,0,0,0.4);
  transition: transform .13s cubic-bezier(.2,.9,.3,1.5), box-shadow .13s;
  animation: cardIn .38s cubic-bezier(.2,.9,.3,1.4) backwards;
  position: relative;
}
.card:hover { transform: translateY(-8px) scale(1.04); }
.card:active { transform: translateY(-2px) scale(0.99); }
@keyframes cardIn { from { opacity: 0; transform: translateY(46px) rotateZ(-3deg) scale(.85);} to { opacity: 1; } }

.card.rarity-common { --rarity: #5aa53c; }
.card.rarity-rare { --rarity: #3d8fd6; }
.card.rarity-epic { --rarity: #9d4fd4; }
.card.rarity-rare::after, .card.rarity-epic::after {
  content: attr(data-rar);
}
.card.rarity-rare::before, .card.rarity-epic::before {
  position: absolute; top: -14px; right: -10px;
  font-size: 12px; font-weight: bold;
  color: #fff;
  padding: 3px 11px;
  border-radius: 999px;
  letter-spacing: 1px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}
.card.rarity-rare::before { content: "RARE"; background: #3d8fd6; }
.card.rarity-epic::before { content: "EPIC"; background: #9d4fd4; }

.cardIcon { width: 84px; height: 84px; background: rgba(126,227,107,0.12); border-radius: 18px; border: 2.5px solid rgba(0,0,0,0.08); }
.cardName { font-weight: bold; font-size: 19px; color: #4c3b22; }
.cardDesc { font-size: 13.5px; color: #7a6240; font-weight: bold; min-height: 36px; }
.cardLevel { font-size: 12.5px; font-weight: bold; color: #fff; background: var(--rarity); padding: 3px 12px; border-radius: 999px; }

/* ---------- game over ---------- */

.goPanel { min-width: min(88vw, 400px); padding: 18px 28px; }
#goTitle { color: #d64545; text-shadow: 0 2px 0 #f5d3c0, 0 4px 0 rgba(160,40,30,0.15); }
#goTitle.gold { color: #d69e1e; text-shadow: 0 2px 0 #fdf0cf, 0 4px 0 rgba(180,130,20,0.25); }

.goScoreBig { margin: 0 0 10px; }
.goScoreBig span { display:block; font-size: 13px; letter-spacing: 3px; color: #8a6b3c; font-weight: bold; }
.goScoreBig b { font-size: clamp(36px, 5.5vw, 54px); color: #4c3b22; text-shadow: 0 3px 0 #e6d3ac; }

.goStats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.goStat {
  background: rgba(126,227,107,0.12);
  border: 2px solid #dcecc9;
  border-radius: 13px;
  padding: 6px 4px;
}
.goStat span { display:block; font-size: 10.5px; letter-spacing: 1.5px; color: #8a6b3c; font-weight: bold; }
.goStat b { font-size: 19px; color: #4c3b22; }
.goStat.gold { border-color: #f0d48a; background: rgba(255,210,62,0.16); }
.goStat.gold b { color: #a8730a; }

.goDaily { font-size: 13.5px; color: #8a6b3c; margin-bottom: 10px; min-height: 17px; }
.enterHint { font-size: 12px; color: #b09b74; margin-top: 10px; }

.goPanel .btn.big { animation: btnPulse 1.5s ease-in-out infinite; }
@keyframes btnPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.goPanel .btn { display: block; margin: 7px auto 0; }

/* ---------- touch controls ---------- */

#touchUI { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
.touchBtn {
  position: absolute;
  width: 76px; height: 76px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.5);
  background: rgba(20,30,20,0.45);
  color: #fff;
  font-family: var(--font);
  font-weight: bold;
  font-size: 15px;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
}
#btnDashTouch { right: 26px; bottom: 108px; }
#joyBase {
  position: absolute; left: 40px; bottom: 60px;
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.35);
  background: rgba(20,30,20,0.3);
  pointer-events: none;
}
#joyKnob {
  position: absolute; left: 50%; top: 50%;
  width: 52px; height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: #caa36a; border-radius: 999px; border: 2px solid var(--panel); }
::-webkit-scrollbar-track { background: transparent; }
