:root {
  --bg: #06060a;
  --surface: #0e0e14;
  --surface2: #16161e;
  --surface3: #1e1e2a;
  --border: #2a2a3a;
  --border2: #3a3a4e;
  --text: #eaeaf0;
  --text2: #9090a8;
  --text3: #5a5a72;
  --advocate-a: #3b82f6;
  --advocate-a-dim: rgba(59,130,246,0.1);
  --advocate-a-border: rgba(59,130,246,0.25);
  --advocate-b: #f97316;
  --advocate-b-dim: rgba(249,115,22,0.1);
  --advocate-b-border: rgba(249,115,22,0.25);
  --judge: #a855f7;
  --judge-dim: rgba(168,85,247,0.1);
  --judge-border: rgba(168,85,247,0.25);
  --green: #22c55e;
  --red: #ef4444;
  --font: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --radius: 14px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }

/* === HERO IMAGE === */
.hero-image {
  width: 100%;
  max-width: 480px;
  height: auto;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px var(--border);
  margin-bottom: 24px;
  display: block;
  object-fit: cover;
}

.login-card .hero-image {
  max-width: 100%;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.brand .hero-image {
  margin: 0 auto 24px;
}

/* === SETUP PAGE === */
.setup-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 60px 24px;
}

.brand {
  text-align: center;
  margin-bottom: 48px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 12px;
}

.brand-logo svg { color: var(--judge); }
.brand-logo .a { color: var(--advocate-a); }
.brand-logo .b { color: var(--advocate-b); }

.brand-sub {
  font-size: 1rem;
  color: var(--text2);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Form sections */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}

.form-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text3);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section-label svg { width: 16px; height: 16px; }

.dilemma-input {
  width: 100%;
  padding: 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 90px;
}

.dilemma-input:focus { outline: none; border-color: var(--judge); }
.dilemma-input::placeholder { color: var(--text3); }

.context-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  resize: vertical;
  min-height: 60px;
  margin-top: 12px;
}

.context-input:focus { outline: none; border-color: var(--border2); }
.context-input::placeholder { color: var(--text3); }

/* Options row */
.options-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: start;
}

.option-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.option-card.a { border-color: var(--advocate-a-border); }
.option-card.b { border-color: var(--advocate-b-border); }

.option-label-input {
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.option-label-input.a:focus { outline: none; border-color: var(--advocate-a); }
.option-label-input.b:focus { outline: none; border-color: var(--advocate-b); }

.option-text-input {
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text2);
  font-family: var(--font);
  font-size: 0.85rem;
  resize: vertical;
  min-height: 50px;
}

.option-text-input:focus { outline: none; border-color: var(--border2); }

.vs-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text3);
  padding-top: 24px;
}

/* Mode selector */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.mode-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.mode-card:hover { border-color: var(--border2); transform: translateY(-1px); }
.mode-card.active { border-color: var(--judge); background: var(--judge-dim); }

.mode-card svg { margin-bottom: 6px; color: var(--text2); }
.mode-card.active svg { color: var(--judge); }

.mode-card-name { font-size: 0.8rem; font-weight: 600; }

/* Model selectors */
.model-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.model-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.model-group label.a { color: var(--advocate-a); }
.model-group label.b { color: var(--advocate-b); }
.model-group label.judge { color: var(--judge); }

.model-select {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%235a5a72' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.model-select:focus { outline: none; border-color: var(--judge); }
optgroup { font-weight: 600; color: var(--text2); }

.rounds-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.rounds-input {
  width: 60px;
  padding: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9rem;
  text-align: center;
}

.rounds-label { font-size: 0.85rem; color: var(--text2); }

/* Start button */
.btn-start {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--advocate-a), var(--judge), var(--advocate-b));
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: opacity 0.2s;
  margin-top: 8px;
}

.btn-start:hover { opacity: 0.9; }
.btn-start:disabled { opacity: 0.4; cursor: not-allowed; }

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* === DEBATE PAGE === */
.debate-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px;
}

