/* El jardín · estilos. Un solo archivo, sin build. Las variables de color de :root son copia literal de las de la web
   principal (public/assets/styles.css), con su modo oscuro duplicado (@media y data-theme); las del juego llevan --g-. */
:root {
  color-scheme: light dark;
  --bg: #F4F0E6;
  --paper: #FBF8F1;
  --ink: #1E2B23;
  --ink-soft: #46574B;
  --label: #4E6B58;
  --link: #2A4E3B;
  --link-hover: #16301F;
  --accent: #4F7A55;
  --line: #D8D0BD;
  --line-soft: #E3DCCB;
  --pill: #B8C4B0;
  --btn-bg: #2A4E3B;
  --btn-ink: #FFFFFF;
  --card: #FBF8F1;
  --shadow: rgba(60, 50, 30, 0.08);
  --shadow-strong: rgba(60, 50, 30, 0.25);
  --sky-line: rgba(70, 87, 75, 0.22);
  --sky-moon-dark: #D9DFDA;
  --sky-moon-edge: #9DB0BB;
  --season-wash-1: #DCE6D6;
  --season-wash-2: #F0DFA0;
  --season-wash-2-opacity: 0.5;
  --season-accent: #466B4B;
  --blob-hero: #DCE6D6;
  --blob-hero-opacity: 0.8;
  --blob-rose: #EED6C8;
  --blob-rose-opacity: 0.45;
  --blob-sun: #F0DFA0;
  --blob-sun-opacity: 0.4;
  --breath-outer: #D3E2CF;
  --breath-inner: #BFD6BA;
  --grain-opacity: 0.16;
  --grain-blend: multiply;
  --leaf-opacity: 1;
  --vivero-bg: #2A4E3B;
  --sheet: #FFFDF8;
  --mb-green: #DCE6D6;
  --mb-sand: #E8DCC4;
  --mb-peach: #EAD9C2;
  --mb-sun: #F0E6B8;
  --mb-sky: #D7E2E8;
  --mb-rose: #EAD5C6;
  --mb-frost: #E3EBEE;
  --au-strong: #2A4E3B;
  --au-on-strong: #FFFFFF;
  --au-soft: #BFD6BA;
  --au-current: #EEF3E8;
  --au-word: #F1F5EC;
  --au-word-line: #D3E0CC;
  --au-track: #D8D0BD;
  --au-panel: #FBF8F1;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Nunito Sans", system-ui, sans-serif;
}

/* Modo oscuro. Los mismos colores dos veces, porque CSS no permite compartirlos: cuando el sistema lo pide
   (salvo que se haya elegido Claro) y cuando se elige Oscuro a mano (assets/theme.js pone data-theme).
   npm test comprueba que las dos listas coinciden. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141B16;
    --paper: #19221C;
    --ink: #E8E5D9;
    --ink-soft: #B3BDB0;
    --label: #9AB5A0;
    --link: #A8CDAD;
    --link-hover: #CFE6D1;
    --accent: #9CC29F;
    --line: #2F3B32;
    --line-soft: #263029;
    --pill: #4B5D4F;
    --btn-bg: #A8CDAD;
    --btn-ink: #11211A;
    --card: #E9E3D4;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-strong: rgba(0, 0, 0, 0.6);
    --sky-line: rgba(220, 230, 222, 0.18);
    --sky-moon-dark: #2E3A33;
    --sky-moon-edge: #6F8794;
    --season-wash-1: #26412F;
    --season-wash-2: #4A4128;
    --season-wash-2-opacity: 0.4;
    --season-accent: #9CC29F;
    --blob-hero: #26412F;
    --blob-hero-opacity: 0.6;
    --blob-rose: #4A3329;
    --blob-rose-opacity: 0.35;
    --blob-sun: #4A4128;
    --blob-sun-opacity: 0.3;
    --breath-outer: #2B4734;
    --breath-inner: #3A5E44;
    --grain-opacity: 0.08;
    --grain-blend: screen;
    --leaf-opacity: 0.75;
    --vivero-bg: #1C3326;
    --sheet: #1B251E;
    --mb-green: #2A4533;
    --mb-sand: #3B3527;
    --mb-peach: #4A3A2C;
    --mb-sun: #4A4528;
    --mb-sky: #2B3F4A;
    --mb-rose: #4A3331;
    --mb-frost: #2E4550;
    --au-strong: #A8CDAD;
    --au-on-strong: #16261C;
    --au-soft: #3E5E48;
    --au-current: #24352A;
    --au-word: #1F2D24;
    --au-word-line: #34483A;
    --au-track: #3A463D;
    --au-panel: #222E26;
  }
}
:root[data-theme="dark"] {
  --bg: #141B16;
  --paper: #19221C;
  --ink: #E8E5D9;
  --ink-soft: #B3BDB0;
  --label: #9AB5A0;
  --link: #A8CDAD;
  --link-hover: #CFE6D1;
  --accent: #9CC29F;
  --line: #2F3B32;
  --line-soft: #263029;
  --pill: #4B5D4F;
  --btn-bg: #A8CDAD;
  --btn-ink: #11211A;
  --card: #E9E3D4;
  --shadow: rgba(0, 0, 0, 0.3);
  --shadow-strong: rgba(0, 0, 0, 0.6);
  --sky-line: rgba(220, 230, 222, 0.18);
  --sky-moon-dark: #2E3A33;
  --sky-moon-edge: #6F8794;
  --season-wash-1: #26412F;
  --season-wash-2: #4A4128;
  --season-wash-2-opacity: 0.4;
  --season-accent: #9CC29F;
  --blob-hero: #26412F;
  --blob-hero-opacity: 0.6;
  --blob-rose: #4A3329;
  --blob-rose-opacity: 0.35;
  --blob-sun: #4A4128;
  --blob-sun-opacity: 0.3;
  --breath-outer: #2B4734;
  --breath-inner: #3A5E44;
  --grain-opacity: 0.08;
  --grain-blend: screen;
  --leaf-opacity: 0.75;
  --vivero-bg: #1C3326;
  --sheet: #1B251E;
  --mb-green: #2A4533;
  --mb-sand: #3B3527;
  --mb-peach: #4A3A2C;
  --mb-sun: #4A4528;
  --mb-sky: #2B3F4A;
  --mb-rose: #4A3331;
  --mb-frost: #2E4550;
  --au-strong: #A8CDAD;
  --au-on-strong: #16261C;
  --au-soft: #3E5E48;
  --au-current: #24352A;
  --au-word: #1F2D24;
  --au-word-line: #34483A;
  --au-track: #3A463D;
  --au-panel: #222E26;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---------- Variables propias del juego (DESIGN.md §2.2). El modo oscuro va duplicado, como en la web. ---------- */
