/* Entradas de Inicio: las mismas láminas ilustradas que el resto del atlas. */
#app .mode-daily-zone { display: grid; gap: 8px; }
#app .mode-daily-zone::before,
#app .mode-entry-grid::before { color: #805b37; font: 700 .7rem/1.2 var(--ui-font); letter-spacing: .19em; padding-left: 4px; }
#app .mode-daily-zone::before { content: "EL RETO DE HOY"; }
#app .mode-entry-grid::before { content: "ELIGE TU CAMINO"; grid-column: 1 / -1; }
#app .mode-daily-family { margin: -2px 4px 2px; color: #665442; font: .8rem/1.4 var(--ui-font); }
#app .mode-play-zone { min-width: 0; }
#app .mode-play-card { width: 100%; transform: translateZ(0); backface-visibility: hidden; }
#app .mode-choices-reveal { contain: layout paint; }
#app .mode-play-card .mode-play-chevron { display: inline-block; margin-left: 8px; font: 700 1.35rem/0.7 var(--font-display); vertical-align: middle; transition: transform .32s ease; }
#app .mode-play-card[aria-expanded="true"] .mode-play-chevron { transform: rotate(180deg); }
#app .mode-play-card:focus-visible { outline: 3px solid #9c4f2c; outline-offset: 3px; }
#app .mode-choices-reveal { display: grid; grid-template-rows: 0fr; margin-top: 0; opacity: 0; visibility: hidden;  }
#app .mode-choices-reveal.is-open { grid-template-rows: 1fr; margin-top: 12px; opacity: 1; visibility: visible; }
/* Sangrado con una línea guía: las opciones son hijas de la lámina «Jugar» de
   arriba, no un bloque al mismo nivel. */
