/* Ťapkova cesta — the game renders into one fixed frame (W × 720 virtual pixels, see resize() in game.js).
   Everything inside #ui is laid out for a 720 px tall screen and scaled uniformly, like a console game. */

/* Fonts (SIL Open Font License, see assets/fonts/OFL-*.txt): Nunito for UI, Fraunces for titles. */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('assets/fonts/nunito-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('assets/fonts/nunito-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/fraunces-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/fraunces-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/fraunces-latin-ext-wght-italic.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('assets/fonts/fraunces-latin-wght-italic.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --gold: #f1c17a;
  --gold-light: #ffdc9c;
  --gold-dim: #d6b777;
  --ink: #fff4d9;
  --text: #e6e0cc;
  --muted: #a9b9ae;
  --panel: #0a1d19e8;
  --panel-solid: #0b201b;
  --line: #e9d6a333;
  --danger: #ffb38a;
  --display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ui: 'Nunito', system-ui, 'Segoe UI', Roboto, sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #040c0a;
  color: var(--ink);
  font-family: var(--ui);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
main {
  position: relative;
  height: 100%;
}
main[data-cursor='hidden'] {
  cursor: none;
}
img {
  -webkit-user-drag: none;
}
[hidden] {
  display: none !important;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}
button:focus {
  outline: none;
}

/* ---------- Frame ---------- */
#screen {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}
#ui {
  position: absolute;
  left: 0;
  top: 0;
  height: 720px;
  transform-origin: 0 0;
  pointer-events: none;
  container-type: inline-size;
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 26px 34px;
  background: linear-gradient(#050f0dcc, transparent);
}
.hearts {
  display: flex;
  gap: 3px;
  font-size: 30px;
  line-height: 1;
}
.heart {
  color: #ff6d6d;
  text-shadow:
    0 2px 0 #7a1f25,
    0 0 10px #ff6d6d66;
}
.heart.empty {
  color: #ffffff38;
  text-shadow: 0 2px 0 #0006;
}
.hud-counters {
  display: flex;
  gap: 18px;
  margin-top: 8px;
}
.counter {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 18px;
  text-shadow: 0 2px 4px #000;
}
.counter img {
  height: 22px;
  width: 30px;
  object-fit: contain;
}
.hud-title {
  position: absolute;
  left: 0;
  right: 0;
  top: 24px;
  text-align: center;
}
.hud-title strong {
  font:
    400 22px var(--display),
    serif;
  color: var(--ink);
  text-shadow: 0 2px 8px #000;
}
.hud-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
#deaths {
  font-size: 14px;
  color: var(--text);
  margin-right: 6px;
  text-shadow: 0 1px 3px #000;
}
.hud-button {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #06130fa6;
  font-size: 17px;
  color: var(--text);
}
.hud-button:hover {
  background: #1d3a30;
}
#bossHud {
  position: absolute;
  left: 28%;
  right: 28%;
  top: 92px;
  text-align: center;
  font-size: 15px;
  letter-spacing: 3px;
  text-shadow: 0 2px 4px #000;
}
#bossHud small {
  font-size: 11px;
  color: #e5bf9f;
  margin-left: 10px;
}
#bossHud > div {
  height: 10px;
  margin-top: 9px;
  background: #1c1414cc;
  border: 1px solid #d0a07f88;
  border-radius: 5px;
  overflow: hidden;
}
#bossFill {
  display: block;
  height: 100%;
  background: linear-gradient(#ff9a6e, #d8603e);
  transition: width 0.15s;
}
#ability {
  position: absolute;
  bottom: 50px;
  left: 26px;
  max-width: 70%;
  color: #a6f4fa;
  font-size: 14px;
  letter-spacing: 1px;
  text-shadow: 0 1px 3px #000;
}
#notice {
  position: absolute;
  top: 140px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 20px;
  color: #ffe2a0;
  text-shadow:
    0 2px 8px #000,
    0 0 2px #000;
  transition: opacity 0.3s;
}
footer {
  position: absolute;
  bottom: 18px;
  left: 26px;
  right: 26px;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  letter-spacing: 1px;
  color: #e7e3c9;
  text-shadow: 0 1px 3px #000;
}
main[data-screen='overlay'] #hud,
main[data-screen='overlay'] footer,
main[data-screen='overlay'] #ability,
main[data-screen='overlay'] #notice,
main[data-screen='overlay'] #bossHud,
main[data-screen='overlay'] .level-card,
main[data-screen='overlay'] #touch {
  display: none;
}

