/* =============================================================================
   COMMENT PICKER — tool.css
   Matches universal design system: clean Apple-like, glass card, no emoji icons.
   ============================================================================= */

*, *::before, *::after { box-sizing: border-box !important; }

input, textarea, select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box !important;
}

/* ── TOOL CARD ────────────────────────────────────────────────────────────── */
.cp-tool {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 680px;
  padding: var(--space-3);
  padding-bottom: 2.5rem;
  margin-bottom: 7rem;
  text-align: left;
}

/* ── Section heading style (matches pw-options h3) ── */
.cp-tool h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin: 0 0 0.75rem 0;
  font-weight: 600;
}

/* ── Divider (matches pw-divider) ── */
.cp-divider {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 1.5rem 0;
}

/* ── Platform badges row ── */
.cp-platform-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 0.5rem;
}

.cp-platform-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  font-size: 0.76rem;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.cp-platform-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem 0;
}

/* ── Textarea section ── */
.cp-textarea-section {
  margin-bottom: 0;
}

.cp-textarea-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  display: block;
  margin-bottom: 0.65rem;
}

#cp-textarea {
  width: 100%;
  min-height: 180px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-sm, 10px);
  color: var(--text-primary, #fff);
  font-size: 0.95rem;
  font-family: inherit;
  padding: 0.85rem 1rem;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  line-height: 1.6;
}

#cp-textarea:focus {
  outline: none;
  border-color: var(--accent, #8b5cf6);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.18);
}

#cp-textarea::placeholder {
  color: rgba(255,255,255,0.25);
}

/* ── Stats bar ── */
.cp-stats-bar {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
  padding: 0.6rem 0 0;
}

.cp-stat-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.cp-stat-value {
  color: rgba(255,255,255,0.7);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ── Options section ── */
.cp-options-section {
  margin-bottom: 0;
}

.cp-select-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.cp-select-row label {
  font-size: 0.88rem;
  color: var(--text-secondary, rgba(255,255,255,0.75));
  white-space: nowrap;
}

#cp-winners {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  color: var(--text-primary, #fff);
  font-size: 0.88rem;
  padding: 0.3rem 0.55rem;
  cursor: pointer;
  font-family: inherit;
}

#cp-winners:focus {
  outline: none;
  border-color: var(--accent, #8b5cf6);
}

/* Checkboxes — match pw-check-label style */
.cp-checks {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cp-check-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  color: var(--text-secondary, rgba(255,255,255,0.75));
  font-size: 0.9rem;
  transition: color 0.15s;
  user-select: none;
}

.cp-check-label:hover {
  color: var(--text-primary, #fff);
}

.cp-check-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  accent-color: var(--accent, #8b5cf6);
  cursor: pointer;
  border-radius: 4px;
}

/* ── Error ── */
#cp-error {
  display: none;
  color: #f87171;
  font-size: 0.88rem;
  padding: 0.6rem 0.9rem;
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.25);
  border-radius: 8px;
}

/* ── Pick button — centred, not full width ── */
.cp-pick-wrap {
  display: flex;
  justify-content: center;
  padding-top: 0.5rem;
}

#cp-pick-btn {
  min-width: 200px;
  max-width: 340px;
  width: 100%;
  font-size: 1rem;
  padding: 0.82em 1.5em;
}

/* ── Result section ── */
#cp-result {
  display: none;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-sm, 10px);
  padding: 1.5rem;
  background: rgba(255,255,255,0.03);
  text-align: center;
}

/* ── Winner display ── */
#cp-winner-display {
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.65rem;
}

.cp-single-winner {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--accent, #8b5cf6);
  word-break: break-word;
  line-height: 1.2;
}

/* ── Suspense animation ── */
.cp-winner-suspense {
  animation: cp-pulse 0.6s ease-in-out infinite;
}

@keyframes cp-pulse {
  0%, 100% { opacity: 0.5; transform: scale(0.98); }
  50%       { opacity: 1;   transform: scale(1);    }
}

.cp-suspense-text {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.5);
  font-style: italic;
}

/* ── Winner reveal ── */
.cp-winner-revealed {
  animation: cp-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes cp-reveal {
  0%   { opacity: 0; transform: scale(0.7) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Multiple winners list ── */
.cp-winner-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
  width: 100%;
  counter-reset: winner-counter;
}

.cp-winner-list li {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent, #8b5cf6);
  padding: 0.5rem 0.75rem;
  background: rgba(139,92,246,0.08);
  border-radius: 8px;
  counter-increment: winner-counter;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  word-break: break-word;
}

.cp-winner-list li::before {
  content: counter(winner-counter) ".";
  color: rgba(139,92,246,0.55);
  font-size: 0.82rem;
  font-weight: 700;
  min-width: 1.5ch;
}

/* ── Picked-from label ── */
#cp-picked-from {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.38);
  margin-bottom: 1rem;
  display: block;
}

/* ── Result action buttons ── */
.cp-result-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cp-result-actions .u-btn {
  min-width: 130px;
}

/* ── Security note ── */
.cp-security-note {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.35);
  text-align: center;
  margin-top: 0.5rem;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .cp-tool {
    padding: 1.25rem;
    margin-bottom: 4rem;
  }

  .cp-result-actions {
    flex-direction: column;
  }

  .cp-result-actions .u-btn {
    width: 100%;
  }

  #cp-pick-btn {
    max-width: 100%;
  }
}
