/* Treze — mazmorra 16-bit (paleta propia, sin IP Nintendo) */

:root {
  --font-pixel: "Press Start 2P", ui-monospace, monospace;
  --font-dialog: VT323, "Press Start 2P", ui-monospace, monospace;
  --color-primary-900: #292546;
  --color-primary-700: #4A5DA5;
  --color-primary-600: #493F93;
  --color-primary-500: #6E7DB7;
  --color-primary-300: #B6B2D4;
  --color-primary-200: #DBDFED;
  --color-accent: #C98028;
  --color-accent-soft: #DFB37E;
  --color-accent-hover: #a9651e;
  --color-accent-shadow: #8a5618;
  --hero-deep: #0A052D;
  --hero-mid: #291F46;
  --floor-a: #292546;
  --floor-b: #322a54;
  --wall: #1a1630;
  --white: #ffffff;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --container: 420px;
  --tile: 24px;
  --cols: 16;
  --rows: 11;
  --hearts: 5;
  --hearts-max: 5;
}

*, *::before, *::after { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-dialog);
  font-size: 22px;
  font-weight: 400;
  color: var(--white);
  background: #07041a;
  image-rendering: pixelated;
}

img, svg { max-width: 100%; display: block; }

button, a { font-family: inherit; }

a { color: var(--color-accent-soft); }

:focus { outline: none; }

:focus-visible {
  outline: 3px solid var(--color-accent-soft);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateY(-140%);
  padding: 12px 16px;
  background: var(--color-accent);
  color: var(--hero-deep);
  text-decoration: none;
  z-index: 20;
  font-family: var(--font-dialog);
  font-size: 18px;
  font-weight: 700;
}

.skip-link:focus,
.skip-link:focus-visible { transform: translateY(0); }

.game-noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.9'/%3E%3C/svg%3E");
}

.game-shell {
  position: relative;
  z-index: 1;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
}

.game-brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: min(var(--container), 100%);
  margin: 0 auto 12px;
}

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

.game-brand__mark {
  margin: 0;
  font-family: var(--font-dialog);
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 18px;
  color: var(--color-accent-soft);
}

.game-brand__right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.game-brand__link {
  font-family: var(--font-dialog);
  font-size: 18px;
  color: #DBDFED;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.game-brand__link:hover { color: var(--white); }

.mute {
  appearance: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 3px solid #C98028;
  border-radius: 0;
  background: #0A052D;
  color: var(--white);
  cursor: pointer;
  box-shadow: 0 3px 0 #8a5618;
}

.mute:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 #8a5618;
}

.mute svg {
  width: 16px;
  height: 16px;
  margin: 0 auto;
  fill: currentColor;
}

.mute.is-off { color: var(--color-primary-300); }

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.btn,
.option,
.mute { touch-action: manipulation; }

.screen[hidden] { display: none !important; }

.screen {
  display: none;
  width: min(var(--container), 100%);
  margin: 0 auto;
  flex: 1;
  position: relative;
}