.debate-header {
  text-align: center;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.debate-dilemma {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.4;
}

.debate-matchup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-size: 0.85rem;
}

.matchup-side {
  padding: 6px 14px;
  border-radius: 20px;
  font-weight: 600;
}

.matchup-side.a { background: var(--advocate-a-dim); color: var(--advocate-a); border: 1px solid var(--advocate-a-border); }
.matchup-side.b { background: var(--advocate-b-dim); color: var(--advocate-b); border: 1px solid var(--advocate-b-border); }

.matchup-vs { color: var(--text3); font-weight: 800; }

.debate-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 4px 12px;
  background: var(--judge-dim);
  border: 1px solid var(--judge-border);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--judge);
  font-weight: 600;
}

.debate-mode-badge svg { width: 14px; height: 14px; }

/* Oscillation meter */
.oscillation-meter {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px 16px;
  margin-bottom: 24px;
}

.osc-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.osc-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.osc-label.a { color: var(--advocate-a); }
.osc-label.b { color: var(--advocate-b); }

.osc-track {
  position: relative;
  height: 12px;
  background: var(--surface2);
  border-radius: 6px;
  overflow: visible;
  display: flex;
}

.osc-zone {
  flex: 1;
  border-radius: 6px;
}

.osc-zone.a {
  background: linear-gradient(90deg, rgba(59,130,246,0.15), transparent);
  border-radius: 6px 0 0 6px;
}

.osc-zone.b {
  background: linear-gradient(90deg, transparent, rgba(249,115,22,0.15));
  border-radius: 0 6px 6px 0;
}

.osc-center-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border2);
  transform: translateX(-50%);
  z-index: 1;
}

.osc-needle {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text);
  border: 3px solid var(--bg);
  transform: translate(-50%, -50%);
  transition: left 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
  box-shadow: 0 0 12px rgba(255,255,255,0.15);
}

.osc-needle.lean-a {
  background: var(--advocate-a);
  box-shadow: 0 0 16px rgba(59,130,246,0.4);
}

.osc-needle.lean-b {
  background: var(--advocate-b);
  box-shadow: 0 0 16px rgba(249,115,22,0.4);
}

.osc-needle.center {
  background: var(--judge);
  box-shadow: 0 0 12px rgba(168,85,247,0.3);
}

.osc-history {
  position: relative;
  height: 20px;
  margin-top: 6px;
}

.osc-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.6;
  transition: opacity 0.3s;
  cursor: help;
}

.osc-dot:hover { opacity: 1; }
.osc-dot.a { background: var(--advocate-a); }
.osc-dot.b { background: var(--advocate-b); }

/* Messages */
.debate-messages {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}

.debate-msg {
  animation: msgFadeIn 0.4s ease;
}

@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.msg-badge {
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.msg-badge.advocate_a { background: var(--advocate-a-dim); color: var(--advocate-a); }
.msg-badge.advocate_b { background: var(--advocate-b-dim); color: var(--advocate-b); }
.msg-badge.judge { background: var(--judge-dim); color: var(--judge); }
.msg-badge.system { background: var(--surface3); color: var(--text3); }

.msg-model-name { font-size: 0.75rem; color: var(--text3); font-family: var(--mono); }
.msg-round { font-size: 0.7rem; color: var(--text3); font-family: var(--mono); background: var(--surface3); padding: 2px 6px; border-radius: 4px; }

.msg-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  font-size: 0.92rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.debate-msg.advocate_a .msg-content { border-left: 3px solid var(--advocate-a); }
.debate-msg.advocate_b .msg-content { border-left: 3px solid var(--advocate-b); }
.debate-msg.judge .msg-content {
  border-left: 3px solid var(--judge);
  background: var(--judge-dim);
  border-color: var(--judge-border);
}
.debate-msg.system .msg-content {
  background: transparent;
  border: none;
  padding: 12px 0;
  color: var(--text3);
  text-align: center;
  font-style: italic;
}

/* Round divider */
.round-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text3);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin: 8px 0;
}