#app .mode-entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-height: 0; overflow: hidden; margin-left: 22px; padding-left: 18px; border-left: 2px solid #d2b683; }
#app .mode-entry {
  --mode-paper: #f8f0df;
  appearance: none; position: relative; isolation: isolate; display: flex; align-items: center;
  overflow: hidden; width: 100%; min-height: 150px; padding: 0;
  border: 1.5px solid #d2b683; border-radius: 14px;
  color: #2a1c12; text-align: left; cursor: pointer;
  background: var(--mode-paper);
  box-shadow: 0 2px 0 #e2cfa6, 0 12px 26px #4a321a20, inset 0 1px 0 #fffaf0;
}
#app .mode-entry::before {
  content: ""; position: absolute; z-index: 3; inset: 6px; pointer-events: none;
  border: 1px solid #b8955a77; border-radius: 9px;
  box-shadow: inset 0 0 0 1px #fffaf0ab;
}
#app .mode-entry::after {
  content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--mode-paper) 0 26%, #f8f0dfe8 44%, #f8f0df7a 70%, transparent 100%);
}
#app .mode-entry-art { position: absolute; z-index: 0; inset: 0 0 0 auto; width: 73%; overflow: hidden; }
#app .mode-entry-art img { width: 100%; height: 100%; object-fit: cover; object-position: center; filter: sepia(.14) saturate(.85) contrast(1.04); transition: transform .45s ease; }
#app .mode-entry-copy { position: relative; z-index: 2; display: grid; justify-items: start; gap: 6px; width: min(75%, 24rem); padding: 17px 21px; }
#app .mode-entry-copy b { color: #2a1c12; font: 500 clamp(1.4rem, 4.6vw, 1.85rem)/1.1 var(--font-display); }
#app .mode-entry-copy small { max-width: 28ch; color: #4a3d31; font: .95rem/1.35 var(--font-display); }
#app .mode-entry-cta { margin-top: 4px; padding-bottom: 2px; border-bottom: 1px solid #9c7641; color: #6e4a1f; font: 700 .95rem/1.3 var(--font-display); }
#app .mode-entry-cta span { margin-left: 3px; }
#app .mode-entry-featured { grid-column: 1 / -1; min-height: 164px; }
#app .mode-entry-featured .mode-entry-art { width: 63%; }
#app .mode-entry:focus-visible { outline: 3px solid #9c4f2c; outline-offset: 3px; }
#app .mode-entry:active { transform: translateY(1px); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  #app .mode-entry:hover { box-shadow: 0 2px 0 #e2cfa6, 0 16px 30px #4a321a2e; }
  #app .mode-entry:hover .mode-entry-art img { transform: scale(1.045); }
}
@media (prefers-reduced-motion: reduce) {
  #app .mode-choices-reveal, #app .mode-play-card .mode-play-chevron { transition: none; }
}
#app .mode-ranking-summary {
  display: grid; gap: 3px; padding: 12px 17px; border-top: 1px solid #b8955a80;
  color: #493424; font-family: var(--font-display);
}
#app .mode-ranking-summary > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#app .mode-ranking-summary small { font: 700 .7rem var(--ui-font); letter-spacing: .12em; }
#app .mode-ranking-summary b { font-size: 1.4rem; }
#app .mode-ranking-summary p { margin: 0; font-size: .83rem; }
/* Las pantallas de elección continúan el mismo papel y grabado. */
#app .mode-hub-shell { max-width: 760px; margin: 0 auto; padding-top: max(16px, env(safe-area-inset-top)); }
#app .mode-hub-head {
  position: relative; isolation: isolate; display: flex; gap: 16px; align-items: center;
  min-height: 165px; overflow: hidden; margin: 0 0 18px; padding: 20px;
  border: 1.5px solid #d2b683; border-radius: 14px;
  background: #f8f0df; box-shadow: 0 2px 0 #e2cfa6, 0 12px 26px #4a321a20;
}
#app .mode-hub-head::after { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #f8f0df 0 35%, #f8f0dfd9 60%, transparent 100%); }
#app .mode-hub-head > img { position: absolute; z-index: -2; top: 0; right: 0; width: 72%; height: 100%; object-fit: cover; object-position: center; filter: sepia(.17) saturate(.8); }
#app .mode-hub-head .icon-btn { align-self: flex-start; flex: 0 0 auto; background: #f8f0dfcc; }
#app .mode-hub-title { position: relative; z-index: 1; }
#app .mode-hub-title .eyebrow { color: #805b37; }
#app .mode-hub-title h1 { margin: .25rem 0 0; color: #2a1c12; font: 500 clamp(1.8rem, 5vw, 2.6rem)/1.1 var(--font-display); }
#app .mode-hub-list { display: grid; gap: 12px; }
#app .mode-hub-list .mode-entry { min-height: 126px; }
#app .mode-hub-list .mode-entry-copy b { font-size: clamp(1.3rem, 4.2vw, 1.65rem); }
#app .mode-online-config { display: grid; gap: 8px; }
#app .mode-online-config .hint { margin: 0; line-height: 1.4; }
#app .mode-topic-picker { display: grid; gap: 14px; }
#app .mode-topic-picker > p { margin: 0; line-height: 1.4; }
#app .mode-topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#app .mode-topic-grid label { position: relative; display: flex; align-items: center; gap: 9px; min-height: 52px; padding: 8px 11px; font-size: .9rem; line-height: 1.2; border: 1px solid #d2b683; border-radius: 10px; background: #f8f0df; cursor: pointer; transition: background .15s ease, color .15s ease; }
#app .mode-topic-grid input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
#app .mode-topic-grid label::before { content: "✓"; display: grid; place-items: center; flex: 0 0 auto; width: 18px; height: 18px; border: 1.5px solid #9c7641; border-radius: 5px; color: transparent; font: 800 .74rem/1 var(--ui-font); }
#app .mode-topic-grid label:has(input:checked) { color: var(--ink-solid-contrast, #fff); background: var(--ink-solid, #84432a); border-color: transparent; }
#app .mode-topic-grid label:has(input:checked)::before { border-color: currentColor; color: currentColor; }
#app .mode-topic-grid label:has(input:focus-visible) { outline: 3px solid #9c4f2c; outline-offset: 2px; }
#app .mode-topic-count { margin: -4px 2px 0; }
/* Jugar online: el tablón de mesas abiertas (como el vestíbulo de Risk) y la pantalla para crear una. */
#app .public-board { display: grid; gap: 8px; }
/* Títulos de sección de «Jugar online»: versalitas doradas con una línea fina, como «EL RETO DE HOY»
   y los epígrafes de las pantallas de configuración. */
