:root {
  --sky-top: #3f93e6;
  --sky-bot: #bfe9ff;
  --paper: #fde3a7;
  --paper-2: #f9d28a;
  --paper-3: #f3c070;
  --wood-dark: #5b2b10;
  --wood: #8a4a1c;
  --wood-mid: #b5651d;
  --wood-light: #e8a04a;
  --ink: #4a1f0e;
  --muted: #8a5a34;
  --green: #3f8f2f;
  --green-dark: #2a6321;
  --red: #c8362e;
  --gold: #f7c948;
  --blue: #2f6fd0;
  --spring: #e2619a;
  --summer: #e0a012;
  --fall: #d2601f;
  --winter: #3f8fd0;
  --head: "Pixelify Sans", "VT323", monospace;
  --body: "VT323", "Pixelify Sans", monospace;
  --sidebar-w: 250px;
  --topbar-h: 62px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--sky-bot);
  color: var(--ink);
  font: 400 21px/1.3 var(--body);
}

a { color: var(--blue); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover { color: var(--red); }

h1, h2, h3, h4 { font-family: var(--head); font-weight: 600; margin: 0; line-height: 1.15; }

/* Fondo: cielo, nubes y colinas hechos con CSS, sin imágenes del juego */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, #7cc3f7 45%, var(--sky-bot) 100%);
}
.cloud {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #fff;
  opacity: 0.9;
  box-shadow:
    16px 0 #fff, 32px 0 #fff, 48px 0 #fff, 64px 0 #fff, 80px 0 #fff,
    16px -16px #fff, 32px -16px #fff, 48px -16px #fff, 64px -16px #fff,
    32px -32px #fff, 48px -32px #fff,
    0 16px #e3f3ff, 16px 16px #e3f3ff, 32px 16px #e3f3ff, 48px 16px #e3f3ff, 64px 16px #e3f3ff, 80px 16px #e3f3ff, 96px 16px #e3f3ff;
}
.c1 { top: 16%; left: 6%; }
.c2 { top: 30%; left: 62%; transform: scale(1.5); }
.c3 { top: 9%; left: 82%; transform: scale(0.8); }
.hills {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 120px;
  background:
    linear-gradient(180deg, transparent 0 40px, #4fa83a 40px 56px, #3f8f2f 56px 88px, #2a6321 88px),
    transparent;
}
.hills::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 8px;
  height: 32px;
  background: repeating-linear-gradient(90deg, #4fa83a 0 48px, transparent 48px 64px, #4fa83a 64px 160px, transparent 160px 208px);
}

/* Marco de madera */
.panel {
  background: var(--paper);
  border: 4px solid var(--wood-dark);
  box-shadow:
    inset 0 0 0 4px var(--wood-light),
    inset 0 0 0 8px var(--wood-mid),
    inset 0 0 0 10px var(--wood-dark),
    8px 8px 0 rgba(43, 22, 8, 0.28);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background:
    repeating-linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0 2px, transparent 2px 14px),
    var(--wood);
  border-bottom: 4px solid var(--wood-dark);
  box-shadow: inset 0 4px 0 var(--wood-mid), 0 4px 0 rgba(43, 22, 8, 0.25);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand:hover { color: #fff; }
.brand-mark { width: 40px; height: 40px; border: 3px solid var(--wood-dark); image-rendering: pixelated; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-title { font: 700 26px/1 var(--head); color: var(--gold); text-shadow: 2px 2px 0 var(--wood-dark); letter-spacing: 0.02em; }
.brand-sub { font-size: 18px; color: #ffe9c4; margin-top: 3px; }

.menu-toggle {
  display: none;
  font: 600 18px var(--head);
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--wood-dark);
  box-shadow: inset 0 0 0 2px var(--wood-light);
  padding: 6px 14px;
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 24px);
  max-height: calc(100vh - var(--topbar-h) - 48px);
  overflow-y: auto;
  background: var(--paper);
  border: 4px solid var(--wood-dark);
  box-shadow: inset 0 0 0 4px var(--wood-light), inset 0 0 0 6px var(--wood-mid), 6px 6px 0 rgba(43, 22, 8, 0.28);
  padding: 12px;
}
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-group { font: 600 15px var(--head); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 10px 8px 4px; }
.nav-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  color: var(--ink);
  text-decoration: none;
  font: 500 19px var(--head);
  border: 2px solid transparent;
}
.nav-list a:hover { background: var(--paper-2); color: var(--ink); }
.nav-list a.active { background: var(--paper-3); border-color: var(--wood-dark); box-shadow: inset 0 0 0 2px var(--wood-light); }
.nav-list .px { font-size: 22px; flex: none; }

.main { padding: 34px 38px 40px; min-height: 60vh; outline: none; }

.main h1 { font-size: 40px; font-weight: 700; color: var(--wood-dark); text-shadow: 2px 2px 0 var(--paper-3); margin-bottom: 6px; }
.main h1 .px { font-size: 40px; margin-right: 6px; }
.lead { font-size: 23px; color: var(--muted); margin: 0 0 22px; max-width: 70ch; }
.main h2 {
  font-size: 28px;
  margin: 34px 0 12px;
  padding-bottom: 6px;
  border-bottom: 4px dotted var(--wood-mid);
  color: var(--wood-dark);
}
.main h3 { font-size: 22px; margin: 22px 0 8px; color: var(--wood); }
.main p { margin: 0 0 12px; max-width: 78ch; }
.main ul, .main ol { margin: 0 0 14px; padding-left: 26px; max-width: 78ch; }
.main li { margin-bottom: 4px; }
.main li::marker { color: var(--wood-mid); }
strong { color: #2b1608; font-weight: 400; background: linear-gradient(180deg, transparent 62%, rgba(247, 201, 72, 0.7) 62%); }
.en { color: var(--muted); }

/* Iconos pixel */
.px { display: inline-block; width: 1em; height: 1em; vertical-align: -0.14em; line-height: 0; }
.px svg { width: 100%; height: 100%; display: block; }

/* Avisos tipo cuadro de diálogo */
.tip, .warn, .note {
  margin: 16px 0;
  padding: 12px 16px;
  border: 3px solid var(--wood-dark);
  box-shadow: inset 0 0 0 3px var(--tip-edge, #9ad07a);
  background: var(--tip-bg, #e4f3c4);
  max-width: 82ch;
}
.tip p:last-child, .warn p:last-child, .note p:last-child { margin-bottom: 0; }
.warn { --tip-bg: #fbd3b0; --tip-edge: #e8884a; }
.note { --tip-bg: #d6ecfb; --tip-edge: #7ab8e6; }
.tip-title { font: 600 19px var(--head); display: block; margin-bottom: 2px; }

/* Etiquetas */
.tag {
  display: inline-block;
  font: 500 15px/1 var(--head);
  padding: 3px 7px 4px;
  color: #fff;
  background: var(--wood);
  border: 2px solid rgba(43, 22, 8, 0.55);
  white-space: nowrap;
}
.tag.s0 { background: var(--spring); }
.tag.s1 { background: var(--summer); }
.tag.s2 { background: var(--fall); }
.tag.s3 { background: var(--winter); }
.tag.green { background: var(--green); }
.tag.red { background: var(--red); }
.tag.plain { background: var(--paper-3); color: var(--ink); }

/* Tablas */
.table-wrap { overflow-x: auto; margin: 12px 0 18px; border: 3px solid var(--wood-dark); background: #fff3d2; }
table { border-collapse: collapse; width: 100%; font-size: 20px; }
th {
  font: 600 16px var(--head);
  text-align: left;
  background: var(--wood);
  color: #ffe9c4;
  padding: 7px 10px;
  white-space: nowrap;
}
td { padding: 6px 10px; border-top: 2px solid var(--paper-3); vertical-align: top; }
tbody tr:nth-child(even) td { background: rgba(243, 192, 112, 0.22); }
td.num, th.num { text-align: right; white-space: nowrap; }

/* Tarjetas */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin: 14px 0 20px; }
.card {
  background: #fff3d2;
  border: 3px solid var(--wood-dark);
  box-shadow: inset 0 0 0 3px var(--paper-3);
  padding: 12px 14px;
}
.card h3 { margin: 0 0 4px; font-size: 21px; color: var(--wood-dark); }
.card p { margin: 0 0 6px; font-size: 19px; }
.card p:last-child { margin-bottom: 0; }
a.card { text-decoration: none; color: var(--ink); display: block; }
a.card:hover { background: var(--paper-2); color: var(--ink); }
.card .px { font-size: 26px; margin-right: 4px; }
.card-meta { color: var(--muted); font-size: 18px; }

/* Listas de tareas */
.checklist { list-style: none; padding-left: 0 !important; }
.checklist li { margin-bottom: 2px; }
.chk { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 3px 6px; }
.chk:hover { background: var(--paper-2); }
.chk input {
  appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  background: #fff3d2;
  border: 3px solid var(--wood-dark);
  cursor: pointer;
}
.chk input:checked { background: var(--green); box-shadow: inset 0 0 0 3px #fff3d2; }
.chk input:checked + span { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 2px; }
.chk small { display: block; font-size: 18px; color: var(--muted); }

/* Controles */
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 16px; }
.btn, .controls input[type="search"] {
  font: 500 18px var(--head);
  color: var(--ink);
  background: #fff3d2;
  border: 3px solid var(--wood-dark);
  box-shadow: inset 0 0 0 2px var(--paper-3);
  padding: 5px 12px;
}
.btn { cursor: pointer; }
.btn:hover { background: var(--paper-2); }
.btn[aria-pressed="true"] { background: var(--wood); color: #ffe9c4; box-shadow: inset 0 0 0 2px var(--wood-mid); }
.controls input[type="search"] { min-width: 220px; flex: 1 1 220px; max-width: 360px; }

/* Barra de progreso (como la de energía) */
.bar { height: 22px; border: 3px solid var(--wood-dark); background: #fff3d2; position: relative; margin: 6px 0 14px; max-width: 520px; }
.bar > span { display: block; height: 100%; background: linear-gradient(180deg, #7fd45a 0 50%, var(--green) 50%); }
.bar > em { position: absolute; inset: 0; text-align: center; font: 600 15px/16px var(--head); font-style: normal; color: var(--ink); }

/* Calendario */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 10px 0 18px; }
.cal-head { font: 600 15px var(--head); text-align: center; color: var(--muted); padding: 2px 0; }
.cal-day { background: #fff3d2; border: 3px solid var(--wood-mid); min-height: 92px; padding: 3px 5px; font-size: 17px; line-height: 1.1; overflow: hidden; }
.cal-day .n { font: 600 16px var(--head); color: var(--muted); display: flex; justify-content: space-between; }
.cal-day.fest { background: #ffe08a; border-color: var(--wood-dark); }
.cal-day .ev { display: block; margin-top: 2px; }
.cal-day .ev.f { color: var(--red); }
.cal-day .ev.b { color: var(--ink); }
.cal-day .ev.w { color: var(--green-dark); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 18px; color: var(--muted); margin-bottom: 8px; }

/* Aldeanos */
.cards[data-list] { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.npc h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.npc .loves { font-size: 19px; }
.npc .easy { color: var(--green-dark); }

/* Lotes */
.room { margin-bottom: 26px; }
.bundles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.bundle h4 { font-size: 20px; color: var(--wood-dark); display: flex; justify-content: space-between; gap: 8px; }
.bundle h4 small { font: 500 15px var(--head); color: var(--muted); white-space: nowrap; }
.bundle.done { background: #e4f3c4; }
.bundle .reward { font-size: 18px; color: var(--muted); margin-top: 6px; }
.bundle ul { list-style: none; margin: 6px 0 0; padding: 0; }

.footer { max-width: 1280px; margin: 0 auto; padding: 0 20px 150px; font-size: 18px; color: #1d4d6e; }
.footer a { color: inherit; }

@media (max-width: 900px) {
  body { font-size: 20px; }
  .menu-toggle { display: block; }
  .layout { grid-template-columns: minmax(0, 1fr); padding: 14px 10px 30px; }
  .sidebar { display: none; position: static; max-height: none; }
  .sidebar.open { display: block; }
  .main { padding: 24px 20px 28px; }
  .main h1 { font-size: 32px; }
  .main h1 .px { font-size: 32px; }
  .main h2 { font-size: 24px; }
  .brand-title { font-size: 22px; }
  .brand-sub { font-size: 16px; }
  .cal { gap: 2px; }
  .cal-day { min-height: 74px; font-size: 14px; padding: 2px 3px; border-width: 2px; }
  .bundles { grid-template-columns: minmax(0, 1fr); }
}
