/* Shared styles for the Laboe Puzzle Hunt. */

:root {
  --bg: #12141c;
  --bg-panel: #1b1e2b;
  --bg-panel-2: #232739;
  --ink: #e7e3d8;
  --muted: #9a94a8;
  --brand: #f2b155;
  --brand-2: #7c9ef2;
  --accent: #6ee7b7;
  --line: #2c3044;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  background:
    radial-gradient(1200px 600px at 15% -10%, #1d2233 0%, transparent 60%),
    radial-gradient(1000px 500px at 110% 10%, #241d2e 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.65;
}

a {
  color: var(--brand-2);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 60rem;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* ---------- Puzzle grid ---------- */

.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.puzzle-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: linear-gradient(180deg, var(--bg-panel-2), var(--bg-panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.puzzle-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  text-decoration: none;
}

.puzzle-card .num {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.puzzle-card h2 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--ink);
}

.puzzle-card .blurb {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Puzzle page ---------- */

.puzzle {
  background: linear-gradient(180deg, var(--bg-panel-2), var(--bg-panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem clamp(1.25rem, 4vw, 2.75rem);
  box-shadow: var(--shadow);
}

.puzzle .num {
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
}

.puzzle h1 {
  margin: 0.25rem 0 0.75rem;
  color: var(--brand);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.puzzle .flavor {
  color: var(--muted);
  font-style: italic;
  margin: 0 0 1.5rem;
}

.puzzle .flavor.poem {
  text-align: center;
  line-height: 1.9;
  color: var(--ink);
  border-left: 2px solid rgba(242, 177, 85, 0.35);
  border-right: 2px solid rgba(242, 177, 85, 0.35);
  padding: 0.5rem 1rem;
  margin: 0 auto 2rem;
  max-width: 40rem;
}

.puzzle .body > * + * {
  margin-top: 1rem;
}

.puzzle pre,
.puzzle .mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: #0e1017;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  font-size: 0.95rem;
  line-height: 1.7;
}

.puzzle figure {
  margin: 0;
  text-align: center;
}

.puzzle figcaption {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

hr.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 1.75rem 0;
}

/* Ordered row of state silhouettes */
.states-row {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 1rem;
  counter-reset: state;
}

.states-row li {
  counter-increment: state;
  background: #0e1017;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.states-row li::before {
  content: counter(state);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  color: var(--brand);
  border: 1px solid rgba(242, 177, 85, 0.4);
  border-radius: 999px;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
}

.states-row img {
  width: 100%;
  max-height: 5.5rem;
  object-fit: contain;
}

/* ---------- Nav / footer ---------- */

.backlink {
  display: inline-block;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.backlink:hover {
  color: var(--brand);
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 3rem;
}
