/* Rastgele Sayı sayfası. Palet, bilet kartı, buton, sonuç etiketi, mühür, sarsıntı ve confetti canvas'ı style.css'ten gelir. */

.tool-head {
  text-align: center;
  margin-bottom: 20px;
}
.tool-head h1 {
  font-size: clamp(1.7rem, 7vw, 2.2rem);
  margin: 0 0 6px;
}
.tool-head p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Kart kenar boşlukları sıkı tutulur ki 360x640'ta buton ilk ekrana sığsın (çentikler --pad-x'e bağlı, birlikte kayar). */
.ticket {
  --pad-x: 20px;
  --btn-gap: 16px;
  padding: 20px var(--pad-x) 20px;
}

/* ---- Girdiler ---- */
.rs-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.rs-field label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 500;
}
.rs-field input {
  width: 100%;
  height: 44px;
  background: var(--surface-2);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 0 12px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
  transition: border-color 0.15s ease;
}
.rs-field input::-webkit-outer-spin-button,
.rs-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.rs-field input:focus { border-color: var(--accent); }
.rs-field input:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---- Kaç sayı ---- */
.rs-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.rs-count-label {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 500;
}
.rs-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}
.rs-stepper button {
  width: 38px;
  height: 36px;
  border: none;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.rs-stepper button:hover:not(:disabled) { background: var(--accent); color: var(--bg); }
.rs-stepper button:focus-visible,
.rs-repeat input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.rs-stepper button:disabled { cursor: not-allowed; opacity: 0.4; }
#countVal {
  min-width: 36px;
  text-align: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

/* ---- Tekrar kutusu ---- */
.rs-repeat {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease;
}
.rs-repeat input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: inherit;
}
.rs-repeat:has(input:disabled) {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---- Doğrulama mesajı: tek satır, yer her zaman ayrılı ---- */
.rs-msg {
  height: 1.3rem;
  margin: 4px 0 var(--btn-gap);   /* çentikler bu boşluğun ortasında */
  color: var(--accent-2);
  font-size: 0.8rem;
  line-height: 1.3rem;
  white-space: nowrap;
}

/* ---- Sonuç alanı: sabit yükseklik, sayı adedi ya da uzunluğu kartı oynatmaz ---- */
.rs-area {
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* geniş sayı kartı taşırmasın; yazı boyutu küçülerek sığar */
  padding-top: 20px;
}
.rs-area > * { grid-area: 1 / 1; }

.rs-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
/* Mühür animasyonu büyük başlayıp küçüldüğü için yatay taşma sayfada kaydırma çubuğu açmasın. */
.rs-view { overflow-x: clip; }
.rs-view .result-label { visibility: hidden; }
.rs-view .result-label.on { visibility: visible; }

/* 3 satırlık yükseklik (1.75rem x 3 + satır arası); tek büyük sayı (3.5rem) de buraya sığar. */
.rs-nums {
  --row-gap: 6px;
  position: relative;
  width: 100%;
  height: calc(1.75rem * 1.15 * 3 + var(--row-gap) * 2);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: var(--row-gap) 14px;
  font-variant-numeric: tabular-nums;
}
.rs-num {
  display: block;
  flex: none;
  max-width: none;
  overflow-wrap: normal;
  white-space: nowrap;
  font-size: inherit;
  text-align: center;
}

.rs-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Alt metin ---- */
.about {
  margin-top: 24px;
  padding: 24px;
}
.about h2 {
  font-size: 1.15rem;
  margin: 0 0 8px;
}
.about p {
  font-size: 0.92rem;
}
.about p:last-child { margin-bottom: 0; }
