/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn:hover {
  border-color: var(--green);
  box-shadow: 0 0 15px var(--green-glow);
  color: var(--green);
}

.btn-primary {
  background: var(--green);
  color: var(--bg-primary);
  border-color: var(--green);
  font-weight: 700;
}

.btn-primary:hover {
  background: var(--green-dim);
  color: var(--bg-primary);
  box-shadow: 0 0 20px var(--green-glow);
}

.btn-danger {
  border-color: var(--red-dim);
  color: var(--red);
}

.btn-danger:hover {
  border-color: var(--red);
  box-shadow: 0 0 15px var(--red-glow);
}

.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.75rem;
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
}

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

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: var(--border-bright);
}

.card-glow:hover {
  border-color: var(--green-dim);
  box-shadow: 0 0 20px var(--green-glow);
}

/* Mission Cards */
.mission-card {
  position: relative;
  overflow: hidden;
}

.mission-card.locked {
  opacity: 0.4;
  pointer-events: none;
}

.mission-card.locked::after {
  content: 'LOCKED';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.9rem;
  color: var(--text-dim);
  letter-spacing: 4px;
  font-weight: 700;
}

.mission-card.completed {
  border-color: var(--green-dim);
}

.mission-card .mission-number {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: var(--space-xs);
}

.mission-card .mission-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
}

.mission-card .mission-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

.mission-card .mission-games {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.mission-card .game-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-bright);
}

.mission-card .game-pip.done {
  background: var(--green);
  box-shadow: 0 0 6px var(--green-glow);
}

/* Inputs */
.input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.input:focus {
  border-color: var(--green);
  box-shadow: 0 0 10px var(--green-glow);
}

.input::placeholder {
  color: var(--text-dim);
}

/* Toggles */
.toggle-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.toggle-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle-item:hover {
  border-color: var(--border-bright);
}

.toggle-item.active {
  border-color: var(--green-dim);
  background: var(--green-subtle);
}

.toggle-switch {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: var(--border-bright);
  position: relative;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-dim);
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all var(--transition-fast);
}

.toggle-item.active .toggle-switch {
  background: var(--green);
}

.toggle-item.active .toggle-switch::after {
  left: 20px;
  background: var(--bg-primary);
}

/* Progress Bar */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar .progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width var(--transition-normal);
  box-shadow: 0 0 8px var(--green-glow);
}

/* Feedback Toast */
.feedback {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-md);
  font-size: 0.85rem;
  border: 1px solid;
  animation: slideIn 0.3s ease;
}

.feedback.correct {
  background: rgba(0, 255, 136, 0.08);
  border-color: var(--green-dim);
  color: var(--green);
}

.feedback.incorrect {
  background: rgba(255, 51, 85, 0.08);
  border-color: var(--red-dim);
  color: var(--red);
}

.feedback.partial {
  background: rgba(255, 204, 0, 0.08);
  border-color: var(--yellow-dim);
  color: var(--yellow);
}

/* Option buttons for quiz games */
.options-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.option-btn {
  display: block;
  width: 100%;
  padding: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.option-btn:hover {
  border-color: var(--green-dim);
  background: var(--green-subtle);
}

.option-btn.selected {
  border-color: var(--green);
  background: var(--green-subtle);
  color: var(--green);
}

/* Checkbox options */
.checkbox-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.checkbox-item:hover {
  border-color: var(--border-bright);
}

.checkbox-item.checked {
  border-color: var(--green-dim);
  background: var(--green-subtle);
}

.checkbox-box {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-bright);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.checkbox-item.checked .checkbox-box {
  border-color: var(--green);
  background: var(--green);
  color: var(--bg-primary);
}

/* Drag list */
.drag-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.drag-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: grab;
  transition: all var(--transition-fast);
  user-select: none;
}

.drag-item:active {
  cursor: grabbing;
  border-color: var(--cyan);
  box-shadow: 0 0 15px var(--cyan-glow);
}

.drag-handle {
  color: var(--text-dim);
  font-size: 1.2rem;
}

.drag-rank {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Swipe cards */
.swipe-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.swipe-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  margin-top: var(--space-lg);
}

/* Score display */
.score-display {
  text-align: center;
  padding: var(--space-xl);
}

.score-big {
  font-size: 4rem;
  font-weight: 700;
  color: var(--green);
  text-shadow: 0 0 30px var(--green-glow);
}

.rank-badge {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  border: 2px solid var(--green);
  border-radius: var(--radius-md);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-top: var(--space-md);
  text-shadow: 0 0 10px var(--green-glow);
  box-shadow: 0 0 20px var(--green-glow);
}

/* Conversation sim */
.chat-window {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: var(--space-md);
}

.chat-msg {
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  max-width: 85%;
}

.chat-msg.attacker {
  background: rgba(255, 51, 85, 0.1);
  border: 1px solid rgba(255, 51, 85, 0.2);
  margin-right: auto;
}

.chat-msg.system {
  background: rgba(0, 204, 255, 0.1);
  border: 1px solid rgba(0, 204, 255, 0.2);
  margin: 0 auto;
  text-align: center;
  font-size: 0.75rem;
  color: var(--cyan);
}

.chat-sender {
  font-weight: 600;
  font-size: 0.75rem;
  margin-bottom: var(--space-xs);
}

.attacker .chat-sender { color: var(--red); }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
