/* The daily puzzle page. Builds on style.css (colours, fonts, buttons, toast). Phone first. */

body.daily {
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--font-ui);
  margin: 0;
}

.daily-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px 48px;
  display: grid;
  gap: 18px;
}

.daily-home {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9rem;
}

.daily-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 2.8rem);
  margin: 0;
  line-height: 1.05;
}
.daily-title em {
  color: var(--red);
}
.daily-rules {
  margin: 6px 0 0;
  color: var(--ink-2);
  line-height: 1.45;
}

.daily-off {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.daily-game {
  display: grid;
  gap: 18px;
}
.daily-game[hidden],
.daily-reveal[hidden] {
  display: none;
}

.daily-game h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 8px;
}

/* Voice */
.daily-voice {
  display: grid;
  gap: 8px;
}
.daily-play {
  font-size: 1.1rem;
  padding: 14px 18px;
}
.daily-wave {
  width: 100%;
  height: 48px;
}

/* Cards */
.card-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.daily-card-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  cursor: pointer;
  min-height: 48px;
}
.daily-card-btn:hover:not(:disabled) {
  border-color: var(--teal);
}
.daily-card-btn:disabled {
  cursor: default;
  opacity: 0.6;
}
.daily-card.asked .daily-card-btn {
  opacity: 1;
  background: var(--parchment-2);
}
.daily-card .dcost {
  flex: none;
  font-size: 0.8rem;
  color: var(--ink-3);
  white-space: nowrap;
}
.daily-card .answer {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  margin: 4px 14px 0;
  color: var(--teal-2);
}

/* Guessing */
.guess-form {
  display: flex;
  gap: 8px;
}
.guess-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
}
.daily-globe {
  width: 100%;
  aspect-ratio: 1;
  max-height: 420px;
  margin-top: 10px;
  touch-action: none;
}
.dguess-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.dguess {
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--card);
  border-left: 4px solid var(--ink-3);
}
.dguess.close {
  border-left-color: var(--gold);
  background: var(--gold-soft);
}
.dguess.found {
  border-left-color: var(--green);
  font-weight: 600;
}

/* Reveal */
.daily-reveal {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.reveal-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.8rem;
  margin: 4px 0;
}
.reveal-flag {
  width: 40px;
  height: 30px;
  border: 1px solid var(--line);
}
.reveal-said {
  margin: 12px 0;
  padding-left: 12px;
  border-left: 3px solid var(--teal);
}
.reveal-said p {
  margin: 0 0 4px;
  font-style: italic;
}
.reveal-said footer {
  color: var(--ink-2);
}
.reveal-score {
  font-weight: 700;
  font-size: 1.15rem;
}