/* Level title card: slides in, holds, fades away. */
.level-card {
  position: absolute;
  left: 0;
  right: 0;
  top: 200px;
  text-align: center;
  opacity: 0;
}
.level-card.show {
  animation: levelCard 3s ease-out both;
}
.level-card span {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--gold-light);
  text-shadow: 0 2px 6px #000;
}
.level-card strong {
  display: block;
  margin-top: 10px;
  font:
    400 64px var(--display),
    serif;
  color: #fff4dc;
  text-shadow:
    0 4px 0 #0b1d15,
    0 8px 30px #000c;
}
@keyframes levelCard {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  14%,
  70% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
    transform: translateY(-8px);
  }
}
#fader {
  position: absolute;
  inset: 0;
  background: #020605;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Overlay shell ---------- */
#overlay {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  overflow: hidden;
}
#overlay[data-view='dialog'] {
  background: #030b09a6;
  backdrop-filter: blur(5px) saturate(0.8);
}
.menu-scenery {
  position: absolute;
  inset: 0;
  background: #17352e url('assets/forest-scene.webp') center 55% / cover;
}
#overlay[data-view='dialog'] .menu-scenery {
  display: none;
}
.menu-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #04140ff0 0%, #071911d0 28%, #0a211840 58%, #0b241000 80%),
    linear-gradient(0deg, #03120fd9, transparent 38%, #061b1250);
  transition: background 0.3s;
}
#overlay[data-page='worlds'] .menu-vignette,
#overlay[data-page='collection'] .menu-vignette,
#overlay[data-page='settings'] .menu-vignette,
#overlay[data-page='controls'] .menu-vignette {
  background: linear-gradient(100deg, #051b18f7, #071b19ee 60%, #061712d6);
}
.menu-hero {
  position: absolute;
  width: 520px;
  height: 400px;
  right: 60px;
  bottom: 70px;
  filter: drop-shadow(0 18px 24px #06120ea0);
  transition:
    opacity 0.35s,
    transform 0.35s;
}
#overlay:not([data-page='title']):not([data-page='home']) .menu-hero {
  opacity: 0;
  transform: translateY(20px);
}
.hero-stone {
  position: absolute;
  width: 100%;
  height: 185px;
  bottom: 0;
  object-fit: fill;
}
.hero-dog {
  position: absolute;
  width: 290px;
  bottom: 150px;
  left: 90px;
  transform: scaleX(-1);
  animation: heroBreath 3.2s ease-in-out infinite;
  transform-origin: bottom center;
}
@keyframes heroBreath {
  50% {
    transform: scaleX(-1) scaleY(1.025);
  }
}
.hero-plush {
  position: absolute;
  width: 120px;
  bottom: 151px;
  left: 338px;
  transform: rotate(-8deg);
}
.firefly {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffe3a3;
  box-shadow: 0 0 14px 5px #e6d48666;
  animation: menuDrift 7s ease-in-out infinite;
  opacity: 0.55;
}
.f1 {
  left: 53%;
  top: 38%;
}
.f2 {
  left: 78%;
  top: 59%;
  animation-delay: -3s;
}
.f3 {
  left: 86%;
  top: 23%;
  animation-delay: -5s;
}
.f4 {
  left: 64%;
  top: 16%;
  animation-delay: -1.5s;
}
@keyframes menuDrift {
  50% {
    transform: translate(18px, -25px);
    opacity: 0.15;
  }
}
.menu-page {
  position: absolute;
  inset: 0;
  animation: pageIn 0.28s ease-out;
}
@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.menu-hints {
  position: absolute;
  right: 30px;
  bottom: 20px;
  font-size: 13px;
  letter-spacing: 0.5px;
  color: var(--muted);
}
#overlay[data-page='title'] .menu-hints {
  display: none;
}

