:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --border: #e8e5e0;
  --text: #1a1a1a;
  --dim: #999;
  --accent: #ff6b35;
  --accent2: #c47a12;
  --green: #1a8f5c;
  --red: #d44;
  --blue: #2563eb;
  --font: "Nunito", sans-serif;
  --radius: 16px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.floating-chars {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.float-char {
  position: absolute;
  opacity: 0.06;
  image-rendering: pixelated;
}

.fc-1  { width: 100px; top: 3%;   left: 5%;   animation: bob 7s ease-in-out infinite; }
.fc-2  { width: 80px;  top: 8%;   right: 8%;  animation: bob 9s ease-in-out infinite 1s; }
.fc-3  { width: 110px; top: 18%;  left: 80%;  animation: bob 6s ease-in-out infinite 0.5s; }
.fc-4  { width: 70px;  top: 25%;  left: 2%;   animation: bob 8s ease-in-out infinite 2s; }
.fc-5  { width: 90px;  top: 35%;  right: 3%;  animation: bob 7.5s ease-in-out infinite 1.5s; }
.fc-6  { width: 85px;  top: 42%;  left: 8%;   animation: bob 6.5s ease-in-out infinite 3s; }
.fc-7  { width: 75px;  top: 50%;  right: 6%;  animation: bob 8.5s ease-in-out infinite 0.8s; }
.fc-8  { width: 95px;  top: 58%;  left: 3%;   animation: bob 7s ease-in-out infinite 2.5s; }
.fc-9  { width: 70px;  top: 65%;  right: 10%; animation: bob 9.5s ease-in-out infinite 1.2s; }
.fc-10 { width: 80px;  top: 72%;  left: 6%;   animation: bob 6s ease-in-out infinite 3.5s; }
.fc-11 { width: 90px;  top: 78%;  right: 4%;  animation: bob 8s ease-in-out infinite 0.3s; }
.fc-12 { width: 85px;  top: 85%;  left: 10%;  animation: bob 7.5s ease-in-out infinite 2.8s; }
.fc-13 { width: 100px; top: 90%;  right: 8%;  animation: bob 6.5s ease-in-out infinite 1.8s; }
.fc-14 { width: 75px;  top: 95%;  left: 4%;   animation: bob 9s ease-in-out infinite 0.6s; }

header {
  text-align: center;
  padding: 40px 20px 20px;
  position: relative;
  z-index: 1;
}

.hero-character { margin-bottom: 14px; }

.hero-img {
  width: 240px;
  image-rendering: pixelated;
  animation: bob 4s ease-in-out infinite;
}

header h1 {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: 2px;
}

.accent { color: var(--accent); }

.tagline {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--dim);
  margin-top: 6px;
  letter-spacing: 1px;
}

.agent-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dim);
  margin-top: 10px;
}

.agent-count span {
  color: var(--accent);
}

.stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 14px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

main {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px 20px;
  position: relative;
  z-index: 1;
}

section { margin-bottom: 40px; }

h2 {
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dim);
}

.game-picker {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}

.picker-btn {
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 20px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--dim);
  cursor: pointer;
  transition: all 0.2s;
}

.picker-btn:hover { color: var(--text); }

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

.game-panel.hidden { display: none; }

.game-desc {
  text-align: center;
  color: var(--dim);
  font-size: 0.85rem;
  margin-bottom: 14px;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step {
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.step-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.step-num {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent);
  min-width: 24px;
}

.step strong { display: block; margin-bottom: 1px; font-size: 0.95rem; font-weight: 700; }
.step p { color: var(--dim); font-size: 0.85rem; }
.step .code-block { margin-top: 10px; margin-bottom: 0; }
.step pre { background: var(--bg); }

.code-block { margin-bottom: 14px; position: relative; }

.code-header {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--dim);
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.copy-btn:hover { color: var(--accent); }

pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  padding-right: 36px;
  overflow-x: auto;
  font-size: 0.8rem;
  font-family: "SF Mono", "Menlo", monospace;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  white-space: pre;
  -webkit-overflow-scrolling: touch;
}

code { color: var(--text); font-family: inherit; }

.endpoint-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.method {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  min-width: 46px;
  text-align: center;
  letter-spacing: 0.5px;
}

.method.get { background: #e6f7ee; color: var(--green); }
.method.post { background: #e8f0fe; color: var(--blue); }

.path { font-weight: 700; min-width: 180px; font-family: "SF Mono", "Menlo", monospace; font-size: 0.8rem; }
.desc { color: var(--dim); font-size: 0.8rem; }

footer {
  text-align: center;
  padding: 30px 20px;
  color: var(--dim);
  font-size: 0.8rem;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.api-link {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.api-link:hover { text-decoration: underline; }

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

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h2 {
  margin-bottom: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--dim);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-rules {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--dim);
  line-height: 1.6;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

@media (max-width: 600px) {
  header h1 { font-size: 1.8rem; }
  .hero-img { width: 180px; }
  .float-char { opacity: 0.04; }
  .endpoint { flex-wrap: wrap; }
  .path { min-width: auto; }
  .desc { flex-basis: 100%; margin-top: 3px; }
}
