/* ==========================================================================
   THEATRON — oyun sayfaları için ortak yapı taşları
   (kurulum başlığı, adım kartları, form alanları, devam et şeridi, final / podyum / ödüller)
   Tabu kendi tb-* sınıflarını kullanır; diğer oyunlar bu g-* sınıflarını paylaşır.
   ========================================================================== */

body.gm {
  --topbar-h: 68px;
}

/* sahne ışığı: tepeden süzülen ışık */
body.gm::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(48% 42% at 50% -4%, rgba(255, 238, 190, 0.17), transparent 72%),
    radial-gradient(26% 64% at 50% 0, rgba(255, 238, 190, 0.06), transparent 70%);
}

.gm-main {
  position: relative;
  z-index: 1;
  width: min(100% - 2 * var(--gutter), 1180px);
}

/* ---------- çip varyantları ---------- */
.chip b {
  color: #fff;
  font-weight: 800;
}

.chip--good {
  color: #c8eaa6;
  border-color: rgba(121, 181, 81, 0.55);
  background: rgba(121, 181, 81, 0.14);
}

.chip--amber {
  color: var(--gold-300);
  border-color: rgba(235, 203, 126, 0.45);
  background: rgba(217, 177, 90, 0.12);
}

.chip--bad {
  color: #ffb3b8;
  border-color: rgba(224, 80, 90, 0.55);
  background: rgba(224, 80, 90, 0.14);
}

/* ---------- devam et şeridi ---------- */
.g-resume {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.2rem;
  margin-bottom: 1.2rem;
  border-radius: var(--r-l);
  background: linear-gradient(120deg, rgba(235, 203, 126, 0.14), rgba(255, 255, 255, 0.03));
  animation: th-fade-up 0.6s var(--ease-out) both;
}

.g-resume__ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--gold-300), var(--gold-600));
  color: #2b1d06;
}

.g-resume__txt {
  flex: 1;
  min-width: 220px;
  display: grid;
  gap: 0.15rem;
}

.g-resume__txt span {
  color: var(--text-dim);
  font-size: 0.92rem;
}

.g-resume__act {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* ---------- kurulum başlığı ---------- */
.g-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: clamp(1.2rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(0.4rem, 3vw, 2rem) 0 clamp(1.6rem, 4vw, 3rem);
}

.g-hero__copy {
  display: grid;
  gap: 1.1rem;
  justify-items: start;
}

.g-hero h1 {
  font-size: clamp(2.9rem, 8.4vw, 6rem);
  line-height: 0.98;
  letter-spacing: 0.06em;
  overflow-wrap: break-word;
  filter: drop-shadow(0 12px 40px rgba(217, 177, 90, 0.35));
}

.g-hero__lead {
  max-width: 26ch;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.4rem, 3vw, 2.05rem);
  line-height: 1.2;
  color: var(--text-dim);
  text-wrap: balance;
}

.g-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.g-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.3rem;
}

.g-hero__art {
  justify-self: center;
  width: min(100%, 420px);
  aspect-ratio: 4 / 3;
  position: relative;
}

/* ---------- kurulum adımları ---------- */
.g-step {
  margin-top: 1.1rem;
  animation: th-fade-up 0.65s var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 90ms);
}

.g-step__head {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 1.3rem;
}

.g-step__head h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.15rem, 1rem + 0.7vw, 1.45rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.g-step__head p {
  margin-top: 0.25rem;
  font-size: 0.95rem;
  text-wrap: pretty;
}

.g-step__head .step-num {
  flex: none;
  margin-top: 0.1rem;
}

.g-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1.6rem;
}

.g-field {
  display: grid;
  gap: 0.55rem;
  align-content: start;
}

.g-field--wide {
  grid-column: 1 / -1;
}

.g-field__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  min-height: 1.4rem;
}

.g-field__top .label {
  margin: 0;
}

.g-field__hint {
  font: 600 0.78rem/1.3 var(--font-ui);
  color: var(--text-mute);
}

.g-field > .stepper,
.g-field > .seg {
  justify-self: start;
  max-width: 100%;
}

.g-field > .seg--fill {
  display: flex;
  flex-wrap: nowrap;
  justify-self: stretch;
  width: 100%;
}

