/* Hallmark v2 | brand: BIXTROM Enredo | theme: custom, playful | idea: The missing cushion turns a pet’s home into a playable floor plan | signature: Enredo’s pink silhouette against the plum-orange parlour */
/* The board carries the first screen, with the mystery in the room itself and the controls against its edge. */

:root {
  --game-floor: #f1c08f;
  --game-floor-line: #d78f6a;
  --game-wall: #8f335c;
  --game-wall-deep: #66314f;
  --game-shadow: #53304848;
  --game-terracotta: #d95c45;
  --game-orange: #fda267;
  --game-gold: #fee5af;
  --game-red: #b63460;
  --game-milk: #ffedce;
  --game-rug: #e868a0;
  --game-leaf: #718758;
  --game-leaf-dark: #445d4d;
  --game-hall: #e3b9bc;
  --game-hall-line: #bd829e;
  --game-bedroom: #c4b8d7;
  --game-bedroom-line: #a99ac4;
  --game-blue: #686893;
  --game-blue-dark: #514e76;
  --game-fur: #c07045;
  --game-cat: #e9a759;
}

.enredo-page [hidden] { display: none !important; }
.enredo-main { padding-block: clamp(1.3rem, 3vw, 2.7rem) 3rem; }
.enredo-title { margin-block-end: clamp(1rem, 2vw, 1.7rem); }
.enredo-title h1 {
  color: var(--ink);
  font: 900 clamp(2.05rem, 7vw, 5.5rem)/.97 var(--display);
  text-transform: uppercase;
  text-wrap: wrap;
}
.enredo-title p { margin-block-start: .55rem; font-weight: 690; }
.enredo-layout { display: grid; grid-template-columns: minmax(0, 2.35fr) minmax(0, 1fr); gap: clamp(1rem, 2.6vw, 2rem); align-items: start; }
.enredo-play, .enredo-sidebar { min-width: 0; }
.room-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem .9rem;
  min-height: 3.15rem;
  align-items: center;
  justify-content: space-between;
  padding: .48rem .75rem;
  border: 2px solid var(--ink);
  border-block-end: 0;
  color: var(--paper);
  background: var(--wine);
}
.room-bar h2 { font: 900 clamp(1.3rem, 2.7vw, 1.85rem)/1.12 var(--display); text-transform: uppercase; }
.room-bar p { font-size: .83rem; line-height: 1.25; }
.room-scene {
  position: relative;
  isolation: isolate;
  overflow: clip;
  aspect-ratio: 1.78;
  min-height: 230px;
  border: 2px solid var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 20px, var(--game-floor-line) 20px 21px),
    var(--game-floor);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.room-scene::before {
  content: '';
  position: absolute;
  inset: 0;
  border: clamp(5px, 1.2vw, 10px) solid var(--game-wall);
  border-block-start-width: clamp(12px, 3vw, 28px);
  box-shadow: inset 0 0 0 2px var(--game-wall-deep), inset 0 5px 0 3px var(--game-shadow);
  pointer-events: none;
}
.scene-objects { position: absolute; inset: 0; pointer-events: none; }
.scene-objects > span { position: absolute; }
.room-rug {
  inset: 31% 21% 11%;
  border: 2px solid var(--game-red);
  border-radius: 42% / 38%;
  background: repeating-linear-gradient(132deg, var(--game-rug) 0 5px, var(--pink) 5px 10px);
  box-shadow: inset 0 0 0 4px var(--game-rug), 0 5px var(--game-shadow);
}
.room-window {
  z-index: 1;
  top: 2.5%;
  left: 23%;
  width: 24%;
  height: 8%;
  border: 2px solid var(--game-wall-deep);
  background: repeating-linear-gradient(90deg, var(--game-milk) 0 20%, var(--game-floor) 20% 23%);
  box-shadow: 0 3px var(--game-shadow);
}
.room-plant {
  z-index: 1;
  top: 19%;
  right: 9%;
  width: 6%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid var(--game-wall-deep);
  border-radius: 50%;
  background: var(--game-orange);
  box-shadow: 0 4px var(--game-shadow);
}
.room-plant i { position: absolute; width: 43%; height: 69%; border-radius: 78% 10% 65% 24%; background: var(--game-leaf); }
.room-plant i:first-child { transform: translate(-45%, -20%) rotate(-50deg); background: var(--game-leaf-dark); }
.room-plant i:nth-child(2) { transform: translate(40%, -25%) rotate(50deg); }
.room-plant i:last-child { transform: translateY(-58%) rotate(20deg); }
.room-table {
  left: 39%;
  top: 47%;
  width: 18%;
  height: 14%;
  border: 2px solid var(--game-wall-deep);
  border-radius: 42%;
  background: var(--game-milk);
  box-shadow: inset 0 0 0 4px var(--game-gold), 0 6px var(--game-shadow);
}
.room-table::after {
  content: '';
  position: absolute;
  width: 20%;
  height: 46%;
  inset: 25% auto auto 32%;
  border: 1px solid var(--game-wall-deep);
  border-radius: 40%;
  background: var(--game-blue);
}
.scene-prop { left: var(--prop-x); top: var(--prop-y); transform: translate(-50%, -50%); }
.scene-sofa {
  --prop-x: 43%;
  --prop-y: 29%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4%;
  width: 39%;
  height: 24%;
  padding: 3% 4% 2%;
  border: 2px solid var(--game-wall-deep);
  border-radius: 9px;
  background: var(--game-terracotta);
  box-shadow: 0 6px var(--game-shadow), inset 0 7px var(--game-red);
}
.scene-sofa i { border: 1px solid var(--game-wall-deep); border-radius: 5px; background: var(--game-orange); }
.scene-sofa i:nth-child(2) { background: var(--game-terracotta); border-style: dashed; }
.scene-ball {
  --prop-x: 18%;
  --prop-y: 36%;
  width: clamp(15px, 4vw, 31px);
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: repeating-linear-gradient(50deg, var(--citrus) 0 8px, var(--game-leaf) 8px 11px, var(--citrus) 11px 18px);
  box-shadow: 0 3px var(--game-shadow);
}
.scene-cushion {
  --prop-x: 84%;
  --prop-y: 29%;
  width: clamp(20px, 5vw, 39px);
  aspect-ratio: 1.17;
  border: 2px solid var(--game-wall-deep);
  border-radius: 34%;
  background: repeating-linear-gradient(120deg, var(--pink) 0 5px, var(--game-rug) 5px 7px);
  box-shadow: 0 4px var(--game-shadow);
  transform: translate(-50%, -50%) rotate(10deg);
}
.scene-pet { width: clamp(37px, 7vw, 59px); z-index: 1; }
.scene-pet--dog { --prop-x: 68%; --prop-y: 57%; --fur: var(--game-fur); --ear: var(--game-wall-deep); }
.scene-pet--cat { --prop-x: 70%; --prop-y: 54%; --fur: var(--game-cat); --ear: var(--game-orange); }
.pet-face {
  position: relative;
  display: block;
  width: 72%;
  margin-inline: auto;
  aspect-ratio: 1.1;
  border: 2px solid var(--game-wall-deep);
  border-radius: 48% 48% 42% 42%;
  background: var(--fur);
  box-shadow: 0 3px var(--game-shadow);
}
.pet-face::before, .pet-face::after {
  content: '';
  position: absolute;
  top: -10%;
  width: 35%;
  height: 58%;
  border: 1px solid var(--game-wall-deep);
  border-radius: 46% 48% 56% 38%;
  background: var(--ear);
}
.pet-face::before { left: -15%; transform: rotate(25deg); }
.pet-face::after { right: -15%; transform: rotate(-25deg); }
.scene-pet--cat .pet-face::before, .scene-pet--cat .pet-face::after { top: -26%; height: 51%; border-radius: 64% 0 50% 80%; }
.pet-face i {
  position: absolute;
  top: 44%;
  left: 23%;
  width: 12%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: .92em 0 var(--ink), .46em .62em 0 -.03em var(--ink);
  font-size: clamp(9px, 1.65vw, 17px);
}
.pet-label {
  display: block;
  margin-block-start: .19rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: var(--game-milk);
  text-align: center;
  font-weight: 780;
  font-size: clamp(.63rem, 1.4vw, .8rem);
}
.scene-door {
  width: clamp(22px, 5vw, 41px);
  height: clamp(40px, 7vw, 63px);
  border: 2px solid var(--game-wall-deep);
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, var(--game-milk) 0 5px, var(--game-gold) 5px 8px);
  box-shadow: 3px 4px var(--game-shadow);
}
.scene-door::after {
  content: '';
  position: absolute;
  inset: 39% 18% auto auto;
  width: 22%;
  aspect-ratio: 1;
  border: 1px solid var(--game-wall-deep);
  border-radius: 50%;
  background: var(--citrus);
}
.scene-door--e { --prop-x: 92%; --prop-y: 50%; }
.scene-door--w { --prop-x: 9%; --prop-y: 52%; }
.scene-door--n { --prop-x: 53%; --prop-y: 14%; transform: translate(-50%, -50%) rotate(90deg); }
.scene-door--s { --prop-x: 53%; --prop-y: 86%; transform: translate(-50%, -50%) rotate(90deg); }

