/* Çekiliş sayfası. Palet, bilet kartı, buton, sarsıntı, confetti canvas'ı ve sonuç alanının yumuşak açılması
   (.result / .result-clip: grid 0fr->1fr) 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;
  line-height: 1.177;   /* "Çekiliş" başlığındaki ş başka bir yazı tipi alt kümesinden gelir ve satırı 1 px büyütür; kart yüksekliği sabitlenir */
}
.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;
}

/* ş, İ, Ğ gibi harfler başka bir yazı tipi alt kümesinden gelir ve satır yüksekliğini 1 px oynatabilir;
   düğme yüksekliği (54 px) metinden bağımsız sabitlenir, kart zıplamaz. */
#goBtn { line-height: 22px; }

/* ---- Katılımcılar ---- */
.cl-field label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 16px;
}
.cl-field textarea {
  display: block;
  width: 100%;
  height: calc(22px * 6 + 24px);   /* 6 satır + dikey iç boşluk ve kenarlık; kendiliğinden büyümez, içeride kayar */
  background: var(--surface-2);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 22px;
  resize: none;
  overflow-y: auto;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(169, 174, 220, 0.35) transparent;
  transition: border-color 0.15s ease;
}
.cl-field textarea::placeholder { color: var(--text-dim); }
.cl-field textarea:focus { border-color: var(--accent); }
.cl-field textarea:disabled { opacity: 0.6; cursor: not-allowed; }

/* Sayaç: tek satır, yüksekliği sabit (aria-live yok). */
.cl-count {
  height: 16px;
  margin: 6px 0 0;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 16px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---- Aynı isim bir kez sayılsın ---- */
.cl-dedupe {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  margin-top: 6px;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 20px;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease;
}
.cl-dedupe input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
  cursor: inherit;
}
.cl-dedupe input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.cl-dedupe:has(input:disabled) {
  opacity: 0.4;
  cursor: not-allowed;
}
.cl-hint {
  height: 16px;
  margin: 0 0 0 28px;
  color: var(--text-dim);
  font-size: 0.76rem;
  line-height: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Asil / Yedek seçicileri: yan yana, etiket üstte, her biri yarım genişlik ---- */
.cl-pickers {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 10px;
}
.cl-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cl-picker-label {
  margin-bottom: 4px;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 16px;
}
.cl-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cl-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;
}
.cl-stepper button:hover:not(:disabled) { background: var(--accent); color: var(--bg); }
.cl-stepper button:focus-visible,
.cl-copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.cl-stepper button:disabled { cursor: not-allowed; opacity: 0.4; }
.cl-stepper span {
  min-width: 36px;
  text-align: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 24px;
  font-variant-numeric: tabular-nums;
}

/* ---- Doğrulama mesajı: tek satır, yer her zaman ayrılı ---- */
.cl-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ç ---- */
/* .result bir grid: sütun içeriğe göre büyümesin (uzun isim kartı taşırmasın); isim kendi kutusunda kırpılır. */
.cl-result { grid-template-columns: minmax(0, 1fr); }
.cl-body { padding-top: 20px; }

/* Akış alanı: tek satır, sabit 44 px. Akışta rastgele isimler değişir; bitince katılımcı özeti kalır. */
.cl-flow {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--accent);
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 20px;
  text-align: center;
}
.cl-flow span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cl-flow.done {
  color: var(--text-dim);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
}

.cl-head {
  height: 24px;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 20px;
  color: var(--accent);
}
.cl-head.backup { margin-top: 14px; color: var(--text-dim); }

.cl-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Satırlar son boyutta kurulur (44 px); isim yeri soluk bir yuvadır, isim düşünce dolar. */
.cl-row {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px 0 8px;
  border: 1px dashed rgba(169, 174, 220, 0.35);
  border-radius: 12px;
  animation: cl-wait 1.8s ease-in-out infinite;
}
@keyframes cl-wait {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.cl-row.in {
  background: var(--surface-2);
  border: 1px solid transparent;
  animation: none;
}
.cl-row.first.in { border-color: var(--accent); }
/* Yedek satırları ikincil: zemin yok, ince çerçeve, soluk metin. */
.cl-row.backup.in {
  background: transparent;
  border-color: rgba(169, 174, 220, 0.25);
}

.cl-num {
  flex: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-dim);
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cl-row.in .cl-num { background: var(--surface); color: var(--text); }
.cl-row.backup.in .cl-num { background: transparent; box-shadow: inset 0 0 0 1px rgba(169, 174, 220, 0.4); color: var(--text-dim); }
.cl-row.first .cl-num,
.cl-row.first.in .cl-num { background: var(--accent); color: var(--bg); }
/* Mühür: 1. asilin rozetinde, ana sayfadaki kadar sert değil (1.35x'ten oturur). */
.cl-num.stamp { animation: cl-stamp 0.4s both; }
@keyframes cl-stamp {
  0% { transform: scale(1.35) rotate(-3deg); animation-timing-function: cubic-bezier(0.3, 1.2, 0.6, 1); }
  60% { transform: scale(0.97) rotate(0.5deg); animation-timing-function: ease-out; }
  100% { transform: scale(1) rotate(0deg); }
}

.cl-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
  line-height: 20px;
  color: var(--text);
  visibility: hidden;
}
.cl-row.backup .cl-name { color: var(--text-dim); }
.cl-row.in .cl-name {
  visibility: visible;
  animation: cl-pop 0.18s ease-out;
}
@keyframes cl-pop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

/* "Sonucu kopyala" yeri baştan ayrılı; sonuç gelince görünür, kart büyümez. */
.cl-copy-row {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.cl-copy {
  visibility: hidden;
  min-width: 150px;
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 0.88rem;
  line-height: 20px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.cl-copy.on { visibility: visible; }
.cl-copy:hover { background: var(--accent); color: var(--bg); }

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

@media (prefers-reduced-motion: reduce) {
  .cl-row, .cl-row.in .cl-name, .cl-num.stamp { animation: none; }
}

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