.hogar {
  --h-fondo: #172b25;
  --h-papel: #21362d;
  --h-linea: #81704a;
  --h-dorado: #e9c67d;
  --h-texto: #f5ead0;
  --h-tenue: #d4d0b9;
  color: var(--h-texto);
  font: 1rem/1.35 system-ui, sans-serif;
  background: var(--h-fondo);
  min-width: 0;
}
dialog.hogar-juego {
  box-sizing: border-box;
  position: fixed;
  inset: var(--h-top, 0px) auto auto var(--h-left, 0px);
  width: var(--h-width, 100%);
  height: var(--h-height, 100%);
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}
dialog.hogar-juego::backdrop { background: #0e1b17; }
.hogar [hidden] { display: none !important; }
.hogar-pantalla { height: 100%; display: grid; grid-template-rows: auto minmax(0,1fr); }
.hogar-cabecera {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .25rem .5rem;
  align-items: center; padding: .375rem .75rem;
  background: #1c3028; border-bottom: 1px solid #5e583d;
}
.hogar h1,.hogar h2,.hogar p { margin: 0; }
.hogar h1,.hogar h2 { font-family: Georgia, serif; line-height: 1.07; color: var(--h-dorado); overflow-wrap: anywhere; }
.hogar h1 { font-size: 1.22em; }
.hogar h2 { font-size: 1.1em; }
.hogar-saldo { color: var(--h-tenue); font-size: .9em; }
.hogar-ensayo { grid-column: 1 / -1; font-size: .78em; color: #e4d3a2; }
.hogar-cab-acciones { display: flex; gap: .25rem; align-items: center; }
.hogar-cab-acciones button[data-h="volver"] i { display: none; font-style: normal; }
.hogar button,.hogar select {
  box-sizing: border-box; min-width: 44px; min-height: 44px; padding: .25em .65em;
  color: var(--h-texto); background: #2b4035; border: 1px solid var(--h-linea); border-radius: 6px;
  font: inherit; line-height: 1.15; white-space: normal;
}
.hogar button:not(:disabled) { cursor: pointer; }
.hogar button:disabled { opacity: .62; }
.hogar button:focus-visible,.hogar select:focus-visible,.hogar-cuerpo:focus-visible {
  outline: 2px solid #ffe19b; outline-offset: -3px;
}
.hogar-area {
  position: relative; overflow: hidden; min-height: 0;
  background: radial-gradient(ellipse at center, #354738, #263e34 78%);
}
.hogar-arte,.hogar-anclas { position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); }
.hogar-arte { pointer-events: none; }
.hogar-arte img { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
.hogar-anclas { pointer-events: none; }
.hogar button.hogar-objetivo {
  position: absolute; left: clamp(22px,var(--x),calc(100% - 22px)); top: clamp(22px,var(--y),calc(100% - 22px)); transform: translate(-50%,-50%);
  pointer-events: auto; width: 44px; height: 44px; padding: 0; display: grid; place-items: center;
  background: transparent; border-color: transparent;
}
.hogar-objetivo i { width: 14px; height: 14px; border: 2px solid #ddbf80; background: #23352c; transform: rotate(45deg); box-shadow: 0 0 0 2px #253329; }
.hogar-objetivo span {
  position: absolute; left: 50%; top: calc(100% - 4px); transform: translateX(-50%); z-index: 1;
  padding: .2em .5em; background: #20342b; border: 1px solid #9b8254; border-radius: 4px;
  font-size: .88em; color: #f8dfaa; pointer-events: none; visibility: hidden;
}
.hogar-objetivo:is(:focus-visible,[aria-expanded="true"]) span { visibility: visible; }
.hogar-objetivo:is(:focus-visible,[aria-expanded="true"]) i { background: #d6ad61; }
[data-paso="abierto"] .hogar-objetivo[data-h="paso"] i, [data-instituto="mejora"] .hogar-objetivo[data-h="instituto"] i { border-color: #96d2a6; }
.hogar-aviso {
  position: absolute; z-index: 2; top: 4px; left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 16px); padding: .25em .65em; border-radius: 5px;
  font-size: .88em; color: #f8e4b7; background: #172b25f2; border: 1px solid #63583d;
}
.hogar-ficha {
  position: absolute; z-index: 3; bottom: 8px; right: 8px;
  display: flex; flex-direction: column; gap: .25em;
  box-sizing: border-box; width: min(21rem,calc(100% - 16px)); max-height: calc(100% - 16px);
  padding: .45em .6em; border: 1px solid #9b8254; border-radius: 7px;
  background: var(--h-papel); box-shadow: 0 3px 12px #111a15a8;
}
.hogar-ficha header { display: flex; align-items: center; justify-content: space-between; gap: .25em; flex: none; }
.hogar-ficha header button { padding: 0; }
.hogar-cuerpo { overflow-y: auto; min-height: 0; scrollbar-color: #ac905b #263a30; scrollbar-gutter: stable; }
.hogar-cuerpo p + p,.hogar-cuerpo label + p,.hogar-cuerpo p + label { margin-top: .35em; }
.hogar-cuerpo label { display: block; }
.hogar-cuerpo select { display: block; width: 100%; margin: .2em 0; }
.hogar-cuerpo ul { margin: 0; padding-left: 1.2em; }
.hogar-cuerpo li + li { margin-top: .25em; }
.hogar-motivo { color: #f2c780; }
.hogar-ficha footer { flex: none; }
.hogar-desplaza { display: block; font-size: .72em; color: var(--h-tenue); }
.hogar-pie { display: flex; flex-wrap: wrap; gap: .3em; }
.hogar-pie .hogar-primario { background: #715632; border-color: #ba9658; }
.hogar-capital-acciones { margin-top: .25em; }
@media (max-width: 480px) {
  .hogar-cabecera { padding-inline: 8px; column-gap: 6px; }
  .hogar-cab-acciones { gap: 4px; }
  .hogar-cab-acciones button { width: 44px; padding: 0; }
  .hogar-cab-acciones button[data-h="volver"] span { display: none; }
  .hogar-cab-acciones button[data-h="volver"] i { display: inline; }
  .hogar-ficha { right: 5px; bottom: 5px; width: calc(100% - 10px); max-height: min(66%, calc(100% - 10px)); }
}
@media (max-width: 480px) and (orientation: portrait) {
  .hogar-arte,.hogar-anclas { top: 40%; }
}
@media (max-height: 380px) and (orientation: landscape) {
  .hogar-cabecera { padding: 3px 8px; column-gap: 6px; row-gap: 1px; }
  .hogar-cab-acciones { gap: 4px; }
  .hogar-cab-acciones button { width: 44px; padding: 0; }
  .hogar-cab-acciones button[data-h="volver"] span { display: none; }
  .hogar-cab-acciones button[data-h="volver"] i { display: inline; }
  .hogar-ficha { right: 5px; bottom: 5px; width: min(21rem,65%); max-height: calc(100% - 10px); padding: 6px 8px; gap: 4px; }
  .hogar-ficha footer { display: flex; align-items: center; justify-content: space-between; gap: .4em; }
  .hogar-desplaza { order: 1; text-align: right; }
}
@media (max-width: 360px), (max-height: 380px) and (orientation: landscape) {
  .hogar-capital-acciones:has([data-h="academia"]) {
    display: grid; grid-template-columns: repeat(2,minmax(min-content,1fr)); gap: .15em;
  }
  .hogar-capital-acciones button { padding-inline: .08em; }
  .hogar-capital-acciones [data-h="academia"] { grid-column: 1 / -1; }
}
