:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  background: #11100e;
  color: #eee5d7;
}

* { box-sizing: border-box; }
html, body { max-width: 100%; }
body { margin: 0; overflow-wrap: anywhere; }

.static-fallback,
.content-page {
  width: min(900px, calc(100% - 32px));
  min-width: 0;
  margin: 48px auto;
  line-height: 1.7;
}

.static-fallback h1,
.static-fallback h2,
.static-fallback h3,
.content-page h1,
.content-page h2,
.content-page h3 {
  color: #f0d5a5;
  font-family: Georgia, serif;
  line-height: 1.15;
}

.static-fallback nav,
.content-page nav,
.daily-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.static-fallback a,
.content-page a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: #f4c962;
}

.content-page .example {
  padding: 16px;
  border-left: 3px solid #c69438;
  background: #24231f;
  white-space: pre-wrap;
}

.daily-position {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 0.48fr);
  gap: clamp(18px, 4vw, 36px);
  align-items: start;
  min-width: 0;
}

.daily-board {
  position: relative;
  width: min(100%, 580px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 250, 234, 0.45);
  border-radius: 12px;
  background-color: #d6c5a6;
  background-image:
    url("/assets/generated/grid-overlay.webp"),
    url("/assets/generated/board-limestone.webp");
  background-position: center;
  background-size: 100% 100%, cover;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.38);
}

.daily-board > ol {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.daily-stone {
  position: absolute;
  left: calc((var(--x) + 0.5) * 100% / 15);
  top: calc((var(--y) + 0.5) * 100% / 15);
  width: calc(90% / 15);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
}

.daily-stone img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 3px rgba(42, 31, 19, 0.42));
}

.daily-stone > span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.daily-position-text {
  min-width: 0;
  padding: 14px 18px;
  border: 1px solid #544c40;
  border-radius: 10px;
  background: #1d1c19;
}

.daily-position-text h3 { margin-top: 0; }
.daily-position-text ol { margin: 0; padding-left: 24px; columns: 2; column-gap: 24px; }
.daily-position-text li { break-inside: avoid; }

.daily-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 24px 0;
  overflow: hidden;
  border: 1px solid #4d463b;
  border-radius: 10px;
  background: #4d463b;
}

.daily-facts > div { min-width: 0; padding: 11px 14px; background: #1d1c19; }
.daily-facts dt { color: #aaa299; font-size: 0.86rem; }
.daily-facts dd { margin: 2px 0 0; }
.daily-facts code { overflow-wrap: anywhere; }
.daily-facts .daily-hash { grid-column: 1 / -1; }

.primary-action,
.daily-actions > a {
  min-height: 48px !important;
  justify-content: center;
  padding: 8px 20px;
  border: 1px solid #f2cc75;
  border-radius: 9px;
  color: #1b160d !important;
  background: #d6a746;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.daily-board > .daily-stone {
  display: block;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 3px 3px rgba(42, 31, 19, 0.42));
}

.daily-neighbours a,
.related-links a,
.daily-list a {
  padding: 6px 10px;
  border: 1px solid #514939;
  border-radius: 8px;
  text-decoration: none;
}

.daily-neighbours a { flex: 1 1 140px; justify-content: space-between; gap: 12px; }
.daily-neighbours b { color: #eee5d7; font-size: 0.88rem; }

.daily-gap-note {
  margin: 24px 0;
  padding: 14px 16px;
  border-left: 3px solid #c69438;
  background: #24231f;
}

.daily-list { display: grid; gap: 10px; margin: 24px 0; padding: 0; list-style: none; }
.daily-list a { display: flex; justify-content: space-between; gap: 16px; }
.daily-list time { color: #eee5d7; font-variant-numeric: tabular-nums; }
.content-page footer { margin-top: 40px; color: #aaa299; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media (max-width: 660px) {
  .static-fallback, .content-page { width: min(100% - 24px, 900px); margin-block: 24px; }
  .daily-position { grid-template-columns: minmax(0, 1fr); }
  .daily-position-text ol { columns: 2; }
  .daily-facts { grid-template-columns: minmax(0, 1fr); }
  .daily-facts .daily-hash { grid-column: auto; }
  .daily-list a { flex-direction: column; gap: 2px; }
}

@media (max-width: 360px) {
  .daily-position-text ol { columns: 1; }
  .daily-neighbours a { flex-basis: 100%; }
}
