/* Scoped styles for the 1-49 Random Number Generator widget
   All rules are namespaced under .ontool-rng to avoid global style pollution.
   Font: Arial. Button color: #4CAF50. Mobile-first. */
.ontool-rng {
  font-family: Arial, Helvetica, sans-serif;
  box-sizing: border-box;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 12px;
}

.ontool-rng__card {
  background: #ffffff;
  color: #0b0b0b;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  overflow: hidden; /* avoid scroll bars */
}

/* Header */
.ontool-rng__header { margin-bottom: 0.6rem; }
.ontool-rng__title {
  font-size: 1.05rem;
  margin: 0;
  font-weight: 700;
}
.ontool-rng__subtitle {
  margin: 4px 0 0 0;
  color: #444;
  font-size: 0.88rem;
}

/* Main layout: mobile-first stacked panels */
.ontool-rng__body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

/* Panels */
.ontool-rng__panel {
  background: linear-gradient(180deg, #f8f8f9, #ffffff);
  border: 1px solid rgba(0,0,0,0.04);
  padding: 0.85rem;
  border-radius: 8px;
}

/* Labels and small text */
.ontool-rng__label { font-size: 0.92rem; font-weight: 600; color: #0b0b0b; margin-bottom: 0.5rem; display:block; }
.ontool-rng__small { display:block; margin-bottom: 0.25rem; font-size:0.86rem; color:#333; }

/* Rows */
.ontool-rng__row { display:flex; gap:0.6rem; align-items:center; margin-bottom:0.6rem; flex-wrap:wrap; }

/* Inputs */
.ontool-rng__input--small {
  width: 86px;
  min-height: 44px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #d7d7d7;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 1rem;
}

/* Select */
.ontool-rng__select {
  min-height: 44px;
  padding: 0 0.6rem;
  border-radius: 6px;
  border: 1px solid #d7d7d7;
  background: #fff;
  font-size: 1rem;
}

/* Buttons (touch target >= 44px) */
.ontool-rng__btn {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .12s ease, box-shadow .12s ease;
}

/* Primary generate button - required color */
.ontool-rng__btn--generate {
  background: #4CAF50;
  color: #fff;
  box-shadow: 0 6px 18px rgba(76,175,80,0.18);
}
.ontool-rng__btn--generate:hover { transform: translateY(-2px); }

/* Secondary buttons */
.ontool-rng__btn--clear {
  background: #f1f1f1;
  color: #121212;
  border: 1px solid rgba(0,0,0,0.06);
}
.ontool-rng__btn--copy { background: #4CAF50; color: #fff; }
.ontool-rng__btn--download { background: #e9e9e9; color: #111; }

/* Output area */
.ontool-rng__output {
  min-height: 120px;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px dashed rgba(0,0,0,0.06);
  background: #fcfcfc;
  font-size: 1rem;
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  align-items:center;
}

/* Visual number tokens (balls) */
.ontool-rng__token {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:44px;
  height:44px;
  border-radius:50%;
  background: linear-gradient(180deg,#ffffff,#f3f3f3);
  border: 2px solid rgba(0,0,0,0.06);
  font-weight:700;
  box-shadow: 0 6px 14px rgba(0,0,0,0.06);
  font-size:0.98rem;
  color:#111;
}

/* Meta area */
.ontool-rng__meta { margin-left:auto; display:flex; gap:8px; align-items:center; }
.ontool-rng__meta-item { font-size:0.86rem; color:#333; }

/* Hint and status */
.ontool-rng__hint { font-size:0.82rem; color:#555; margin-top:0.25rem; }

/* Footer */
.ontool-rng__footer { margin-top:0.6rem; font-size:0.85rem; color:#666; }

/* Larger screens: two-column horizontal layout */
@media (min-width: 780px) {
  .ontool-rng__body {
    grid-template-columns: 360px 1fr;
    gap: 1rem;
    align-items: start;
  }
  .ontool-rng__panel--controls { max-width: 360px; }
  .ontool-rng__panel--output { min-height: 240px; }
}

/* Ensure no unwanted scrollbars and good spacing on small widths */
@media (max-width: 420px) {
  .ontool-rng__input--small { width: 100%; }
  .ontool-rng__row--buttons { width: 100%; display:flex; gap:8px; }
  .ontool-rng__controls-bottom { flex-direction: column; align-items: stretch; gap:8px; }
  .ontool-rng__btn { width: 100%; justify-content: center; }
}

/* Utility: hide focus outline only if keyboard not used (keeps accessibility) */
.ontool-rng__btn:focus, .ontool-rng__select:focus, .ontool-rng__input--small:focus {
  outline: 3px solid rgba(76,175,80,0.18);
  outline-offset: 2px;
}
