:root {
  --bg: #187525;
  --card: #f9a0a0;
  --text: #1e293b;
  --muted: #64748b;
  --primary: #d92d20;
  --primary-hover: #b42318;
  --secondary: #d1e4fd;
  --border: #cbd5e1;
  --success: #0f766e;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding: 24px 16px;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

header {
  text-align: center;
  margin-bottom: 4px;
}

header h1 {
  color: #d4ea10;
  font-size: 1.9rem;
  margin-bottom: 4px;
}

header p {
  color:  #e02b1e;
  font-size: 1.25rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.card h2 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-header h2 {
  margin-bottom: 0;
}

.hint {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 14px;
}

.hidden {
  display: none !important;
}

/* Mode Selector */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.mode-btn {
  text-align: left;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s ease;
}

.mode-btn span {
  font-size: 0.85rem;
  color: var(--muted);
}

.mode-btn.active {
  border-color: var(--primary);
  background: #fef2f2;
}

/* Mode C Groups & Exclusions */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.group-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: #f8fafc;
}

.group-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.group-badge {
  font-weight: 700;
  font-size: 0.95rem;
}

.exclusion-label {
  font-size: 0.8rem;
  color: var(--muted);
  display: block;
  margin-bottom: 6px;
}

.exclusion-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  user-select: none;
}

.pill-toggle.excluded {
  background: #fee2e2;
  border-color: var(--primary);
  color: var(--primary-hover);
  font-weight: 600;
}

/* Add Form */
.add-form {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.add-form input,
.add-form select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

.add-form input {
  flex: 1;
}

/* Participants List */
.participants-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.person-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.92rem;
}

.person-chip .tag {
  background: var(--text);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.person-chip button {
  background: none;
  border: none;
  color: var(--muted);
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
}

.person-chip button:hover {
  color: var(--primary);
}

/* Buttons & Errors */
.btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-hover);
}

.btn.secondary {
  background: var(--secondary);
  color: var(--text);
}

.btn.danger-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
}

.btn.large {
  font-size: 1.05rem;
  padding: 12px 20px;
}

.btn.small {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 0.92rem;
}

/* Reveal Grid */
.reveal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.reveal-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
  text-align: left;
  transition: transform 0.1s ease;
}

.reveal-card:hover {
  transform: translateY(-1px);
  border-color: var(--primary);
}

.reveal-card .giver {
  font-weight: 700;
  display: block;
}

.reveal-card .status {
  font-size: 0.85rem;
  color: var(--success);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  background: #fff;
  padding: 24px;
  border-radius: 14px;
  max-width: 380px;
  width: 100%;
  text-align: center;
}

.secret-box {
  margin: 18px 0;
  padding: 20px;
  border-radius: 10px;
  background: #f1f5f9;
  font-size: 1.25rem;
  font-weight: 700;
}

.secret-box.revealed {
  background: #ecfdf5;
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
@media (min-width: 768px) {
  .container:has(#mode-c-panel:not(.hidden)) {
    max-width: 1200px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    align-items: start;
    gap: 20px;
  }

  .container:has(#mode-c-panel:not(.hidden)) > * {
    grid-column: 1;
  }

  .container:has(#mode-c-panel:not(.hidden)) > header {
    grid-column: 1 / -1;
  }

  .container:has(#mode-c-panel:not(.hidden)) > #mode-c-panel {
    grid-column: 2;
    grid-row: 2 / span 4;
  }

  #mode-c-panel .groups-grid {
    grid-template-columns: 1fr;
  }
}
.share-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

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

.saved-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8fafc;
}

.saved-row .hint {
  display: block;
  margin-bottom: 0;
}

.saved-actions {
  display: flex;
  gap: 8px;
}