/* RandomGen — tool-specific styles.
   Shared styles (nav, panels, buttons, chips) live in ../../css/style.css */

.rg {
  max-width: 640px;
  margin: 6px auto 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- Result ---------- */
.rg-hero .panel-body {
  text-align: center;
  padding: 26px 18px;
  background:
    radial-gradient(130% 130% at 50% 0%, rgba(232, 70, 124, .14), transparent 70%),
    var(--card-2);
}
.rg-result {
  display: block;
  font-size: clamp(2rem, 7vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.15;
  color: #fff;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
  user-select: all;
}
.rg-result.is-long { font-size: clamp(1rem, 3.4vw, 1.4rem); font-weight: 700; line-height: 1.5; }

.rg-hero-actions { margin-top: 18px; display: flex; gap: 8px; justify-content: center; }
.rg-hero-actions .btn { padding: 11px 32px; font-size: .95rem; }

/* ---------- Form ---------- */
.rg-form { display: flex; flex-direction: column; gap: 16px; }

.rg-range { display: flex; gap: 10px; }
.rg-field { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.rg-field-small { flex: 0 0 110px; }
.rg-label {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #74747e;
}
.rg-range input {
  width: 100%;
  background: #141418;
  border: 1px solid #26262b;
  border-radius: 11px;
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  padding: 11px 12px;
  text-align: center;
  outline: none;
  font-variant-numeric: tabular-nums;
  transition: border-color .15s;
}
.rg-range input:focus { border-color: var(--pink); }
.rg-range input::-webkit-outer-spin-button,
.rg-range input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.rg-range input { -moz-appearance: textfield; }

.rg-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.rg-presets .chip { font-size: .78rem; padding: 6px 13px; }
.rg-presets .chip:hover { border-color: var(--pink); color: var(--text); }

/* ---------- Switches ---------- */
.rg-options { display: flex; flex-direction: column; gap: 10px; }
.rg-switch {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: .86rem;
  color: #c4c4cc;
  cursor: pointer;
}
.rg-switch em { font-style: normal; color: #5c5c66; }
.rg-switch input { position: absolute; opacity: 0; pointer-events: none; }
.rg-switch-track {
  flex: none;
  width: 36px; height: 20px;
  border-radius: 999px;
  background: #2a2a31;
  position: relative;
  transition: background .18s;
}
.rg-switch-track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #74747e;
  transition: transform .18s, background .18s;
}
.rg-switch input:checked + .rg-switch-track { background: rgba(232, 70, 124, .35); }
.rg-switch input:checked + .rg-switch-track::after {
  transform: translateX(16px);
  background: var(--pink);
}
.rg-switch input:focus-visible + .rg-switch-track { box-shadow: 0 0 0 3px rgba(232, 70, 124, .3); }

.rg-error {
  color: #fca5a5;
  background: rgba(239, 68, 68, .1);
  border: 1px solid rgba(239, 68, 68, .3);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .83rem;
}
.rg-error[hidden] { display: none; }

/* ---------- History ---------- */
.rg-history {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 260px;
  overflow-y: auto;
}
.rg-history:empty::after {
  content: "Nothing rolled yet.";
  color: #4a4a52;
  font-size: .82rem;
}
.rg-history li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  background: #141418;
  border: 1px solid #1c1c20;
  border-radius: 9px;
}
.rg-history code {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .8rem;
  color: var(--pink-light);
  word-break: break-word;
}
.rg-history .icon-btn { flex: none; font-size: .7rem; padding: 4px 8px; }

.rg-note {
  color: #5c5c66;
  font-size: .78rem;
  line-height: 1.55;
  text-align: center;
}
.rg-note code { font-family: ui-monospace, Menlo, Consolas, monospace; color: #8b8b94; }

@media (max-width: 560px) {
  .rg-range { flex-wrap: wrap; }
  .rg-field { flex: 1 1 40%; }
  .rg-field-small { flex: 1 1 100%; }
}
