/* ── It Refused ─────────────────────────────────────────── */
/* Deliberately leaner than the other games. No fog, no particle
   drift, no round counter, no score. The point of this one is
   friction, not atmosphere — it should feel starker than the rest of
   the site, not prettier. */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-deep: #0a0807;
  --text-primary: #c2bbb5;
  --text-dim: #948b84;
  --text-faint: #7d766f;
  --text-bright: #e2dad2;
  --accent-rust: #a06a54;
}

html {
  min-height: 100%;
  background: var(--bg-deep);
}

body {
  font-family: Georgia, 'Times New Roman', 'Palatino Linotype', serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.grain-overlay {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  z-index: 100;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  animation: grainShift 0.5s steps(1) infinite;
}

@keyframes grainShift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2%, -1%); }
  50% { transform: translate(1%, 2%); }
  75% { transform: translate(-1%, -2%); }
}

.refused-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: 3rem 1.5rem;
  text-align: center;
}

.refused-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 400;
  color: var(--text-bright);
  letter-spacing: 0.05em;
}

.refused-instruction {
  color: var(--text-dim);
  font-size: 1rem;
  letter-spacing: 0.02em;
  max-width: 360px;
}

/* The stage the button dodges around inside. Fixed size so the button
   always has somewhere to land, and never off the edge of the page. */
.doit-stage {
  position: relative;
  width: min(90vw, 420px);
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.doit-button {
  font: inherit;
  font-size: 1rem;
  color: var(--text-primary);
  background: rgba(120, 90, 75, 0.15);
  border: 1px solid rgba(160, 106, 84, 0.3);
  border-radius: 2px;
  padding: 0.7em 2em;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: background 200ms ease, border-color 200ms ease, color 200ms ease,
    top 260ms cubic-bezier(.2, .9, .3, 1.3), left 260ms cubic-bezier(.2, .9, .3, 1.3);
}

.doit-button:hover {
  background: rgba(160, 106, 84, 0.22);
  border-color: rgba(160, 106, 84, 0.5);
  color: var(--text-bright);
}

.doit-button:focus-visible {
  outline: 2px solid var(--text-bright);
  outline-offset: 4px;
}

.doit-button:disabled {
  cursor: default;
  opacity: 0.85;
}

.doit-button.dodging {
  position: absolute;
}

/* A quick jitter and color-split, borrowed from the homepage's own
   ambient glitch — the button flinching, not just relocating. */
.doit-button.flinch {
  animation: doitFlinch 220ms steps(2, jump-none);
}

@keyframes doitFlinch {
  0%   { text-shadow: none; }
  30%  { text-shadow: 1px 0 rgba(210, 100, 90, 0.5), -1px 0 rgba(90, 150, 200, 0.5); }
  60%  { text-shadow: -1px 0 rgba(210, 100, 90, 0.4), 1px 0 rgba(90, 150, 200, 0.4); }
  100% { text-shadow: none; }
}

.refused-counter {
  min-height: 1.2em;
  font-size: 0.8rem;
  font-style: italic;
  color: var(--text-faint);
  letter-spacing: 0.04em;
}

.aftermath {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  max-width: 380px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 900ms ease, transform 900ms ease;
}

.aftermath.visible {
  opacity: 1;
  transform: none;
}

.refused-line {
  font-size: 1rem;
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.8;
}

.aftermath-actions {
  display: flex;
  gap: 1rem;
  margin-top: 0.8rem;
}

.text-button {
  font: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: none;
  border: none;
  border-bottom: 1px solid rgba(160, 106, 84, 0.3);
  padding: 0.2em 0;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 300ms ease, border-color 300ms ease;
}

.text-button:hover {
  color: var(--text-bright);
  border-bottom-color: var(--accent-rust);
}

.text-button:focus-visible {
  outline: 2px solid var(--text-bright);
  outline-offset: 4px;
}

.noscript {
  text-align: center;
  padding: 2rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.noscript a {
  color: var(--text-primary);
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  .grain-overlay { animation: none; }
  .doit-button { transition: background 200ms ease, border-color 200ms ease, color 200ms ease; }
  .doit-button.flinch { animation: none; }
  .aftermath { transition: none; }
}

::selection {
  background: rgba(160, 106, 84, 0.25);
  color: var(--text-bright);
}