/* ---------- Logo ---------- */
.logo {
  margin: 0;
  font-family: var(--display);
  font-weight: 560;
  line-height: 0.88;
  color: #fff1ce;
  text-shadow:
    0 4px 0 #0b1d15,
    0 10px 30px #000b;
}
.logo span {
  display: block;
  font-size: 124px;
  letter-spacing: -4px;
}
.logo em {
  display: block;
  font-size: 128px;
  letter-spacing: -3px;
  margin-left: 70px;
  color: var(--gold);
  font-weight: 620;
}
.logo-small span {
  font-size: 70px;
  letter-spacing: -2px;
}
.logo-small em {
  font-size: 74px;
  margin-left: 40px;
}

/* ---------- Title screen ---------- */
.title-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 90px 60px;
}
.tagline {
  margin: 26px 0 0 6px;
  font-size: 21px;
  letter-spacing: 1px;
  color: #d6dcc8;
  text-shadow: 0 2px 6px #000;
}
.press-start {
  margin: 64px 0 0 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--gold-light);
  text-shadow: 0 2px 8px #000;
  animation: pressBlink 1.8s ease-in-out infinite;
}
@keyframes pressBlink {
  50% {
    opacity: 0.35;
  }
}
.loader {
  margin: 64px 0 0 6px;
  width: 320px;
}
.loader-bar {
  height: 6px;
  border-radius: 3px;
  background: #ffffff1f;
  overflow: hidden;
}
.loader-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-light));
  transition: width 0.2s;
}
.loader span {
  display: block;
  margin-top: 10px;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--muted);
}
.title-screen:not([data-ready]) .press-start,
.title-screen[data-ready] .loader {
  display: none;
}
.for-touch {
  display: none;
}
@media (pointer: coarse) {
  .for-keys {
    display: none;
  }
  .for-touch {
    display: inline;
  }
}

/* ---------- Main menu ---------- */
.menu-home {
  padding: 56px 90px 0;
}
.menu-list {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-top: 34px;
}
.menu-item {
  position: relative;
  min-width: 360px;
  padding: 9px 22px 9px 48px;
  border-radius: 10px;
  text-align: left;
  font-size: 26px;
  font-weight: 700;
  color: #ddd6bf;
  text-shadow: 0 2px 6px #000a;
  transition:
    color 0.12s,
    background 0.12s,
    transform 0.12s;
}
.menu-item::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  background: var(--gold);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity 0.12s,
    transform 0.12s;
}
.menu-item.is-selected {
  color: #fff8e6;
  background: linear-gradient(90deg, #f1c17a38, #f1c17a10 70%, transparent);
  transform: translateX(8px);
}
.menu-item.is-selected::before {
  opacity: 1;
  transform: none;
}
.menu-item.danger {
  color: var(--danger);
}
.menu-fine {
  margin: 18px 0 0 16px;
  font-size: 15px;
  color: var(--muted);
}
.menu-banner {
  margin: 10px 0 0 16px;
  max-width: 520px;
  font-size: 14px;
  line-height: 1.5;
  color: #e8c489;
}
.menu-banner:empty {
  display: none;
}
.menu-status {
  position: absolute;
  left: 90px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 26px;
  font-size: 15px;
  color: var(--text);
}
.status-journey {
  color: var(--muted);
}
.status-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-item img {
  width: 28px;
  height: 22px;
  object-fit: contain;
}
.modal {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #020806b3;
  backdrop-filter: blur(4px);
}
.modal-card {
  width: 480px;
  padding: 32px 36px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-solid);
  box-shadow: 0 20px 60px #000c;
}
.modal-card h2 {
  margin: 0 0 8px;
  font: 400 40px var(--display);
}
.modal-card p {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
}
.modal-card .menu-item {
  display: block;
  width: 100%;
  font-size: 22px;
}

/* ---------- Sub pages ---------- */
.sub-page {
  padding: 34px 56px 56px;
}
.page-head {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 22px;
}
.page-head h2 {
  margin: 0;
  font: 400 44px var(--display);
  color: #f6e6c6;
  text-shadow: 0 3px 10px #000;
}
.page-sub {
  margin-left: auto;
  font-size: 15px;
  color: var(--muted);
}
.back-button {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: #06130f99;
}
.back-button.is-selected,
.small-button.is-selected {
  color: #1a2419;
  background: var(--gold);
  border-color: var(--gold);
}
.small-button {
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  background: #10251fcc;
}
.small-button:disabled {
  opacity: 0.4;
  cursor: default;
}

