/* Home page composition. Chart Table tokens and the shared form primitives
   (chart-field, chart-select, chart-btn-*, chart-warning, queue-activity,
   chart-pin, chart-eyebrow) live in board.css; this file lays out the page. */

.home-main {
  --home-parchment:
    radial-gradient(40% 30% at 12% 88%, rgba(90, 58, 34, 0.1), rgba(0, 0, 0, 0) 70%),
    radial-gradient(30% 24% at 88% 10%, rgba(90, 58, 34, 0.12), rgba(0, 0, 0, 0) 70%),
    repeating-linear-gradient(0deg, rgba(62, 95, 112, 0.07) 0 1px, rgba(0, 0, 0, 0) 1px 52px),
    repeating-linear-gradient(90deg, rgba(62, 95, 112, 0.07) 0 1px, rgba(0, 0, 0, 0) 1px 52px),
    linear-gradient(158deg, var(--parchment-100) 0%, var(--parchment-300) 100%);
  --home-medal-fill: #1d140b;
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 2.5vw, 2rem) clamp(2.5rem, 5vw, 3.5rem);
}

/* --- Hero: title, board capture and both ways to play --- */
.home-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  grid-template-areas:
    "intro play"
    "prize play"
    "shot play";
  grid-template-rows: auto auto 1fr;
  column-gap: clamp(2rem, 5vw, 4.5rem);
  row-gap: 2.6rem;
  padding: clamp(2.25rem, 5vw, 3.75rem) 0 clamp(2rem, 4vw, 2.75rem);
}

.home-hero-rhumbs {
  position: absolute;
  z-index: -1;
  top: -3rem;
  left: 0;
  width: 100%;
  height: calc(100% + 3rem);
  color: var(--gold-300);
  opacity: 0.075;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(55% 70% at 62% 34%, #000 30%, transparent 100%);
  mask-image: radial-gradient(55% 70% at 62% 34%, #000 30%, transparent 100%);
}

.home-intro {
  grid-area: intro;
  min-width: 0;
}

.home-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  color: var(--gold-300);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.home-eyebrow::before {
  content: "";
  flex: none;
  width: 2.25rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(196, 154, 58, 0), var(--gold-500));
}

.home-title {
  margin: 1rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5.4vw, 4.4rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--parchment-100);
  text-wrap: balance;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.35);
}

.home-course {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: min(21rem, 72%);
  margin: 1.55rem 0 1.4rem;
}

.home-course .home-x {
  flex: none;
  color: var(--parchment-300);
}

.home-course-line {
  flex: 1;
  border-top: 2px dashed rgba(194, 84, 63, 0.95);
}

.home-course-dot {
  flex: none;
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  background: #c2543f;
  box-shadow: 0 0 0 4px rgba(166, 58, 46, 0.25);
}

.home-lede {
  margin: 0;
  max-width: 50ch;
  font-size: 1.1rem;
  line-height: 1.65;
  color: rgba(242, 231, 204, 0.8);
  text-wrap: pretty;
}

/* The capture stays upright: rotating it would blur its interface text. */
.home-shot {
  grid-area: shot;
  position: relative;
  align-self: start;
  margin: 0.25rem 0 0;
  padding: 0.55rem;
  border: 1px solid rgba(224, 194, 102, 0.42);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(224, 194, 102, 0.3), rgba(90, 58, 34, 0.4) 55%, rgba(36, 26, 16, 0.7));
  box-shadow:
    0 50px 90px -40px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(242, 231, 204, 0.22);
}

.home-shot-media {
  position: relative;
}

.home-shot img,
.home-shot video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

/* The clip starts on its first frame (the image below), so fading it in is seamless. */
.home-shot video {
  position: absolute;
  inset: 0;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.home-shot video.is-playing {
  opacity: 1;
}

.home-shot .chart-pin {
  top: -8px;
  z-index: 1;
}

/* --- Season prize: above the capture on desktop and right after «Jugar vs IA»
   in one column. home_prize.html renders both slots; one is shown per width. --- */
.home-prize {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 10.5rem) minmax(0, 1fr);
  align-items: center;
  gap: 1.3rem;
  margin: 0;
  padding: 1rem 1.4rem 1rem 1.1rem;
  border: 1px solid rgba(224, 194, 102, 0.32);
  border-radius: 14px;
  background:
    radial-gradient(70% 90% at 15% 50%, rgba(166, 58, 46, 0.32), rgba(0, 0, 0, 0) 70%),
    var(--surface-brass);
  box-shadow: 0 26px 50px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(242, 231, 204, 0.08);
}

