/* Base – no scrollbars inside iframe */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tool-body {
  background: radial-gradient(circle at top, #ffe6f0 0, #f7f7ff 40%, #f3f5ff 100%);
}

/* Shell + card (similar to other tools) */
.tool-shell {
  max-width: 1120px;
  margin: 16px auto 24px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, #ffe6f0, #fff7eb);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06);
}

.tool-card {
  background: #ffffff;
  border-radius: 22px;
  padding: 22px 22px 26px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

/* Header */
.tool-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.tool-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.td-icon {
  background: linear-gradient(135deg, #ec4899, #f97316);
  box-shadow: 0 8px 18px rgba(236, 72, 153, 0.4);
}

.tool-card-icon-text {
  color: #ffffff;
  font-weight: 700;
  font-size: 20px;
}

.tool-card-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #201a3b;
}

.tool-card-caption {
  margin: 4px 0 0;
  font-size: 14px;
  color: #6b7280;
}

.tool-main {
  padding-top: 10px;
}

/* Layout */
.td-layout {
  display: flex;
  gap: 28px;
}

.td-left {
  flex: 1.1;
}

.td-right {
  flex: 1.1;
}

/* Generic sections */
.td-section {
  margin-bottom: 18px;
}

.td-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 6px;
}

.td-label-inline {
  margin-bottom: 4px;
}

/* Select */
.td-select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: 8px 10px;
  font-size: 14px;
  outline: none;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.td-select:focus {
  border-color: #ec4899;
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.2);
}

/* Hint text */
.td-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #9ca3af;
}

/* Buttons row */
.td-buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Buttons (reuse style similar to other tools) */
.btn-primary {
  display: inline-block;
  padding: 9px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background-image: linear-gradient(135deg, #ec4899, #f97316);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(236, 72, 153, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 13px 25px rgba(236, 72, 153, 0.4);
  filter: brightness(1.04);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 7px 14px rgba(236, 72, 153, 0.3);
}

.btn-secondary {
  padding: 9px 16px;
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  color: #4b5563;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.btn-secondary:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}

/* Type-specific coloring */
.td-btn-truth {
  background-image: linear-gradient(135deg, #3b82f6, #22c55e);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.35);
}

.td-btn-dare {
  background-image: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow: 0 10px 20px rgba(239, 68, 68, 0.35);
}

/* Error */
.td-error {
  min-height: 18px;
  font-size: 13px;
  color: #b91c1c;
  margin: 4px 0 0;
}

/* Card section */
.td-card-section {
  height: 100%;
}

.td-card-wrapper {
  background: #fdf2ff;
  border-radius: 18px;
  padding: 16px 16px 18px;
  box-shadow: 0 10px 24px rgba(236, 72, 153, 0.18);
  height: 100%;
}

.td-question-card {
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #fef2ff);
  box-shadow: 0 12px 26px rgba(148, 163, 184, 0.35);
  padding: 14px 16px 18px;
}

/* Card inner for potential 3D flip */
.td-card-inner {
  perspective: 1000px;
}

/* Card front */
.td-card-front {
  transform-origin: center;
  transition: transform 0.35s ease;
}

/* Flip animation class */
.td-card-flip {
  transform: rotateY(360deg);
}

/* Type badge row */
.td-type-badge-wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.td-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.td-type-badge-neutral {
  background: #e5e7eb;
  color: #4b5563;
}

.td-type-badge-truth {
  background: #dbeafe;
  color: #1d4ed8;
}

.td-type-badge-dare {
  background: #fee2e2;
  color: #b91c1c;
}

.td-category-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: #fef3c7;
  color: #92400e;
}

/* Question text */
.td-question-text-wrapper {
  min-height: 110px;
  display: flex;
  align-items: center;
}

.td-question-text {
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
  color: #111827;
}

.td-question-placeholder {
  color: #6b7280;
  font-size: 16px;
}

/* Card tip */
.td-card-tip {
  margin: 14px 0 0;
  font-size: 12px;
  color: #6b7280;
}

/* History */
.td-history-section {
  max-height: 260px;
  display: flex;
  flex-direction: column;
}

.td-section-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: #4b5563;
}

.td-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
  border-radius: 10px;
  border: 1px dashed #e5e7eb;
  padding: 6px 8px;
  background: #f9fafb;
}

.td-history-item {
  font-size: 12px;
  color: #4b5563;
  padding: 4px 2px;
  border-bottom: 1px dashed #e5e7eb;
}

.td-history-item:last-child {
  border-bottom: none;
}

.td-history-tag {
  font-weight: 600;
  font-size: 11px;
  margin-right: 4px;
}

.td-history-type-truth {
  color: #1d4ed8;
}

.td-history-type-dare {
  color: #b91c1c;
}

.td-history-meta {
  font-size: 11px;
  color: #9ca3af;
}

/* Scrollbar for history only */
.td-history-list::-webkit-scrollbar {
  width: 6px;
}

.td-history-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 999px;
}

.td-clear-history-btn {
  margin-top: 8px;
  align-self: flex-start;
  border-radius: 999px;
  font-size: 12px;
  padding: 5px 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  color: #6b7280;
  cursor: pointer;
}

.td-clear-history-btn:hover {
  background: #f3f4f6;
}

/* Responsive */
@media (max-width: 768px) {
  .tool-shell {
    margin: 8px;
    padding: 16px;
    border-radius: 18px;
  }

  .tool-card {
    padding: 18px 14px 20px;
  }

  .td-layout {
    flex-direction: column;
  }

  .td-right {
    order: -1;
  }

  .td-question-text-wrapper {
    min-height: 90px;
  }
}