/* World map: the painted map keeps its 16:9 shape; nodes are placed in % of it. */
.map-page {
  background: #06120f;
}
.world-map {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(100%, 1280px);
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%);
  overflow: hidden;
  box-shadow: 0 0 80px #000;
}
.map-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: mapIn 0.6s ease-out;
}
@keyframes mapIn {
  from {
    transform: scale(1.04);
    filter: brightness(0.6);
  }
}
.map-trail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.map-trail path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#trailAll {
  stroke: #1a120899;
  stroke-width: 9;
  stroke-dasharray: 2 20;
}
#trailOpen {
  stroke: #ffe3a3;
  stroke-width: 7;
  stroke-dasharray: 2 18;
  filter: drop-shadow(0 0 6px #ffcf7a) drop-shadow(0 2px 2px #0008);
}
.map-node {
  position: absolute;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 3px solid #3b2a17;
  background: radial-gradient(circle at 35% 30%, #fff1c9, #e3a94f 60%, #a8681f);
  box-shadow:
    0 3px 0 #2a1c0c,
    0 6px 12px #000a;
  font-size: 16px;
  font-weight: 800;
  line-height: 28px;
  text-align: center;
  color: #4a2d0c;
  transition: transform 0.15s;
}
.map-node.boss {
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  line-height: 38px;
  font-size: 20px;
  background: radial-gradient(circle at 35% 30%, #ffd9c9, #d9573f 60%, #7c2415);
  color: #fff3dc;
}
.map-node.bonus {
  background: radial-gradient(circle at 35% 30%, #ffe0ea, #e3748f 60%, #8d2e46);
  color: #fff3f5;
}
.map-node.cleared {
  border-color: #fff0c4;
}
.map-node.locked {
  background: radial-gradient(circle at 35% 30%, #6c6f6a, #3a3d3a 70%);
  border-color: #1d1f1d;
  color: #c9ccc4;
  cursor: default;
}
.map-node.locked::after {
  content: '🔒';
  position: absolute;
  inset: 0;
  font-size: 13px;
  line-height: 28px;
}
.map-node.boss.locked::after {
  line-height: 38px;
}
.map-node.is-selected {
  transform: scale(1.25);
  box-shadow:
    0 3px 0 #2a1c0c,
    0 0 0 4px #fff6d8,
    0 0 24px 6px #ffd98a;
}
.map-dog {
  position: absolute;
  width: 92px;
  margin: -96px 0 0 -46px;
  transform: scaleX(-1);
  filter: drop-shadow(0 6px 4px #000a);
  pointer-events: none;
  transition:
    left 0.35s ease-in-out,
    top 0.35s ease-in-out;
  animation: dogHop 0.9s ease-in-out infinite;
}
@keyframes dogHop {
  50% {
    translate: 0 -5px;
  }
}
.map-head {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 26px 40px 60px;
  background: linear-gradient(#050d0bd9, transparent);
  pointer-events: none;
}
.map-head > * {
  pointer-events: auto;
}
/* Info bar along the bottom edge, below the lowest map node. */
.map-info {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px 24px;
  border: 1px solid #ffe3a355;
  border-radius: 16px;
  background: linear-gradient(160deg, #0f2721f2, #081a16f2);
  box-shadow: 0 12px 34px #000b;
}
.map-info-main {
  display: flex;
  flex-direction: column;
  min-width: 300px;
}
.map-info-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#overlay[data-page='worlds'] .menu-hints {
  display: none;
}
.map-info strong {
  font:
    400 30px var(--display),
    serif;
  color: #fff1ce;
}
#mapStatus {
  font-size: 16px;
  color: var(--text);
}
.map-info.locked #mapStatus {
  color: var(--muted);
}
.map-stats {
  display: flex;
  gap: 18px;
  margin-top: 0;
}
.map-stats:empty {
  display: none;
}
.map-stat {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 17px;
  font-weight: 700;
  color: #fff4dc;
}
.map-stat.bone::before,
.map-stat.capy::before {
  content: '';
  width: 30px;
  height: 22px;
  background: url('assets/bone.webp') center / contain no-repeat;
}
.map-stat.capy::before {
  background-image: url('assets/capybara.webp');
}
.map-action {
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--gold-light);
}
.map-action:empty {
  display: none;
}
#overlay[data-page='worlds'] .menu-hints {
  text-shadow: 0 1px 3px #000;
  color: #e8e2cc;
}

/* Collection */
.collection-body {
  display: grid;
  grid-template-columns: 2.1fr 1fr;
  gap: 24px;
  align-items: start;
}
.rewards-panel {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.rewards-panel h3 {
  margin: 0 0 12px;
  font: 400 24px var(--display);
  color: #e4d7b5;
}
.story-replay {
  margin-top: 14px;
}
.about-body p {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text);
}
.about-body a {
  color: var(--gold-light);
}
.controls-card .credits dt {
  font-weight: 700;
  color: var(--gold);
}
#rewards {
  margin: 0;
  padding: 0;
  list-style: none;
}
#rewards li {
  padding: 8px 0;
  border-bottom: 1px solid #ffffff0d;
  font-size: 15px;
  color: var(--text);
}
#homeNote {
  margin: 12px 4px 0;
  font-size: 15px;
  line-height: 1.5;
  color: #dfcba1;
}
.home-scene {
  position: relative;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border: 1px solid #d4c99c44;
  border-radius: 14px;
  background: #526d47 url('assets/home-garden.webp') center/cover;
}
.home-dog {
  position: absolute;
  left: 42%;
  bottom: 23%;
  width: 18%;
  z-index: 4;
}
.home-prop {
  position: absolute;
  width: 25%;
  height: 50%;
  background-image: url('assets/home-props.webp');
  background-size: 400% 200%;
  filter: drop-shadow(0 3px 2px #15271440);
}
.home-prop:hover,
.home-prop.is-selected {
  filter: drop-shadow(0 0 6px #ffecb1);
}
.home-prop-0 {
  left: 38%;
  bottom: 16%;
  background-position: 0 0;
  z-index: 1;
}
.home-prop-1 {
  left: 38%;
  bottom: 17%;
  background-size: 384% 200%;
  background-position: 33.45% 0;
  z-index: 2;
}
.home-prop-2 {
  left: 9%;
  bottom: 24%;
  background-position: 69.6% 0;
}
.home-prop-3 {
  left: 63%;
  bottom: 9%;
  background-position: 100% 0;
  z-index: 5;
}
.home-prop-4 {
  left: 67%;
  bottom: 35%;
  width: 28%;
  background-size: 360% 200%;
  background-position: 0 100%;
}
.home-prop-5 {
  left: 32%;
  bottom: 31%;
  background-size: 426% 200%;
  background-position: 37% 100%;
}
.home-prop-6 {
  left: 5%;
  bottom: 39%;
  background-position: 70.7% 100%;
}
.home-plush {
  position: absolute;
  left: 56%;
  bottom: 23%;
  width: 15%;
  z-index: 4;
  filter: drop-shadow(0 4px 3px #15271455);
}
.home-capy {
  position: absolute;
  width: 5.5%;
  z-index: 6;
}
.home-giant-capy {
  position: absolute;
  width: 25%;
  left: 38%;
  bottom: 21%;
  filter: drop-shadow(0 8px 8px #36261955);
}
.home-sleeping {
  z-index: 3;
  animation: tapkoSleep 3s ease-in-out infinite;
}
@keyframes tapkoSleep {
  50% {
    transform: translateY(3px) scaleY(0.97);
  }
}

/* Settings */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 720px;
  max-width: 100%;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 22px;
  border: 1px solid #b4c3a82e;
  border-radius: 12px;
  background: var(--panel);
  font-size: 20px;
  font-weight: 700;
  color: #e4ddc6;
  text-align: left;
  transition:
    background 0.12s,
    border-color 0.12s;
}
.setting-row.is-selected {
  border-color: var(--gold);
  background: #26311fee;
  color: #fff8e6;
}
.setting-row.accent {
  color: var(--gold-light);
}
.setting-value {
  display: flex;
  align-items: center;
  gap: 12px;
}
.setting-value b {
  min-width: 150px;
  text-align: center;
  color: var(--gold-light);
}
.setting-value i {
  font-style: normal;
  font-size: 15px;
  color: var(--gold);
  opacity: 0.35;
}
.setting-row.is-selected .setting-value i {
  opacity: 1;
}
.setting-note {
  margin: 0 0 6px 24px;
  font-size: 14px;
  color: var(--muted);
}
.settings-foot {
  margin: 18px 0 0 4px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

/* Controls */
.controls-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.controls-card {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.controls-card h3 {
  margin: 0 0 22px;
  font: 400 30px var(--display);
  color: #f0dfba;
}
.controls-card dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px 18px;
  align-items: center;
  margin: 0;
}
.controls-card dt {
  white-space: nowrap;
}
.controls-card dd {
  margin: 0;
  font-size: 17px;
  color: var(--text);
}
.controls-card .abilities dt {
  font-weight: 700;
  color: var(--gold);
}
kbd {
  display: inline-block;
  min-width: 30px;
  padding: 4px 9px;
  border: 1px solid #e9d6a366;
  border-bottom-width: 3px;
  border-radius: 6px;
  background: #142923;
  font: 700 15px var(--ui);
  text-align: center;
  color: #fff4dc;
}
.controls-note {
  margin: 18px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- Dialogs (pause, fall, world clear) ---------- */
.dialog {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pageIn 0.25s ease-out;
}
.dialog-card {
  width: 580px;
  padding: 34px 44px 30px;
  border: 1px solid #ddcda250;
  border-radius: 18px;
  background: linear-gradient(160deg, #0f2721f2, #081a16f2);
  box-shadow: 0 24px 70px #000c;
}
.eyebrow {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--gold-dim);
}
.dialog-card h1 {
  margin: 12px 0 14px;
  font: 400 60px/1 var(--display);
  letter-spacing: -2px;
  color: #fff1ce;
}
.dialog-card h1 em {
  color: var(--gold);
}
.dialog-card p {
  margin: 0;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
}
.dialog-stats {
  display: grid;
  gap: 6px;
  margin: 6px 0 4px;
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 10px 16px;
  border: 1px solid #ffffff12;
  border-radius: 10px;
  background: #ffffff08;
  animation: statIn 0.35s ease-out both;
}
.stat-name {
  min-width: 110px;
  font-size: 16px;
  color: var(--muted);
}
.stat-value {
  font-size: 24px;
  color: #fff4dc;
}
.stat.complete .stat-value {
  color: var(--gold-light);
}
.stat.complete::after {
  content: '✦ vše';
  margin-left: auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
}
.stat-note {
  margin-left: auto;
  font-size: 14px;
  color: var(--muted);
}
.stat-note.best {
  font-weight: 700;
  color: var(--gold);
}
@keyframes statIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
}
.dialog-list {
  margin: 20px 0 0 -16px;
}
.dialog-list .menu-item {
  min-width: 320px;
  font-size: 24px;
}
.dialog-card .fine {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}
.finale-scene {
  position: relative;
  width: 230px;
  height: 130px;
  margin: 0 auto 12px;
}
.finale-plush {
  position: absolute;
  width: 210px;
  bottom: 0;
  left: 0;
}
.finale-dog {
  position: absolute;
  width: 100px;
  bottom: 5px;
  left: 70px;
}
.finale-scene span {
  position: absolute;
  right: 0;
  top: 12px;
  color: #ecd4a3;
  font: 24px var(--display);
}

/* ---------- Touch controls (outside the scaled frame so they stay finger-sized) ---------- */
/* ---------- Touch controls (touch.js), laid out like Akari ---------- */
/* The layer starts below the HUD so its buttons (pause, sound, full screen) stay tappable. */
#touch {
  --s: min(9.5vh, 6.8vw);
  display: none;
  position: fixed;
  inset: 15% 0 0;
  z-index: 10;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
main[data-touch][data-screen='game']:not([data-story]) #touch {
  display: block;
}
main[data-touch] footer #hint {
  visibility: hidden;
}
.stick-base {
  position: fixed;
  transform: translate(-50%, -50%);
  border: 2px solid #ffffff59;
  border-radius: 50%;
  background: #ffffff29;
  pointer-events: none;
}
.stick-base > svg {
  position: absolute;
  inset: 8%;
  fill: #ffffff80;
}
.stick-base.active {
  border-color: #ffffff99;
  background: #10081c59;
}
.stick-base.active > svg {
  display: none;
}
.stick-knob {
  position: absolute;
  left: 29%;
  top: 29%;
  width: 42%;
  height: 42%;
  border-radius: 50%;
  background: #ffffffd9;
  display: none;
}
.stick-base.active .stick-knob {
  display: block;
}
.tbtn {
  position: fixed;
  display: grid;
  place-items: center;
  border: 2.5px solid #ffffff99;
  border-radius: 50%;
  background: #0a171e47;
  pointer-events: none;
}
.tbtn svg {
  width: 56%;
  height: 56%;
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}
.tbtn.on {
  border-color: #fff;
  background: #ffe7b08c;
}
.tbtn.on svg {
  opacity: 1;
}
.tbtn-jump {
  right: calc(var(--s) * 0.55 + env(safe-area-inset-right));
  bottom: calc(var(--s) * 0.55);
  width: calc(var(--s) * 2.1);
  height: calc(var(--s) * 2.1);
}
.tbtn-attack {
  right: calc(var(--s) * 3.09 + env(safe-area-inset-right));
  bottom: calc(var(--s) * 0.34);
  width: calc(var(--s) * 1.72);
  height: calc(var(--s) * 1.72);
}
.tbtn-dash {
  right: calc(var(--s) * 0.65 + env(safe-area-inset-right));
  bottom: calc(var(--s) * 3.2);
  width: calc(var(--s) * 1.6);
  height: calc(var(--s) * 1.6);
}
.tbtn-bite {
  right: calc(var(--s) * 3.16 + env(safe-area-inset-right));
  bottom: calc(var(--s) * 2.96);
  width: calc(var(--s) * 1.28);
  height: calc(var(--s) * 1.28);
}
/* Before the laser, attacking is biting: one button. With the laser, biting gets its own. */
#touch:not([data-laser]) .tbtn-bite,
#touch .icon-laser,
#touch[data-laser] .tbtn-attack .icon-bite {
  display: none;
}
#touch[data-laser] .tbtn-attack .icon-laser {
  display: inline;
}

