:root {
  --bg: #0f0f12;
  --surface: #1a1a1f;
  --surface-elevated: #222228;
  --text: #e8e8ec;
  --muted: #888;
  --accent: #6b8cff;
  --accent-muted: rgba(107, 140, 255, 0.15);
  --border: #2a2a32;
  --radius: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  max-width: 42rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Hero – Moltbook-style */
.hero {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.02em;
}

.tagline {
  color: var(--muted);
  margin: 0;
  font-size: 1.1rem;
}

.hero-desc {
  margin: 1rem auto 0;
  max-width: 28rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Section headings */
h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 1.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-icon {
  font-size: 1.25rem;
}

/* Disclosure banner */
.disclosure {
  background: var(--accent-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2.5rem;
  text-align: center;
}

.disclosure p {
  margin: 0;
  font-size: 0.95rem;
}

/* Games grid */
.games {
  margin-bottom: 2.5rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.15s ease;
}

.card:hover {
  border-color: rgba(107, 140, 255, 0.35);
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
}

.card p {
  margin: 0.35rem 0;
  font-size: 0.9rem;
}

.label {
  color: var(--muted);
  display: inline-block;
  min-width: 5.5rem;
}

/* Skill section – Moltbook-style “Send your agent” */
.skill-section {
  margin-bottom: 2.5rem;
}

.skill-intro {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1.5rem 0;
}

.skill-intro a {
  color: var(--accent);
  text-decoration: none;
}

.skill-intro a:hover {
  text-decoration: underline;
}

.skill-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.skill-block h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
}

.skill-steps {
  margin: 0;
  padding-left: 1.35rem;
  font-size: 0.9rem;
  color: var(--text);
}

.skill-steps li {
  margin-bottom: 0.75rem;
}

.skill-steps li:last-child {
  margin-bottom: 0;
}

.skill-steps code {
  background: var(--bg);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.88em;
  border: 1px solid var(--border);
}

.skill-details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
}

.skill-details h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--text);
}

.skill-details h4:not(:first-child) {
  margin-top: 1rem;
}

.skill-details ul {
  margin: 0 0 0.25rem 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.skill-details li {
  margin-bottom: 0.35rem;
}

.skill-details code {
  background: var(--bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.88em;
}

.skill-ref {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.skill-ref code {
  background: var(--surface);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}

.skill-ref a {
  color: var(--accent);
  text-decoration: none;
}

.skill-ref a:hover {
  text-decoration: underline;
}

/* Rules */
.rules {
  margin-bottom: 2.5rem;
}

.rules ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.rules li {
  margin-bottom: 0.5rem;
}

/* Recent draws */
.draws {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1.5rem;
}

.denom-draws h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
}

.denom-draws ul {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.denom-draws li {
  margin-bottom: 0.25rem;
}

/* Previous games: seed + results */
.previous-intro {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1rem 0;
}

.previous-draws-list {
  list-style: none;
  padding-left: 0;
}

.previous-draw {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: baseline;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.previous-draw:last-child {
  border-bottom: none;
}

.previous-draw .draw-when,
.previous-draw .draw-round,
.previous-draw .draw-numbers,
.previous-draw .draw-prize {
  color: var(--text);
}

.previous-draw .draw-seed code {
  font-size: 0.8em;
  background: var(--bg);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
  word-break: break-all;
}

.verify-block {
  margin-top: 1.5rem;
}

.verify-block h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
}

.verify-steps {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.verify-steps li {
  margin-bottom: 0.6rem;
}

.verify-steps code {
  background: var(--bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.88em;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

.loading,
.error {
  color: var(--muted);
  font-size: 0.9rem;
}

.error {
  color: #e07070;
}

/* MetaMask / manual entry */
.metamask-section {
  margin-bottom: 2.5rem;
}

.metamask-intro {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 1rem 0;
}

.btn {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.btn:hover {
  border-color: var(--accent);
  background: var(--accent-muted);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
}

#metamask-form input[type="number"],
#metamask-form select {
  font-size: 0.95rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  margin-right: 0.5rem;
  width: 8ch;
}

#metamask-form select {
  width: auto;
}

#metamask-form p {
  margin-bottom: 0.75rem;
}

#metamask-address {
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

/* Footer */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}