.home-prize--aside {
  grid-area: prize;
  align-self: start;
}

.home-prize--inline {
  display: none;
}

.home-prize-image {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, 0.5));
}

.home-prize-copy {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.home-prize-copy p {
  margin: 0;
}

.home-prize-eyebrow {
  color: var(--gold-300);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.home-prize-name {
  color: var(--parchment-100);
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}

.home-prize-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 1rem;
  margin-top: 0.2rem;
}

.home-prize-link,
.home-prize-switch {
  min-width: 0;
  color: var(--gold-300);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.home-prize-link:hover,
.home-prize-switch:hover {
  color: var(--parchment-100);
}

/* «Jugar en Competitiva»: botón con el aspecto de los enlaces del premio. */
.home-prize-switch {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.home-prize-switch[hidden] {
  display: none;
}

.home-prize-link:focus-visible,
.home-prize-switch:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

/* Only the one-column slot can be closed (home_prize.html). */
.home-prize-close {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: rgba(242, 231, 204, 0.72);
  cursor: pointer;
}

.home-prize-close:hover {
  background: rgba(242, 231, 204, 0.08);
  color: var(--parchment-100);
}

.home-prize-close:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: -2px;
}

/* Room for the close button beside the eyebrow only. */
.home-prize--inline .home-prize-eyebrow {
  padding-right: 1.6rem;
}

/* --- Play cards --- */
.home-play {
  grid-area: play;
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

/* Notices share one slot above the play cards. The open-match warning comes
   first in the HTML; the maintenance notice follows both forms (reading order
   and the buttons' aria-describedby) but is painted above the buttons it
   disables. */
.home-play > .chart-warning {
  order: -1;
  margin: 0;
}

.home-play-card {
  container-type: inline-size;
  position: relative;
  margin: 0;
  padding: 1.6rem 1.75rem 1.7rem;
  border: 1px solid rgba(90, 58, 34, 0.55);
  border-radius: 14px;
  background: var(--home-parchment);
  color: var(--ink-950);
  box-shadow:
    0 34px 64px -28px rgba(0, 0, 0, 0.92),
    inset 0 0 70px rgba(90, 58, 34, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: homeCardIn 0.6s 0.1s ease-out both;
}

.home-play-card--human {
  animation-delay: 0.22s;
}

.home-play-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.3rem;
}

/* Keep both activity stubs visible at desktop height, including the admin
   seed row. Scope the compact headers to home; other pages share these styles. */
.home-play > .home-play-card {
  padding-top: 1.2rem;
}

.home-play .home-play-head {
  gap: 0.75rem;
  margin-bottom: 0.8rem;
}

.home-play .home-play-head .home-medal {
  width: 2.2rem;
  height: 2.2rem;
}

.home-play .home-play-head .home-icon {
  width: 1.15rem;
  height: 1.15rem;
}

.home-play-heading {
  min-width: 0;
}

.home-medal {
  flex: none;
  display: grid;
  place-items: center;
  width: 3.1rem;
  height: 3.1rem;
  border: 1px solid var(--gold-500);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3b2a19, #1a120a 72%);
  box-shadow:
    0 0 0 3px rgba(196, 154, 58, 0.2),
    0 8px 16px -8px rgba(0, 0, 0, 0.7);
  color: var(--gold-300);
}

.home-medal .home-icon {
  width: 1.5rem;
  height: 1.5rem;
}

.home-medal .discord-icon {
  width: 1.35rem;
  height: 1rem;
}

.home-medal--small {
  width: 2.6rem;
  height: 2.6rem;
  box-shadow: 0 0 0 2px rgba(196, 154, 58, 0.16);
}

.home-medal--small .home-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.home-play-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.05;
  color: var(--ink-950);
  text-wrap: balance;
}

.home-play-flavor {
  margin: 0.3rem 0 0;
  font-size: 0.86rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--ink-600);
  text-wrap: pretty;
}

.home-play-card .chart-fields {
  gap: 1.05rem;
}

.home-play-card .chart-select {
  padding-top: 0.78rem;
  padding-bottom: 0.78rem;
  font-size: 0.95rem;
  background-color: rgba(255, 252, 242, 0.85);
}

.home-play-start {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.3rem;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  background: var(--btn-gold-background);
  box-shadow: var(--btn-gold-shadow);
  font-size: 1.05rem;
  font-weight: 700;
}

.match-capacity-notice {
  margin: 0;
}

.match-capacity-notice[hidden] {
  display: none;
}

/* Activity counters close each card like the stub of a ticket. */
.home-play-card .queue-activity {
  display: flex;
  /* board.css widens the queue pill to 100% on phones; the stub must bleed. */
  width: auto;
  margin: 1.4rem -1.75rem -1.7rem;
  padding: 0.8rem 1.75rem;
  border: 0;
  border-top: 1.5px dashed rgba(90, 58, 34, 0.32);
  border-radius: 0 0 13px 13px;
  background: rgba(90, 58, 34, 0.08);
  font-size: 0.82rem;
}

.home-play-card .queue-activity[hidden] {
  display: none;
}

.home-play > .home-play-card .queue-activity {
  margin-top: 0.9rem;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
}

/* Buscar rival es la acción principal; la mesa privada queda debajo, tras «o». */
.home-play-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 0.45rem;
}