/* ---------- Photo epilogue (full viewport) ---------- */
.photo-ending {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 24px;
  overflow: hidden;
  text-align: center;
  background: #100f0d;
  color: #fff4df;
}
.ending-images {
  position: absolute;
  inset: 0 0 180px;
  overflow: hidden;
}
.ending-photo,
.ending-home {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.ending-home {
  object-fit: cover;
  opacity: 1;
  animation: story-in 9s ease-out both;
}
.photo-ending[data-step='1'] .ending-home,
.photo-ending[data-step='2'] .ending-home {
  opacity: 0;
}
.photo-ending[data-step='1'] #endingPhotoOne,
.photo-ending[data-step='2'] #endingPhotoTwo {
  opacity: 1;
}
.ending-copy,
.ending-controls {
  position: relative;
  z-index: 1;
  max-width: 850px;
}
.ending-copy h2 {
  margin: 8px 0;
  font-family: var(--display);
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.1;
}
.ending-copy p {
  margin: 8px 0;
  line-height: 1.5;
}
.ending-copy .eyebrow {
  font-size: 10px;
  letter-spacing: 0.25em;
  color: #d3b87a;
}
.ending-controls button {
  margin: 8px 5px;
  padding: 12px 22px;
  border: 1px solid #dac291;
  border-radius: 8px;
  background: #dac291;
  color: #211c16;
}
.ending-controls button:focus-visible {
  outline: 3px solid white;
  outline-offset: 4px;
}
#endingMenu {
  background: transparent;
  color: #f9e8c9;
}
.ending-controls small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: #b9b0a0;
}
@media (max-height: 560px) {
  .ending-images {
    bottom: 145px;
  }
  .ending-copy h2 {
    font-size: 23px;
  }
  .ending-copy p {
    margin: 4px;
    font-size: 13px;
  }
  .ending-controls small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .firefly,
  .hero-dog,
  .press-start,
  .home-sleeping,
  .ending-home,
  .story-img,
  .rotate-phone,
  .menu-page,
  .dialog {
    animation: none;
  }
  .ending-photo,
  .ending-home {
    transition: none;
  }
}