.screen.is-active {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#screen-win.is-active,
#screen-lose.is-active { overflow: auto; }

/* Title: muro de mazmorra + pergamino */
.title-wall {
  position: absolute;
  inset: -8px;
  z-index: 0;
  background-color: #1a1630;
  background-image:
    linear-gradient(#0e0a1c 3px, transparent 3px),
    linear-gradient(90deg, #0e0a1c 3px, transparent 3px),
    linear-gradient(#3a3358 1px, transparent 1px),
    linear-gradient(90deg, #2a2448 1px, transparent 1px);
  background-size: 48px 28px, 48px 28px, 24px 14px, 24px 14px;
  background-position: 0 0, 0 0, 0 0, 24px 14px;
  box-shadow: inset 0 0 90px #07041a;
}

.title-scroll {
  position: relative;
  z-index: 1;
  margin: auto 0;
  padding: 22px 18px 20px;
  background: #0A052D;
  border: 4px solid #C98028;
  box-shadow:
    0 0 0 4px #0A052D,
    0 0 0 8px #C98028,
    0 18px 0 rgba(0, 0, 0, .35);
}

.eyebrow {
  margin: 0 0 12px;
  font-family: var(--font-dialog);
  color: var(--color-accent-soft);
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: 18px;
}

.eyebrow--clear { color: var(--color-accent-soft); }
.eyebrow--over { color: #e8a0a0; }

.panel h1,
.panel h2,
.title-scroll h1,
.end-stage h2 {
  margin: 0;
  font-family: var(--font-pixel);
  color: #C98028;
  font-weight: 400;
  font-size: clamp(16px, 4.4vw, 22px);
  line-height: 1.35;
}

.title-scroll h1 span,
.end-stage h2 span {
  display: block;
  color: #fff;
  margin-top: 8px;
}

.lead {
  margin: 14px 0 0;
  color: #DBDFED;
  font-size: 22px;
  line-height: 1.25;
}

.title-hint {
  margin: 14px 0 0;
  font-family: var(--font-dialog);
  color: #DBDFED;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 18px;
  animation: blink-hint 1.2s steps(2, end) infinite;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 0;
  text-decoration: none;
  font-family: var(--font-pixel);
  font-size: 12px;
  line-height: 1.4;
  text-transform: uppercase;
}

.btn--primary {
  background: #C98028;
  color: #0A052D;
  border: 3px solid #DFB37E;
  box-shadow: 0 4px 0 #8a5618;
}

.btn--primary:hover { background: #DFB37E; }

.btn--primary:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #8a5618;
}

.btn--ghost {
  background: #0A052D;
  color: var(--white);
  border: 3px solid #493F93;
  box-shadow: 0 4px 0 #1a1630;
}

.btn--ghost:hover { border-color: #C98028; }

.btn--ghost:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #1a1630;
}

.btn--wide { width: 100%; }

.btn--start {
  min-width: 180px;
  min-height: 52px;
}

/* HUD SNES */
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: #0A052D;
  border: 4px solid #C98028;
  box-shadow: 0 0 0 3px #0A052D, 0 0 0 6px #8a5618;
}

.hud__vitals {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hud__lives {
  margin: 0;
  font-family: var(--font-dialog);
  font-size: 18px;
  line-height: 1;
  color: #fff;
}

.hud__room {
  margin: 0;
  font-family: var(--font-dialog);
  font-size: 18px;
  letter-spacing: .08em;
  color: #DFB37E;
}

.hearts {
  display: flex;
  align-items: center;
  gap: 4px;
}

.heart {
  width: 18px;
  height: 16px;
  color: #C98028;
  image-rendering: pixelated;
}

.heart.is-empty { color: #3a3470; }

/* Dungeon tilemap — one room */
.hud {
  align-items: center;
}

.minimap {
  display: grid;
  grid-template-columns: repeat(3, 7px);
  grid-template-rows: repeat(3, 7px);
  gap: 3px;
  margin-left: 8px;
}

.minimap i {
  display: block;
  width: 7px;
  height: 7px;
  background: #16102e;
  box-shadow: inset 0 0 0 1px #3a3470;
}

.minimap i.is-visited { background: #493F93; box-shadow: none; }
.minimap i.is-current { background: #C98028; box-shadow: 0 0 4px #C98028; }

.dungeon-wrap {
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.dungeon {
  --tile: 24px;
  position: relative;
  width: calc(var(--cols) * var(--tile));
  height: calc(var(--rows) * var(--tile));
  background: #07041a;
  border: 4px solid #C98028;
  box-shadow: 0 0 0 3px #0A052D, 0 0 0 6px #8a5618;
  image-rendering: pixelated;
  overflow: hidden;
}

.dungeon-wrap.is-hurt .dungeon {
  box-shadow:
    0 0 0 3px #0A052D,
    0 0 0 6px #8a5618,
    inset 0 0 50px rgba(73, 63, 147, .4);
}

.dungeon.is-fade {
  filter: brightness(.35);
}

.dungeon__tiles {
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--tile));
  grid-template-rows: repeat(var(--rows), var(--tile));
  width: 100%;
  height: 100%;
}

.tile {
  position: relative;
  width: var(--tile);
  height: var(--tile);
  display: block;
  image-rendering: pixelated;
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.tile--floor-1 { background-image: url("../img/floor_1.png"); }
.tile--floor-2 { background-image: url("../img/floor_2.png"); }
.tile--floor-3 { background-image: url("../img/floor_3.png"); }
.tile--floor-4 { background-image: url("../img/floor_4.png"); }
.tile--floor-5 { background-image: url("../img/floor_5.png"); }
.tile--floor-6 { background-image: url("../img/floor_6.png"); }

.tile--wall-n { background-image: url("../img/wall_top_mid.png"); }
.tile--wall-s { background-image: url("../img/wall_mid.png"); }
.tile--wall-w { background-image: url("../img/wall_left.png"); }
.tile--wall-e { background-image: url("../img/wall_right.png"); }
.tile--wall-nw { background-image: url("../img/wall_top_left.png"); }
.tile--wall-ne { background-image: url("../img/wall_top_right.png"); }
.tile--wall-sw { background-image: url("../img/wall_left.png"); }
.tile--wall-se { background-image: url("../img/wall_right.png"); }

.tile--column::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/column.png") no-repeat center bottom;
  background-size: 100% auto;
  image-rendering: pixelated;
  z-index: 2;
  pointer-events: none;
  display: none;
}

.tile--banner::after {
  content: "";
  position: absolute;
  inset: -20% 10% auto 10%;
  height: 140%;
  background: url("../img/wall_banner_yellow.png") no-repeat center top;
  background-size: contain;
  image-rendering: pixelated;
  z-index: 2;
  pointer-events: none;
  display: none;
}

.prop--torch {
  width: 14px;
  height: 22px;
  z-index: 6;
}
.prop--torch::before {
  content: "";
  position: absolute;
  left: 5px;
  bottom: 0;
  width: 4px;
  height: 11px;
  background: #1a1630;
  box-shadow: 1px 0 0 #C98028, -1px 0 0 #0A052D;
}
.prop--torch::after {
  content: "";
  position: absolute;
  left: 2px;
  top: -1px;
  width: 10px;
  height: 11px;
  background: #C98028;
  box-shadow: 0 0 10px 3px rgba(201, 128, 40, .85), 2px 2px 0 #a9651e;
  animation: torch-flicker .28s steps(2) infinite;
}
.prop--torch-nw { left: calc(var(--tile) * 3); top: 2px; }
.prop--torch-ne { left: calc(var(--tile) * 12); top: 2px; }
.prop--torch-sw { left: calc(var(--tile) * 3); top: calc(var(--tile) * 10); }
.prop--torch-se { left: calc(var(--tile) * 12); top: calc(var(--tile) * 10); }

@keyframes torch-flicker {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: .72; transform: scale(.86, 1.08); }
}

.prop {
  position: absolute;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  pointer-events: none;
  z-index: 3;
}

.prop--door {
  width: calc(var(--tile) * 2);
  height: calc(var(--tile) * 2);
  background-image: url("../img/doors_leaf_closed.png");
}

.dungeon.is-open-exit .prop--door-exit {
  background-image: url("../img/doors_leaf_open.png");
}

.dungeon[data-exit="east"] .prop--door-exit,
.dungeon[data-enter="east"] .prop--door-enter {
  left: calc(var(--tile) * 14);
  top: calc(var(--tile) * 4);
}
.dungeon[data-exit="west"] .prop--door-exit,
.dungeon[data-enter="west"] .prop--door-enter {
  left: 0;
  top: calc(var(--tile) * 4);
}
.dungeon[data-exit="south"] .prop--door-exit,
.dungeon[data-enter="south"] .prop--door-enter {
  left: calc(var(--tile) * 7);
  top: calc(var(--tile) * 9);
}
.dungeon[data-exit="north"] .prop--door-exit,
.dungeon[data-enter="north"] .prop--door-enter {
  left: calc(var(--tile) * 7);
  top: 0;
}

.prop--pit { display: none; }

.prop--chest {
  width: var(--tile);
  height: var(--tile);
  left: calc(var(--tile) * 7);
  top: calc(var(--tile) * 5);
  background-image: url("../img/chest_full_open_anim_f0.png");
  z-index: 3;
}
.prop--chest.is-open {
  background-image: url("../img/chest_empty_open_anim_f2.png");
}


/* Room variants: furniture + mobs */
.dungeon[data-variant="0"] .furn-col-nw::after,
.dungeon[data-variant="0"] .furn-col-ne::after,
.dungeon[data-variant="0"] .furn-ban-a::after,
.dungeon[data-variant="0"] .furn-ban-b::after { display: block; }

.dungeon[data-variant="1"] .furn-ban-a::after { display: block; }

.dungeon[data-variant="2"] .furn-col-sw::after,
.dungeon[data-variant="2"] .furn-col-se::after,
.dungeon[data-variant="2"] .furn-ban-b::after { display: block; }

.dungeon[data-variant="3"] .furn-ban-a::after,
.dungeon[data-variant="3"] .furn-ban-b::after,
.dungeon[data-variant="3"] .furn-ban-c::after,
.dungeon[data-variant="3"] .furn-ban-d::after { display: block; }

.dungeon[data-variant="4"] .furn-col-nw::after,
.dungeon[data-variant="4"] .furn-col-se::after { display: block; }
.dungeon[data-variant="4"] .dungeon__tiles { filter: brightness(.78) saturate(.85); }

.dungeon[data-variant="5"] .furn-col-ne::after,
.dungeon[data-variant="5"] .furn-col-sw::after,
.dungeon[data-variant="5"] .furn-ban-c::after { display: block; }

.dungeon[data-variant="6"] .furn-col-ne::after,
.dungeon[data-variant="6"] .furn-ban-a::after,
.dungeon[data-variant="6"] .furn-ban-b::after { display: block; }

.prop--mob {
  display: none;
  width: 32px;
  height: 32px;
  margin-left: -4px;
  margin-top: -12px;
  z-index: 4;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  animation: mob-idle .72s steps(4) infinite;
}
.prop--mob-goblin { background-image: url("../img/mob_goblin.png"); background-size: 128px 32px; }
.prop--mob-imp { background-image: url("../img/mob_imp.png"); background-size: 128px 32px; }
.prop--mob-skelet { background-image: url("../img/mob_skelet.png"); background-size: 128px 32px; }
.prop--mob-zombie { background-image: url("../img/mob_zombie.png"); background-size: 128px 32px; }
.prop--mob-orc {
  width: 32px;
  height: 46px;
  margin-top: -26px;
  background-image: url("../img/mob_orc.png");
  background-size: 128px 46px;
}
.prop--mob-muddy { background-image: url("../img/mob_muddy.png"); background-size: 128px 32px; }
.prop--mob-necro {
  width: 32px;
  height: 46px;
  margin-top: -26px;
  background-image: url("../img/mob_necro.png");
  background-size: 128px 46px;
}

.dungeon[data-variant="0"] .prop--mob-goblin { display: block; left: calc(var(--tile) * 4); top: calc(var(--tile) * 3); }
.dungeon[data-variant="1"] .prop--mob-imp { display: block; left: calc(var(--tile) * 11); top: calc(var(--tile) * 3); }
.dungeon[data-variant="2"] .prop--mob-skelet { display: block; left: calc(var(--tile) * 4); top: calc(var(--tile) * 7); }
.dungeon[data-variant="3"] .prop--mob-zombie { display: block; left: calc(var(--tile) * 11); top: calc(var(--tile) * 7); }
.dungeon[data-variant="4"] .prop--mob-orc { display: block; left: calc(var(--tile) * 4); top: calc(var(--tile) * 3); }
.dungeon[data-variant="5"] .prop--mob-muddy { display: block; left: calc(var(--tile) * 11); top: calc(var(--tile) * 7); }
.dungeon[data-variant="6"] .prop--mob-necro { display: block; left: calc(var(--tile) * 11); top: calc(var(--tile) * 3); }

@keyframes mob-idle {
  to { background-position: -128px 0; }
}

.prop--mob.is-attack {
  z-index: 6;
  animation:
    mob-idle .72s steps(4) infinite,
    mob-lunge .36s cubic-bezier(.22, .61, .36, 1) both;
}

@keyframes mob-lunge {
  0% { transform: translate(0, 0) scale(1); }
  55% { transform: translate(var(--dx, 0), var(--dy, 0)) scale(1.18); }
  100% { transform: translate(0, 0) scale(1); }
}

/* Hero — 0x72 knight sheet, 22x28 cells at 2x */
.hero {
  position: absolute;
  top: 0;
  left: 0;
  width: 44px;
  height: 56px;
  z-index: 5;
  pointer-events: none;
  overflow: visible;
  will-change: transform;
  margin-left: -10px;
  margin-top: -32px;
}

.hero__juice {
  width: 44px;
  height: 56px;
  transform-origin: center bottom;
}

.hero[data-facing="left"] .hero__juice { transform: scaleX(-1); }
.hero[data-facing="left"] .hero__juice.is-pop,
.hero[data-facing="left"] .hero__juice.is-shake { transform: scaleX(-1); }

.hero.is-dead {
  z-index: 5;
}
.hero.is-dead .hero__juice,
.hero.is-dead .hero__juice.is-pop,
.hero.is-dead .hero__juice.is-shake,
.hero.is-dead[data-facing="left"] .hero__juice {
  transform: rotate(90deg);
  transform-origin: 50% 80%;
  filter: grayscale(.35) brightness(.75);
  animation: none;
  transition: transform .28s ease, filter .28s ease;
}

.hero__sprite,
.hero__sprite.is-end-down {
  display: block;
  width: 44px;
  height: 56px;
  image-rendering: pixelated;
  background-image: url("../img/hero.png");
  background-repeat: no-repeat;
  background-size: 176px 168px;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .55));
}

.hero[data-anim="idle"][data-frame="0"] .hero__sprite { background-position: 0 0; }
.hero[data-anim="idle"][data-frame="1"] .hero__sprite { background-position: -44px 0; }
.hero[data-anim="idle"][data-frame="2"] .hero__sprite { background-position: -88px 0; }
.hero[data-anim="idle"][data-frame="3"] .hero__sprite { background-position: -132px 0; }
.hero[data-anim="run"][data-frame="0"] .hero__sprite { background-position: 0 -56px; }
.hero[data-anim="run"][data-frame="1"] .hero__sprite { background-position: -44px -56px; }
.hero[data-anim="run"][data-frame="2"] .hero__sprite { background-position: -88px -56px; }
.hero[data-anim="run"][data-frame="3"] .hero__sprite { background-position: -132px -56px; }
.hero.is-down .hero__sprite,
.hero[data-anim="down"] .hero__sprite,
.hero__sprite.is-end-down { background-position: 0 -112px; }

.hero__juice.is-pop { animation: player-pop .45s var(--ease); }
.hero__juice.is-shake { animation: player-shake .42s ease; }

/* Dialogue box */
.dialog {
  margin-top: 10px;
  padding: 12px 14px 12px;
  background: #0A052D;
  border: 4px solid #C98028;
  box-shadow: 0 0 0 3px #0A052D, 0 0 0 6px #8a5618;
}

.dialog__kicker {
  margin: 0 0 8px;
  font-family: var(--font-dialog);
  color: var(--color-accent-soft);
  font-size: 18px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.dialog__prompt {
  margin: 0 0 12px;
  font-family: var(--font-dialog);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 400;
}

.options { display: grid; gap: 6px; }

.option {
  appearance: none;
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  text-align: left;
  border: 2px solid #493F93;
  border-radius: 0;
  background: #16102e;
  color: var(--white);
  font-size: 20px;
  line-height: 1.2;
  cursor: pointer;
}

.option:hover,
.option:focus-visible {
  border-color: #C98028;
  background: #1c1638;
}

.option:disabled {
  cursor: default;
  opacity: .7;
}

.option__cursor {
  flex: none;
  color: var(--color-accent-soft);
  font-family: var(--font-dialog);
  font-size: 18px;
  line-height: 24px;
}

.option__key {
  flex: none;
  font-family: var(--font-dialog);
  font-size: 18px;
  color: #DFB37E;
  line-height: 24px;
}

.option__label { flex: 1; }

.feedback { display: none; }
.feedback.is-open { display: block; }

.feedback__text {
  margin: 0 0 12px;
  color: #DBDFED;
  font-size: 22px;
  line-height: 1.25;
}

.options.is-hidden,
.feedback:not(.is-open) { display: none; }

.end-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
  padding: 8px 0 20px;
}

.end-sprite {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  background: #0A052D;
  border: 4px solid #C98028;
  image-rendering: pixelated;
}

.end-sprite .hero__sprite {
  width: 48px;
  height: 48px;
}

.end-sprite--down .hero__sprite {
  transform: none;
}

.end-sprite--dead .hero__sprite {
  background-position: 0 -112px;
  transform: rotate(90deg);
  transform-origin: 50% 80%;
  filter: grayscale(.35) brightness(.75);
}

.pixel-chest {
  width: 36px;
  height: 28px;
  background: #8a5618;
  box-shadow:
    inset 0 10px 0 #C98028,
    inset 0 -3px 0 #3d2a14,
    inset 4px 0 0 #3d2a14,
    inset -4px 0 0 #3d2a14;
  position: relative;
}

.pixel-chest.is-open {
  background: #C98028;
  box-shadow: inset 0 8px 0 #DFB37E, inset 0 -3px 0 #8a5618;
}

.pixel-chest::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  width: 6px;
  height: 6px;
  background: #DFB37E;
  transform: translateX(-50%);
}

.end-block {
  margin-top: 4px;
  padding: 14px;
  background: #0A052D;
  border: 4px solid #493F93;
}

.end-block h3 {
  margin: 0 0 8px;
  font-family: var(--font-pixel);
  font-size: 14px;
  line-height: 1.5;
  color: var(--color-accent-soft);
}

.end-block p {
  margin: 0 0 12px;
  color: #DBDFED;
  line-height: 1.25;
}

.socials {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.socials a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 10px;
  text-decoration: none;
  color: var(--white);
  background: #16102e;
  border: 2px solid #493F93;
  font-family: var(--font-dialog);
  font-size: 18px;
}

.socials a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-soft);
}

@keyframes blink-hint {
  50% { opacity: 0; }
}

@keyframes player-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.28) translateY(-3px); }
  100% { transform: scale(1); }
}