.room-bench, .room-bed, .room-crate, .scene-cushion, .scene-pet--cat,
.scene-door--w, .scene-door--n, .scene-door--s { display: none; }
.room-scene:not([data-room="salon"]) :is(.scene-sofa, .scene-ball, .scene-pet--dog, .scene-door--e, .room-table) { display: none; }
.room-scene[data-ball-found="true"] .scene-ball { display: none; }
.room-scene[data-room="pasillo"] {
  background: repeating-linear-gradient(90deg, transparent 0 24px, var(--game-hall-line) 24px 26px), var(--game-hall);
}
.room-scene[data-room="pasillo"] .room-rug {
  inset: 26% 8% 24%;
  border-radius: 12px;
  background: repeating-linear-gradient(45deg, var(--game-wall) 0 6px, var(--game-wall-deep) 6px 8px);
  box-shadow: inset 0 0 0 4px var(--game-rug), 0 4px var(--game-shadow);
}
.room-scene[data-room="pasillo"] :is(.scene-door--w, .scene-door--n, .room-bench, .room-crate) { display: block; }
.room-bench {
  right: 12%;
  bottom: 11%;
  width: 31%;
  height: 12%;
  border: 2px solid var(--game-wall-deep);
  border-radius: 5px;
  background: repeating-linear-gradient(0deg, var(--game-gold) 0 5px, var(--game-floor) 5px 7px);
  box-shadow: 0 5px var(--game-shadow);
}
.room-crate {
  width: 10%;
  aspect-ratio: 1;
  border: 2px solid var(--game-wall-deep);
  background: repeating-linear-gradient(0deg, var(--game-floor) 0 4px, var(--game-orange) 4px 6px);
  box-shadow: 3px 4px var(--game-shadow);
}
.room-crate--a { top: 16%; left: 14%; transform: rotate(-8deg); }
.room-crate--b { top: 20%; left: 24%; transform: rotate(9deg); }
.room-scene[data-room="dormitorio"] {
  background: repeating-linear-gradient(0deg, transparent 0 18px, var(--game-bedroom-line) 18px 19px), var(--game-bedroom);
}
.room-scene[data-room="dormitorio"] .room-rug {
  inset: 38% 13% 13% 29%;
  border-color: var(--game-blue-dark);
  background: repeating-linear-gradient(130deg, var(--game-blue) 0 8px, var(--game-bedroom-line) 8px 11px);
  box-shadow: inset 0 0 0 4px var(--game-blue), 0 4px var(--game-shadow);
}
.room-scene[data-room="dormitorio"] :is(.scene-door--s, .scene-pet--cat, .scene-cushion, .room-bed) { display: block; }
.room-scene[data-room="dormitorio"]:not([data-miso-met="true"]) .scene-cushion,
.room-scene[data-room="dormitorio"][data-cushion-found="true"] .scene-cushion { display: none; }
.room-scene[data-room="dormitorio"] .room-plant { display: none; }
.room-bed {
  left: 11%;
  top: 19%;
  width: 31%;
  height: 53%;
  border: 2px solid var(--game-blue-dark);
  border-radius: 7px;
  background: repeating-linear-gradient(130deg, var(--game-blue) 0 5px, var(--game-blue-dark) 5px 7px);
  box-shadow: 0 5px var(--game-shadow);
}
.room-bed i {
  display: block;
  width: 74%;
  height: 27%;
  margin: 9% auto;
  border: 1px solid var(--game-blue-dark);
  border-radius: 23%;
  background: var(--game-milk);
}
.enredo-player {
  position: absolute;
  z-index: 3;
  left: 32%;
  top: 74%;
  width: clamp(39px, 7.5vw, 65px);
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 5px 0 var(--game-shadow));
}
.enredo-player img { width: 100%; height: auto; }
.enredo-thread {
  position: absolute;
  z-index: 2;
  height: 3px;
  border-radius: 2px;
  background: var(--pink);
  transform-origin: left center;
  pointer-events: none;
}

