html, body {
  margin: 0;
  height: 100%;
  background: #0a060e;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  font-family: 'Alegreya', Georgia, serif;
}

#game {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  image-rendering: pixelated;
}

#back {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 30;
  font: 600 13px 'Cinzel', serif;
  color: #f6e3b8;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(26, 14, 30, 0.55);
  border: 1px solid rgba(224, 176, 64, 0.45);
  backdrop-filter: blur(4px);
}
#back:hover { background: rgba(60, 30, 50, 0.75); }

/* Location banner */
#banner {
  position: fixed;
  top: 11%;
  left: 50%;
  transform: translate(-50%, -12px);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.9s ease, transform 0.9s ease;
  z-index: 20;
}
#banner.show { opacity: 1; transform: translate(-50%, 0); }
#banner .b-title {
  font: 900 clamp(28px, 5vw, 54px) 'Cinzel Decorative', serif;
  color: #f6d573;
  background: linear-gradient(#fff7d6, #f6d573 45%, #d9982c 60%, #b0701e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 6px rgba(30, 10, 30, 0.8));
}
#banner .b-sub {
  margin-top: 2px;
  font: 600 clamp(12px, 1.8vw, 18px) 'Cinzel', serif;
  letter-spacing: 0.25em;
  color: #fdebc8;
  text-shadow: 0 2px 6px rgba(20, 8, 24, 0.9);
}
#banner .b-sub::before, #banner .b-sub::after { content: ' ❧ '; color: #e0b040; }

/* Clock */
#clock {
  position: fixed;
  top: 12px;
  left: 14px;
  z-index: 20;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  font: 600 13px 'Cinzel', serif;
  color: #f6e3b8;
  background: rgba(26, 14, 30, 0.55);
  border: 1px solid rgba(224, 176, 64, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.6s;
}
#clock.show { opacity: 1; }
#clock .ico { color: #f6d573; margin-right: 7px; font-size: 15px; }

/* Controls hint */
#hint {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 10px;
  font: 500 14px 'Alegreya', serif;
  color: #fbe9c8;
  background: rgba(26, 14, 30, 0.55);
  border: 1px solid rgba(224, 176, 64, 0.35);
  opacity: 0;
  transition: opacity 1s;
  pointer-events: none;
}
#hint.show { opacity: 1; }
#hint b { color: #f6d573; font-weight: 700; }

/* Dialogue */
#dialogue {
  position: fixed;
  left: 50%;
  bottom: 4vh;
  width: min(760px, 92vw);
  transform: translate(-50%, 30px);
  opacity: 0;
  pointer-events: none;
  z-index: 25;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#dialogue.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#dialogue .dlg-box {
  position: relative;
  padding: 22px 28px 24px;
  min-height: 72px;
  background: linear-gradient(#fdf5df, #efdcb0);
  border: 3px solid #7a4a24;
  border-radius: 14px;
  box-shadow: 0 0 0 3px #e0b040, 0 0 0 6px #5a2f16, 0 14px 30px rgba(10, 4, 16, 0.55);
  font: 500 clamp(16px, 2.2vw, 21px)/1.45 'Alegreya', serif;
  color: #3e2616;
}
#dialogue .dlg-name {
  position: absolute;
  top: -20px;
  left: 22px;
  padding: 4px 16px;
  font: 700 clamp(13px, 1.6vw, 16px) 'Cinzel', serif;
  letter-spacing: 0.06em;
  color: #fff3d6;
  background: linear-gradient(#c9683c, #8e3f24);
  border: 2px solid #e0b040;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}
#dialogue .dlg-next {
  position: absolute;
  right: 18px;
  bottom: 8px;
  color: #8e3f24;
  font-size: 14px;
  opacity: 0;
}
#dialogue.done .dlg-next { opacity: 1; animation: nudge 0.9s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(3px); } }

