:root {
  color-scheme: dark;
  --wall: #211a1d;
  --frame: #51393c;
  --paper: #f6e7c9;
  --ink: #362624;
  --muted: #66534a;
  --red: #a33434;
  --mint: #bad6a1;
  --mono: "IBM Plex Mono", monospace;
  --display: "Barlow Condensed", Impact, sans-serif;
}

* { box-sizing: border-box; }
[hidden], .symbols { display: none !important; }
body {
  margin: 0;
  background: repeating-linear-gradient(90deg, #ffffff02 0 1px, transparent 1px 36px), var(--wall);
  color: var(--paper);
  font: 500 15px/1.45 "DM Sans", system-ui, sans-serif;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible + span { outline: 2px solid #ce6868; outline-offset: 3px; }
svg { display: block; width: 1.2rem; height: 1.2rem; flex: none; }
.wrap { width: min(1140px, calc(100% - 64px)); margin-inline: auto; }
.top { background: #2c2124; border-bottom: 1px solid var(--frame); }
.top-inner { min-height: 64px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--paper); text-decoration: none; }
.brand h1 { font: italic 900 37px/.88 var(--display); letter-spacing: -.025em; margin: 0; }
.brand svg { width: 23px; height: 23px; color: #df7770; }
.header-line { color: #d5b9a3; border-left: 1px solid #795858; padding-left: 17px; font: 500 10px var(--mono); letter-spacing: .09em; }
.sound { margin-left: auto; background: transparent; border: 1px solid #86605a; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 2px; font: 500 11px var(--mono); }
.sound:hover { border-color: var(--paper); }
.sound svg { color: #e9817b; width: 16px; height: 16px; }
main.wrap { padding-block: 19px 28px; }
.steps { list-style: none; margin: 0 0 15px; padding: 0; display: flex; gap: 5px; align-items: center; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 5px 10px; color: #dcbaaa; font: 500 12px var(--mono); white-space: nowrap; }
.steps li::before { content: ""; width: 5px; height: 5px; border: 1px solid currentColor; transform: rotate(45deg); }
.steps li[aria-current] { background: var(--mint); color: #26392c; font-weight: 600; }
.steps li[aria-current]::before, .steps li.done::before { background: currentColor; }
.game { display: grid; grid-template-columns: minmax(0, 1.46fr) minmax(0, 1fr); align-items: stretch; gap: 15px; }
.scene {
  min-width: 0;
  min-height: 485px;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 5px solid #110e11;
  outline: 1px solid var(--frame);
  background: #482933;
}
.scene::before { content: ""; z-index: -2; position: absolute; inset: 0; background: center / cover no-repeat url("vestidor.png"); }
.scene::after { content: ""; z-index: -1; position: absolute; inset: 0; background: linear-gradient(180deg, #130e174d 0%, transparent 22% 77%, #190d1199 100%); }
.game[data-phase="2"] .scene::before, .game[data-phase="3"] .scene::before { background-image: url("bodegon-v2.png"); }
.game[data-venue] .scene::before { background: #251a26; }
#rematch-background { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.game[data-venue="pista"] .scene .sprites { padding-inline: 18%; }
.game[data-venue="libreria"] .scene .sprites { padding-inline: 13%; }
.game[data-venue] .scene .sprites canvas { height: min(68%, 250px); }
.scene:has(.bodegon[data-event="blackout"])::before { filter: brightness(.29) saturate(.68); }
.scene:has(.bodegon[data-event="blackout"]) .sprites { filter: brightness(.72) sepia(.18); }
.scene:has(.bodegon[data-event="rain"])::before { filter: brightness(.87) saturate(.83); }
.scene-top { display: flex; justify-content: space-between; padding: 11px; gap: 5px; }
.scene-tag { display: flex; align-items: center; gap: 7px; padding: 6px 8px; background: #2c2025ed; border: 1px solid #8b625b; color: var(--paper); font: 500 10px/1.1 var(--mono); letter-spacing: .02em; }
.dot { display: inline-block; width: 5px; height: 5px; background: #e48a78; transform: rotate(45deg); flex: none; }
.sprites { position: absolute; inset: 0 0 9%; display: flex; align-items: end; justify-content: center; gap: clamp(0px, 2.35vw, 28px); pointer-events: none; }
.sprites canvas { height: min(85%, 374px); width: auto; max-width: 45%; object-fit: contain; object-position: center bottom; image-rendering: pixelated; }
.game:is([data-phase="2"], [data-phase="3"]) .sprites {
  bottom: 9%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  justify-items: center;
  padding-inline: 9%;
  gap: 0;
}
.game:is([data-phase="2"], [data-phase="3"]) .sprites canvas { height: min(76%, 292px); max-width: 100%; }
.game:is([data-phase="2"], [data-phase="3"]) :is(#hero, #hero-chair) { grid-area: 1 / 1; }
.game:is([data-phase="2"], [data-phase="3"]) :is(#date-sprite, #date-chair) { grid-area: 1 / 2; }
.bodegon {
  --table-width: clamp(110px, 32%, 217px);
  --table-bottom: 7%;
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.bodegon canvas { position: absolute; image-rendering: pixelated; }
#table {
  width: var(--table-width);
  left: 50%;
  bottom: var(--table-bottom);
  transform: translateX(-50%);
  filter: drop-shadow(3px 5px #21141b70);
}
#table-prop {
  width: clamp(48px, 12%, 89px);
  bottom: calc(var(--table-bottom) + var(--table-width) * .47);
  left: 50%;
  transform: translateX(-50%);
}
#server {
  --server-duration: 1700ms;
  width: clamp(92px, 29%, 203px);
  bottom: 15%;
  right: 36%;
  opacity: 0;
  animation: server-pass var(--server-duration) linear both;
}
.bodegon:has(#server:not([hidden])) #table-prop { animation: prop-served 0s 790ms both; }
.bodegon[data-event="blackout"] #server { animation-delay: 270ms; }
.bodegon[data-event="blackout"]:has(#server:not([hidden])) #table-prop { animation-delay: 1060ms; }
.bodegon[data-event="band"] #server { --server-duration: 2450ms; }
.candlelight, .rain { display: none; position: absolute; }
.bodegon[data-event="blackout"] .candlelight {
  display: block;
  inset: 0;
  background: radial-gradient(ellipse at 50% 71%, #ffc96e62, #d2834a28 21%, transparent 50%);
  animation: candle-appears 220ms 1060ms both;
}
.bodegon[data-event="blackout"] #table { filter: brightness(.56); }
.bodegon[data-event="blackout"] #server { filter: brightness(.74); }
.scene:has(.bodegon[data-event="blackout"]) #hero { --recoil: -12px; animation: startle 510ms steps(4, end); }
.scene:has(.bodegon[data-event="blackout"]) #date-sprite { --recoil: 12px; animation: startle 530ms 35ms steps(4, end); }
.scene:has(.bodegon[data-reaction="laugh"]) #date-sprite { animation: laugh 430ms steps(5, end); }
.scene:has(.bodegon[data-reaction="awkward"]) #date-sprite { --recoil: 7px; animation: lean 480ms steps(5, end); }
.bodegon[data-event="rain"] .rain {
  display: block;
  inset: 5% 3% 43%;
  background: repeating-linear-gradient(111deg, transparent 0 20px, #b3c4eb70 21px 23px, transparent 24px 34px);
  mask-image: linear-gradient(90deg, #000, transparent 28% 72%, #000);
  animation: rainfall 550ms linear 6;
  opacity: .68;
}
.bodegon[data-event="soda"] #table-prop { animation: bottle-rattle 430ms steps(5, end); }
@keyframes server-pass {
  0% { transform: translate(235%, 0); opacity: 1; }
  12% { transform: translate(170%, -3px); }
  22% { transform: translate(115%, 0); }
  34% { transform: translate(45%, -4px); }
  42% { transform: translate(0, 0); }
  49% { transform: translate(0, 6px); }
  55% { transform: translate(0, 0); }
  66% { transform: translate(65%, -4px); }
  78% { transform: translate(130%, 0); }
  90% { transform: translate(192%, -4px); opacity: 1; }
  100% { transform: translate(235%, 0); opacity: 0; }
}
@keyframes prop-served { from { opacity: 0; } to { opacity: 1; } }
@keyframes candle-appears { from { opacity: 0; } to { opacity: 1; } }
@keyframes startle {
  0%, 100% { transform: translate(0); }
  26% { transform: translate(var(--recoil), -17px) rotate(-4deg); }
  56% { transform: translate(var(--recoil), 1px); }
  76% { transform: translate(0, -4px); }
}
@keyframes laugh {
  0%, 50%, 100% { transform: translateY(0); }
  28%, 76% { transform: translateY(-7px); }
}
@keyframes lean { 50% { transform: translateX(var(--recoil)) rotate(3deg); } }
@keyframes rainfall { to { background-position: -32px 65px; } }
@keyframes bottle-rattle {
  45% { transform: translate(-45%, -8px) rotate(-13deg); }
  75% { transform: translate(-57%, -2px) rotate(7deg); }
}
@media (prefers-reduced-motion: reduce) {
  .scene .bodegon #server,
  .scene .bodegon #table-prop,
  .scene .bodegon .candlelight,
  .scene .bodegon .rain,
  .scene .sprites canvas { animation: none !important; }
  .bodegon #server:not([hidden]) { opacity: 1; right: 6%; }
}
.scene-top, .scene-footer { z-index: 1; }
.scene-footer { margin: 0 11px 11px; padding: 7px 10px; display: flex; align-items: center; gap: 10px; align-self: start; border-left: 2px solid #e48a78; background: #2c2025f0; }
.scene-footer svg { color: #ef9f91; }
.scene-footer strong { display: block; font: 600 11px/1.25 var(--mono); }
.scene-footer span { color: #e2c2ab; display: block; font-size: 12px; }
.panel {
  min-width: 0;
  color-scheme: light;
  color: var(--ink);
  background: repeating-linear-gradient(0deg, transparent 0 3px, #69452905 3px 4px), var(--paper);
  border: 1px solid #b39877;
  border-top: 4px solid var(--red);
  padding: 20px;
  position: relative;
  box-shadow: inset 0 0 0 4px #d6b98a3d;
}
.panel::after { content: ""; position: absolute; bottom: -5px; left: -1px; right: -1px; height: 5px; background: linear-gradient(135deg, var(--paper) 25%, transparent 25%) 0 0 / 10px 10px, linear-gradient(225deg, var(--paper) 25%, transparent 25%) 0 0 / 10px 10px; pointer-events: none; }
.panel h2 { margin: 0; font: 800 33px/.99 var(--display); }
.panel-head { margin-bottom: 13px; padding-bottom: 11px; border-bottom: 1px dashed #a98a6d; }
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.label, .panel-head .label, .closet legend { margin: 0 0 5px; padding: 0; color: var(--red); font: 600 10px/1.4 var(--mono); letter-spacing: .085em; text-transform: uppercase; }
.levels { margin: 0; padding: 0; min-width: 0; border: 0; display: grid; gap: 6px; }
.level, .option { display: block; position: relative; cursor: pointer; }
.level input, .option input { position: absolute; z-index: 1; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.level-face { min-height: 52px; display: grid; gap: 1px; padding: 6px 10px; border: 1px solid #bda385; background: #fff4dc66; }
.level-face > span { display: flex; align-items: baseline; justify-content: space-between; gap: 7px; }
.level-face b { font-size: 15px; }
.level-face em { color: var(--red); font: 600 11px var(--mono); text-align: right; }
.level-face small { color: var(--muted); font-size: 12px; }
.level input:checked + span, .option input:checked + span { border-color: #527353; box-shadow: inset 3px 0 #527353; background: #d7dfba; }
.level input:hover + span, .option input:hover + span { border-color: #527353; }
.closet { display: grid; gap: 13px; }
.closet fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
.option span { min-height: 42px; height: 100%; display: flex; align-items: center; gap: 6px; border: 1px solid #bda385; padding: 6px; background: #fff4dc66; font-size: 12px; line-height: 1.12; font-weight: 700; }
.swatch { display: block; width: 11px; height: 11px; flex: none; background: var(--swatch); border: 1px solid #21181d44; }
.actions { display: flex; gap: 6px; margin-top: 15px; }
.primary, .secondary { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 7px 10px; border: 1px solid; font-weight: 700; border-radius: 2px; }
.primary { flex: 1; background: #8f2e2f; color: #fff1d6; border-color: #8f2e2f; box-shadow: 0 2px #591f22; }
.primary:hover { background: #a13c3d; }
.secondary { border-color: #ac8c70; background: #fff3d7; font-size: 12px; }
.secondary:hover { border-color: var(--red); }
.secondary svg { width: 15px; height: 15px; }
.date-panel, .ending { display: flex; flex-direction: column; min-height: 100%; }
.meter { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; color: #5b4037; font: 600 10px/1.3 var(--mono); letter-spacing: .09em; }
.meter progress { grid-column: span 2; width: 100%; height: 7px; appearance: none; border: 0; background: #d4b99c; overflow: hidden; accent-color: #a63c3a; }
.meter progress::-webkit-progress-bar { background: #d4b99c; }
.meter progress::-webkit-progress-value { background: #a63c3a; }
.meter progress::-moz-progress-bar { background: #a63c3a; }
.dialogue { margin: 14px 0 10px; padding: 8px 10px; border-left: 3px solid var(--red); background: #eddbb9; }
.dialogue .label { display: block; margin-bottom: 3px; }
.dialogue p { margin: 0; font-weight: 700; }
.dialogue { display: grid; grid-template-columns: var(--portrait-size) minmax(0, 1fr); align-items: start; gap: 11px; --portrait-size: 116px; }
.portrait {
  display: block;
  width: var(--portrait-size);
  aspect-ratio: 1;
  flex: none;
  border: 2px solid #57393e;
  background: #2b172a url("retratos.png") var(--portrait-x) var(--portrait-y) / 400% 400% no-repeat;
  image-rendering: pixelated;
}
.speech { padding-top: 3px; }
.dialogue .callback { margin-bottom: 6px; color: #67483e; font-size: 12px; font-weight: 600; }
.spoken { display: flex; align-items: center; gap: 9px; --portrait-size: 58px; }
.spoken .chosen { margin: 0; }
.spoken .label { display: block; }
.player-portrait { background: #2b172a; image-rendering: pixelated; }
.ending-dialogue { align-items: center; }
.chosen { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.answers { display: grid; gap: 5px; }
.answer { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 7px 9px; background: #fff4dc; border: 1px solid #bda385; text-align: left; font-size: 13px; line-height: 1.23; }
.answer:hover { border-color: #527353; background: #d7dfba; }
.answer b { color: var(--red); font: 600 11px/1.3 var(--mono); }
.date-panel .actions { margin-top: auto; padding-top: 12px; }
.ending { justify-content: center; }
.ending .eyebrow { margin: 0 0 8px; color: var(--red); font: 600 10px var(--mono); }
.ending .dot { margin-right: 3px; }
.ending h2 { color: #8f2e2f; }
.ending p { color: var(--muted); }
.ending .meter { margin-top: 7px; }
.ending .actions { margin-top: 18px; }
.site-footer { margin: 20px 0; color: #d9bdaa; font-size: 13px; }
.play-ad {
  width: min(100% - 26px, 728px);
  margin: 150px auto 32px;
}
.play-ad p {
  margin: 0 0 9px;
  color: #d5b9a3;
  font: 500 10px var(--mono);
  letter-spacing: .09em;
  text-transform: uppercase;
}
.play-ad:has([data-ad-status="unfilled"]) { display: none; }
@media (min-width: 1240px) {
  .play-layout:not(:has(.play-ad [data-ad-status="unfilled"])) {
    width: min(1510px, 100% - 64px);
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    column-gap: 150px;
    align-items: start;
  }
  .play-layout:not(:has(.play-ad [data-ad-status="unfilled"])) > main.wrap { width: 100%; }
  .play-ad { width: 240px; margin: 59px 0 32px; }
}
.site-footer a, .privacy a { color: inherit; text-underline-offset: 3px; }
.privacy { max-width: 66ch; padding-bottom: 36px; color: #e0c8b6; }
.privacy h1, .privacy h2 { color: var(--paper); }
.privacy p { line-height: 1.55; }

@media (max-width: 930px) {
  .wrap { width: calc(100% - 40px); }
  .game { grid-template-columns: minmax(0, 1.14fr) minmax(0, 1fr); gap: 12px; }
  .panel { padding: 15px; }
}

@media (max-width: 700px) {
  .wrap { width: calc(100% - 26px); }
  .top-inner { min-height: 52px; gap: 9px; }
  .brand { gap: 6px; }
  .brand h1 { font-size: 31px; }
  .brand svg { width: 18px; height: 18px; }
  .header-line { display: none; }
  main.wrap { padding-top: 11px; }
  .steps { margin-bottom: 9px; gap: 2px; justify-content: space-between; }
  .steps li { gap: 5px; padding: 5px 6px; font-size: 10px; }
  .game { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .scene { min-height: clamp(223px, 58vw, 390px); }
  .bodegon { --table-bottom: 5%; }
  .scene-top { padding: 6px; }
  .scene-footer { margin: 0 6px 6px; padding: 5px 7px; }
  .scene-footer strong { font-size: 10px; }
  .scene-footer span { font-size: 11px; }
  .panel { padding: 13px; }
  .panel h2 { font-size: 29px; }
  .closet { gap: 10px; }
  .level-face { min-height: 47px; padding: 5px 8px; }
  .dialogue { --portrait-size: 90px; gap: 8px; }
}