/* Link from the main title screen */
.daily-link {
  /* At least 44px tall so it is easy to tap on a phone. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 2px;
  color: var(--teal-2);
  font-weight: 600;
}
.daily-link[hidden] {
  display: none;
}

.daily-credits {
  font-size: 0.8rem;
  color: var(--ink-3);
  line-height: 1.5;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.daily-credits a {
  color: inherit;
}

.reveal-actions {
  margin: 12px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.daily-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
  text-align: center;
}
.daily-stats[hidden] {
  display: none;
}
.daily-stats dt {
  font-size: 0.75rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.daily-stats dd {
  margin: 2px 0 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

/* ---------- Daily v2: five voices ---------- */
.day-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.voice-dots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.voice-dot {
  min-width: 36px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 0.85rem;
  text-align: center;
  color: var(--ink-3);
}
.voice-dot.now {
  border-color: var(--teal);
  color: var(--teal-2);
  font-weight: 700;
}
.voice-dot.done {
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
/* The result stamps (public/result-stamps.js): small beside a score, big on the end-of-day summary. */
.result-stamp {
  width: 1.4em;
  height: 1.4em;
  flex: none;
  vertical-align: middle;
}
.result-stamp text {
  font-family: var(--font-display);
  font-weight: 800;
}
.voice-dot .result-stamp {
  width: 24px;
  height: 24px;
}
.result-stamp.big {
  width: 54px;
  height: 54px;
}
.summary-stamps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 4px;
}
/* Slightly askew, like stamps on a passport page. */
.summary-stamps .result-stamp:nth-child(odd) {
  transform: rotate(-8deg);
}
.summary-stamps .result-stamp:nth-child(even) {
  transform: rotate(6deg);
}
.day-score {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  white-space: nowrap;
}
.day-score small,
.summary-score small {
  font-size: 0.9rem;
  color: var(--ink-3);
}
.voice-intro,
.voice-play {
  display: grid;
  gap: 12px;
}
.voice-intro[hidden],
.voice-play[hidden],
.day-summary[hidden] {
  display: none;
}
.voice-intro {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.voice-intro h2,
.voice-head h2 {
  margin: 0;
}
.voice-intro p {
  margin: 0;
  color: var(--ink-2);
}
.voice-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.voice-clock {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-variant-numeric: tabular-nums;
}
.voice-clock.low {
  color: var(--red);
}
.voice-turn {
  margin: 0;
  font-weight: 600;
}
.field-notes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.field-notes .note {
  display: grid;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--parchment-2);
}
.field-notes .note-q {
  font-size: 0.9rem;
  color: var(--ink-2);
}
.field-notes .answer {
  font-family: var(--font-hand);
  font-size: 1.35rem;
  color: var(--teal-2);
}
.daily-deck h3,
.daily-guess h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 8px;
}
.deck-hint {
  margin: 0 0 8px;
  color: var(--red);
  font-weight: 600;
}
.deck-cats {
  display: grid;
  gap: 6px;
}
.deck-cat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 10px;
}
.deck-cat summary {
  cursor: pointer;
  /* At least 44px tall, easy to tap. */
  padding: 11px 2px;
  font-weight: 600;
}
.deck-cat .card-list {
  padding-bottom: 8px;
}
.reveal-guesses {
  list-style: none;
  margin: 8px 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.summary-score {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.6rem;
}
.summary-voices {
  list-style: none;
  margin: 12px 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.summary-voice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.sv-points {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* Your ear (#78): one short line and a link, under the five voices. */
.ear-note {
  margin: 0 0 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}
.ear-line {
  font-weight: 600;
}
.ear-line[hidden] {
  display: none;
}
.ear-atlas {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--teal);
  font-weight: 600;
  white-space: nowrap;
}
.day-summary {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

/* ---------- Challenge links ("beat my #142") ---------- */
.challenge-banner {
  background: var(--gold-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
}
.challenge-banner[hidden],
.challenge-result[hidden] {
  display: none;
}
.challenge-banner .eyebrow {
  margin: 0;
}
.challenge-teaser {
  margin: 4px 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.3;
}
.challenge-stamps {
  margin: 0;
  display: flex;
  gap: 4px;
  font-size: 1.3rem;
}
.challenge-note {
  margin: 8px 0 0;
  color: var(--ink-2);
}
.challenge-result {
  margin: 12px 0;
  padding: 12px;
  background: var(--gold-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.cr .eyebrow {
  margin: 0;
}
.cr-verdict {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 2px 0 8px;
}
.cr-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.cr-table th,
.cr-table td {
  padding: 6px 4px;
  text-align: left;
  border-top: 1px solid var(--line);
}
.cr-table thead th {
  border-top: 0;
  font-size: 0.85rem;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}
.cr-table .win {
  font-weight: 700;
}
.cr-table tfoot th,
.cr-table tfoot td {
  font-weight: 700;
}
#challenge-past .cr {
  margin-top: 10px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.share-name {
  display: grid;
  gap: 4px;
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.share-name input {
  font: inherit;
  color: var(--ink);
  max-width: 16rem;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

/* ---------- Results: streak stamp and the countdown to the next puzzle ---------- */
.results-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 4px 0 12px;
}
.streak {
  display: flex;
  align-items: center;
  gap: 14px;
}
.streak[hidden] {
  display: none;
}
/* A round rubber stamp, like the passport stamps elsewhere in the game. */
.streak-stamp {
  flex: none;
  width: 74px;
  height: 74px;
  margin: 0;
  display: grid;
  place-content: center;
  text-align: center;
  border: 3px solid var(--red);
  outline: 1.5px solid var(--red);
  outline-offset: -8px;
  border-radius: 50%;
  color: var(--red);
  transform: rotate(-10deg);
  background: rgba(244, 219, 207, 0.45);
  -webkit-mask: var(--stamp-mask);
  mask: var(--stamp-mask);
}
.streak-stamp strong {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.8rem;
  line-height: 1;
}
.streak-stamp span {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.streak-text {
  margin: 0;
  display: grid;
  gap: 2px;
}
.streak-text strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.streak-text span {
  font-size: 0.9rem;
  color: var(--ink-3);
}
.next-puzzle {
  margin: 0;
  padding: 8px 14px;
  display: grid;
  gap: 0;
  border: 1px dashed var(--line);
  border-radius: 10px;
  text-align: center;
}
.next-label {
  font-size: 0.75rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.next-time {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}
.next-puzzle [hidden] {
  display: none;
}
.next-ready {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--teal);
  font-weight: 600;
}

/* Test days (DAILY_TEST_LAUNCH): a clear line that this isn't the real daily, with "Clear test data". */
.test-banner {
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 2px dashed var(--red);
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--ink);
  font-size: 0.9rem;
}
.test-banner button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--red-2);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
.daily-credits .social-links {
  display: block;
  margin-top: 4px;
}