:root {
  --g-bed: #EEE8D9;
  --g-slot-line: #8A7F66;
  --g-slot-ink: #46574B;
  --g-slot-faint: #C9BFA6;
  --g-select: #2A4E3B;
  --g-new: #E2B23C;
  --g-tag-bg: rgba(251, 248, 241, 0.94);
  --g-scrim: rgba(30, 43, 35, 0.45);
  --g-card-edge: transparent;
  --g-p1: #2A4E3B;
  --g-p2: #3D6481;
  --g-p3: #6E4A7E;
  --g-p4: #9A4A2A;
  --g-p-ink: #FBF8F1;
  --g-wash-opacity: 0.18;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --g-bed: #1E2820;
    --g-slot-line: #7E8C80;
    --g-slot-ink: #B3BDB0;
    --g-slot-faint: #3A463D;
    --g-select: #A8CDAD;
    --g-new: #E2B23C;
    --g-tag-bg: rgba(251, 248, 241, 0.94);
    --g-scrim: rgba(0, 0, 0, 0.6);
    --g-card-edge: rgba(255, 255, 255, 0.08);
    --g-p1: #A8CDAD;
    --g-p2: #9DC0DA;
    --g-p3: #C9A9D6;
    --g-p4: #E0A283;
    --g-p-ink: #11211A;
    --g-wash-opacity: 0.22;
  }
}
:root[data-theme="dark"] {
  --g-bed: #1E2820;
  --g-slot-line: #7E8C80;
  --g-slot-ink: #B3BDB0;
  --g-slot-faint: #3A463D;
  --g-select: #A8CDAD;
  --g-new: #E2B23C;
  --g-tag-bg: rgba(251, 248, 241, 0.94);
  --g-scrim: rgba(0, 0, 0, 0.6);
  --g-card-edge: rgba(255, 255, 255, 0.08);
  --g-p1: #A8CDAD;
  --g-p2: #9DC0DA;
  --g-p3: #C9A9D6;
  --g-p4: #E0A283;
  --g-p-ink: #11211A;
  --g-wash-opacity: 0.22;
}
:root {
  --ease: cubic-bezier(.2, .7, .2, 1);
  --sh-card: 0 1px 2px var(--shadow), 0 2px 6px var(--shadow);
  --sh-lift: 0 8px 18px var(--shadow-strong);
  --sh-dialog: 0 16px 48px var(--shadow-strong);
  --dock-h: 204px;
}

/* ---------- Fuentes ---------- */
@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces-normal.woff2") format("woff2"); font-weight: 300 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/assets/fonts/fraunces-italic.woff2") format("woff2"); font-weight: 300 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("/assets/fonts/nunito-sans.woff2") format("woff2"); font-weight: 200 1000; font-style: normal; font-display: swap; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: var(--link); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--ink); margin: 0; }
h1 { font-size: 28px; line-height: 1.15; }
h2 { font-size: 21px; line-height: 1.2; font-weight: 520; }
h3 { font-size: 18px; font-weight: 560; }
p { margin: 0; }
img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1:focus, h1:focus-visible, [tabindex="-1"]:focus:not(.cell):not(.rules-content) { outline: none; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.icon { width: 1em; height: 1em; flex: none; fill: currentColor; }
.label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--label);
}
.hint { font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.app-loading { padding: 48px 16px; text-align: center; color: var(--ink-soft); }
.app.is-ready .app-loading { display: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 28px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s, border-color .15s;
}
.btn .icon { width: 20px; height: 20px; }
.btn-primary { background: var(--btn-bg); color: var(--btn-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--link); border-color: var(--pill); }
.btn-ghost:hover { border-color: var(--link); }
.btn:active { transform: translateY(1px); }
.btn[aria-disabled="true"] { opacity: .5; cursor: default; }
.btn[aria-disabled="true"]:active { transform: none; }
.btn-wide { width: 100%; }
.btn-tall { min-height: 56px; width: 100%; max-width: 320px; }
.btn-s { min-height: 44px; padding: 0 14px; font-size: 15px; }
.btn-two { flex-direction: column; gap: 2px; padding-top: 8px; padding-bottom: 8px; min-height: 64px; }
.btn-two small { font-size: 15px; font-weight: 600; opacity: .9; }
.btn-text {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  color: var(--link);
  font-weight: 700;
  font-size: 15px;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.btn-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--link);
  cursor: pointer;
}
.btn-icon .icon { width: 22px; height: 22px; }
.btn-icon:hover { background: var(--g-bed); }
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 0 12px 0 4px;
  border: 0;
  background: none;
  color: var(--link);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
}
.btn-back .icon { width: 20px; height: 20px; }