.seg--fill .seg__opt {
  flex: 1 1 0;
  min-width: 0;
  padding-inline: 0.2rem;
}

/* seçili / seçili değil durumu net okunsun */
.g-step button.chip[aria-pressed='true'] {
  background: linear-gradient(180deg, rgba(235, 203, 126, 0.42), rgba(217, 177, 90, 0.24));
  border-color: rgba(247, 222, 156, 0.85);
  color: #fff3cf;
  box-shadow: 0 8px 18px -10px rgba(217, 177, 90, 0.9);
}

.g-step button.chip[aria-pressed='false'] {
  background: transparent;
  border-style: dashed;
  opacity: 0.62;
}

.g-step button.chip[aria-pressed='false']:hover {
  opacity: 0.95;
}

.g-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.g-presets .chip {
  justify-content: center;
  padding-inline: 0.6rem;
  white-space: nowrap;
}

.g-toggles {
  display: grid;
  gap: 1rem;
}

.g-hint {
  margin-top: 1.2rem;
  font-size: 0.95rem;
  color: var(--text-dim);
  text-wrap: pretty;
}

.g-hint strong {
  color: var(--gold-300);
}

.g-hint .warn {
  color: var(--coral-300);
}

.g-dock__sum {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.g-dock__sum .chip {
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
}

/* ---------- final: podyum, ödüller ---------- */
.g-fin {
  display: grid;
  gap: 1.9rem;
  padding-bottom: 1rem;
}

.g-fin__head {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  text-align: center;
}

.g-fin__head h2 {
  font-size: clamp(2.4rem, 9vw, 5rem);
  line-height: 1;
  letter-spacing: 0.05em;
  overflow-wrap: break-word;
  text-wrap: balance;
  filter: drop-shadow(0 12px 40px rgba(217, 177, 90, 0.35));
}

.g-fin__sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.3rem, 3.2vw, 1.8rem);
  color: var(--text-dim);
}

.g-fin__head .g-hero__chips {
  justify-content: center;
}

.g-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 1.3rem);
  height: clamp(310px, 46vh, 430px);
  padding-top: 0.6rem;
}

.g-pod {
  --c: var(--gold-500);
  display: flex;
  flex: 0 1 clamp(100px, 24%, 210px);
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  min-width: 0;
}

.g-pod__who {
  display: grid;
  justify-items: center;
  gap: 0.32rem;
  margin-bottom: 0.9rem;
  text-align: center;
  animation: th-fade-up 0.8s var(--ease-out) both;
  animation-delay: calc(var(--d) + 600ms);
}

.g-pod__crown {
  color: var(--gold-300);
  filter: drop-shadow(0 0 14px var(--gold-500));
  animation: th-float 3s ease-in-out infinite;
  --r: 0deg;
}

.g-pod__crown .ico {
  width: 38px;
  height: 38px;
}

.g-pod__name {
  max-width: 14ch;
  font: 800 1rem/1.15 var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--c);
  overflow-wrap: anywhere;
}

.g-pod__score {
  font: 800 1.7rem/1 var(--font-display);
  color: var(--cream-50);
}

.g-pod__col {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: calc((100% - 10.5rem) * var(--k, 1));
  min-height: 70px;
  border-radius: 6px 6px 0 0;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.13) 0 3px, transparent 3px 14px),
    linear-gradient(180deg, color-mix(in srgb, var(--c) 38%, #fff6e8), color-mix(in srgb, var(--c) 72%, #241a10));
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.5),
    0 22px 40px -18px rgba(0, 0, 0, 0.85);
  transform-origin: bottom;
  animation: g-rise 0.95s var(--ease-spring) both;
  animation-delay: var(--d);
}

.g-pod__col::before,
.g-pod__col::after {
  content: '';
  position: absolute;
  left: -7px;
  right: -7px;
  border-radius: 5px;
}

