.main {
  width: 100%;
}

textarea {
  font-family: var(--ff);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.6rem 0.75rem;
  outline: none;
  width: 100%;
  resize: vertical;
  transition: border-color 0.15s;
}

textarea:focus {
  border-color: var(--accent);
}

textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

input[type="text"] {
  font-family: var(--ff);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.6rem 0.75rem;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}

input[type="text"]:focus {
  border-color: var(--accent);
}

input[type="text"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Space between stacked input groups (e.g. Items textarea and Framing Question) */
.input-group {
  margin-top: 1.25rem;
  margin-bottom: 1rem;
}

.config-row {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
}

.config-row > div {
  flex: 1;
}

.config-intro {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

.config-notice {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.4rem;
  min-height: 1.2em;
}

.field-help {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.4rem;
  line-height: 1.4;
}

.btn-primary {
  font-family: var(--ff);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 0.6rem 1.5rem;
  cursor: pointer;
}

.btn-primary:hover {
  opacity: 0.85;
}

.btn-primary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

#start-btn {
  margin-top: 0.75rem;
}

.progress-label {
  font-size: 0.8rem;
  font-family: var(--ff-mono);
  color: var(--muted);
  text-align: center;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}

.arena-prompt {
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 1rem;
}

.choices {
  display: flex;
  gap: 0.75rem;
}

.choice-btn {
  flex: 1;
  font-size: 0.95rem;
  padding: 1.25rem 1rem;
  min-height: 4.5rem;
  line-height: 1.35;
  margin-top: 0;
}

.arena-actions {
  text-align: center;
  margin-top: 1.5rem;
}

.results-count {
  font-size: 0.75rem;
  color: var(--muted);
}

.rank-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.rank-row:last-child {
  border-bottom: none;
}

.rank-num {
  min-width: 1.75rem;
  font-family: var(--ff-mono);
  font-size: 0.825rem;
  color: var(--muted);
  text-align: right;
}

.rank-body {
  flex: 1;
  min-width: 0;
}

.rank-name {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
  overflow-wrap: anywhere;
}

.rank-bar {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.rank-bar-fill {
  height: 100%;
  background: var(--accent);
}

.rank-elo {
  min-width: 2.5rem;
  font-family: var(--ff-mono);
  font-size: 0.825rem;
  color: var(--muted);
  text-align: right;
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.method-panel {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
}

.method-panel summary {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.method-panel h2 {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin: 1rem 0 0.25rem;
}

.method-panel p {
  margin-bottom: 0.5rem;
}

.formula {
  font-family: var(--ff-mono);
  font-size: 0.75rem;
  text-align: center;
  margin: 0.4rem 0;
}

@media (max-width: 480px) {
  .choices {
    flex-direction: column;
  }

  .results-actions {
    flex-wrap: wrap;
  }
}
