:root {
  --ink: #1b1530;
  --night: #221b45;
  --night-2: #2e2562;
  --night-3: #3c3280;
  --paper: #fff7e8;
  --paper-2: #f6e7c8;
  --text: #fff7e8;
  --muted: #b9b0d6;
  --ochre: #f2a541;
  --terra: #e4572e;
  --turq: #2ab7ca;
  --magenta: #c03fa3;
  --green: #5a8f29;
  --ok: #3fbf6f;
  --warn: #f2c14e;
  --bad: #e5484d;
  --radius: 16px;
  --font-title: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --font-body: 'Rubik', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--night);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-title); font-weight: 400; letter-spacing: .5px; margin: 0 0 .4em; line-height: 1.1; }
a { color: var(--ochre); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- Botones estilo juego ---------- */
.btn {
  --c: var(--ochre);
  --c-dark: #b8741c;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 3px solid var(--ink);
  background: var(--c);
  color: var(--ink);
  font-family: var(--font-title);
  font-size: 18px;
  letter-spacing: .5px;
  padding: 12px 20px;
  border-radius: 14px;
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
  transition: transform .06s, box-shadow .06s;
  text-decoration: none;
  user-select: none;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { display: flex; width: 100%; }
.btn.big { font-size: 22px; padding: 16px 22px; }
.btn.red { --c: var(--terra); color: var(--paper); }
.btn.turq { --c: var(--turq); }
.btn.green { --c: var(--ok); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--muted); box-shadow: none; font-family: var(--font-body); font-size: 15px; padding: 9px 14px; }
.btn.ghost:active { transform: none; }
.btn.small { font-size: 14px; padding: 7px 12px; box-shadow: 0 3px 0 var(--ink); border-width: 2px; border-radius: 10px; }

/* ---------- Formularios ---------- */
label { display: block; font-size: 14px; color: var(--muted); margin: 14px 0 6px; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--ochre); box-shadow: 0 0 0 3px rgba(242,165,65,.35); }
textarea { resize: vertical; min-height: 70px; }
.check { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: 16px; }
.check input { width: 22px; height: 22px; accent-color: var(--ok); }

/* ---------- Tarjetas ---------- */
.card {
  background: var(--night-2);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 6px 0 var(--ink);
  padding: 18px;
}
.card.paper { background: var(--paper); color: var(--ink); }
.card.paper .muted { color: #6b6280; }

/* ---------- Mensajes ---------- */
.error { background: rgba(229,72,77,.15); border: 2px solid var(--bad); color: #ffd3d5; padding: 10px 12px; border-radius: 10px; margin-top: 12px; font-size: 14px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(150%);
  background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink);
  padding: 12px 18px; border-radius: 14px; font-weight: 600; z-index: 1000; transition: transform .25s;
  max-width: calc(100% - 32px);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- Modal / hoja ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15,10,35,.75); z-index: 500;
  display: flex; align-items: flex-end; justify-content: center; padding: 16px;
  animation: fade .2s;
}
@media (min-width: 640px) { .overlay { align-items: center; } }
.sheet { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; animation: rise .25s; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }

/* ---------- Pantalla de acceso ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-wrap .card { width: 100%; max-width: 400px; }
.logo { text-align: center; margin-bottom: 18px; }
.logo .t1 { font-family: var(--font-title); font-size: 40px; color: var(--ochre); text-shadow: 3px 3px 0 var(--ink); line-height: 1; }
.logo .t2 { font-family: var(--font-title); font-size: 22px; color: var(--paper); text-shadow: 2px 2px 0 var(--ink); }
.tabs { display: flex; gap: 6px; background: var(--ink); padding: 5px; border-radius: 14px; margin-bottom: 6px; }
.tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); font: 600 15px var(--font-body); padding: 10px; border-radius: 10px; cursor: pointer; }
.tabs button.on { background: var(--ochre); color: var(--ink); }

/* Fila de casitas decorativas */
.houses { display: flex; gap: 4px; justify-content: center; margin: 4px 0 14px; }
.houses span { width: 22px; height: 26px; border: 2px solid var(--ink); border-radius: 3px 3px 0 0; position: relative; }
.houses span::after { content: ''; position: absolute; left: 6px; top: 6px; width: 6px; height: 8px; background: var(--ink); border-radius: 3px 3px 0 0; opacity: .7; }
