/* Random Team Generator — 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;
}

.field-group--inline {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

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: 160px;
  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.75rem;
}

.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;
}

/* ── Controls Row ─────────────────────────────────────────────────────────── */

.controls-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

/* ── Stepper ──────────────────────────────────────────────────────────────── */

.stepper {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.stepper-btn {
  width: 44px;
  height: 44px;
  background: var(--bg);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  font-family: var(--font);
}

.stepper-btn:hover        { background: #EDEDFF; }
.stepper-btn:active       { background: #DCDCFF; }
.stepper-btn:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.stepper input[type="number"] {
  width: 48px;
  height: 44px;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font);
  color: var(--ink);
  background: var(--surface);
  -moz-appearance: textfield;
}

.stepper input[type="number"]::-webkit-inner-spin-button,
.stepper input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
}

.stepper input[type="number"]:focus {
  outline: none;
  background: #EDEDFF;
}

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

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 400;
  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: 1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
}

@media (min-width: 480px) {
  .results-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 760px) {
  .results-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Team Cards ───────────────────────────────────────────────────────────── */

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.team-card-header {
  padding: 0.65rem 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.team-name {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
}

.member-count {
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.team-card-body {
  list-style: none;
  padding: 0.65rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  background: var(--surface);
}

.team-card-body li {
  font-size: 0.92rem;
  color: var(--ink);
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--border);
}

.team-card-body li:last-child { border-bottom: none; }

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

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

/* ── 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); }
}

/* ── Cross-link Banner ────────────────────────────────────────────────────── */

.crosslink-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--warm-bg);
  border-top: 1px solid var(--warm-border);
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  color: var(--stone);
  flex-wrap: wrap;
  text-align: center;
}

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

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

/* ── Print ────────────────────────────────────────────────────────────────── */

@media print {
  .skip-link, .site-header, .ad-slot, .tool-header,
  .input-section, .action-row, .site-footer { display: none !important; }

  body { background: #fff; display: block; }

  .tool-main { padding: 0; max-width: 100%; }

  .tool-card {
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .results-section::before {
    content: 'Team Results';
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
  }

  .results-heading { display: none; }

  .results-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }

  .team-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1.5px solid #ccc;
  }

  .team-card-header {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .team-name, .member-count { color: #fff !important; }

  .team-card-body { background: #fff; }
}