/* Chips: radio, casilla o botón con aria-pressed. Elegido: fondo verde y ✓ (nunca solo color). */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 56px;
  padding: 0 18px;
  border: 1.5px solid var(--pill);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.chip .chip-check { display: none; width: 16px; height: 16px; }
.chip:has(input:checked), .chip[aria-pressed="true"], .chip.is-on { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.chip:has(input:checked) .chip-check, .chip[aria-pressed="true"] .chip-check { display: block; }
.chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.chip-s { min-height: 44px; padding: 0 14px; font-size: 15px; }

/* Ficha de jugador: color + símbolo + (al lado) el nombre. */
.player-token {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pc);
  color: var(--g-p-ink);
}
.player-token .icon { width: 64%; height: 64%; }
.tok-xs { width: 20px; height: 20px; }
.tok-s { width: 24px; height: 24px; }
.tok-m { width: 28px; height: 28px; }
.tok-l { width: 36px; height: 36px; }
.tok-xl { width: 72px; height: 72px; }
.p1, .sc-p1, .g-p1 { --pc: var(--g-p1); }
.p2, .sc-p2, .g-p2 { --pc: var(--g-p2); }
.p3, .sc-p3, .g-p3 { --pc: var(--g-p3); }
.p4, .sc-p4, .g-p4 { --pc: var(--g-p4); }

/* ---------- Páginas de texto (preparación, deseo, reglas, privacidad) ---------- */
.page { max-width: 640px; margin: 0 auto; padding: 8px 16px 32px; }
.page-head { min-height: 52px; display: flex; align-items: center; margin-left: -8px; }
.page > h1 { margin: 4px 0 20px; }

/* ---------- Inicio ---------- */
.home {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}
.fan { position: relative; width: 260px; height: 190px; flex: none; }
.fan-blob { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--mb-green); }
.fan-card {
  position: absolute;
  top: 26px;
  left: 50%;
  width: 96px;
  margin-left: -48px;
  aspect-ratio: 57 / 89;
  height: auto;
  border-radius: 7px;
  box-shadow: var(--sh-card), 0 0 0 1px var(--g-card-edge);
}
.fan-0 { transform: translate(-64px, 10px) rotate(-8deg); }
.fan-1 { transform: translateY(-4px); }
.fan-2 { transform: translate(64px, 10px) rotate(8deg); }
.home-text { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 460px; }
.display {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 380;
  font-size: 44px;
  line-height: 1;
  color: var(--link);
}
.intro { color: var(--ink-soft); max-width: 32ch; }
.meta { font-size: 15px; color: var(--ink-soft); font-weight: 700; }
.home-actions { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 360px; margin: 12px 0 6px; align-items: stretch; }
.home-actions .btn-text { align-self: center; }
.privacy-line { font-size: 15px; color: var(--ink-soft); max-width: 40ch; }

/* ---------- Pie ---------- */
.site-foot {
  max-width: 960px;
  margin: 24px auto 0;
  padding: 20px 16px max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
  font-size: 15px;
}
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 4px; }
.foot-links a, .foot-by a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.foot-by { width: 100%; text-align: center; color: var(--ink-soft); }
.lang-switch { display: flex; gap: 6px; }
.theme-switch { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.theme-switch button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  cursor: pointer;
}
.theme-switch button[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-ink); }
.theme-switch svg { flex: none; }
@media (max-width: 400px) {
  .theme-switch button { padding: 0 10px; gap: 6px; }
}

/* ---------- Preparación ---------- */
.setup-form fieldset { border: 0; margin: 0 0 28px; padding: 0; min-width: 0; }
.setup-form legend { padding: 0; margin-bottom: 10px; }
.setup-form legend label { cursor: pointer; }
.setup-form .hint { margin-top: 8px; }
.names { display: grid; gap: 14px; }
.field label { display: block; font-size: 15px; font-weight: 700; color: var(--ink-soft); margin-bottom: 4px; }
.field-row { display: flex; align-items: center; gap: 10px; }
.field input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--sheet);
  font-size: 17px;
}
.field input:focus { border-color: var(--g-select); }
.field input::placeholder { color: var(--ink-soft); opacity: .8; }
.options { display: grid; gap: 10px; }
.option-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 72px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
}
.option-card input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--g-select); cursor: pointer; }
.option-card:has(input:checked) { border: 2px solid var(--g-select); padding: 15px; background: var(--g-bed); }
.option-card:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.option-card input:focus-visible { outline: none; }
.option-card.is-disabled { cursor: default; }
.option-card.is-disabled input, .option-card.is-disabled .oc-title, .option-card.is-disabled .oc-desc { opacity: .55; }
.oc-text { display: flex; flex-direction: column; gap: 2px; }
.oc-title { font-weight: 700; font-size: 17px; }
.oc-desc { font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.oc-note { font-size: 15px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.select-wrap { position: relative; max-width: 360px; }
.select-wrap select {
  width: 100%;
  height: 48px;
  padding: 0 40px 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--sheet);
  font-size: 17px;
  appearance: none;
  cursor: pointer;
}
.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 19px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--ink-soft);
  border-bottom: 2px solid var(--ink-soft);
  transform: rotate(45deg);
  pointer-events: none;
}
.start-bar {
  position: sticky;
  bottom: 0;
  margin: 0 -16px;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
}