.enredo-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  align-items: center;
  gap: .55rem .85rem;
  padding: .65rem .75rem;
  border: 2px solid var(--ink);
  border-block-start: 0;
  background: var(--print-paper);
}
.move-pad { display: grid; width: max-content; grid-template-columns: repeat(3, minmax(44px, 2.8rem)); gap: 4px; }
.move-pad button, .enredo-button, .encounter-actions button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
  font: 750 .88rem/1.2 var(--body);
  text-decoration: none;
  cursor: pointer;
}
.move-pad button { touch-action: manipulation; }
.move-pad button::before {
  content: '';
  width: .61rem;
  height: .61rem;
  border-block-start: 2px solid currentColor;
  border-inline-end: 2px solid currentColor;
  transform: rotate(45deg);
}
.move-pad button[data-move="up"] { grid-column: 2; }
.move-pad button[data-move="left"] { grid-column: 1; }
.move-pad button[data-move="up"]::before { transform: rotate(-45deg); }
.move-pad button[data-move="left"]::before { transform: rotate(-135deg); }
.move-pad button[data-move="down"]::before { transform: rotate(135deg); }
.move-pad button:hover, .encounter-actions button:hover { background: var(--pink); }
.enredo-button { width: max-content; padding: .45rem .7rem; }
.enredo-button--main { background: var(--citrus); box-shadow: 3px 3px var(--ink); }
.enredo-button--main:hover { background: var(--pink); }
.enredo-button--main:active { box-shadow: none; }
.enredo-button:disabled, .encounter-actions button:disabled { border-color: var(--muted); background: var(--book-jacket); color: var(--muted); cursor: default; box-shadow: none; }
#interaction-name { font-size: .94rem; font-weight: 790; }
#interaction-help { max-width: 32ch; margin-block: .13rem .42rem; color: var(--muted); font-size: .8rem; line-height: 1.27; }
.enredo-keys { margin-block-start: .6rem; color: var(--muted); font-size: .84rem; }