.round-divider::before, .round-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Typing */
.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
  color: var(--text3);
  font-size: 0.85rem;
  animation: msgFadeIn 0.3s ease;
}

.thinking-dots {
  display: flex;
  gap: 4px;
}

.thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text3);
  animation: dotBounce 1.4s infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* Status */
.debate-status {
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
  color: var(--text3);
}

.debate-status.done { color: var(--green); }
.debate-status.error { color: var(--red); }

/* New debate button */
.btn-new {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 20px;
}

.btn-new:hover { border-color: var(--judge); }

/* Verdict card */
.verdict-card {
  background: var(--surface);
  border: 1px solid var(--judge-border);
  border-left: 3px solid var(--judge);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
}

.verdict-header {
  background: var(--judge-dim);
  padding: 20px 24px;
  border-bottom: 1px solid var(--judge-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.verdict-winner {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--judge);
}

.verdict-winner.a { color: var(--advocate-a); }
.verdict-winner.b { color: var(--advocate-b); }
.verdict-winner.draw { color: var(--text2); }

.verdict-confidence {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--judge);
  background: rgba(168,85,247,0.15);
  padding: 4px 12px;
  border-radius: 20px;
}

.verdict-scores {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.score-row {
  display: grid;
  grid-template-columns: 100px 1fr 50px;
  align-items: center;
  gap: 12px;
}

.score-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-align: right;
}

.score-label.a { color: var(--advocate-a); }
.score-label.b { color: var(--advocate-b); }

.score-bar-wrap {
  height: 8px;
  background: var(--surface3);
  border-radius: 4px;
  overflow: hidden;
}

.score-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.score-bar.a { background: var(--advocate-a); }
.score-bar.b { background: var(--advocate-b); }

.score-num {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.score-num.a { color: var(--advocate-a); }
.score-num.b { color: var(--advocate-b); }

.verdict-section {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}

.verdict-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.verdict-section-title.a { color: var(--advocate-a); }
.verdict-section-title.b { color: var(--advocate-b); }
.verdict-section-title.neutral { color: var(--text3); }

.verdict-point {
  font-size: 0.88rem;
  line-height: 1.6;
  padding: 4px 0;
  color: var(--text2);
}

.verdict-point.good::before { content: '+ '; color: var(--green); font-weight: 700; }
.verdict-point.bad::before { content: '- '; color: var(--red); font-weight: 700; }

.verdict-text {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text2);
}

.verdict-bottom-line {
  padding: 20px 24px;
  background: var(--judge-dim);
}

.verdict-bottom-line .verdict-text {
  color: var(--text);
  font-weight: 500;
}

.verdict-raw {
  padding: 20px 24px;
  font-size: 0.9rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Action buttons */
.debate-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--advocate-a), var(--judge), var(--advocate-b));
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

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

.btn-action.secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  animation: none;
}

.btn-action.secondary:hover { border-color: var(--judge); }

.error-text {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

/* History section */
.history-section { margin-top: 12px; }

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

.history-item {
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.history-item:hover { border-color: var(--judge); transform: translateY(-1px); }

.history-dilemma {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.history-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text3);
}

.history-sides { font-family: var(--mono); }

.history-status {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.5px;
}

.history-status.done { background: rgba(34,197,94,0.15); color: var(--green); }
.history-status.error { background: rgba(239,68,68,0.15); color: var(--red); }
.history-status.running { background: var(--judge-dim); color: var(--judge); }
.history-status.created { background: var(--surface3); color: var(--text3); }

/* === LOGIN PAGE === */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  max-width: 400px;
  width: 100%;
  text-align: center;
}

.login-card .brand-logo {
  margin-bottom: 24px;
}

.login-sub {
  font-size: 0.9rem;
  color: var(--text3);
  margin-bottom: 24px;
}

.login-error {
  display: none;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.3);
  color: var(--red);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.login-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.login-input:focus { outline: none; border-color: var(--judge); }

/* === CREDITS PANEL === */
.credits-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.credits-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text3);
  user-select: none;
}

.credits-header:hover { color: var(--text2); }

