/* cruzromeromorales.com — LOTERÍA (homepage only; blog + 404 use styles.css)
   A caller, a board, and beans. Light by default (El Sol), dark when the
   visitor's system asks for it (La Luna). */

:root {
  --bg: #FFF1C9; --board: #FFE08A; --card: #FFFDF6;
  --ink: #1E1B4B; --muted: #57537F;
  --accent: #E4007C; --on-accent: #FFFFFF;
  --bean: #6B3A1E; --bean-hi: #A8673C;
  color-scheme: light;

  --f-slab: Rockwell, "Rockwell Nova", "Roboto Slab", "Zilla Slab", "DejaVu Serif", Georgia, serif;
  --f-body: "Segoe UI Variable Text", "Segoe UI", "Avenir Next", system-ui, -apple-system, sans-serif;
  --f-mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --edge: 2px solid var(--ink);
  --wrap: 1240px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E0C2A; --board: #1A1846; --card: #22205A;
    --ink: #F2EEFF; --muted: #ABA6D6;
    --accent: #FFC93C; --on-accent: #1A1300;
    --bean: #C98A57; --bean-hi: #E8B488;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 1rem/1.55 var(--f-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
img { display: block; max-width: 100%; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 6px; }
.skip:focus { top: 12px; }

/* ── masthead ─────────────────────────────────────────────────────── */
.mast { padding: clamp(28px, 5vw, 56px) 0 clamp(24px, 3vw, 36px); }
.mast-in { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: clamp(18px, 3vw, 36px); align-items: center; }
.portrait {
  width: 96px; height: 128px; object-fit: cover; object-position: 50% 18%;
  border: var(--edge); border-radius: 8px; background: var(--card);
  box-shadow: 4px 4px 0 var(--ink); transform: rotate(-3deg);
}
.name { margin: 0; font: 700 clamp(2rem, 1.2rem + 3vw, 3.6rem)/0.95 var(--f-slab); letter-spacing: -0.015em; }
.roles { margin: 10px 0 0; font: 600 0.75rem/1.3 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.thesis { margin: 12px 0 0; font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem); line-height: 1.45; max-width: 46ch; }
.act { display: grid; gap: 8px; justify-items: end; text-align: right; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 20px; border: var(--edge); border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font: 700 1rem/1 var(--f-body); text-decoration: none;
  box-shadow: 3px 3px 0 var(--ink); transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { color: var(--on-accent); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.mail, .lang { margin: 0; font-size: 0.9rem; }
.lang { font: 600 0.78rem/1 var(--f-mono); letter-spacing: 0.06em; }

/* ── the game ─────────────────────────────────────────────────────── */
.game { padding: clamp(8px, 2vw, 20px) 0 clamp(40px, 6vw, 72px); }
.game-in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.label { margin: 0 0 12px; font: 700 0.8rem/1 var(--f-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }

/* el canto: the card being called */
.canto { position: sticky; top: 24px; }
.stage { perspective: 1200px; }
.called { margin: 0; }
.big-card {
  position: relative; display: grid; gap: 12px; padding: 14px 14px 16px;
  border: 3px solid var(--ink); border-radius: 14px; background: var(--card);
  box-shadow: 7px 7px 0 var(--ink);
}
.called.deal .big-card { animation: deal .55s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes deal { from { transform: translate(40px, -24px) rotate(7deg); opacity: 0; } to { transform: none; opacity: 1; } }
.no { position: absolute; top: 12px; left: 16px; font: 700 1.6rem/1 var(--f-slab); }
.chip { justify-self: end; font: 600 0.66rem/1 var(--f-mono); letter-spacing: 0.1em; text-transform: uppercase; padding: 5px 8px; border-radius: 999px; border: 1.5px solid var(--ink); }
.chip--live { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chip--wip { border-style: dashed; }
.big-face { display: block; aspect-ratio: 16 / 10; overflow: hidden; border: 2px solid var(--ink); border-radius: 6px; background: var(--bg); }
.big-face img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.banner { border-top: 3px solid var(--ink); padding-top: 12px; text-align: center; font: 700 clamp(1.3rem, 1rem + 1vw, 1.8rem)/1.05 var(--f-slab); text-transform: uppercase; letter-spacing: 0.03em; }
.verso { margin: 18px 4px 0; font: italic 400 clamp(1.05rem, 1rem + 0.3vw, 1.2rem)/1.45 var(--f-slab); min-height: 4.4em; }
.verso::before { content: "“"; color: var(--accent); font-weight: 700; }
.verso::after { content: "”"; color: var(--accent); font-weight: 700; }
:lang(es) .verso::before { content: "«"; }
:lang(es) .verso::after { content: "»"; }
.canto-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 14px; }
.visit { font-weight: 700; }
.visit-host { font: 500 0.85rem var(--f-mono); color: var(--muted); }
.next, .auto, .again {
  font: 700 0.9rem/1 var(--f-body); padding: 10px 14px; border-radius: 999px; cursor: pointer;
  border: var(--edge); background: var(--card); color: var(--ink);
}
.next:hover, .auto:hover, .again:hover { background: var(--board); }
.auto { font: 600 0.72rem/1 var(--f-mono); letter-spacing: 0.06em; text-transform: uppercase; padding: 9px 12px; }
.how { margin: 14px 0 0; font-size: 0.88rem; color: var(--muted); max-width: 42ch; }

/* la tabla: the board, printed */
.board {
  background: var(--board); border: 3px solid var(--ink); border-radius: 16px;
  padding: clamp(14px, 2vw, 22px); box-shadow: 7px 7px 0 var(--ink);
}
.board-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.board-head .label { color: var(--ink); }
.count { margin: 0; font: 600 0.78rem/1 var(--f-mono); }
.tabla { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(8px, 1.2vw, 14px); }
.tile a {
  position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: 6px; height: 100%;
  padding: 6px 6px 8px; border: var(--edge); border-radius: 8px; background: var(--card);
  text-decoration: none; color: var(--ink); transition: transform .15s ease, box-shadow .15s ease;
}
.tile a:hover { color: var(--ink); transform: translateY(-3px) rotate(-1deg); box-shadow: 3px 4px 0 var(--ink); }
.tile.is-current a { outline: 3px solid var(--accent); outline-offset: 2px; }
.t-no { font: 700 0.8rem/1 var(--f-slab); }
.t-face { display: block; aspect-ratio: 4 / 3; overflow: hidden; border: 1.5px solid var(--ink); border-radius: 4px; background: var(--bg); }
.t-face img { width: 100%; height: 100%; object-fit: cover; object-position: top left; }
.t-name { font: 700 0.68rem/1.15 var(--f-slab); text-transform: uppercase; letter-spacing: 0.02em; text-align: center; border-top: 1.5px solid var(--ink); padding-top: 6px; }
.mark { display: grid; place-items: center; height: 100%; color: var(--ink); background: repeating-linear-gradient(-45deg, transparent 0 8px, color-mix(in srgb, var(--accent) 14%, transparent) 8px 10px); }
.mark svg { width: 70%; max-height: 80%; }
.big-face .mark svg { width: 46%; }
svg .f { fill: var(--accent); }
svg .s { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* the bean */
.bean { position: absolute; left: 50%; top: 46%; width: 44%; transform: translate(-50%, -50%) rotate(-18deg) scale(0); opacity: 0; pointer-events: none; filter: drop-shadow(1px 2px 0 rgba(0,0,0,.25)); }
.bean path { fill: var(--bean); }
.bean .bean-eye { fill: none; stroke: var(--bean-hi); stroke-width: 2; stroke-linecap: round; }
.tile.is-called .bean { opacity: 1; transform: translate(-50%, -50%) rotate(var(--tilt, -18deg)) scale(1); transition: transform .35s cubic-bezier(.3, 1.8, .5, 1), opacity .1s; }
.tile.is-called .t-face { filter: saturate(.55); }

/* ¡Lotería! */
.win { margin-top: 16px; padding: 18px; border: var(--edge); border-radius: 12px; background: var(--card); text-align: center; }
.win-h { margin: 0 0 6px; font: 700 clamp(2rem, 1.4rem + 2vw, 3rem)/1 var(--f-slab); color: var(--accent); transform: rotate(-2deg); }
.win.pop .win-h { animation: shout .6s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes shout { from { transform: scale(.4) rotate(-12deg); } to { transform: scale(1) rotate(-2deg); } }
.win p { margin: 0 0 12px; }
.win-act { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; margin: 0 !important; }

/* ── el reverso: the three concerns ───────────────────────────────── */
.reverso { border-top: 3px solid var(--ink); padding: clamp(36px, 5vw, 64px) 0; }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); }
.col h2 { margin: 0 0 16px; font: 700 1.35rem/1 var(--f-slab); display: flex; align-items: center; gap: 10px; }
.col h2::before { content: ""; width: 14px; height: 18px; border: 2px solid var(--ink); border-radius: 3px; background: var(--accent); transform: rotate(-8deg); flex: none; }
.col p { margin: 0 0 12px; max-width: 46ch; }
.links { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.links a { font-weight: 600; }
.note { display: block; font-size: 0.86rem; color: var(--muted); }
.more { margin-top: 14px !important; font-weight: 600; }
.fine { font-size: 0.82rem; color: var(--muted); margin-top: 12px !important; }
.receipts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0 4px; }
.receipts div { border: var(--edge); border-radius: 8px; padding: 10px 12px; background: var(--card); box-shadow: 3px 3px 0 var(--ink); }
.receipts dt { font: 700 1.4rem/1 var(--f-slab); color: var(--accent); }
.receipts dd { margin: 4px 0 0; font-size: 0.78rem; line-height: 1.3; color: var(--muted); }

.foot { border-top: 1.5px solid color-mix(in srgb, var(--ink) 25%, transparent); padding: 24px 0 40px; }
.foot-in { display: grid; gap: 8px; }
.colophon { margin: 0; font: italic 0.88rem/1.5 var(--f-slab); color: var(--muted); max-width: 70ch; }
.contact { margin: 0; font-size: 0.88rem; }

/* ── smaller screens ──────────────────────────────────────────────── */
@media (max-width: 980px) {
  .game-in { grid-template-columns: 1fr; }
  .canto { position: static; }
  .cols { grid-template-columns: 1fr 1fr; }
  .cols .col:last-child { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .mast-in { grid-template-columns: auto minmax(0, 1fr); }
  .portrait { width: 72px; height: 96px; }
  .act { grid-column: 1 / -1; justify-items: start; text-align: left; }
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .t-name { display: none; }
  .tile a { grid-template-rows: auto 1fr; padding: 4px 4px 5px; gap: 4px; }
  .t-no { font-size: 0.7rem; }
  .board { padding: 12px; box-shadow: 4px 4px 0 var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
