/* Yesterday's Mesh: one board on the page, the app underneath. Builds on
   simple.css (tokens, nav, buttons, the board and player). */
.y-main {
  max-width: 900px; margin: 0 auto;
  padding-block: clamp(28px, 5vw, 56px);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 22px;
}
.y-head { display: flex; flex-direction: column; gap: 10px; }
.y-head h1 { font-size: clamp(36px, 6vw, 60px); font-weight: 300; }
.y-head h3 { font: 300 clamp(28px, 3.4vw, 40px)/1.05 var(--display); letter-spacing: -0.02em; margin: 0; }
.y-mount { display: flex; flex-direction: column; gap: 22px; }
.y-missing { font-size: clamp(28px, 4vw, 40px); font-weight: 300; }
.y-meta { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ink-soft); }
.y-tier {
  --c: var(--cyan);
  padding: 3px 12px; border-radius: 999px; border: 1.5px solid var(--c); color: var(--c);
  font: 600 14px var(--display); box-shadow: 0 0 18px -6px var(--c);
}
.y-tier:empty { display: none; }
.y-full { margin-left: auto; color: var(--cyan); text-decoration: none; font: 600 14px var(--display); }
.y-full:hover { text-decoration: underline; }
.y-lede { color: var(--ink-soft); max-width: 40em; font-size: 17px; }
.y-player { margin-top: 0; width: 100%; }
.y-howto { font-size: 15px; color: var(--ink-soft); }

.y-done {
  display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap;
  padding: 18px 22px; border-radius: 18px; background: rgba(93, 204, 140, .08); border: 1.5px solid rgba(93, 204, 140, .5);
}
.y-done[hidden] { display: none; }
.y-done-fresh { animation: y-rise .4s ease-out; }
@keyframes y-rise { from { opacity: 0; transform: translateY(8px); } }
.y-done > div:first-child { flex: 1 1 240px; }
.y-done-title { font: 600 24px var(--display); color: var(--easy); }
.y-done-line { color: var(--ink-soft); font-size: 16px; }
.y-done-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.y-copied { flex-basis: 100%; font-size: 14px; color: var(--ink-soft); min-height: 0; }
.y-copied:empty { display: none; }

.y-cta {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px 22px; align-items: start;
  padding: clamp(18px, 3vw, 28px); border-radius: 22px; background: var(--card); border: 1px solid var(--rule);
}
.y-cta > img { border-radius: 16px; box-shadow: 0 0 40px -8px rgba(45, 226, 230, .5); }
.y-cta-copy { display: flex; flex-direction: column; gap: 10px; }
.y-cta h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 400; }
.y-cta-copy > p:not(.s-soon) { color: var(--ink-soft); font-size: 16px; }
.y-cta .s-soon { align-self: flex-start; margin: 4px 0 0; }
.y-next { text-align: center; font-size: 14px; color: var(--ink-soft); }
.y-next:empty { display: none; }

@media (max-width: 600px) {
  .y-cta { grid-template-columns: minmax(0, 1fr); }
  .y-cta > img { width: 56px; height: 56px; }
  .y-player .player-top { justify-content: center; }
  .y-howto { flex-basis: 100%; text-align: center; }
}

/* Phones: the board keeps its left-to-right layout, so it gets the card's
   full width (less padding) to keep the circles as large as they can be. */
@media (max-width: 600px) {
  .y-player { padding-inline: 6px; }
  .y-player .player-top, .y-player .hint-card { margin-inline: 10px; }
}
.y-turn { display: none; }
@media (max-width: 600px) and (orientation: portrait) {
  .y-turn { display: inline; }
}
/* A phone on its side: the board, the tray and a hint all fit on one
   screen. The hint goes beside the tray (digits on the left), so neither
   the board nor the digits move when it appears. */
@media (max-height: 500px) and (orientation: landscape) {
  .y-player { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 14px; padding-block: 10px; }
  .y-player > * { grid-column: 1 / -1; }
  .y-player [data-tray] { grid-column: 1; justify-content: flex-start; flex-wrap: nowrap; gap: 8px; min-height: 78px; align-items: center; }
  .y-player .hint-card { grid-column: 2; font-size: 13px; line-height: 1.4; padding: 8px 12px; }
  .y-player [data-status]:empty { display: none; }
  .y-player .try-tray button { width: 44px; height: 44px; font-size: 20px; }
  .y-page .s-nav { position: static; }
  .y-player .mini-board { max-height: calc(100vh - 190px); max-height: calc(100dvh - 190px); }
}
/* Small phones on their side (iPhone SE): smaller digits, more room for the hint. */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 740px) {
  .y-player .try-tray button { width: 38px; height: 38px; font-size: 18px; }
  .y-player [data-tray] { gap: 6px; min-height: 96px; }
  .y-player .hint-card { font-size: 12.5px; padding: 6px 10px; }
  .y-player .mini-board { max-height: calc(100vh - 205px); max-height: calc(100dvh - 205px); }
}

/* Solved: the lit board and its equations stay; the controls go. Just
   solved (y-fresh), the row above the board keeps its space, faded, so the
   board doesn't move; the next visit does without it. */
.y-solved .y-player [data-tray], .y-solved .y-player .hint-card, .y-solved .y-player [data-status],
.y-solved:not(.y-fresh) .y-player .player-top { display: none; }
.y-fresh .y-player .player-top { visibility: hidden; }

/* Phones: every digit on one row, shrinking to fit. */
@media (max-width: 600px) {
  .y-player .try-tray { flex-wrap: nowrap; gap: 6px; }
  .y-player .try-tray button { flex: 0 1 48px; width: auto; height: auto; aspect-ratio: 1; min-width: 0; }
}
