/* Takım Oluştur 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;
}
.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;
}

/* ---- İsimler ---- */
.tb-field label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 500;
}
.tb-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;
}
.tb-field textarea::placeholder { color: var(--text-dim); }
.tb-field textarea:focus { border-color: var(--accent); }
.tb-field textarea:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---- Takım sayısı ---- */
.tb-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.tb-count-label {
  color: var(--text-dim);
  font-size: 0.8rem;
  font-weight: 500;
}
.tb-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
}
.tb-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;
}
.tb-stepper button:hover:not(:disabled) { background: var(--accent); color: var(--bg); }
.tb-stepper button:focus-visible,
.tb-copy:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tb-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;
}

/* ---- Doğrulama mesajı: tek satır, yer her zaman ayrılı ---- */
.tb-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ç ---- */
.tb-body { padding-top: 20px; }

.tb-teams {
  --row-h: 30px;
  --row-gap: 6px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}
@media (min-width: 560px) {
  .tb-teams { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.tb-team {
  background: var(--surface-2);
  border-radius: 14px;
  padding: 12px;
}
.tb-title {
  display: inline-block;
  margin: 0 0 8px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent);
  transform-origin: left center;
}
/* Mühür: ana sayfadaki kadar sert değil, başlıklar küçük olduğu için 1.35x'ten oturur. */
.tb-title.stamp { animation: tb-stamp 0.4s both; }
@keyframes tb-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); }
}

/* Her takım en büyük takım kadar yer ayırır: kim fazla alırsa alsın sonuç alanı aynı yükseklikte kalır. */
.tb-slots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--row-gap);
  min-height: calc(var(--rows) * var(--row-h) + (var(--rows) - 1) * var(--row-gap));
}
.tb-slot {
  height: var(--row-h);
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 1px dashed rgba(169, 174, 220, 0.35);
  border-radius: 8px;
  animation: tb-wait 1.8s ease-in-out infinite;
}
@keyframes tb-wait {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
.tb-slot.in {
  background: var(--surface);
  border-color: transparent;
  animation: none;
}
.tb-name {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  color: var(--text);
  visibility: hidden;
}
.tb-slot.in .tb-name {
  visibility: visible;
  animation: tb-pop 0.18s ease-out;
}
@keyframes tb-pop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

/* "Sonucu kopyala" yeri baştan ayrılı; sonuç gelince görünür, kart büyümez. */
.tb-copy-row {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.tb-copy {
  visibility: hidden;
  min-width: 150px;
  padding: 8px 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;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tb-copy.on { visibility: visible; }
.tb-copy:hover { background: var(--accent); color: var(--bg); }

.tb-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) {
  .tb-slot, .tb-slot.in .tb-name, .tb-title.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; }