.home-play-or {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink-600);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-play-or::before,
.home-play-or::after {
  flex: 1;
  border-top: 1px dashed rgba(90, 58, 34, 0.3);
  content: "";
}

.home-queue-button,
.home-play-actions .chart-btn-private {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3.1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  font: inherit;
  font-size: 0.93rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  text-align: center;
}

.home-queue-button {
  min-height: 3.3rem;
  border: 0;
  background: var(--btn-gold-background);
  color: var(--btn-gold-color);
  box-shadow: var(--btn-gold-shadow);
  font-size: 1.02rem;
  cursor: pointer;
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.home-queue-button::after {
  margin-left: 0.55rem;
  content: "→" / "";
}

.home-queue-button:hover {
  filter: brightness(1.05);
}

.home-queue-button:active {
  transform: translateY(1px);
}

.home-queue-button:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

.home-queue-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}


/* --- Quick links --- */
.home-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.home-nav--guides { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.home-nav-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  padding: 0.95rem 1.05rem;
  border: 1px solid rgba(224, 194, 102, 0.26);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(196, 154, 58, 0.13), rgba(90, 58, 34, 0.24));
  box-shadow: 0 12px 26px -16px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(242, 231, 204, 0.1);
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

.home-nav-link:hover {
  transform: translateY(-2px);
  border-color: rgba(224, 194, 102, 0.6);
  filter: brightness(1.1);
  color: var(--text);
}

.home-nav-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.home-nav-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.home-nav-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--parchment-100);
}

.home-nav-hint {
  font-size: 0.76rem;
  line-height: 1.35;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.home-nav-arrow {
  flex: none;
  color: var(--gold-300);
}

/* --- Parchment sections --- */
.home-chart,
.home-faq {
  position: relative;
  margin-top: clamp(3rem, 6vw, 4.75rem);
  padding: clamp(1.75rem, 4vw, 3.4rem);
  border: 1px solid rgba(90, 58, 34, 0.55);
  border-radius: 10px;
  background: var(--home-parchment);
  color: var(--ink-950);
  box-shadow: 0 34px 70px -24px rgba(10, 6, 2, 0.85), inset 0 0 90px rgba(90, 58, 34, 0.16);
}

.home-section-title {
  margin: 0.4rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--ink-950);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

/* Practice with the AI: text, compass rose and the three-step route. */
.home-chart {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
  column-gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.home-chart-text p {
  margin: 1rem 0 0;
  max-width: 62ch;
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink-600);
  text-wrap: pretty;
}

.home-chart-rose {
  display: grid;
  place-items: center;
}

.home-rose {
  width: min(100%, 17rem);
  height: auto;
}

.home-rose-needle {
  transform-origin: 130px 130px;
}

.home-route {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 2.6rem 0 0;
  padding: 2.1rem 0 0;
  border-top: 1px solid rgba(90, 58, 34, 0.2);
  list-style: none;
}

.home-route li {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.home-route-point {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  border: 1.5px solid var(--wood-700);
  border-radius: 50%;
  background: rgba(255, 252, 242, 0.7);
  box-shadow: inset 0 0 0 3px rgba(242, 231, 204, 0.9), inset 0 0 0 4px rgba(90, 58, 34, 0.25);
  color: var(--wood-700);
  font: 700 0.85rem ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.home-route-label {
  flex: 0 1 auto;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-950);
}

.home-route-leg {
  display: flex;
  flex: 1 1 1.5rem;
  align-items: center;
  justify-content: flex-end;
  min-width: 1.5rem;
  height: 18px;
  background: repeating-linear-gradient(90deg, rgba(166, 58, 46, 0.72) 0 7px, rgba(0, 0, 0, 0) 7px 12px) left center / 100% 2px no-repeat;
}

.home-route-leg--end {
  background-size: calc(100% - 24px) 2px;
  color: var(--lacquer);
}

/* --- Feature cards --- */
.home-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: clamp(3rem, 6vw, 4.75rem);
}

.home-feature {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem 1.9rem 1.8rem;
  border: 1px solid rgba(224, 194, 102, 0.24);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(62, 43, 26, 0.72), rgba(30, 21, 13, 0.88));
  box-shadow: 0 26px 50px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(242, 231, 204, 0.08);
}