#app .mode-section-title { display: flex; align-items: center; gap: 10px; margin: 0; padding-left: 4px; color: #805b37; font: 700 .7rem/1.2 var(--ui-font); letter-spacing: .19em; text-transform: uppercase; }
#app .mode-section-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, #b8935a80, transparent); }
#app .mode-section-title small { order: 2; color: #805b37; font: 700 .7rem/1.2 var(--ui-font); letter-spacing: 0; }
#app .public-quick-label { margin-top: 10px; }
#app .public-quick-hint { margin: -4px 4px 0; color: #4a3d31; line-height: 1.4; text-align: left; }
#app .public-board-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
#app .public-board-empty { padding: 14px 16px; border: 1px dashed #c9a96f; border-radius: 12px; color: #4a3d31; background: #f8f0df8c; line-height: 1.4; }
#app .public-board-alert { margin: 0; padding: 10px 14px; border-radius: 10px; color: #7a2418; background: #f7dfd4; }
#app .public-table { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; border: 1px solid #d2b683; border-radius: 14px; background: #fbf5e9; }
#app .public-table-avatar { flex: 0 0 44px; display: grid; place-items: center; }
#app .public-table-copy { display: grid; flex: 1; gap: 2px; min-width: 0; }
#app .public-table-copy b { color: #2a1c12; font: 500 1.08rem/1.2 var(--font-display); overflow-wrap: anywhere; }
#app .public-table-copy small { color: #5c4a3a; font-size: .82rem; line-height: 1.3; overflow-wrap: anywhere; }
#app .public-table-seats { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
#app .public-table-seats i { width: 10px; height: 10px; border: 1.5px solid #9c7641; border-radius: 50%; }
#app .public-table-seats i.is-taken { border-color: #84432a; background: #84432a; }
#app .public-table-seats em { margin-left: 4px; color: #5c4a3a; font-size: .78rem; font-style: normal; font-variant-numeric: tabular-nums; }
#app .public-table-join { flex: 0 0 auto; min-height: 44px; padding-inline: 16px; }
#app .public-create { display: grid; gap: 14px; }
#app .public-create .field { margin: 0; }
#app .public-create .hint { margin: 0; line-height: 1.4; }
#app .public-create-segmented { grid-template-columns: repeat(var(--pills, 2), minmax(0, 1fr)); gap: 8px; }
#app .public-create-segmented .segmented-option { justify-items: center; align-content: center; min-height: 46px; padding: 8px 6px; text-align: center; }
#app .public-create-segmented .segmented-option b { font-size: .92rem; }
html #app .public-create-segmented .segmented-option::after { content: none !important; }
:root[data-theme="dark"] #app .public-table,
:root[data-theme="dark"] #app .public-board-empty { background: #332a20; border-color: #8c6f45; color: #e8dccb; }
:root[data-theme="dark"] #app .public-table-copy b { color: #f3e8d6; }
:root[data-theme="dark"] #app .public-quick-hint { color: #cdbda5; }
:root[data-theme="dark"] #app .public-table-copy small,
:root[data-theme="dark"] #app .public-table-seats em { color: #cdbda5; }
:root[data-theme="dark"] #app .public-table-seats i { border-color: #c9a96f; }
:root[data-theme="dark"] #app .public-table-seats i.is-taken { border-color: #e0a77d; background: #e0a77d; }
}
/* Acceso directo de Inicio para unirse a una partida a la que te han invitado. */
#app .mode-join-shortcut { margin-top: 13px; }
#app .home-doors-shell .mode-join-shortcut,
#app .home-doors-shell .mode-join-shortcut .home-door-copy { min-height: 96px; }
#app .home-doors-shell .mode-join-shortcut .home-door-copy { padding-block: 11px; gap: 3px; }
#app .home-doors-shell .mode-join-shortcut .home-door-copy b { font-size: clamp(1.12rem, 3.2vw, 1.3rem); }
@media (max-width: 700px) {
  #app .mode-entry-grid { grid-template-columns: 1fr; }
  #app .mode-entry-featured { grid-column: auto; min-height: 150px; }
  #app .mode-entry-featured .mode-entry-art { width: 73%; }
}
@media (max-width: 420px) {
  #app .mode-entry-grid { margin-left: 14px; padding-left: 12px; }
  #app .mode-entry, #app .mode-entry-featured { min-height: 132px; }
  #app .mode-entry-copy { width: 78%; padding: 13px 17px; gap: 4px; }
  #app .mode-entry-copy b { font-size: 1.48rem; }
  #app .mode-entry-copy small { font-size: .86rem; }
  #app .mode-hub-head { padding: 14px; gap: 10px; min-height: 142px; }
  #app .mode-hub-title h1 { font-size: 1.72rem; }
  #app .mode-topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 340px) {
  #app .mode-topic-grid { grid-template-columns: 1fr; }
}
:root[data-theme="dark"] #app .mode-entry,
:root[data-theme="dark"] #app .mode-hub-head { --mode-paper: #332a20; background: #332a20; border-color: #8c6f45; box-shadow: 0 12px 26px #0006; }
:root[data-theme="dark"] #app .mode-entry-grid { border-left-color: #8c6f45; }
:root[data-theme="dark"] #app .mode-entry::after { background: linear-gradient(90deg, #332a20 0 26%, #332a20e8 44%, #332a207a 70%, transparent 100%); }
:root[data-theme="dark"] #app .mode-entry-copy b,
:root[data-theme="dark"] #app .mode-hub-title h1 { color: #f1e1bf; }
:root[data-theme="dark"] #app .mode-entry-copy small { color: #e9dcc3; }
:root[data-theme="dark"] #app .mode-entry-cta,
:root[data-theme="dark"] #app .mode-daily-zone::before,
:root[data-theme="dark"] #app .mode-entry-grid::before,
:root[data-theme="dark"] #app .mode-hub-title .eyebrow { color: #e6c58e; }
:root[data-theme="dark"] #app .mode-hub-head::after { background: linear-gradient(90deg, #332a20 0 35%, #332a20d9 60%, transparent 100%); }
:root[data-theme="dark"] #app .mode-ranking-summary,
:root[data-theme="dark"] #app .mode-daily-family { color: #e9dcc3; }
:root[data-theme="dark"] #app .mode-topic-grid label:not(:has(input:checked)),
:root[data-theme="dark"] #app .mode-hub-head .icon-btn { background: #332a20cc; }