/* Touch controls */
#touch { display: none; }
#touch.show { display: block; }
#stick {
  position: fixed;
  left: 22px;
  bottom: 22px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(rgba(255, 240, 210, 0.18), rgba(255, 240, 210, 0.06));
  border: 2px solid rgba(224, 176, 64, 0.45);
  z-index: 22;
  touch-action: none;
}
#knob {
  position: absolute;
  left: 40px;
  top: 40px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3d0, #e0b040 60%, #9a6a1c);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}
.tbtn {
  position: fixed;
  z-index: 22;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 22px 'Cinzel', serif;
  color: #fff3d6;
  border: 2px solid #e0b040;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tbtn.on { transform: scale(0.92); filter: brightness(1.2); }
#btnA { right: 26px; bottom: 60px; background: radial-gradient(circle at 35% 30%, #e58a5c, #8e3f24); }
#btnB { right: 106px; bottom: 26px; width: 56px; height: 56px; font-size: 13px; background: radial-gradient(circle at 35% 30%, #5f8fd6, #1d3f73); }
#btnX { right: 106px; bottom: 98px; width: 52px; height: 52px; font-size: 18px; background: radial-gradient(circle at 35% 30%, #c9685a, #6e2a20); }
#btnT { right: 36px; bottom: 146px; width: 50px; height: 50px; font-size: 11px; letter-spacing: 0.5px; background: radial-gradient(circle at 35% 30%, #8a8a9a, #3a3a4a); }
@media (pointer: coarse) { #hint { display: none; } }
body.touch #hint { display: none; }
@media (max-width: 520px) {
  #stick { width: 110px; height: 110px; left: 16px; bottom: 16px; }
  #knob { left: 32px; top: 32px; width: 46px; height: 46px; }
  #btnA { right: 18px; bottom: 50px; width: 62px; height: 62px; }
  #btnB { right: 90px; bottom: 20px; }
  #btnX { right: 92px; bottom: 84px; width: 46px; height: 46px; }
  #btnT { right: 26px; bottom: 124px; width: 44px; height: 44px; font-size: 10px; }
}

/* ---------- Purse & bag ---------- */
.coin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  vertical-align: -3px;
  background: radial-gradient(circle at 35% 30%, #fff4c0, #e8b640 55%, #9a6a14);
  box-shadow: inset 0 0 0 1.5px #8a5a14, 0 1px 2px rgba(0, 0, 0, 0.4);
  position: relative;
}
.coin::after {
  content: '';
  position: absolute;
  inset: 4px 5px;
  border-radius: 50% 50% 40% 40%;
  background: #b98424;
  opacity: 0.55;
}
#purse, #bagBtn {
  position: fixed;
  top: 48px;
  z-index: 20;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  font: 700 14px 'Cinzel', serif;
  color: #f6e3b8;
  background: rgba(26, 14, 30, 0.55);
  border: 1px solid rgba(224, 176, 64, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.6s;
}
#purse { left: 14px; display: flex; align-items: center; gap: 7px; }
#purse small { font: 600 11px 'Cinzel', serif; opacity: 0.75; }
#purse.show, #bagBtn.show { opacity: 1; }
#purse.bump { animation: bump 0.5s ease; }
@keyframes bump { 30% { transform: scale(1.18); background: rgba(120, 80, 20, 0.8); } }
#bagBtn { left: 160px; cursor: pointer; display: flex; align-items: center; gap: 7px; }
#bagBtn:hover { background: rgba(60, 30, 50, 0.75); }
.bag-ico {
  width: 14px;
  height: 14px;
  border-radius: 3px 3px 6px 6px;
  background: linear-gradient(#b0703a, #6b4226);
  box-shadow: inset 0 3px 0 #8a5a34, 0 0 0 1px #3a2010;
}

/* ---------- Toasts ---------- */
#toasts {
  position: fixed;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 26;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  font: 700 15px 'Cinzel', serif;
  color: #5a2a14;
  background: linear-gradient(#fdf5df, #efdcb0);
  border: 2px solid #e0b040;
  box-shadow: 0 6px 16px rgba(10, 4, 16, 0.45);
  animation: toastIn 0.35s ease;
  transition: opacity 0.5s, transform 0.5s;
}
.toast img { width: 27px; height: 27px; image-rendering: pixelated; }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.9); } }