/* ---------- Cambio de turno: en el dock, con el jardín y el marcador a la vista (DECISIONS.md, 11) ---------- */
.game[data-step="H"] .prompt-row { display: none; }
.game[data-step="H"] .dock { height: auto; }
.handoff-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding: 4px 0 2px;
}
.handoff-last { font-size: 15px; color: var(--ink-soft); max-width: 40ch; }
.handoff-who { display: flex; align-items: center; gap: 12px; text-align: left; }
.handoff-who .label { line-height: 1.2; }
.handoff-name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  line-height: 1.1;
  color: var(--link);
  overflow-wrap: anywhere;
}
.handoff-text { max-width: 36ch; }
.handoff-bonus { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.handoff-bonus .icon { color: var(--accent); }
.handoff-card .btn-tall { margin-top: 4px; }

/* ---------- Deseo ---------- */
.turn-mini { display: flex; align-items: center; gap: 8px; min-height: 52px; font-family: var(--serif); font-weight: 520; font-size: 19px; }
.wish > h1 { margin: 4px 0 8px; }
.wish > p { margin-bottom: 16px; }
.wish-grid { border: 0; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.wish-opt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 150px;
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
}
.wish-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wish-opt:has(input:checked) { border: 3px solid var(--g-select); padding: 12px 6px; background: var(--g-bed); }
.wish-opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
.wish-check { display: none; position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-ink); place-items: center; }
.wish-check .icon { width: 16px; height: 16px; }
.wish-opt:has(input:checked) .wish-check { display: grid; }
.wish-icon .icon { width: 40px; height: 40px; }
.wish-name { font-weight: 700; font-size: 16px; line-height: 1.25; }
.wish-card { width: 48px; height: auto; aspect-ratio: 57 / 89; border-radius: 4px; box-shadow: var(--sh-card); }
.wish .btn-wide { margin-bottom: 8px; }
.wish .hint { margin-bottom: 6px; }