.credits-toggle-arrow {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 1rem;
}

.credits-body {
  padding: 0 20px 16px;
}

.credits-loading {
  color: var(--text3);
  font-size: 0.85rem;
  padding: 8px 0;
}

.credit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.82rem;
}

.credit-row.credit-error {
  border-color: rgba(239,68,68,0.4);
  background: rgba(239,68,68,0.08);
}

.credit-provider {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.credit-status {
  color: var(--text2);
  text-align: right;
  font-size: 0.78rem;
}

.credit-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.credit-dot.active { background: var(--green); box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.credit-dot.error { background: var(--red); box-shadow: 0 0 6px rgba(239,68,68,0.5); animation: errorPulse 1s infinite; }
.credit-dot.nokey { background: var(--text3); }

@keyframes errorPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* === USER ARGUMENT PANEL === */
.user-arg-panel {
  background: var(--surface);
  border: 2px solid var(--judge-border);
  border-radius: var(--radius);
  padding: 24px;
  margin: 8px 0;
  animation: argPanelIn 0.4s ease;
}

@keyframes argPanelIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.user-arg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--judge);
  margin-bottom: 8px;
}

.user-arg-hint {
  font-size: 0.82rem;
  color: var(--text3);
  margin-bottom: 14px;
}

.user-arg-side-select {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.user-arg-side-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface2);
  color: var(--text2);
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.user-arg-side-btn:hover { border-color: var(--border2); }
.user-arg-side-btn.active { border-color: var(--judge); background: var(--judge-dim); color: var(--judge); }
.user-arg-side-btn.a.active { border-color: var(--advocate-a); background: var(--advocate-a-dim); color: var(--advocate-a); }
.user-arg-side-btn.b.active { border-color: var(--advocate-b); background: var(--advocate-b-dim); color: var(--advocate-b); }

.user-arg-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 14px;
}

.user-arg-input:focus { outline: none; border-color: var(--judge); }
.user-arg-input::placeholder { color: var(--text3); }

.user-arg-actions {
  display: flex;
  gap: 10px;
}

.user-arg-timer {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--text3);
  font-family: var(--mono);
}

/* === USER ARGUMENT MESSAGE === */
.debate-msg.user_argument .msg-content {
  border-left: 3px solid var(--judge);
  background: var(--judge-dim);
}

.msg-badge.user_argument {
  background: var(--judge-dim);
  color: var(--judge);
}

/* === QUOTA ERROR BANNER === */
.quota-error-msg {
  animation: quotaShake 0.5s ease;
}

@keyframes quotaShake {
  0%, 100% { transform: translateX(0); }
  10%, 50%, 90% { transform: translateX(-4px); }
  30%, 70% { transform: translateX(4px); }
}

.quota-error-banner {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: rgba(239,68,68,0.12);
  border: 2px solid var(--red);
  border-radius: var(--radius);
  padding: 24px;
  animation: errorPulseBorder 2s infinite;
}

@keyframes errorPulseBorder {
  0%, 100% { border-color: var(--red); box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50% { border-color: #ff6b6b; box-shadow: 0 0 20px rgba(239,68,68,0.3); }
}

.quota-error-icon {
  background: var(--red);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 900;
  flex-shrink: 0;
  animation: errorPulse 1s infinite;
}

.quota-error-text {
  flex: 1;
}

.quota-error-text strong {
  display: block;
  color: var(--red);
  font-size: 1rem;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.quota-error-text div {
  color: var(--text2);
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* Responsive */
@media (max-width: 640px) {
  .options-row { grid-template-columns: 1fr; }
  .vs-divider { padding: 0; }
  .model-row { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: repeat(2, 1fr); }
  .debate-dilemma { font-size: 1.1rem; }
  .setup-page { padding: 32px 16px; }
  .login-card { padding: 32px 24px; }
  .user-arg-side-select { flex-wrap: wrap; }
  .credit-row { flex-direction: column; gap: 4px; align-items: flex-start; }
  .hero-image { max-width: 100%; }
}