.g-pod__col::before {
  top: -12px;
  height: 14px;
  background: linear-gradient(#fff6d9, var(--gold-500));
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.g-pod__col::after {
  bottom: -10px;
  height: 10px;
  background: linear-gradient(#d8c9be, #8f7e6e);
}

.g-pod__rank {
  font: 800 clamp(2.4rem, 8vw, 4rem) / 1 var(--font-display);
  color: rgba(26, 18, 51, 0.78);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

@keyframes g-rise {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

.g-board {
  display: grid;
  gap: 0.9rem;
  max-width: 820px;
  width: 100%;
  margin-inline: auto;
}

.g-board h3,
.g-sec-title {
  font: 800 clamp(1.1rem, 2.6vw, 1.4rem) var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.g-awards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.g-award {
  --c: var(--gold-500);
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 1rem 1.1rem;
  border-radius: var(--r-l);
  border: 1px solid color-mix(in srgb, var(--c) 45%, transparent);
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 16%, transparent), rgba(255, 255, 255, 0.03));
}

.g-award__ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--c);
  color: #1b1230;
  box-shadow: 0 8px 20px -8px var(--c);
}

.g-award div {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.g-award small {
  font: 800 0.66rem/1.2 var(--font-ui);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-mute);
}

.g-award b {
  font: 800 1.35rem/1.15 var(--font-display);
}

.g-award span {
  font-size: 0.9rem;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}

.g-fin__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 0.6rem;
}

/* ---------- açılır tekrar listesi (öğrenme özeti) ---------- */
.g-recap {
  max-width: 820px;
  width: 100%;
  margin-inline: auto;
}

.g-recap header {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1.1rem;
}

.g-recap h3 {
  font: 800 clamp(1.3rem, 3vw, 1.7rem) var(--font-display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.g-recap__list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.g-recap__i {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.g-recap__b {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.g-recap__b:hover {
  background: rgba(255, 255, 255, 0.04);
}

.g-recap__n {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(235, 203, 126, 0.5);
  background: rgba(235, 203, 126, 0.16);
  font: 800 0.85rem var(--font-display);
}

.g-recap__w {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.g-recap__w b {
  font: 700 1rem/1.3 var(--font-ui);
  text-wrap: pretty;
}

.g-recap__w small {
  font: 600 0.78rem/1.2 var(--font-ui);
  color: var(--text-mute);
}

.g-recap__chev .ico {
  transition: transform 0.3s var(--ease-out);
}

.g-recap__b[aria-expanded='true'] .g-recap__chev .ico {
  transform: rotate(180deg);
}

.g-recap__note {
  padding: 0 1.1rem 1rem 4rem;
  color: var(--text-dim);
  text-wrap: pretty;
  animation: th-fade-up 0.35s var(--ease-out) both;
}

/* ---------- duyarlı ---------- */
@media (max-width: 980px) {
  .g-hero {
    grid-template-columns: 1fr;
  }
  .g-hero__art {
    display: none;
  }
}

@media (max-width: 760px) {
  .g-controls {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  /* kurulum alt çubuğu: tek satır özet + tam genişlik başlat düğmesi */
  body.gm .dock {
    gap: 0.55rem;
    padding: 0.7rem 0.8rem;
    padding-bottom: max(0.7rem, env(safe-area-inset-bottom));
  }
  body.gm .dock > .btn--xl {
    flex: 1 1 100%;
    min-height: 56px;
    padding-block: 0.8rem;
    font-size: 1.05rem;
  }
  .g-dock__sum {
    gap: 0.35rem;
  }
  .g-dock__sum .chip {
    padding: 0.32rem 0.6rem;
    font-size: 0.74rem;
  }
  .g-dock__sum .chip .ico {
    display: none;
  }
  .g-hero .eyebrow::before {
    display: none;
  }
  .g-resume__act {
    width: 100%;
    flex-wrap: nowrap;
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 0.35rem;
  }
  .g-resume__act .btn {
    justify-content: center;
  }
  .g-fin__actions {
    flex-direction: column;
    align-items: stretch;
    width: min(100%, 340px);
    margin-inline: auto;
  }
  .g-fin__actions .btn {
    justify-content: center;
  }
  .g-resume__act .btn--gold {
    padding-inline: 0.8rem;
    white-space: normal;
  }
  .g-podium {
    height: 340px;
  }
  .g-pod__name {
    font-size: 0.82rem;
  }
  .g-pod__score {
    font-size: 1.35rem;
  }
  .g-recap__note {
    padding-left: 1.1rem;
  }
}
