/* GameOnRPG — table felt system */
:root {
  --felt: #1e3a2f;
  --felt-deep: #142921;
  --felt-edge: #0e1f18;
  --bone: #ede6d6;
  --bone-dim: #c9c0ac;
  --brass: #b8935a;
  --brass-bright: #d4af6e;
  --red: #b8452f;
  --card: #f2ecdd;
  --card-ink: #22271f;
  --maxw: 720px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--felt-deep);
  background-image: radial-gradient(ellipse 120% 80% at 50% -10%, var(--felt) 0%, var(--felt-deep) 70%);
  color: var(--bone);
  font-family: "Spectral", Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.65;
  min-height: 100vh;
}

h1, h2, h3, .btn, .site-mark, .card-name, nav {
  font-family: "Bricolage Grotesque", "Arial Black", sans-serif;
}

/* ---------- header ---------- */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid rgba(184, 147, 90, 0.25);
}
.site-mark {
  color: var(--bone);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.site-mark span { color: var(--brass-bright); }
header nav a {
  color: var(--bone-dim);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 1.25rem;
}
header nav a:hover, header nav a:focus-visible { color: var(--brass-bright); }
.no-login {
  font-size: 0.72rem;
  color: var(--brass);
  border: 1px solid rgba(184,147,90,.45);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  white-space: nowrap;
}

/* ---------- hero / generator head ---------- */
.gen-head {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 1.5rem 1.5rem;
  text-align: center;
}
.gen-head h1 {
  font-size: clamp(2rem, 5.5vw, 3.1rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.01em;
}
.gen-head h1 em {
  font-style: normal;
  color: var(--brass-bright);
}
.gen-head p.lede {
  margin: 0.9rem auto 0;
  max-width: 34em;
  color: var(--bone-dim);
}

/* ---------- controls ---------- */
.controls {
  max-width: var(--maxw);
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}
.controls select {
  background: var(--felt-edge);
  color: var(--bone);
  border: 1px solid rgba(184,147,90,.4);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 0.95rem;
}
.btn {
  background: var(--brass);
  color: var(--felt-edge);
  border: none;
  border-radius: 8px;
  padding: 0.75rem 1.8rem;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease;
}
.btn:hover, .btn:focus-visible { background: var(--brass-bright); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .controls select:focus-visible, a:focus-visible {
  outline: 2px solid var(--brass-bright);
  outline-offset: 2px;
}

/* ---------- the tray (signature) ---------- */
.tray {
  max-width: 860px;
  margin: 2rem auto 0;
  padding: 1.75rem 1.5rem 2.25rem;
  min-height: 180px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  border-top: 2px solid rgba(184,147,90,.35);
  border-bottom: 2px solid rgba(184,147,90,.35);
  background:
    radial-gradient(ellipse 90% 100% at 50% 0%, rgba(255,255,255,0.03), transparent 60%);
}
.tray-empty {
  grid-column: 1 / -1;
  align-self: center;
  text-align: center;
  color: var(--bone-dim);
  font-style: italic;
  opacity: 0.7;
}

.result-card {
  background: var(--card);
  color: var(--card-ink);
  border-radius: 10px;
  padding: 1.1rem 1.1rem 0.8rem;
  box-shadow: 0 6px 18px rgba(0,0,0,0.45), 0 1px 0 rgba(255,255,255,0.25) inset;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  animation: deal 320ms cubic-bezier(.2,.9,.3,1.15) both;
  transition: transform 160ms ease;
}
/* hand-dealt scatter — 4-step cycle so no zigzag pattern reads */
.result-card:nth-child(4n+1) { transform: rotate(-0.6deg); }
.result-card:nth-child(4n+2) { transform: rotate(0.35deg); }
.result-card:nth-child(4n+3) { transform: rotate(-0.25deg); }
.result-card:nth-child(4n)   { transform: rotate(0.55deg); }
.result-card:hover, .result-card:focus-within { transform: rotate(0); }

@keyframes deal {
  from { opacity: 0; transform: translateY(26px) rotate(3deg) scale(0.96); }
}
@media (prefers-reduced-motion: reduce) {
  .result-card { animation: none; transition: none; }
  html { scroll-behavior: auto; }
}

.card-name {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.15;
  color: #1c2e24;
}
.card-flavor {
  font-size: 0.88rem;
  color: #4a4d42;
  font-style: italic;
  flex-grow: 1;
}
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px dashed rgba(34,39,31,0.25);
  padding-top: 0.45rem;
  margin-top: 0.3rem;
}
.card-mark {
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(34,39,31,0.45);
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
}
.card-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  color: var(--red);
  padding: 0.15rem 0.4rem;
}
.card-actions button:hover { text-decoration: underline; }
.card-actions button.copied { color: #2e6b45; }

/* ---------- prose / SEO body ---------- */
.prose {
  max-width: var(--maxw);
  margin: 2.5rem auto 0;
  padding: 0 1.5rem;
}
.prose h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 2rem 0 0.6rem;
  color: var(--brass-bright);
}
.prose p { margin-bottom: 1rem; color: var(--bone); }
.prose a { color: var(--brass-bright); }

/* ---------- related / index grid ---------- */
.gen-grid {
  max-width: 860px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.9rem;
}
.gen-grid a {
  display: block;
  background: var(--felt-edge);
  border: 1px solid rgba(184,147,90,.3);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  color: var(--bone);
  text-decoration: none;
  transition: border-color 120ms ease, transform 120ms ease;
}
.gen-grid a:hover { border-color: var(--brass-bright); transform: translateY(-2px); }
.gen-grid a strong {
  display: block;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  margin-bottom: 0.25rem;
  color: var(--brass-bright);
}
.gen-grid a small { color: var(--bone-dim); font-size: 0.82rem; }

.section-label {
  max-width: 860px;
  margin: 3rem auto 0;
  padding: 0 1.5rem;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
}

/* ---------- ad slots ---------- */
.ad-slot {
  max-width: var(--maxw);
  margin: 2rem auto;
  padding: 0 1.5rem;
  text-align: center;
}
.ad-slot .ad-box {
  border: 1px dashed rgba(184,147,90,.25);
  border-radius: 8px;
  color: rgba(201,192,172,0.35);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2.2rem 0;
}

/* ---------- footer ---------- */
footer {
  margin-top: 4rem;
  padding: 2rem 1.5rem 2.5rem;
  border-top: 1px solid rgba(184,147,90,.25);
  text-align: center;
  color: var(--bone-dim);
  font-size: 0.85rem;
}
footer a { color: var(--brass-bright); }

@media (max-width: 600px) {
  header nav a { margin-left: 0.8rem; }
  .no-login { display: none; }
}