.home-feature::before {
  content: "";
  position: absolute;
  top: -1px;
  right: 1.9rem;
  left: 1.9rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(224, 194, 102, 0), var(--gold-300), rgba(224, 194, 102, 0));
}

.home-feature-title {
  margin: 0.35rem 0 0;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--parchment-100);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.home-feature p {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.65;
  color: rgba(242, 231, 204, 0.84);
  text-wrap: pretty;
}

.home-feature .home-feature-detail {
  color: var(--text-secondary);
}

.home-feature-link {
  align-self: flex-start;
  margin-top: auto;
  padding-top: 0.5rem;
  color: var(--gold-300);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(224, 194, 102, 0.35);
  text-underline-offset: 0.3em;
}

.home-feature-link:hover {
  color: var(--parchment-100);
  text-decoration-color: currentColor;
}

.home-feature-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 5px;
}

/* --- FAQ: the content stays in the HTML; only the answers fold --- */
.home-faq {
  display: grid;
  grid-template-columns: minmax(0, 0.72fr) minmax(0, 1.6fr);
  column-gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.home-faq-mark {
  display: block;
  margin-top: 0.75rem;
  font-family: var(--font-display);
  font-size: 11rem;
  font-style: italic;
  font-weight: 600;
  line-height: 0.9;
  color: rgba(90, 58, 34, 0.14);
}

.home-faq-list {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid rgba(90, 58, 34, 0.22);
  list-style: none;
}

.home-faq-list li {
  border-top: 1px solid rgba(90, 58, 34, 0.22);
}

.home-faq-item summary {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.15rem 0.25rem;
  border-radius: 6px;
  cursor: pointer;
  list-style: none;
}

.home-faq-item summary::-webkit-details-marker {
  display: none;
}

.home-faq-item summary:focus-visible {
  outline: 2px solid var(--gold-500);
  outline-offset: 2px;
}

.home-faq-number {
  flex: none;
  width: 1.6rem;
  color: var(--accent-dark);
  font: 700 0.8rem ui-monospace, "SFMono-Regular", Menlo, monospace;
}

.home-faq-question {
  flex: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-950);
  text-wrap: pretty;
}

.home-faq-item summary:hover .home-faq-question {
  color: var(--wood-700);
}

.home-faq-toggle {
  position: relative;
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border: 1px solid rgba(90, 58, 34, 0.4);
  border-radius: 50%;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.home-faq-toggle::before,
.home-faq-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.7rem;
  height: 1.5px;
  background: var(--wood-700);
  transform: translate(-50%, -50%);
}

.home-faq-toggle::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.home-faq-item[open] .home-faq-toggle {
  border-color: var(--wood-700);
  background: var(--wood-700);
}

.home-faq-item[open] .home-faq-toggle::before {
  background: var(--parchment-100);
}

.home-faq-item[open] .home-faq-toggle::after {
  display: none;
}

.home-faq-answer {
  padding: 0 3.4rem 1.4rem 3.05rem;
}

.home-faq-answer p {
  margin: 0;
  max-width: 68ch;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-600);
  text-wrap: pretty;
}

.home-faq-answer p + p {
  margin-top: 0.75rem;
}

#play-vs-human {
  scroll-margin-top: 5rem;
}

