/* Page layout: header, main column, buttons, toasts */
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-main);
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.site-header {
  display: grid;
  grid-template-columns: minmax(44px, auto) 1fr minmax(44px, auto);
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
}
.site-header h1 {
  text-align: center;
  font-family: var(--font-pixel);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header > :last-child { justify-self: end; }
.puzzle-num {
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-muted);
  vertical-align: middle;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.1rem;
  border: 1.5px solid var(--color-border);
}
.icon-btn:hover { background: var(--color-surface-2); }

main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.card {
  width: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 22px 18px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.site-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-muted);
  padding: 12px 16px 20px;
}

:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Buttons */
/* Chunky pixel buttons: square corners and a solid drop shadow that "presses" */
.btn {
  min-height: 46px;
  padding: 0 20px;
  font-family: var(--font-pixel);
  font-size: 1.05rem;
  color: var(--color-text);
  background: var(--color-surface-2);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.06s, box-shadow 0.06s, filter 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.btn-primary {
  background: var(--color-accent);
  color: var(--color-accent-text);
  border-color: transparent;
}
.btn-wide { width: 100%; margin-top: 16px; }
.btn-small { min-height: 32px; padding: 0 14px; font-size: 0.9rem; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }

.muted { color: var(--color-muted); }
.center { text-align: center; }
.error { color: var(--tier-bad); padding: 24px 0; }

/* Toasts */
#toast-root {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
  pointer-events: none;
}
.toast {
  background: var(--color-text);
  color: var(--color-bg);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 16px;
  border-radius: 8px;
  animation: toast-in 0.15s ease-out;
  white-space: nowrap;
}
.toast.leaving { animation: toast-out 0.25s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes toast-out { to { opacity: 0; } }

/* Simple content pages (about, privacy) */
.page { max-width: 640px; margin: 0 auto; padding: 32px 16px; display: flex; flex-direction: column; gap: 14px; }
.page h1 { font-family: var(--font-display); font-size: 2rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
