/* Random Name Picker — Tool Styles */
/* Inherits brand tokens from /assets/css/site.css */

/* ── Tool Layout ──────────────────────────────────────────────────────────── */

.tool-main {
  width: 100%;
  max-width: var(--tool-max);
  margin: 0 auto;
  padding: 2rem 1rem 2.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tool-header { text-align: center; }

.tool-header h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.tool-header p {
  margin-top: 0.3rem;
  color: var(--stone);
  font-size: 0.95rem;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── Field Groups ─────────────────────────────────────────────────────────── */

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
}

.hint {
  font-weight: 400;
  color: var(--stone);
  font-size: 0.82rem;
}

/* ── Textarea ─────────────────────────────────────────────────────────────── */

textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  resize: vertical;
  min-height: 140px;
  transition: border-color 0.15s;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(55, 48, 163, 0.12);
  background: var(--surface);
}

textarea.drag-over {
  border-color: var(--accent);
  background: #EDEDFF;
}

/* ── File Upload ──────────────────────────────────────────────────────────── */

.upload-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.25rem;
}

.btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: var(--warm-bg);
  color: var(--warm-text);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  min-height: 44px;
}

.btn-upload:hover { background: #FDE68A; border-color: var(--warm); }
.btn-upload:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
}

.upload-hint {
  font-size: 0.82rem;
  color: #2d6a3f;
  font-weight: 600;
}

/* ── Toggle ───────────────────────────────────────────────────────────────── */

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  min-height: 44px;
  color: var(--ink);
}

.toggle-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */

.btn-primary {
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: var(--accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  min-height: 52px;
  touch-action: manipulation;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 6px rgba(55, 48, 163, 0.3);
}

.btn-primary:hover        { background: var(--accent-hover); box-shadow: 0 3px 10px rgba(55, 48, 163, 0.35); }
.btn-primary:active       { transform: scale(0.98); }
.btn-primary:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  min-height: 44px;
  touch-action: manipulation;
}

.btn-secondary:hover        { background: var(--bg); border-color: #c8c0b0; }
.btn-secondary:active       { background: #EDEDFF; }
.btn-secondary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ── Results ──────────────────────────────────────────────────────────────── */

.results-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.results-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--stone);
}

/* ── Winner Display ───────────────────────────────────────────────────────── */

.winner-display {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.winner-name {
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  font-weight: 800;
  color: var(--highlight);
  letter-spacing: -0.02em;
  line-height: 1.15;
  word-break: break-word;
}

.winner-meta {
  font-size: 0.85rem;
  color: var(--stone);
  font-weight: 600;
}

@keyframes winner-pop {
  0%   { transform: scale(0.85); opacity: 0; }
  60%  { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1);    opacity: 1; }
}

.winner--pop .winner-name {
  animation: winner-pop 0.3s ease-out both;
}

/* ── Action Row ───────────────────────────────────────────────────────────── */

.action-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ── Empty State ──────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: var(--stone);
  font-size: 0.95rem;
}

/* ── Cross-link Card ──────────────────────────────────────────────────────── */

.crosslink-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--warm-bg);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  font-size: 0.9rem;
  color: var(--ink);
}

.crosslink-icon {
  color: var(--warm);
  flex-shrink: 0;
}

.crosslink-card strong {
  display: block;
  font-weight: 700;
  margin-bottom: 0.1rem;
}

.crosslink-card a {
  color: var(--warm);
  font-weight: 600;
  text-decoration: none;
}

.crosslink-card a:hover { text-decoration: underline; }

/* ── Toast ────────────────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--surface);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 1000;
  white-space: nowrap;
  animation: toast-in 0.2s ease-out;
  pointer-events: none;
}

.toast--hide { animation: toast-out 0.25s ease-in forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(8px); }
}