/* Narrower screens (the frame is 880–1800 px wide): make room for the logo and menu. */
@container (max-width: 1150px) {
  .menu-hero {
    right: 10px;
    transform: scale(0.8);
    transform-origin: bottom right;
  }
}
@container (max-width: 980px) {
  .menu-hero {
    transform: scale(0.66);
  }
  .map-info-main {
    min-width: 220px;
  }
}

/* ---------- Story scenes (story.js) ---------- */
.story {
  position: absolute;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  background: #050807;
  cursor: pointer;
}
main[data-story] #touch {
  display: none;
}
.story-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.4s ease;
}
.story-img.on {
  opacity: 1;
}
/* A slow camera move over each illustration. */
.story-img[data-pan='in'] {
  animation: story-in 9s ease-out both;
}
.story-img[data-pan='left'] {
  animation: story-left 9s ease-out both;
}
.story-img[data-pan='right'] {
  animation: story-right 9s ease-out both;
}
.story-img[data-pan='up'] {
  animation: story-up 9s ease-out both;
}
@keyframes story-in {
  from {
    transform: scale(1.02);
  }
  to {
    transform: scale(1.12);
  }
}
@keyframes story-left {
  from {
    transform: scale(1.12) translateX(3%);
  }
  to {
    transform: scale(1.12) translateX(-3%);
  }
}
@keyframes story-right {
  from {
    transform: scale(1.12) translateX(-3%);
  }
  to {
    transform: scale(1.12) translateX(3%);
  }
}
@keyframes story-up {
  from {
    transform: scale(1.12) translateY(3%);
  }
  to {
    transform: scale(1.12) translateY(-2%);
  }
}
.story::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background: linear-gradient(transparent, #050807cc);
  pointer-events: none;
}
.story-caption {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 70px;
  width: min(940px, 86%);
  margin: 0;
  transform: translateX(-50%);
  font: 400 32px/1.25 var(--display);
  text-align: center;
  color: #fff4df;
  text-shadow: 0 2px 14px #000d;
  opacity: 0;
  transition: opacity 1s ease 0.8s;
}
.story-caption.on {
  opacity: 1;
}
.story-dots {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 44px;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}
.story-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff4df55;
}
.story-dots i.on {
  background: var(--gold);
}
.story-skip {
  position: absolute;
  z-index: 1;
  top: 22px;
  right: 26px;
  padding: 8px 16px;
  border: 1px solid #fff4df55;
  border-radius: 999px;
  background: #05080788;
  font: 700 14px var(--ui);
  color: #fff4df;
  cursor: pointer;
}
.story-skip:hover {
  border-color: var(--gold);
}
.story-hint {
  position: absolute;
  z-index: 1;
  right: 26px;
  bottom: 18px;
  font: 12px var(--ui);
  color: #d9d0bdaa;
}

