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

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.captcha-container {
  background: #fff;
  border: 1px solid #d3d3d3;
  border-radius: 4px;
  padding: 24px 28px;
  width: 320px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  user-select: none;
}

.captcha-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 0;
}

.checkbox-area {
  width: 28px;
  height: 28px;
  border: 2px solid #c1c1c1;
  border-radius: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  background: #fff;
}

.checkbox-area:hover {
  border-color: #4a90d9;
  background: #f7faff;
}

.checkbox-area.processing {
  border-color: #4a90d9;
}

.checkbox-area .checkmark {
  display: none;
  color: #4a90d9;
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
}

.checkbox-area.checked .checkmark {
  display: block;
}

.spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 3px solid #e0e0e0;
  border-top-color: #4a90d9;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.checkbox-area.processing .spinner { display: block; }

@keyframes spin { to { transform: rotate(360deg); } }

.captcha-label {
  font-size: 15px;
  color: #555;
  font-weight: 500;
}

.brand {
  margin-left: auto;
  text-align: center;
  flex-shrink: 0;
}

.brand .icon {
  font-size: 28px;
  line-height: 1;
}

.brand .text {
  font-size: 8px;
  color: #999;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Challenge panel */
.challenge-panel {
  display: none;
  margin-top: 20px;
  border-top: 1px solid #e8e8e8;
  padding-top: 18px;
}

.challenge-panel.active { display: block; }

.challenge-title {
  font-size: 13px;
  color: #666;
  margin-bottom: 14px;
  text-align: center;
  line-height: 1.5;
}

.challenge-title strong {
  color: #333;
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

/* Binary conversion challenge */
.binary-display {
  font-family: 'Courier New', monospace;
  font-size: 28px;
  font-weight: bold;
  color: #333;
  text-align: center;
  letter-spacing: 4px;
  margin-bottom: 12px;
  background: #f5f5f5;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.binary-input {
  width: 100%;
  padding: 10px;
  font-size: 20px;
  font-family: 'Courier New', monospace;
  text-align: center;
  border: 2px solid #ddd;
  border-radius: 4px;
  margin-bottom: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.binary-input:focus { border-color: #4a90d9; }

.binary-timer {
  font-size: 11px;
  color: #999;
  text-align: center;
  margin-bottom: 10px;
}

/* Slider challenge */
.slider-challenge { text-align: center; margin-bottom: 14px; }

.slider-display {
  font-family: 'Courier New', monospace;
  font-size: 28px;
  font-weight: bold;
  color: #333;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.slider-input {
  width: 100%;
  accent-color: #4a90d9;
  cursor: pointer;
}

.slider-hint {
  font-size: 11px;
  color: #999;
  margin-top: 6px;
}

/* Pattern grid challenge */
.pattern-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 220px;
  margin: 0 auto 14px;
}

.pattern-cell {
  aspect-ratio: 1;
  border: 2px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 0.15s;
}

.pattern-cell:hover { border-color: #4a90d9; background: #eef4fc; }
.pattern-cell.selected { border-color: #4a90d9; background: #dbe9fa; }

/* Verify button */
.verify-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.verify-btn:hover { background: #3a7bc8; }
.verify-btn:disabled { background: #b0c4de; cursor: not-allowed; }

/* Result panel */
.result-panel {
  display: none;
  margin-top: 16px;
  padding: 14px;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
}

.result-panel.success {
  display: block;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  color: #2e7d32;
}

.result-panel.fail {
  display: block;
  background: #fce4ec;
  border: 1px solid #ef9a9a;
  color: #c62828;
}

.result-panel .emoji { font-size: 32px; margin-bottom: 6px; }

.retry-btn {
  margin-top: 10px;
  padding: 6px 18px;
  background: none;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: inherit;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}

.retry-btn:hover { opacity: 0.7; }

.timer-comment {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 6px;
  font-style: italic;
}

/* Hex color challenge */
.color-swatch {
  width: 100%;
  height: 80px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  margin-bottom: 12px;
}

.hex-input {
  width: 100%;
  padding: 10px;
  font-size: 20px;
  font-family: 'Courier New', monospace;
  text-align: center;
  border: 2px solid #ddd;
  border-radius: 4px;
  margin-bottom: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.hex-input:focus { border-color: #4a90d9; }

/* Regex challenge */
.regex-display {
  font-family: 'Courier New', monospace;
  font-size: 16px;
  font-weight: bold;
  color: #333;
  text-align: center;
  background: #f5f5f5;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  margin-bottom: 12px;
  word-break: break-all;
}

.regex-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.regex-cell {
  padding: 8px 10px;
  border: 2px solid #ddd;
  border-radius: 6px;
  background: #fafafa;
  cursor: pointer;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  text-align: center;
  transition: all 0.15s;
}

.regex-cell:hover { border-color: #4a90d9; background: #eef4fc; }
.regex-cell.selected { border-color: #4a90d9; background: #dbe9fa; }

/* Pi challenge */
.pi-prefix {
  font-family: 'Courier New', monospace;
  font-size: 28px;
  font-weight: bold;
  color: #333;
  text-align: center;
  margin-bottom: 8px;
}

.pi-input {
  width: 100%;
  padding: 10px;
  font-size: 18px;
  font-family: 'Courier New', monospace;
  text-align: center;
  border: 2px solid #ddd;
  border-radius: 4px;
  margin-bottom: 14px;
  outline: none;
  transition: border-color 0.2s;
  letter-spacing: 2px;
}

.pi-input:focus { border-color: #4a90d9; }
