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

:root {
  --purple: #667eea;
  --purple-dark: #764ba2;
  --green: #28a745;
  --yellow: #ffc107;
  --red: #dc3545;
  --gray-light: #f8f9fa;
  --gray: #e9ecef;
  --text: #333;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: Menlo, Monaco, "Courier New", monospace;
}

body {
  font-family: var(--font);
  color: var(--text);
  line-height: 1.6;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}

header {
  text-align: center;
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: white;
  padding: 2rem 1rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

header a { color: white; text-decoration: none; }
header h1 { font-size: 2rem; }
.monster-logo { width: 1.2em; height: 1.2em; vertical-align: -0.15em; fill: currentColor; display: inline-block; }
.tagline { margin-top: 0.5rem; }

main { min-height: 60vh; }

.hunt-form h2 { margin-bottom: 0.5rem; }
.hunt-form p { margin-bottom: 1rem; color: #595959; }
.hunt-form label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.hunt-form small { font-weight: 400; color: #6b6b6b; }
.hunt-form textarea {
  width: 100%;
  padding: 0.75rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  border: 2px solid var(--gray);
  border-radius: 8px;
  resize: vertical;
  margin-bottom: 1rem;
}
.hunt-form textarea:focus { border-color: var(--purple); outline: none; }
.try-examples { font-size: 0.85rem; color: #6b6b6b; margin: 0.35rem 0 1rem; }
.try-examples a { color: var(--purple); text-decoration: none; }
.try-examples a:hover { text-decoration: underline; }
.form-row { margin-bottom: 1rem; }
.format-checkboxes {
  border: 2px solid var(--gray);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 1rem;
}
.format-checkboxes legend {
  font-weight: 600;
  padding: 0 0.25rem;
}
.format-group {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}
.format-group-label {
  width: 100%;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6b6b6b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
}
.hunt-form .format-check {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  margin: 0.25rem 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 400;
  width: calc(50% - 0.5rem);
}
.format-check input { cursor: pointer; accent-color: var(--purple); flex-shrink: 0; }
.format-name { font-weight: 600; }
.format-desc { color: #6b6b6b; font-size: 0.8rem; }
.format-desc::before { content: "— "; }
.format-hint { font-size: 0.8rem; color: #6b6b6b; margin: 0.5rem 0 0; }
.hunt-form button {
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
}
.hunt-form button:hover { opacity: 0.9; }

.validation-ok { border-color: var(--green) !important; }
.validation-error { border-color: var(--red) !important; }
.validation-msg { font-size: 0.85rem; margin-top: 0.25rem; }
.validation-msg.ok { color: var(--green); }
.validation-msg.error { color: var(--red); }

.tab-radio { display: none; }
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 2px solid var(--gray);
  margin-bottom: 1rem;
}
.tab {
  background: var(--gray-light);
  border: 1px solid var(--gray);
  border-bottom: none;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
  font-size: 0.85rem;
}
.tab-panel { display: none; }
/* CSS-only tabs: radios are siblings of .tab-bar and .tab-panels inside .result-tabs.
   :has() matches when the Nth radio is checked → show Nth panel.
   Panels are div:nth-of-type(2-8) because .tab-bar is div:nth-of-type(1). */
.result-tabs:has(.tab-radio:nth-of-type(1):checked) > div:nth-of-type(2),
.result-tabs:has(.tab-radio:nth-of-type(2):checked) > div:nth-of-type(3),
.result-tabs:has(.tab-radio:nth-of-type(3):checked) > div:nth-of-type(4),
.result-tabs:has(.tab-radio:nth-of-type(4):checked) > div:nth-of-type(5),
.result-tabs:has(.tab-radio:nth-of-type(5):checked) > div:nth-of-type(6),
.result-tabs:has(.tab-radio:nth-of-type(6):checked) > div:nth-of-type(7),
.result-tabs:has(.tab-radio:nth-of-type(7):checked) > div:nth-of-type(8),
.result-tabs:has(.tab-radio:nth-of-type(8):checked) > div:nth-of-type(9) { display: block; }
/* Active tab label styling */
.tab-radio:nth-of-type(1):checked ~ .tab-bar label:nth-of-type(1),
.tab-radio:nth-of-type(2):checked ~ .tab-bar label:nth-of-type(2),
.tab-radio:nth-of-type(3):checked ~ .tab-bar label:nth-of-type(3),
.tab-radio:nth-of-type(4):checked ~ .tab-bar label:nth-of-type(4),
.tab-radio:nth-of-type(5):checked ~ .tab-bar label:nth-of-type(5),
.tab-radio:nth-of-type(6):checked ~ .tab-bar label:nth-of-type(6),
.tab-radio:nth-of-type(7):checked ~ .tab-bar label:nth-of-type(7),
.tab-radio:nth-of-type(8):checked ~ .tab-bar label:nth-of-type(8) {
  background: white;
  border-color: var(--purple);
  border-bottom: 2px solid white;
  margin-bottom: -2px;
  font-weight: 600;
}

pre {
  background: var(--gray-light);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.4;
}
pre code.numbered {
  counter-reset: line;
  display: block;
}
pre code.numbered .line {
  display: block;
  counter-increment: line;
  padding: 0 0.5em;
}
pre code.numbered .line::before {
  content: counter(line);
  display: inline-block;
  min-width: 2.5ch;
  padding-right: 1ch;
  margin-right: 1ch;
  text-align: right;
  color: #8b949e;
  border-right: 1px solid var(--gray);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

.hunt-errors {
  background: #f8d7da;
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}
.hunt-errors ul { list-style: none; padding-left: 0; }
.hunt-errors li { margin-bottom: 0.5rem; }

.hunt-success { margin-bottom: 1rem; }
.hunt-success h3 { color: var(--green); margin-bottom: 0.5rem; }

.hunt-again {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.5rem 1.5rem;
  background: var(--purple);
  color: white;
  text-decoration: none;
  border-radius: 8px;
}

.progress-container { margin-bottom: 1rem; }
.progress-domain {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}
.progress-domain .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--gray);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray);
  text-align: center;
  color: #6b6b6b;
}
footer nav { margin-bottom: 0.5rem; }
footer a { color: #4a5cc5; text-decoration: none; margin: 0 0.5rem; }
.signature { font-size: 0.85rem; }

.about h3, .privacy h3, .api-docs h3 { margin-top: 1.5rem; margin-bottom: 0.5rem; }
.about ol, .about ul, .privacy ul, .api-docs ul { padding-left: 1.5rem; margin-bottom: 1rem; }
.about li, .privacy li, .api-docs li { margin-bottom: 0.5rem; }
.noscript-note { font-style: italic; color: #6b6b6b; margin-top: 1rem; }

.api-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.api-table th, .api-table td {
  border: 1px solid var(--gray);
  padding: 0.5rem 0.75rem;
  text-align: left;
}
.api-table th {
  background: var(--gray-light);
  font-weight: 600;
}
.api-table code {
  background: var(--gray-light);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  font-size: 0.85rem;
}
.api-docs p { margin-bottom: 1rem; color: #595959; }