@keyframes homeCardIn {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/* CJK titles have no Fraunces glyphs; tight tracking only suits Latin. */
html:lang(ja) .home-title,
html:lang(zh-Hans) .home-title,
html:lang(ja) .home-eyebrow,
html:lang(zh-Hans) .home-eyebrow {
  letter-spacing: normal;
}

/* The Japanese title breaks at its space instead of inside a word. */
html:lang(ja) .home-title {
  font-size: clamp(1.9rem, 3.4vw, 2.85rem);
  line-height: 1.15;
  word-break: keep-all;
}

@media (max-width: 1080px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "intro"
      "play"
      "shot";
    grid-template-rows: auto;
    row-gap: 2rem;
  }

  /* Tablets keep both ways to play side by side while they fit; the prize,
     between them in the HTML, then drops below both (dense placement). */
  .home-play {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(24rem, 100%), 1fr));
    grid-auto-flow: row dense;
    align-items: start;
  }

  .home-play > .chart-warning {
    grid-column: 1 / -1;
  }

  .home-prize--aside {
    display: none;
  }

  .home-prize--inline {
    display: grid;
    grid-column: 1 / -1;
  }

  .home-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-chart {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-chart-rose,
  .home-faq-mark {
    display: none;
  }

  .home-route {
    position: relative;
    flex-direction: column;
    align-items: stretch;
    gap: 1.1rem;
  }

  .home-route::before {
    content: "";
    position: absolute;
    top: calc(2.1rem + 1.45rem);
    bottom: 1.45rem;
    left: calc(1.45rem - 1px);
    border-left: 2px dashed rgba(166, 58, 46, 0.7);
  }

  .home-route-point {
    position: relative;
    background: var(--parchment-100);
  }

  .home-route-leg {
    display: none;
  }

  .home-features {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-faq {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-faq-list {
    margin-top: 1.5rem;
  }
}

@media (max-width: 640px) {
  .home-title {
    font-size: 2.55rem;
  }

  .home-lede {
    font-size: 1rem;
  }

  .home-play-card {
    padding: 1.35rem 1.2rem 1.4rem;
  }

  .home-play-card .queue-activity {
    margin: 1.2rem -1.2rem -1.4rem;
    padding-right: 1.2rem;
    padding-left: 1.2rem;
  }

  .home-play-title {
    font-size: 1.55rem;
  }

  .home-prize {
    grid-template-columns: 6.6rem minmax(0, 1fr);
    gap: 0.9rem;
    padding: 0.9rem 1rem;
  }

  .home-prize-name {
    font-size: 1.12rem;
  }

  .home-medal {
    width: 2.75rem;
    height: 2.75rem;
  }

  .home-nav {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-nav-link {
    padding: 0.8rem 0.95rem;
  }

  .home-route-label {
    font-size: 1.1rem;
  }

  .home-feature {
    padding: 1.6rem 1.35rem 1.5rem;
  }

  .home-feature-title {
    font-size: 1.4rem;
  }

  .home-faq-question {
    font-size: 1.06rem;
  }

  .home-faq-answer {
    padding: 0 0.25rem 1.2rem 2.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-play-card {
    animation: none;
  }

  .home-nav-link,
  .home-nav-link:hover,
  .home-queue-button:active {
    transform: none;
    transition: none;
  }
}

/* --- Jugar vs humano: tres modalidades siempre visibles en un solo grupo --- */
.queue-modes {
  display: grid;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(90, 58, 34, 0.38);
  border-radius: 12px;
  background: rgba(255, 250, 235, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.queue-mode-row {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem 0.75rem;
  padding: 0.72rem 0.85rem 0.72rem 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.queue-mode-row + .queue-mode-row {
  border-top: 1.5px dashed rgba(90, 58, 34, 0.22);
}

.queue-mode-row:hover {
  background: rgba(196, 154, 58, 0.08);
}

.queue-mode-row:has(.queue-mode-input:checked) {
  background: linear-gradient(90deg, rgba(196, 154, 58, 0.24), rgba(196, 154, 58, 0.07));
  box-shadow: inset 3px 0 0 var(--gold-500);
}

.queue-mode-row:has(.queue-mode-input:focus-visible) {
  outline: 2px solid var(--gold-500);
  outline-offset: -2px;
}

.queue-mode-row:has(.queue-mode-input:disabled) {
  cursor: not-allowed;
}

/* El propio radio hace de marcador: sigue siendo el control nativo, accesible y
   pulsable directamente, con el aspecto de las fichas de la portada. */
.queue-mode-input {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
  border: 1.5px solid rgba(90, 58, 34, 0.55);
  border-radius: 50%;
  background: rgba(255, 252, 242, 0.92);
  box-shadow: inset 0 1px 2px rgba(21, 14, 8, 0.12);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.queue-mode-input:checked {
  border-color: var(--gold-500);
  background: radial-gradient(circle, var(--wood-700) 0 32%, rgba(255, 252, 242, 0.95) 36%);
  box-shadow: 0 0 0 3px rgba(196, 154, 58, 0.24);
}

.queue-mode-input:focus-visible {
  outline: none;
}

.queue-mode-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.queue-mode-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}

.queue-mode-head strong {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.15;
}

.queue-mode-elo {
  padding: 0.06rem 0.45rem;
  border: 1px solid rgba(90, 58, 34, 0.3);
  border-radius: 999px;
  color: var(--ink-600);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.queue-mode-elo.is-rated {
  border-color: rgba(138, 109, 26, 0.55);
  background: var(--btn-gold-background);
  color: var(--ink-950);
  cursor: help;
}

.queue-mode-meta {
  color: var(--ink-600);
  font-size: 0.82rem;
  line-height: 1.35;
}

/* Colecciones del formato («OP17+EB04») como una etiqueta discreta. */
.queue-mode-summary {
  padding: 0.02rem 0.35rem;
  border-radius: 4px;
  background: rgba(90, 58, 34, 0.1);
  color: var(--ink-950);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Contador compacto, alineado a la derecha de su modalidad. Más específico que
   el talón de la tarjeta (.home-play > .home-play-card .queue-activity). */
.queue-modes .queue-mode-row .queue-activity {
  justify-content: flex-end;
  gap: 0.4rem;
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 0.24rem 0.55rem;
  border: 0;
  border-radius: 999px;
  background: rgba(90, 58, 34, 0.08);
  font-size: 0.74rem;
  white-space: nowrap;
}

.queue-modes .queue-mode-row .queue-activity-copy {
  flex-wrap: nowrap;
}

@container (max-width: 26rem) {
  .queue-mode-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .queue-modes .queue-mode-row .queue-activity {
    grid-column: 2;
    justify-self: start;
  }
}

/* Mesas privadas: contador compacto bajo su botón, como los de cada modalidad.
   Más específico que el talón de la tarjeta. */
.home-play-card .home-play-actions .queue-activity.home-private-activity {
  justify-self: center;
  gap: 0.4rem;
  width: auto;
  min-height: 0;
  margin: 0.15rem 0 0;
  padding: 0.24rem 0.65rem;
  border: 0;
  border-radius: 999px;
  background: rgba(90, 58, 34, 0.08);
  font-size: 0.74rem;
  white-space: nowrap;
}

/* Competitiva: nota discreta bajo el botón de buscar (temporada y cupo); el
   premio, cuando se muestra en la cola, conserva su recuadro (la portada usa
   .home-prize). */
.queue-competitive-info {
  display: grid;
  gap: 0.2rem;
  margin: 0.15rem 0 0.1rem;
  color: var(--ink-600);
  font-size: 0.76rem;
  line-height: 1.4;
  text-align: center;
}

.queue-competitive-info[hidden] {
  display: none;
}

.queue-competitive-info p {
  margin: 0;
}

.queue-competitive-season strong {
  color: var(--ink-950);
  font-variant-numeric: tabular-nums;
}

.queue-prize {
  display: grid;
  grid-template-columns: 6.4rem minmax(0, 1fr);
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.35rem;
  padding: 0.75rem 0.85rem;
  border: 1.5px dashed rgba(90, 58, 34, 0.32);
  border-radius: 12px;
  background: rgba(90, 58, 34, 0.06);
  text-align: left;
}

.queue-prize-image {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 10px rgba(21, 14, 8, 0.35));
}

.queue-prize-copy {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.queue-prize-eyebrow {
  color: var(--lacquer);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.queue-prize-copy strong {
  color: var(--ink-950);
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.22;
}

.queue-prize-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.9rem;
}

.queue-prize-link {
  justify-self: start;
  min-width: 0;
  margin-top: 0.15rem;
  color: var(--wood-700);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.queue-prize-link:hover {
  color: var(--ink-950);
}

/* «Jugar en Competitiva»: botón con el aspecto de los enlaces del premio. */
.queue-prize-switch {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.queue-prize-switch[hidden] {
  display: none;
}

.queue-prize-switch:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
