.daily-home {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) minmax(230px, 300px);
  gap: clamp(24px, 5vw, 68px);
  align-items: center;
  min-height: 430px;
  padding: clamp(34px, 6vw, 76px);
  border: 1px solid var(--line, #c8c0b1);
  background:
    linear-gradient(90deg, transparent 0 31%, color-mix(in srgb, var(--line, #c8c0b1) 45%, transparent) 31% calc(31% + 1px), transparent calc(31% + 1px)),
    var(--paper, #f2eee5);
  color: var(--ink, #181816);
}

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

.daily-stamp {
  width: 128px;
  aspect-ratio: 1;
  display: grid;
  place-content: center;
  gap: 7px;
  border: 3px double var(--overlap, #8f321f);
  border-radius: 50%;
  color: var(--overlap, #8f321f);
  font-family: var(--mono, ui-monospace, monospace);
  text-align: center;
  transform: rotate(-7deg);
}

.daily-stamp::before,
.daily-stamp::after { content: "★"; font-size: 9px; }
.daily-stamp span { font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.daily-stamp strong { font-size: 27px; letter-spacing: -.04em; }

.daily-home-main h2 {
  margin: 0;
  font-family: var(--serif, Georgia, serif);
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 600;
  letter-spacing: -.045em;
  line-height: .98;
}

.daily-home-copy { max-width: 560px; margin: 18px 0; color: var(--muted, #68635a); line-height: 1.7; }

.daily-word-lockup {
  display: flex;
  align-items: baseline;
  gap: 15px;
  margin: 28px 0;
}

.daily-word-lockup > span {
  color: var(--head, #174e55);
  font-family: var(--serif, Georgia, serif);
  font-size: clamp(35px, 5vw, 58px);
  font-weight: 600;
  line-height: 1;
}

.daily-word-lockup small { color: var(--overlap, #8f321f); font-family: var(--mono, ui-monospace, monospace); font-weight: 700; }
.daily-start { min-width: 190px; }
.daily-status { min-height: 1.5em; margin: 12px 0 0; color: var(--muted, #68635a); font-size: 13px; }

.daily-ledger { margin: 0; border-top: 2px solid var(--ink, #181816); }
.daily-ledger div { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 17px 0; border-bottom: 1px solid var(--line, #c8c0b1); }
.daily-ledger dt { color: var(--muted, #68635a); font-size: 13px; }
.daily-ledger dd { margin: 0; font-family: var(--mono, ui-monospace, monospace); font-size: 13px; font-weight: 700; text-align: right; }

.daily-challenge-entry {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line, #c8c0b1);
  background: var(--paper, #f2eee5);
  color: var(--ink, #181816);
}

.daily-challenge-entry::after {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 74px;
  height: 74px;
  border: 2px solid var(--overlap, #8f321f);
  border-radius: 50%;
  color: var(--overlap, #8f321f);
  content: "DAILY";
  display: grid;
  place-items: center;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  opacity: .78;
  transform: rotate(8deg);
}

.daily-challenge-entry.is-ready::after { animation: daily-stamp-in .36s ease-out both; }

.daily-entry-date,
.daily-result-kicker {
  margin: 0 0 8px;
  color: var(--muted, #68635a);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.daily-entry-word {
  display: block;
  margin: 18px 90px 16px 0;
  color: var(--head, #174e55);
  font-family: var(--serif, Georgia, serif);
  font-size: clamp(34px, 5vw, 56px);
  line-height: .95;
}

.daily-entry-status { min-height: 1.4em; color: var(--muted, #68635a); }

.daily-hud {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 10px 12px;
  border-block: 1px solid var(--line, #c8c0b1);
  background: color-mix(in srgb, var(--paper-deep, #e8e1d5) 55%, transparent);
  color: var(--ink, #181816);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 12px;
}

.daily-hud[hidden] { display: none; }
.daily-hud button { min-height: 38px; }
.daily-hud-identity { min-width: 0; }
.daily-hud-identity strong,
.daily-hud-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-hud-identity small { margin-top: 2px; color: var(--muted, #68635a); }

.daily-metric {
  min-width: 72px;
  padding-left: 12px;
  border-left: 1px solid var(--line, #c8c0b1);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.daily-assisted-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--head, #174e55);
  border-radius: 999px;
  color: var(--head, #174e55);
  white-space: nowrap;
}

.daily-assisted-badge.is-assisted { border-color: var(--overlap, #8f321f); color: var(--overlap, #8f321f); }

.daily-result-overlay,
.daily-overlay { z-index: 80; }

.daily-result-card {
  position: relative;
  width: min(580px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  border-top: 7px solid var(--ink, #181816);
  text-align: left;
}

.daily-result-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line, #c8c0b1);
  border-radius: 50%;
  background: transparent;
  color: var(--ink, #181816);
  cursor: pointer;
  font: 24px/1 var(--serif, Georgia, serif);
}

.daily-result-card h2 { padding-right: 44px; }

.daily-result-meta {
  margin: 22px 0 8px;
  color: var(--ink, #181816);
  font-family: var(--serif, Georgia, serif);
  font-size: clamp(24px, 5vw, 38px);
  line-height: 1.2;
}

.daily-result-stamp {
  margin: 22px 0 10px;
  padding: 15px 17px;
  border-left: 5px solid var(--overlap, #8f321f);
  background: var(--paper-deep, #e8e1d5);
  color: var(--ink, #181816);
  font-family: var(--serif, Georgia, serif);
  font-size: clamp(22px, 5vw, 34px);
}

.daily-result-copy,
.daily-opponent-result { color: var(--muted, #68635a); line-height: 1.65; }
.daily-opponent-result { padding: 11px 13px; border: 1px solid var(--line, #c8c0b1); }
.daily-share-actions,
.daily-result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.daily-share-actions .btn,
.daily-result-actions .btn { flex: 1 1 150px; }

.daily-result-comparison,
.daily-sync-status { color: var(--muted, #68635a); line-height: 1.55; }

.daily-result-route {
  overflow-x: auto;
  margin: 20px 0;
  padding: 18px;
  border: 1px solid var(--line, #c8c0b1);
  background: var(--paper-deep, #e8e1d5);
  color: var(--overlap, #8f321f);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .05em;
  white-space: nowrap;
}

.daily-result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.daily-result-actions .btn { flex: 1 1 160px; }

body.daily-challenge-playing .game-mode-select,
body.daily-challenge-playing #diffSelect { pointer-events: none; opacity: .5; }

body.daily-challenge-mode #diffSelect { display: none; }

body.daily-challenge-playing #solveSection { display: none !important; }

.daily-challenge-entry button:focus-visible,
.daily-hud button:focus-visible,
.daily-result-card button:focus-visible {
  outline: 3px solid var(--head, #174e55);
  outline-offset: 3px;
}

@keyframes daily-stamp-in {
  from { opacity: 0; transform: scale(1.25) rotate(20deg); }
  to { opacity: .78; transform: scale(1) rotate(8deg); }
}

@media (max-width: 720px) {
  .daily-home { grid-template-columns: 1fr; gap: 26px; min-height: auto; background: var(--paper, #f2eee5); }
  .daily-stamp { width: 98px; }
  .daily-ledger { margin-top: 8px; }
  .daily-hud { grid-template-columns: auto 1fr auto; }
  .daily-reset-countdown { grid-column: 2 / -1; text-align: right; }
  .daily-assisted-badge { grid-column: 2; justify-self: end; }
  .daily-result-actions { flex-direction: column; }
  .daily-result-actions .btn { flex-basis: auto; width: 100%; }
}

@media (max-width: 460px) {
  .daily-home { padding: 28px 20px; }
  .daily-word-lockup { align-items: flex-start; flex-direction: column; }
  .daily-hud { gap: 8px; padding-inline: 8px; }
  .daily-metric { min-width: 60px; padding-left: 8px; }
  .daily-challenge-entry::after { width: 62px; height: 62px; }
  .daily-entry-word { margin-right: 70px; }
}

@media (prefers-reduced-motion: reduce) {
  .daily-challenge-entry.is-ready::after { animation: none; }
  .daily-stamp { transform: none; }
}