@keyframes player-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}


@media (max-width: 420px) {
  .dungeon { --tile: 20px; }
  .dialog__prompt { font-size: 20px; }
  .option { font-size: 18px; min-height: 40px; }
}

@media (min-width: 860px) {
  :root { --container: 440px; }
  .game-shell { padding-inline: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero.is-dead .hero__juice { transition: none; }
  .prop--torch::after { animation: none; }
  .prop--mob { animation: none; }
  .prop--mob.is-attack { animation: none; }
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

.game-foot {
  width: min(var(--container), 100%);
  margin: 16px auto 0;
  font-family: var(--font-dialog);
  font-size: 18px;
  color: #DBDFED;
}

.game-foot a {
  color: #DFB37E;
}

.legal {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 8px 0 40px;
}

.legal h1 {
  margin: 0 0 12px;
  font-family: var(--font-pixel);
  font-size: clamp(16px, 4vw, 22px);
  line-height: 1.4;
  color: #C98028;
  font-weight: 400;
}

.legal h2 {
  margin: 28px 0 8px;
  font-family: var(--font-pixel);
  font-size: 14px;
  line-height: 1.5;
  color: #DFB37E;
  font-weight: 400;
}

.legal p, .legal li {
  color: #DBDFED;
  font-size: 22px;
  line-height: 1.3;
}

.legal ul { padding-left: 1.2em; }

.legal a { color: #DFB37E; }