.enredo-sidebar { display: grid; gap: .86rem; }
.enredo-diary, .enredo-encounter, .enredo-ending { padding: clamp(.8rem, 2.3vw, 1.3rem); border: 2px solid var(--ink); }
.enredo-diary { background: var(--book-jacket); }
.enredo-encounter { background: var(--game-milk); }
.enredo-ending { background: var(--pink); }
.enredo-sidebar h2 {
  margin-block-end: .45rem;
  font: 900 clamp(1.4rem, 2.2vw, 1.95rem)/1.06 var(--display);
  text-transform: uppercase;
}
.enredo-diary ul { margin: .7rem 0 0; padding: 0; list-style: none; }
.enredo-diary li { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); gap: .46rem; align-items: start; border-block-start: 1px solid var(--panel-rule); padding-block: .58rem; }
.enredo-diary li:last-child { padding-block-end: 0; }
.enredo-diary li p span { display: block; margin-block-start: .04rem; font-size: .84rem; line-height: 1.32; }
.diary-mark { width: 1.2rem; height: 1.2rem; margin-top: .14rem; border: 1px solid var(--ink); }
.diary-mark--bruno { border-radius: 50%; background: var(--citrus); }
.diary-mark--miso { border-radius: 65% 65% 20% 20%; background: var(--pink); }
.enredo-status { min-height: 2ch; border-block-start: 1px solid var(--panel-rule); padding-block-start: .6rem; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.enredo-reset {
  width: max-content;
  min-height: 44px;
  border: 0;
  padding: 0 .15rem;
  color: var(--ink);
  background: transparent;
  font: inherit;
  font-weight: 720;
  text-decoration: underline;
  cursor: pointer;
}
.encounter-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-block-start: .75rem; }
.encounter-actions button { padding: .35rem .55rem; }
.enredo-ending .enredo-button { margin-block-start: .72rem; }
.enredo-page :is(button, a, [tabindex]):focus-visible { outline: 3px solid var(--wine); outline-offset: 4px; }

@media (max-width: 760px) {
  .enredo-layout { grid-template-columns: minmax(0, 1fr); }
  .room-scene { aspect-ratio: 1.46; }
  .enredo-controls { grid-template-columns: minmax(0, max-content) minmax(0, 1fr); }
}
@media (max-width: 450px) {
  .enredo-controls { padding-inline: .4rem; gap: .45rem; }
  .enredo-title h1 span { display: block; }
  .enredo-button { font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) {
  .enredo-player, .scene-prop, .enredo-button { animation: none; transition: none; }
}