/* ---------- Panels (bag / shop) ---------- */
#panel {
  position: fixed;
  inset: 0;
  z-index: 28;
  display: grid;
  place-items: center;
  background: rgba(12, 6, 18, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#panel.show { opacity: 1; pointer-events: auto; }
.panel-box {
  position: relative;
  width: min(560px, 92vw);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  padding: 20px 22px 14px;
  background: linear-gradient(#fdf5df, #efdcb0);
  border: 3px solid #7a4a24;
  border-radius: 14px;
  box-shadow: 0 0 0 3px #e0b040, 0 0 0 6px #5a2f16, 0 20px 40px rgba(10, 4, 16, 0.6);
  color: #3e2616;
  transform: translateY(10px);
  transition: transform 0.2s;
}
#panel.show .panel-box { transform: none; }
.panel-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: none;
  font-size: 26px;
  color: #8e3f24;
  cursor: pointer;
}
.panel-title { font: 900 24px 'Cinzel Decorative', serif; color: #5a2a14; text-align: center; margin-bottom: 10px; }
.panel-body { overflow-y: auto; padding-right: 4px; }
.panel-foot { margin-top: 10px; text-align: center; font: 600 13px 'Cinzel', serif; color: #8e5a34; }
.pmsg { color: #8e3f24; }
.psec { font: 700 13px 'Cinzel', serif; letter-spacing: 0.12em; color: #8e3f24; margin: 12px 0 6px; border-bottom: 1px solid rgba(142, 63, 36, 0.3); }
.pempty { font: italic 500 15px 'Alegreya', serif; color: #7a5a3a; padding: 4px 2px; }
.prow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid transparent;
}
.prow.buy { cursor: pointer; }
.prow.buy:hover { background: rgba(224, 176, 64, 0.18); }
.prow.sel { background: rgba(224, 176, 64, 0.28); border-color: #e0b040; }
.prow img { width: 45px; height: 45px; image-rendering: pixelated; flex: none; }
.pinfo { flex: 1; }
.pname { font: 700 16px 'Cinzel', serif; color: #5a2a14; }
.pdesc { font: 500 14px/1.3 'Alegreya', serif; color: #5a4030; }
.pright { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font: 700 15px 'Cinzel', serif; color: #5a2a14; white-space: nowrap; }
.price { display: flex; align-items: center; gap: 5px; }
.owned { font: 500 12px 'Alegreya', serif; color: #8e5a34; }
.pquest { font: 500 15px/1.35 'Alegreya', serif; padding: 6px 10px; margin-bottom: 6px; border-left: 3px solid #e0b040; background: rgba(255, 255, 255, 0.3); border-radius: 4px; }
.pquest.done { opacity: 0.6; border-color: #6f9c43; }

/* ---------- Dialogue portrait & choices ---------- */
.dlg-portrait {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 80px;
  height: 72px;
  image-rendering: pixelated;
  border-radius: 12px;
  background: radial-gradient(circle at 50% 40%, #fff8e4, #e8cf98);
  box-shadow: inset 0 0 0 2px #c99a3a;
}
#dialogue.has-portrait .dlg-box { padding-left: 112px; min-height: 84px; }
.dlg-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dlg-choice {
  font: 700 15px 'Cinzel', serif;
  color: #5a2a14;
  padding: 6px 14px;
  border-radius: 999px;
  border: 2px solid #c99a3a;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}
.dlg-choice.sel { background: linear-gradient(#c9683c, #8e3f24); color: #fff3d6; border-color: #e0b040; }
@media (max-width: 520px) {
  #dialogue.has-portrait .dlg-box { padding-left: 84px; }
  .dlg-portrait { width: 60px; height: 54px; left: 12px; }
  #bagBtn { top: 84px; left: 14px; }
}

/* ---------- Battle ---------- */
body.in-battle #clock, body.in-battle #purse, body.in-battle #bagBtn, body.in-battle #hint, body.in-battle #banner, body.in-battle #touch { display: none !important; }
#battle { position: fixed; inset: 0; z-index: 24; pointer-events: none; display: none; }
#battle.show { display: block; }
.bp {
  position: absolute;
  width: min(300px, 44vw);
  padding: 10px 14px 12px;
  background: linear-gradient(#fdf5df, #efdcb0);
  border: 3px solid #7a4a24;
  border-radius: 12px 12px 12px 4px;
  box-shadow: 0 0 0 2px #e0b040, 0 8px 18px rgba(10, 4, 16, 0.45);
  color: #3e2616;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.3s, transform 0.3s;
}
.bp.show { opacity: 1; transform: none; }
.bp.foe { top: 5vh; left: 4vw; }
.bp.me { right: 4vw; bottom: calc(26vh + 14px); border-radius: 12px 12px 4px 12px; transform: translateX(20px); }
.bp.me.show { transform: none; }
.bp-top { display: flex; justify-content: space-between; align-items: baseline; font: 700 clamp(14px, 2vw, 19px) 'Cinzel', serif; color: #5a2a14; }
.bp-lv { font-size: 0.8em; color: #8e3f24; }
.bp-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.bp-type, .tbadge {
  font: 700 10px 'Cinzel', serif;
  letter-spacing: 0.08em;
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  flex: none;
}
.bp-hp { flex: 1; display: flex; align-items: center; gap: 6px; }
.bp-hp b { font: 900 11px 'Cinzel', serif; color: #e0b040; background: #5a2a14; padding: 1px 5px; border-radius: 4px; }
.bp-hp .bar { flex: 1; height: 10px; border-radius: 6px; background: #4a3020; box-shadow: inset 0 0 0 2px #2a1a10; overflow: hidden; }
.bp-hp .bar i { display: block; height: 100%; width: 100%; border-radius: 6px; transition: background 0.3s; }
.bp-hpnum { text-align: right; font: 700 13px 'Cinzel', serif; color: #5a2a14; margin-top: 4px; }
.bp-xp { height: 5px; margin-top: 5px; border-radius: 3px; background: #c8b088; overflow: hidden; }
.bp-xp i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #5a9ad8, #8ec8f0); }
.bbox {
  position: absolute;
  left: 2vw;
  right: 2vw;
  bottom: 2vh;
  height: 24vh;
  min-height: 120px;
  display: flex;
  gap: 14px;
  padding: 16px 20px;
  background: linear-gradient(#fdf5df, #efdcb0);
  border: 3px solid #7a4a24;
  border-radius: 14px;
  box-shadow: 0 0 0 3px #e0b040, 0 0 0 6px #5a2f16, 0 14px 30px rgba(10, 4, 16, 0.55);
  pointer-events: auto;
}
.btext { flex: 1; font: 500 clamp(17px, 2.4vw, 24px)/1.4 'Alegreya', serif; color: #3e2616; }
.bmenu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-content: center; width: min(420px, 52%); }
.bmenu:empty { display: none; }
.bmenu.wide { grid-template-columns: 1fr; max-height: 100%; overflow-y: auto; }
.bbtn {
  --c: #8e3f24;
  font: 700 clamp(13px, 1.7vw, 17px) 'Cinzel', serif;
  color: #fff8e8;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  background: linear-gradient(color-mix(in srgb, var(--c) 80%, white), var(--c));
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
}
.bbtn.fight { --c: #b0402a; }
.bbtn.team { --c: #3d8f6a; }
.bbtn.bag { --c: #b8861c; }
.bbtn.run { --c: #2f6db5; }
.bbtn.back { --c: #6a5a4a; grid-column: 1 / -1; padding: 4px; font-size: 13px; }
.bbtn.sel { outline: 3px solid #f6d573; outline-offset: 1px; transform: translateY(-1px); }
.bbtn.off { opacity: 0.45; cursor: default; }
.bbtn .mt { font: 600 11px 'Alegreya', serif; opacity: 0.9; text-transform: none; }
.bbtn .mv small { font-size: 0.75em; opacity: 0.85; }
@media (max-width: 700px) {
  .bbox { flex-direction: column; height: auto; min-height: 30vh; }
  .bmenu { width: 100%; }
  .bp.me { bottom: calc(34vh + 14px); }
}

/* ---------- Starter picker & creature rows ---------- */
#panel.wide .panel-box { width: min(900px, 94vw); }
#panel.wide .panel-close { display: none; }
.starters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 700px) { .starters { grid-template-columns: 1fr; } }
.scard {
  padding: 12px;
  border-radius: 14px;
  border: 3px solid #c99a3a;
  background: radial-gradient(circle at 50% 30%, #fffaf0, #f0dcb0);
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.scard.sel { transform: translateY(-4px); box-shadow: 0 0 0 3px #f6d573, 0 10px 22px rgba(90, 40, 20, 0.35); border-color: #e0b040; }
.scard canvas { width: 128px; height: 120px; image-rendering: pixelated; }
.sname { font: 900 20px 'Cinzel Decorative', serif; color: #5a2a14; margin: 4px 0; }
.smyth { font: 500 14px/1.35 'Alegreya', serif; color: #5a4030; margin-top: 8px; }
.prow.creature .cimg { width: 64px; height: auto; }
.pname small { font-size: 0.75em; color: #8e3f24; }
.mini-hp, .mini-xp { height: 7px; border-radius: 4px; background: #4a3020; overflow: hidden; margin: 4px 0 2px; max-width: 220px; }
.mini-xp { height: 4px; background: #c8b088; }
.mini-hp i, .mini-xp i { display: block; height: 100%; }
.mini-xp i { background: #5a9ad8; }
.prow.creature small { font: 600 12px 'Cinzel', serif; color: #5a2a14; }

/* ---------- Mythopedia & garden ---------- */
.dex-count { text-align: center; font: 600 14px 'Cinzel', serif; color: #8e3f24; margin-bottom: 10px; }
.dex { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.dcard {
  position: relative;
  padding: 8px 6px 10px;
  border-radius: 12px;
  border: 2px solid #c99a3a;
  background: radial-gradient(circle at 50% 35%, #fffaf0, #efdcb0);
  text-align: center;
  cursor: pointer;
}
.dcard:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(90, 40, 20, 0.25); }
.dcard.unknown { cursor: default; opacity: 0.85; background: radial-gradient(circle at 50% 35%, #efe4cc, #d8c49c); }
.dcard img { width: 96px; height: 84px; object-fit: contain; image-rendering: pixelated; }
.dname { font: 700 13px 'Cinzel', serif; color: #5a2a14; margin: 2px 0 4px; }
.dstar { position: absolute; top: 6px; right: 8px; color: #e0b040; font-size: 16px; text-shadow: 0 0 4px #fff; }
.dexd { display: flex; gap: 18px; align-items: center; }
.dexd img { width: 192px; image-rendering: pixelated; flex: none; }
.dcaught { font: 700 12px 'Cinzel', serif; color: #8e3f24; margin-left: 6px; }
@media (max-width: 600px) { .dexd { flex-direction: column; text-align: center; } }
.dexbtn { margin-bottom: 6px; font: 700 13px 'Cinzel', serif; color: #fff3d6; padding: 6px 14px; border-radius: 999px; border: 2px solid #e0b040; background: linear-gradient(#c9683c, #8e3f24); cursor: pointer; }
.garden { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .garden { grid-template-columns: 1fr; } }
.gbtn { font: 700 11px 'Cinzel', serif; color: #5a2a14; border: 1px solid #c99a3a; background: #fff6de; border-radius: 999px; padding: 2px 8px; cursor: pointer; }
.lead { font: 700 12px 'Cinzel', serif; color: #b8861c; }

/* ---------- Laurels & save indicator ---------- */
#laurels {
  position: fixed;
  top: 84px;
  left: 14px;
  z-index: 20;
  display: none;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(26, 14, 30, 0.55);
  border: 1px solid rgba(224, 176, 64, 0.45);
}
#laurels.show { display: flex; }
.lw {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px dotted rgba(200, 190, 170, 0.45);
  box-sizing: border-box;
}
.lw.on {
  border: 3px dotted #7cc45a;
  box-shadow: 0 0 8px rgba(246, 213, 115, 0.8), inset 0 0 0 2px #e0b040;
}
#saved {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 20;
  font: 700 13px 'Cinzel', serif;
  color: #f6d573;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
}
#saved.show { animation: savedFade 2.4s ease; }
@keyframes savedFade { 15% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
body.in-battle #laurels, body.in-battle #saved { display: none !important; }
@media (max-width: 520px) { #laurels { top: 120px; } }

/* ---------- Menu button & pause ---------- */
#menuBtn.show { display: block; }
#menuBtn {
  display: none;
  position: fixed;
  top: 10px;
  right: 14px;
  z-index: 30;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  color: #f6e3b8;
  background: rgba(26, 14, 30, 0.55);
  border: 1px solid rgba(224, 176, 64, 0.45);
  cursor: pointer;
  backdrop-filter: blur(4px);
}
#menuBtn:hover { background: rgba(60, 30, 50, 0.75); }
#back { right: 60px; }
body.in-battle #menuBtn { display: none; }
#pause {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(12, 6, 18, 0.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#pause.show { opacity: 1; pointer-events: auto; }
.pause-box {
  width: min(460px, 92vw);
  padding: 20px 24px 16px;
  background: linear-gradient(#fdf5df, #efdcb0);
  border: 3px solid #7a4a24;
  border-radius: 14px;
  box-shadow: 0 0 0 3px #e0b040, 0 0 0 6px #5a2f16, 0 20px 40px rgba(10, 4, 16, 0.6);
  color: #3e2616;
}
.pause-rows { display: flex; flex-direction: column; gap: 6px; }
.prow2 {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 2px solid transparent;
  font: 700 15px 'Cinzel', serif;
  color: #5a2a14;
}
.prow2.sel { border-color: #e0b040; background: rgba(224, 176, 64, 0.2); }
.prow2 > span { width: 110px; }
.prow2 input[type='range'] { flex: 1; accent-color: #b0532f; }
.prow2 b { width: 44px; text-align: right; font-size: 13px; }
.pbtn {
  width: 100%;
  font: 700 16px 'Cinzel', serif;
  color: #fff3d6;
  padding: 8px;
  border-radius: 999px;
  border: 2px solid #e0b040;
  background: linear-gradient(#c9683c, #8e3f24);
  cursor: pointer;
}
.seg { display: flex; gap: 4px; flex: 1; }
.seg button {
  flex: 1;
  font: 700 12px 'Cinzel', serif;
  padding: 5px 4px;
  border-radius: 999px;
  border: 1px solid #c99a3a;
  background: #fff6de;
  color: #5a2a14;
  cursor: pointer;
}
.seg button.on { background: linear-gradient(#c9683c, #8e3f24); color: #fff3d6; }
.pause-msg { text-align: center; font: 700 14px 'Cinzel', serif; color: #3d7a2a; height: 20px; margin-top: 6px; opacity: 0; }
.pause-msg.show { animation: savedFade 2.4s ease; }
.pause-help { margin-top: 8px; font: 500 13px/1.4 'Alegreya', serif; color: #6a4a30; text-align: center; }
@media (pointer: coarse) { .pause-help { display: none; } }
body.touch .pause-help { display: none; }

/* ---------- Floating touch stick ---------- */
#stickZone {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 55vw;
  height: 65vh;
  z-index: 21;
  touch-action: none;
}
#touch.show #stick { opacity: 0.55; transition: opacity 0.2s; pointer-events: none; }
#touch.show #stick.active { opacity: 1; }