.mode-inline-drawer { display: grid; gap: 12px; margin-top: 14px; }
.mode-inline-drawer[hidden] { display: none; }

/* Colecciones desplegadas dentro de «Jugar solo»: tarjetas más compactas. */
#app .mode-inline-drawer .gallery { gap: 10px; }
#app .mode-inline-drawer .gallery-panel,
#app .mode-inline-drawer .gallery-panel.active { height: 116px; min-height: 116px; }
#app .mode-inline-drawer .gallery-panel .panel-label strong { font-size: 1.25rem; }
#app .mode-inline-drawer .gallery-panel .panel-label small { font-size: .68rem; }
#app .mode-inline-drawer .gallery-panel .collection-index { top: 9px; left: 12px; min-height: 22px; padding: 2px 9px; font-size: .55rem; }
#app .mode-inline-drawer .gallery-panel .collection-open { width: 28px; height: 28px; right: 12px; }

/* La tarjeta «Jugar» no se mueve al tocarla (el :hover pegado del móvil y el giro de :active la hacían bailar mientras se despliega). */
html #app button.mode-play-card:hover, html #app button.mode-play-card:active { transform: translateZ(0); box-shadow: inherit; }

#app .mode-ranking-summary .mode-ranking-link { margin-top: 10px; width: 100%; }
#app .mode-ranking-summary .mode-ranking-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
#app .mode-ranking-summary .mode-ranking-stats span { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
#app .mode-ranking-summary .mode-ranking-stats small { font: 700 .66rem var(--ui-font); letter-spacing: .1em; text-transform: uppercase; }

/* Retos rápidos: su lámina es la única casi negra entre las del resto del juego. En tema claro se
   aclara hasta quedar en el mismo tono sepia que las demás; en oscuro encaja tal cual. */
:root:not([data-theme="dark"]) #app .mode-entry:is([data-action="quick-challenges"], [data-action="quick-public"]) .mode-entry-art img { filter: sepia(.55) saturate(.7) brightness(1.55) contrast(.72); }
/* Textos de ayuda dentro de los paneles de configuración: alineados a la izquierda, como los campos. */
#app :is(.solo-panel, .public-create, .mode-online-config, .quick-shell .panel) .hint { text-align: left; }
:root[data-theme="dark"] #app .mode-section-title, :root[data-theme="dark"] #app .mode-section-title small { color: #e0b77e; }
:root[data-theme="dark"] #app .public-quick-hint { color: #cdbda5; }

/* Competición al final de la lista de colecciones: mismo formato que ellas, con su grabado oscurecido
   para que case con las demás carátulas, y una flecha en vez de «+» porque no despliega mazos. */
#app .gallery-panel.panel-competition { --scene-glow: #d8b46a; --scene-shade: #3a2c18; --scene-focus: 72%; background: #4a3922; }
#app .gallery-panel.panel-competition .panel-art img,
#app .gallery-panel.panel-competition .panel-backdrop img { object-fit: cover; object-position: 66% 38%; filter: sepia(.75) saturate(.9) brightness(.52) contrast(1.15); }
#app .home-shell .gallery-panel.panel-competition .collection-open::after,
#app .gallery-panel.panel-competition .collection-open::after { content: "→"; }
