:root {
  color-scheme: light;
  --bg: #f4f8f6;
  --fg: #112d25;
  --accent: #12745a;
  --muted: #5a6f67;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", "Segoe UI", sans-serif;
  background: radial-gradient(circle at top right, #e2f8f0, var(--bg) 45%);
  color: var(--fg);
}

.shell {
  max-width: 760px;
  margin: 6rem auto;
  padding: 2rem;
  background: var(--card);
  border: 1px solid #d7e5df;
  border-radius: 16px;
  box-shadow: 0 24px 48px -36px rgba(17, 45, 37, 0.4);
}

h1 {
  margin-top: 0;
  margin-bottom: 1.25rem;
}

.selfhost-shell {
  max-width: 920px;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lead {
  max-width: 760px;
  color: #29473f;
  font-size: 1.1rem;
  line-height: 1.55;
}

.guide-section {
  margin-top: 1.6rem;
}

.guide-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.check-list,
.step-list {
  margin: 0;
  padding-left: 1.2rem;
  line-height: 1.55;
}

.check-list li,
.step-list li {
  margin: 0.45rem 0;
}

code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.92em;
}

pre {
  overflow-x: auto;
  margin: 1rem 0 0;
  padding: 1rem;
  border: 1px solid #d7e5df;
  border-radius: 8px;
  background: #10251f;
  color: #f4fff9;
  line-height: 1.45;
}

.status-panel {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid #d7e5df;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfefd 0%, #f2faf6 100%);
}

.status-copy {
  min-width: 0;
}

#startup-message {
  margin: 0;
  font-size: 1.02rem;
}

.spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 0.2rem;
  border-radius: 999px;
  border: 2px solid #cce3da;
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.button {
  display: inline-block;
  text-decoration: none;
  border: 1px solid #99beb2;
  color: var(--fg);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

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

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

/* ---- Tic-Tac-Toe mini-game ---- */

.ttt-container {
  margin: 1.5rem 0 0;
  padding: 1.25rem;
  border: 1px solid #d7e5df;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfefd 0%, #f2faf6 100%);
  text-align: center;
}

.ttt-label {
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  color: var(--muted);
}

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  max-width: 210px;
  margin: 0 auto;
}

.ttt-cell {
  aspect-ratio: 1;
  border: 2px solid #c4ddd4;
  border-radius: 10px;
  background: #fff;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--fg);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  line-height: 1;
}

.ttt-cell:hover:not(:disabled) {
  background: #e8f5ef;
  border-color: var(--accent);
}

.ttt-cell:active:not(:disabled) {
  transform: scale(0.92);
}

.ttt-cell:disabled {
  cursor: default;
}

.ttt-cell.x {
  color: var(--accent);
}

.ttt-cell.o {
  color: #d35f3a;
}

.ttt-cell.win {
  background: #d5f5e6;
  border-color: var(--accent);
}

.ttt-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-top: 0.85rem;
}

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

.ttt-reset {
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
}

.ttt-more {
  margin-top: 0.85rem;
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
}

.ttt-scoreboard {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.65rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.ttt-scoreboard strong {
  color: var(--fg);
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 640px) {
  .shell {
    margin: 2rem 1rem;
    padding: 1.25rem;
  }

  .status-panel {
    gap: 0.85rem;
    padding: 0.95rem;
  }
}
