/* Zar At sayfası. Palet, bilet kartı, buton, sonuç etiketi, 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;
}

/* ---- Zar sayısı seçici ---- */
.dice-count {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}
.dice-count 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: 1rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.dice-count button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--bg);
}
.dice-count button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.dice-count button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* ---- Sahne: yüksekliği zar sayısından bağımsız sabit ---- */
.dice-stage {
  --stage-h: 180px;
  --floor: 10px;                    /* zarların altında butona kadar ek boşluk */
  height: var(--stage-h);
  padding-bottom: var(--floor);
  margin-bottom: var(--btn-gap);   /* çentikler bu boşluğun ortasında, ana sayfadaki gibi */
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.dice {
  --die: 92px;
  --gap: calc(var(--die) * 0.3);   /* küpler eğimli durduğu için görünen genişlik zardan büyük: yanlarda pay bırakılır */
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: calc(var(--die) * 0.2) var(--gap);
}
.dice[data-n="2"] { --die: 74px; }
.dice[data-n="3"] { --die: 58px; }
.dice[data-n="4"],
.dice[data-n="5"],
.dice[data-n="6"] { --die: 54px; }
/* 4 zar 2+2, 5 ve 6 zar 3+2 / 3+3 dizilir (360 px'te taşmasın). */
.dice[data-n="4"] { max-width: calc(var(--die) * 2 + var(--gap)); }
.dice[data-n="5"],
.dice[data-n="6"] { max-width: calc(var(--die) * 3 + var(--gap) * 2); }

.die-slot {
  position: relative;
  width: var(--die);
  height: var(--die);
}

.die-shadow {
  position: absolute;
  left: 50%;
  bottom: calc(var(--die) * -0.1);
  width: calc(var(--die) * 0.95);
  height: calc(var(--die) * 0.2);
  margin-left: calc(var(--die) * -0.475);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, var(--bg) 0%, transparent 70%);
  opacity: 0.55;
}

.die-lift {
  position: absolute;
  inset: 0;
  perspective: calc(var(--die) * 9);
  will-change: transform;
}

/* Dinlenme duruşunda küçük bir eğim: küp düz bir kare gibi görünmesin. */
.die-tilt {
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transform: translateY(calc(var(--die) * var(--lift, -0.2))) rotateX(-14deg) rotateY(-16deg);
}

.die {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
}

.face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  gap: calc(var(--die) * 0.04);
  padding: calc(var(--die) * 0.14);
  border-radius: 16%;
  backface-visibility: hidden;
  background: linear-gradient(145deg, var(--text), color-mix(in srgb, var(--text) 78%, var(--bg)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bg) 25%, transparent);
}

.pip {
  border-radius: 50%;
  background: transparent;
}
.pip.on { background: var(--bg); }

/* ---- Sonuç alanı: sabit yükseklik (tek zar ve çok zar aynı), sonuç gelince kart büyümez ---- */
.zar-result-area {
  display: grid;
  padding-top: 24px;
}
.zar-result-area > * { grid-area: 1 / 1; }

.zar-sizer {
  visibility: hidden;
  text-align: center;
}

.zar-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

.zar-sum {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.sr-only {
  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; }