/* ---------- Rotate hint (phones held upright) ---------- */
.rotate-veil {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: #040c0a;
  color: var(--ink);
}
@media (orientation: portrait) and (pointer: coarse) {
  .rotate-veil {
    display: flex;
  }
}
.rotate-veil p {
  margin: 18px 0 0;
  font: 400 26px var(--display);
}
.rotate-veil small {
  font: 15px var(--ui);
  color: var(--muted);
}
.rotate-phone {
  width: 54px;
  height: 92px;
  border: 4px solid var(--gold);
  border-radius: 12px;
  animation: rotate-phone 2.4s ease-in-out infinite;
}
@keyframes rotate-phone {
  0%,
  25% {
    transform: rotate(0);
  }
  60%,
  100% {
    transform: rotate(-90deg);
  }
}

/* ---------- Crash screen ---------- */
.crash-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  background: #040c0af2;
  color: var(--ink);
}
.crash-screen[hidden] {
  display: none;
}
.crash-screen h2 {
  margin: 0;
  font: 400 34px var(--display);
}
.crash-screen p {
  max-width: 520px;
  font: 17px/1.5 var(--ui);
  color: var(--text);
}
.crash-screen button {
  margin: 10px 0;
  padding: 12px 24px;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  font: 700 16px var(--ui);
  color: #211c16;
  cursor: pointer;
}
.crash-screen small {
  font: 12px var(--ui);
  color: var(--muted);
}
