/* Duel head-to-head layout */
.duel-head-to-head {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 10px;
}

.duel-player {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 10px;
  padding: 12px 8px;
}

.duel-username {
  font-size: 1rem;
  font-weight: bold;
  font-family: "Macondo", cursive;
  color: #222;
  text-align: center;
}

.duel-progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.duel-progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.duel-progress-bar-fill.completion-green {
  background: #28a745;
}

.duel-progress-bar-fill.completion-orange {
  background: #fd7e14;
}

.duel-progress-bar-fill.completion-red {
  background: #dc3545;
}

.duel-stat {
  font-size: 0.9rem;
  color: #333;
  font-weight: bold;
  text-align: center;
}

.duel-stat-sub {
  font-size: 0.75rem;
  color: #666;
  text-align: center;
}

.duel-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: #ffd700;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
  padding: 0 5px;
  white-space: nowrap;
}

/* Result banner (COMPLETED state) */
.duel-result {
  text-align: center;
  font-size: 1.4rem;
  font-family: "Macondo", cursive;
  font-weight: 600;
  padding: 10px 15px;
  border-radius: 8px;
  margin: 10px 10px 0;
}

.duel-winner {
  background: rgba(255, 215, 0, 0.25);
  color: #6b4c00;
  border: 2px solid rgba(255, 215, 0, 0.6);
}

.duel-tie {
  background: rgba(100, 120, 255, 0.15);
  color: #333;
  border: 2px solid rgba(100, 120, 255, 0.3);
}

/* Pending state card */
.duel-pending-card {
  text-align: center;
  padding: 25px 15px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  margin: 10px 0;
}

.duel-pending-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.duel-pending-card h3 {
  margin: 0 0 8px 0;
  color: #333;
}

.duel-pending-card p {
  color: #555;
  margin: 0;
}

/* No-duel CTA card */
.duel-cta-card {
  text-align: center;
  padding: 25px 15px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  margin: 10px 0;
}

.duel-cta-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.duel-cta-card h3 {
  margin: 0 0 8px 0;
  color: #333;
}

.duel-cta-card p {
  color: #555;
  margin: 0 0 12px 0;
}

/* Inline create-duel form (inside .duel-cta-card) */
.duel-create-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 210px;
  margin: 0 auto;
}

.duel-form-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  box-sizing: border-box;
}

.duel-form-input:focus {
  outline: none;
  border-color: var(--main-color-dark);
}

.duel-form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.duel-duration-input {
  width: 70px;
  flex: 0 0 70px;
  text-align: center;
}

.duel-form-label {
  font-size: 0.9rem;
  color: #555;
}

/* Override blueish-button sizing inside the form to fit the card */
.duel-start-btn {
  min-width: 0;
  max-width: none;
  width: 100%;
  padding: 10px;
  min-height: 0;
  max-height: none;
  margin-left: 0;
}

/* Action row — holds cancel / forfeit buttons below the main card area */
.duel-action-row {
  display: flex;
  justify-content: center;
  padding: 6px 10px 2px;
}

/* Cancel: subtle text-link style */
.duel-action-secondary {
  background: none;
  border: none;
  color: var(--main-color-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.duel-action-secondary:hover {
  color: var(--main-color-dark);
}

.duel-action-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Forfeit: small destructive button */
.duel-action-destructive {
  background-color: var(--flag-red);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
}

.duel-action-destructive:hover {
  opacity: 0.85;
}

.duel-action-destructive:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Forfeit result banner (COMPLETED with forfeit) */
.duel-forfeit {
  background: rgba(231, 5, 5, 0.1);
  color: #8b0000;
  border: 2px solid rgba(231, 5, 5, 0.3);
}