/* Colores de palo (texto sobre la cartela clara) */
.suit-flowers, [data-suit="flowers"] { --suit: #9B3F5E; }
.suit-aromatics, [data-suit="aromatics"] { --suit: #3F6B46; }
.suit-succulents, [data-suit="succulents"] { --suit: #96522F; }
.suit-citrus, [data-suit="citrus"] { --suit: #8C5A00; }
.wish-icon { color: var(--suit); }
:root[data-theme="dark"] .wish-icon { filter: brightness(1.7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wish-icon { filter: brightness(1.7); } }
.season-spring { --s-ink: #8A72B8; --s-bg: #ECE5F5; }
.season-summer { --s-ink: #D19A1E; --s-bg: #F7EBC6; }
.season-autumn { --s-ink: #B0552B; --s-bg: #F3DFD2; }
.season-winter { --s-ink: #5C7F99; --s-bg: #DFE9F0; }

/* ---------- La carta y su cartela (DESIGN.md §5.3) ---------- */
.card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 57 / 89;
  border-radius: 7px;
  box-shadow: var(--sh-card), 0 0 0 1px var(--g-card-edge);
  background: #FBF8F1;
}
.card img { display: block; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.card-tag {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 22px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 2px 0 4px;
  background: var(--g-tag-bg);
  border-radius: 4px 4px 0 0;
}
.tag-num { font-family: var(--serif); font-weight: 600; font-size: 12px; line-height: 1; color: var(--suit); letter-spacing: .02em; }
.tag-player { display: grid; place-items: center; width: 14px; height: 14px; border-radius: 50%; background: var(--pc); color: var(--g-p-ink); }
.tag-player .icon { width: 10px; height: 10px; }
.tag-season { margin-left: auto; display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--s-bg); color: var(--s-ink); }
.tag-season .icon { width: 14px; height: 14px; }
.card-suit {
  position: absolute;
  left: 2px;
  bottom: 2px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--g-tag-bg);
  color: var(--suit);
}
.card-suit .icon { width: 12px; height: 12px; }
.new-tag {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  padding: 0 7px;
  height: 18px;
  line-height: 18px;
  border-radius: 999px;
  background: var(--g-new);
  color: #1E2B23;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.cell, .hand-card, .mini-card { container-type: inline-size; }
@container (min-width: 64px) {
  .card-tag { height: 26px; padding: 0 3px 0 5px; }
  .tag-num { font-size: 15px; }
  .tag-season { width: 20px; height: 20px; }
  .tag-season .icon { width: 16px; height: 16px; }
  .card-suit { width: 20px; height: 20px; left: 3px; bottom: 3px; }
  .card-suit .icon { width: 14px; height: 14px; }
  .card { border-radius: 7px; }
}
@container (max-width: 63px) {
  .card { border-radius: 4px; }
}
@container (max-width: 51px) {
  .tag-num { font-size: 11px; }
  .tag-season { width: 16px; height: 16px; }
  .tag-season .icon { width: 12px; height: 12px; }
  .tag-player { width: 12px; height: 12px; }
  .tag-player .icon { width: 9px; height: 9px; }
}
@container (min-width: 100px) {
  .card-tag, .card-suit { display: none; }
  .card { border-radius: 9px; }
}

/* ---------- Partida (DESIGN.md §4.3) ---------- */
.game { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.game-top { flex: none; background: var(--paper); border-bottom: 1px solid var(--line); }
.turnbar { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 2px 0 12px; }
.turn-name {
  flex: 1;
  min-width: 0;
  padding: 4px 0;
  font-weight: 520;
  font-size: 19px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.deck { font-size: 15px; color: var(--ink-soft); white-space: nowrap; }
.scoreline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-height: 40px; padding: 0 12px 4px; }
.scores { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0; }
/* Cada jugador en su columna, separadas por una línea, para que cada cifra quede con su nombre. */
.score { display: flex; align-items: center; gap: 4px; min-width: 0; min-height: 36px; padding: 0 6px; border-left: 1px solid var(--line); border-bottom: 3px solid transparent; }
.score:first-child { border-left: 0; padding-left: 0; }
.score:last-child { padding-right: 0; }
/* Cuatro jugadores en el móvil: dos filas de dos, para que los nombres se lean enteros. */
@media (max-width: 559px) {
  .scores.n4 { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 0; }
  .scores.n4 .score { min-height: 32px; }
  .scores.n4 .score:nth-child(odd) { border-left: 0; padding-left: 0; padding-right: 8px; }
  .scores.n4 .score:nth-child(even) { padding-left: 8px; padding-right: 0; }
}
.score.is-current { border-bottom-color: var(--pc); }
.score.is-current .score-name { font-weight: 800; }
.score-who { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1 1 auto; }
.score-name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-val { display: flex; align-items: center; gap: 3px; flex: none; }
.score-num { font-family: var(--serif); font-weight: 600; font-size: 17px; font-variant-numeric: lining-nums tabular-nums; }
.score-gain { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.score-care { display: inline-grid; place-items: center; color: var(--ink-soft); }
.score-care .icon { width: 16px; height: 16px; }
.pot {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-height: 44px;
  padding: 4px 12px;
  border: 1.5px solid var(--pill);
  border-radius: 22px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.pot:hover { border-color: var(--link); }
.pot-drop { color: var(--accent); width: 18px; height: 18px; }
.pot-text { font-size: 15px; }
.pot-text b { font-family: var(--serif); font-weight: 600; font-size: 17px; font-variant-numeric: lining-nums tabular-nums; }
.level-pill { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--link); }
.cares-left { font-size: 15px; color: var(--ink-soft); }

/* El bancal (DESIGN.md §5) */
.bed-area {
  flex: 1 1 auto;
  min-height: 0;
  container-type: size;
  display: grid;
  place-items: safe center;
  overflow: auto;
  padding: 8px 12px;
}
.bed {
  --gap: 4px;
  --cell-max: 88px;
  --cols: 3;
  --rows: 3;
  --cell-min: 44px;
  --cell-w: max(var(--cell-min), min(var(--cell-max), (100cqw - 18px - (var(--cols) - 1) * var(--gap)) / var(--cols), ((100cqh - 18px - (var(--rows) - 1) * var(--gap)) / var(--rows)) * 57 / 89));
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell-w));
  gap: var(--gap);
  padding: 8px;
  background: var(--g-bed);
  border-radius: 16px;
}
.bed[data-cols="1"] { --cols: 1; } .bed[data-cols="2"] { --cols: 2; } .bed[data-cols="3"] { --cols: 3; }
.bed[data-cols="4"] { --cols: 4; } .bed[data-cols="5"] { --cols: 5; } .bed[data-cols="6"] { --cols: 6; }
.bed[data-cols="7"] { --cols: 7; } .bed[data-cols="8"] { --cols: 8; }
.bed[data-rows="1"] { --rows: 1; } .bed[data-rows="2"] { --rows: 2; } .bed[data-rows="3"] { --rows: 3; }
.bed[data-rows="4"] { --rows: 4; } .bed[data-rows="5"] { --rows: 5; } .bed[data-rows="6"] { --rows: 6; }
.bed[data-rows="7"] { --rows: 7; } .bed[data-rows="8"] { --rows: 8; }
.bed-row { display: contents; }
.cell { position: relative; aspect-ratio: 57 / 89; border-radius: 6px; }
.cell-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cell-btn:focus-visible, .cell:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.is-slot .cell-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 2px dashed var(--g-slot-line);
  color: var(--g-slot-ink);
  animation: fade .16s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .is-slot .cell-btn:hover { background: color-mix(in srgb, var(--g-select) 8%, transparent); }
}
.slot-plus .icon { width: 20px; height: 20px; }
.slot-drops { display: inline-flex; align-items: center; gap: 2px; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.slot-drops .icon { width: 12px; height: 12px; }
.is-slot-faint .cell-btn { border: 1.5px dashed var(--g-slot-faint); cursor: default; }
.is-new .card { outline: 3px solid var(--g-new); outline-offset: 1px; }
.is-preview .card { opacity: .75; outline: 2px dashed var(--g-select); outline-offset: 2px; }
.gain-pill {
  position: absolute;
  right: -4px;
  bottom: -4px;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}
.is-movable .card { outline: 2px dashed var(--g-select); outline-offset: 2px; }
.move-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--paper);
  color: var(--g-select);
  border: 1.5px solid var(--g-select);
}
.move-badge .icon { width: 14px; height: 14px; }
.is-locked { opacity: .5; }
.is-selected .card { outline: 3px solid var(--g-select); outline-offset: 2px; box-shadow: var(--sh-lift); transform: translateY(-4px); }
.is-origin { border: 2px dashed var(--g-slot-line); display: grid; place-items: center; }
.origin-tag { font-size: 12px; font-weight: 800; color: var(--g-slot-ink); text-align: center; line-height: 1.2; padding: 2px; }
.is-scoring::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--g-select);
  box-shadow: 0 0 0 2px var(--g-bed);
}
.is-trio .card { box-shadow: var(--sh-card), 0 3px 0 0 var(--g-select); }
.is-group .card { outline: 3px dashed var(--pc); outline-offset: 2px; }

/* El dock */
.dock {
  flex: none;
  position: relative;
  min-height: var(--dock-h);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px max(12px, env(safe-area-inset-bottom));
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 8px var(--shadow);
}
.prompt-row { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-height: 44px; }
.prompt { flex: 1 1 170px; min-width: 0; font-size: 15px; line-height: 1.4; }
.prompt b { font-weight: 800; }
.prompt-line { display: block; }
.bd-part { white-space: nowrap; }
.bd-sep { color: var(--ink-soft); }
.prompt-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 4px 8px; margin-left: auto; }
.prompt-actions:empty { display: none; }
.care-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--g-bed); border: 1.5px solid var(--g-select); font-weight: 700; font-size: 15px; }
.care-chip .icon { width: 18px; height: 18px; color: var(--g-select); }
.btn-s .icon { width: 18px; height: 18px; }
.dock-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.hand-row { display: flex; align-items: flex-end; justify-content: center; gap: 12px; }
.hand { display: flex; justify-content: center; align-items: flex-end; gap: 12px; padding-top: 10px; }
.wish-aside { flex: 0 1 112px; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; line-height: 1.3; align-self: center; }
.btn-care { min-height: 44px; padding: 0 12px; white-space: nowrap; }
.care-chip { min-height: 36px; padding: 0 9px; }
.hand.is-dimmed { opacity: .5; }
.hand-slot { position: relative; width: 76px; flex: none; }
.hand-card { display: block; width: 100%; padding: 0; border: 0; border-radius: 7px; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hand-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.hand-slot.is-selected .hand-card { transform: translateY(-10px); animation: lift .14s var(--ease); }
.hand-slot.is-selected .card { outline: 3px solid var(--g-select); outline-offset: 2px; box-shadow: var(--sh-lift); }
.sel-check { display: none; position: absolute; top: -8px; left: -8px; width: 22px; height: 22px; border-radius: 50%; background: var(--btn-bg); color: var(--btn-ink); place-items: center; z-index: 2; }
.sel-check .icon { width: 14px; height: 14px; }
.hand-slot.is-selected .sel-check { display: grid; }
.zoom-btn {
  position: absolute;
  top: -24px;
  right: -20px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  cursor: pointer;
  z-index: 3;
}
.zoom-btn .icon { width: 32px; height: 32px; padding: 6px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--pill); box-shadow: var(--sh-card); }
.hand-compact { justify-content: flex-start; gap: 8px; padding-top: 0; }
.hand-compact .hand-slot { width: 44px; }
.hand-compact .hand-card { cursor: default; }
.dock-chips { display: flex; justify-content: center; }
.chip-info { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink-soft); }
.chip-info .icon { width: 16px; height: 16px; color: var(--suit); }
:root[data-theme="dark"] .chip-info .icon { filter: brightness(1.7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip-info .icon { filter: brightness(1.7); } }
.confirm-row { display: flex; align-items: center; gap: 12px; }
.mini-card { width: 56px; flex: none; }
.confirm-btns { flex: 1; display: flex; gap: 8px; min-width: 0; }
.confirm-btns .btn { flex: 1 1 auto; padding: 0 14px; }
.confirm-btns .btn-primary { flex: 2 1 auto; }
.done-row { display: flex; align-items: center; gap: 12px; }
.done-row .hand { flex: none; padding-top: 4px; }
.done-btns { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.done-btns .btn { padding: 0 14px; }
.done-btns .btn-ghost { min-height: 44px; }

/* Móvil: el dock tiene altura fija (no crece con el cuidado ni con la indicación) y la indicación cabe en tres
   líneas. En pantallas bajas, cartas de la mano más pequeñas y casillas que pueden bajar de 44 px de ancho (siguen
   midiendo más de 44 de alto), para que el 5 × 5 se vea entero (DECISIONS.md, 13). */
@media (max-width: 1023px) {
  .game:not([data-step="H"]) .dock { height: var(--dock-h); }
  .prompt-row { flex-wrap: nowrap; }
  .prompt { flex: 1 1 auto; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
  .prompt-actions { flex: none; flex-wrap: nowrap; }
}
@media (max-height: 760px) and (max-width: 1023px) {
  :root { --dock-h: 186px; }
  .bed { --cell-min: 32px; }
  .hand-slot { width: 62px; }
  .hand-compact .hand-slot { width: 42px; }
  .prompt { font-size: 14px; }
  .scores.n4 { grid-auto-flow: column; grid-template-columns: none; }
  .scores.n4 .score:nth-child(n) { border-left: 1px solid var(--line); padding: 0 6px; }
  .scores.n4 .score:first-child:nth-child(n) { border-left: 0; padding-left: 0; }
  .scores.n4 .score-name { display: none; } /* el nombre de quien juega ya está arriba, en grande */
  .scores.n4 .score-who { flex: 0 0 auto; }
}
@media (max-width: 359px) {
  .hand-slot { width: 68px; }
  .confirm-btns .btn { padding: 0 10px; font-size: 16px; }
}

/* ---------- Diálogos ---------- */
dialog { color: var(--ink); }
dialog::backdrop { background: rgba(30, 43, 35, 0.45); background: var(--g-scrim); }
.modal, .sheet-dialog {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 24px;
  border: 0;
  border-radius: 14px;
  background: var(--sheet);
  box-shadow: var(--sh-dialog);
  animation: dialog-in .18s var(--ease);
}
.modal h2, .sheet-dialog h2 { font-size: 22px; margin-bottom: 12px; }
.modal p { margin-bottom: 12px; }
.modal-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.menu-head { display: flex; align-items: center; justify-content: space-between; margin: -8px -8px 8px 0; }
.menu-head h2 { margin: 0; }
.menu { padding: 20px; width: min(440px, calc(100% - 24px)); }
.menu-list { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.menu-list .btn { min-height: 48px; }
.menu .theme-switch button { padding: 0 10px; gap: 6px; }
.menu-list .label { margin-top: 6px; }
.menu-list .btn-wide { width: 100%; }
.menu-list .theme-switch { flex-wrap: wrap; }
.sheet-handle { display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--pill); margin: -12px auto 12px; }
@media (max-width: 767px) {
  .sheet-dialog {
    margin: auto 0 0;
    width: 100%;
    max-width: 100%;
    max-height: 80dvh;
    border-radius: 20px 20px 0 0;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    animation: sheet-in .18s var(--ease);
  }
}
@media (min-width: 768px) {
  .sheet-handle { display: none; }
  .modal-btns { flex-direction: row-reverse; justify-content: flex-start; }
  .sheet-dialog { width: min(520px, calc(100% - 32px)); }
}
.care-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 12px; }
.care-row { display: grid; grid-template-columns: 64px 1fr; grid-template-areas: "img text" "img btn"; gap: 4px 12px; align-items: start; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.care-img { grid-area: img; width: 64px; height: auto; aspect-ratio: 57 / 89; border-radius: 4px; box-shadow: var(--sh-card); }
.care-text { grid-area: text; }
.care-text h3 { font-size: 21px; font-weight: 520; }
.care-text p { font-size: 15px; line-height: 1.45; color: var(--ink-soft); }
.care-count { font-family: var(--sans); font-size: 15px; color: var(--ink-soft); font-weight: 700; }
.care-why { color: var(--ink) !important; font-weight: 700; margin-top: 4px; }
.care-row .btn { grid-area: btn; justify-self: start; }
.care-row.is-off .care-img, .care-row.is-off .care-text h3, .care-row.is-off .care-text p:not(.care-why) { opacity: .55; }
.card-zoom {
  padding: 16px;
  border: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100dvh;
  overflow: auto;
  text-align: center;
  animation: dialog-in .18s var(--ease);
}
.card-zoom::backdrop { background: rgba(20, 28, 22, .8); }
.zoom-img {
  display: block;
  width: min(340px, 86vw, 62dvh * 57 / 89);
  height: auto;
  aspect-ratio: 57 / 89;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: var(--sh-dialog);
}
.zoom-desc, .zoom-by { display: table; margin: 12px auto 0; padding: 6px 14px; border-radius: 12px; background: rgba(20, 28, 22, .88); color: #FBF8F1; font-weight: 700; }
.zoom-by { margin-top: 4px; color: #E3DCCB; font-weight: 400; font-size: 15px; }
.card-zoom .btn { margin-top: 12px; background: rgba(20, 28, 22, .88); color: #FBF8F1; border-color: rgba(251, 248, 241, .6); }
.levels { width: 100%; border-collapse: collapse; font-size: 15px; }
.levels th { text-align: left; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--label); padding: 6px 4px; }
.levels td { padding: 8px 4px; border-top: 1px solid var(--line-soft); }
.levels .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.levels .is-current td { background: var(--g-bed); }
.lv-mark { white-space: nowrap; color: var(--link); font-weight: 700; }
.rules-dialog {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
}
.rules-top { position: sticky; top: 0; z-index: 2; padding: 8px 12px; background: var(--paper); border-bottom: 1px solid var(--line); }
.rules-top .btn { min-height: 44px; padding: 0 18px; }
.rules-content { max-width: 640px; margin: 16px auto 32px; }

/* ---------- Final ---------- */
.end { display: flex; flex-direction: column; }
.end-bed .bed-area { height: min(62dvh, 560px); }
.end-panel { max-width: 560px; width: 100%; margin: 0 auto; padding: 8px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.end-panel h1 { margin-bottom: 4px; }
.end-result { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.end-big { font-family: var(--serif); font-size: 44px; line-height: 1; font-variant-numeric: lining-nums; }
.end-level { font-family: var(--serif); font-style: italic; font-size: 21px; color: var(--link); margin-bottom: 8px; }
.end-lead { font-family: var(--serif); font-size: 21px; line-height: 1.3; }
.end-list { list-style: none; margin: 0; padding: 0; }
.end-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.er-name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.er-num { font-family: var(--serif); font-weight: 600; font-size: 18px; font-variant-numeric: lining-nums tabular-nums; }
.er-wish { width: 100%; padding-left: 34px; font-size: 15px; color: var(--ink-soft); }
.group-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.end-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.end-thanks { font-size: 15px; color: var(--ink-soft); margin: 8px 0 32px; }

/* ---------- Reglas y privacidad ---------- */
.reading { padding-bottom: 8px; }
.sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: 14px; padding: 24px 16px; }
@media (max-width: 400px) { .reading { padding-left: 10px; padding-right: 10px; } }
.sheet > * + * { margin-top: 12px; }
.sheet h1 { margin-top: 4px; }
.display-s { font-style: italic; color: var(--link); font-size: 40px; line-height: 1.05; }
.lead { font-size: 18px; }
.app-note { font-weight: 700; color: var(--link); }
.print-box { background: var(--g-bed); border-radius: 14px; padding: 18px; margin-top: 20px; }
.print-box h2 { margin-bottom: 6px; }
.print-links { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.print-links .btn { min-height: 48px; font-size: 15px; padding: 8px 18px; }
.rules-section { margin-top: 28px; }
.rules-section > * + * { margin-top: 10px; }
.rules-section h2 { display: flex; align-items: center; gap: 10px; color: var(--link); }
.step-n { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--btn-bg); color: var(--btn-ink); font-family: var(--sans); font-size: 15px; font-weight: 800; }
.rules-section ol, .rules-section ul { padding-left: 22px; margin-bottom: 0; }
.rules-section li + li { margin-top: 6px; }
.rules-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.rules-table td, .rules-table th { padding: 8px 4px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top; }
.rules-table th { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--label); }
.rules-table .num { text-align: right; font-family: var(--serif); font-weight: 600; white-space: nowrap; }
.rules-table th.num { white-space: normal; font-family: var(--sans); }
.seasons { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.seasons li { display: flex; align-items: center; gap: 8px; margin: 0 !important; }
.season-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--s-bg); color: var(--s-ink); flex: none; }
.season-dot .icon { width: 20px; height: 20px; }
.example { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; background: var(--g-bed); border-radius: 14px; padding: 16px; }
.example > div:last-child { flex: 1 1 220px; }
.example p + p { margin-top: 6px; }
.ex-grid { display: grid; grid-template-columns: repeat(3, 52px); gap: 4px; }
.ex-card { display: block; width: 52px; height: auto; aspect-ratio: 57 / 89; border-radius: 4px; box-shadow: var(--sh-card); }
.ex-empty { box-shadow: none; border: 1.5px dashed var(--g-slot-faint); }
.ex-new { outline: 3px solid var(--g-new); outline-offset: 1px; }
.care-rules { list-style: none; padding: 0 !important; display: grid; gap: 12px; }
.care-rules li { display: flex; gap: 12px; align-items: flex-start; margin: 0 !important; }
.care-rules img { width: 56px; height: auto; aspect-ratio: 57 / 89; border-radius: 4px; box-shadow: var(--sh-card); flex: none; }
details { border-top: 1px solid var(--line-soft); }
details summary { display: flex; align-items: center; min-height: 44px; font-weight: 700; cursor: pointer; }
details p { padding-bottom: 12px; }
.notfound h2 { margin-top: 28px; }
.rules-content .privacy-line { margin-top: 24px; }

/* ---------- Tableta (768–1023) ---------- */
@media (min-width: 768px) {
  :root { --dock-h: 232px; }
  h1 { font-size: 36px; }
  h2 { font-size: 24px; }
  body { font-size: 18px; line-height: 1.6; }
  .page { padding-left: 32px; padding-right: 32px; }
  .home { flex-direction: row; justify-content: center; text-align: left; gap: 48px; padding-top: 64px; }
  .fan { width: 400px; height: 320px; }
  .fan-card { width: 160px; margin-left: -80px; top: 36px; }
  .fan-0 { transform: translate(-104px, 16px) rotate(-8deg); }
  .fan-2 { transform: translate(104px, 16px) rotate(8deg); }
  .home-text { align-items: flex-start; }
  .home-actions .btn-text { align-self: flex-start; }
  .display { font-size: 64px; }
  .turn-name { font-size: 22px; }
  .bed { --gap: 6px; --cell-max: 120px; }
  .hand-slot { width: 112px; }
  .hand-compact .hand-slot { width: 64px; }
  .start-bar { position: static; margin: 0; padding: 0; border: 0; background: none; }
  .handoff-card { background: var(--sheet); border-radius: 14px; padding: 32px; box-shadow: var(--sh-card); }
  .wish-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .end-actions { flex-direction: row; }
  .sheet { padding: 36px 40px; }
  .print-links { flex-direction: row; flex-wrap: wrap; }
  .zoom-img { width: min(400px, 86vw, 70dvh * 57 / 89); }
}

/* ---------- Escritorio (≥ 1024): jardín a la izquierda y panel a la derecha ---------- */
@media (min-width: 1024px) {
  .game {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "bed top" "bed dock";
    column-gap: 24px;
    padding: 24px 32px;
  }
  .bed-area { grid-area: bed; padding: 0; }
  .bed { --gap: 8px; --cell-max: 112px; }
  .game-top { grid-area: top; border: 1px solid var(--line); border-bottom: 0; border-radius: 14px 14px 0 0; padding: 16px 16px 4px; }
  .turnbar { padding: 0; }
  .turnbar .player-token { width: 36px; height: 36px; }
  .turn-name { font-size: 24px; }
  .turnbar .deck { display: none; }
  .scoreline { padding: 8px 0; flex-direction: column; align-items: stretch; }
  .scores { grid-auto-flow: row; grid-auto-columns: auto; gap: 2px; }
  .score { padding: 2px 0; border-left: 0; }
  .pot { align-self: flex-start; }
  .dock {
    grid-area: dock;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-top: 1px solid var(--line-soft);
    border-radius: 0 0 14px 14px;
    box-shadow: none;
    padding: 16px;
    justify-content: flex-start;
  }
  .dock-body { flex: none; justify-content: flex-start; }
  .prompt-row { flex-direction: column; align-items: stretch; }
  .prompt { flex: none; font-size: 16px; }
  .prompt-actions { margin-left: 0; justify-content: flex-start; }
  .hand { justify-content: flex-start; }
  .hand-slot { width: 100px; }
  .hand-compact .hand-slot { width: 64px; }
  .done-row { flex-direction: column; align-items: stretch; }
  .confirm-row { flex-wrap: wrap; }
  .end { flex-direction: row; align-items: flex-start; gap: 32px; padding: 24px 32px; }
  .end-bed { flex: 1; min-width: 0; }
  .end-bed .bed-area { height: calc(100dvh - 48px); position: sticky; top: 24px; }
  .end-panel { flex: none; width: 400px; padding-top: 24px; }
  .end-actions { flex-direction: column; }
}

/* ---------- Movimiento ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lift { from { transform: translateY(0); } to { transform: translateY(-10px); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.screen:not([hidden]) { animation: fade .2s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .12s !important; transition-duration: 0s !important; scroll-behavior: auto !important; }
  .hand-slot.is-selected .hand-card, .is-selected .card { transform: none !important; }
  .modal, .sheet-dialog, .card-zoom { animation-name: fade !important; }
}
