:root {
  color-scheme: dark;
  --bg: #150d0c;
  --ink: #f3e8d4;
  --gold: #e9c78b;
  --soft: #d0c6b8;
  --edge: #92774d;
  --serif: 'Trajan Pro', 'Trajan Pro 3', 'Cinzel', 'Palatino Linotype', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.65 var(--sans); }
body:has(dialog[open]) { overflow: hidden; }
h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
:focus-visible { outline: 2px solid #ffe0a4; outline-offset: 5px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.gateway {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(34px, 6vh, 66px) 28px 25px;
  overflow: hidden;
}
.scenery, .scenery::after, .frame { position: absolute; pointer-events: none; }
.scenery {
  --scenery-position: 50% 100%;
  z-index: -2;
  inset: 0;
  background: #211210 url('./assets/metin-vadisi-uc-koy.webp') var(--scenery-position) / cover no-repeat;
}
.scenery-flags {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--scenery-position);
}
.scenery::after {
  content: '';
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 45%, #180c0b70 5%, #180c0a12 57%, #0d07096e 100%),
    linear-gradient(0deg, #0d08089c 0%, transparent 17%, transparent 82%, #10080932 100%);
}
.meteor-shower {
  position: absolute;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.meteor-shower canvas { display: block; width: 100%; height: 100%; }
/* Çarpışma anında sahneyi ve karakterleri aydınlatan sıcak ışık */
.impact-light {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse 55% 45% at var(--lx, 50%) var(--ly, 80%), #ff9a3c66, #ff6a1f26 45%, transparent 75%);
  mix-blend-mode: screen;
}
.frame {
  z-index: -1;
  inset: clamp(13px, 2.2vw, 28px);
  border: 1px solid #d6ad743f;
}
.frame span { position: absolute; width: 22px; height: 22px; border-color: #d2a767a6; border-style: solid; }
.frame span:nth-child(1) { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.frame span:nth-child(2) { top: -1px; right: -1px; border-width: 1px 1px 0 0; }
.frame span:nth-child(3) { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }
.frame span:nth-child(4) { bottom: -1px; left: -1px; border-width: 0 0 1px 1px; }

.gateway-content {
  align-self: center;
  justify-self: center;
  display: grid;
  justify-items: center;
  width: min(100%, 630px);
  padding-block: 10px 40px;
  text-align: center;
}
.wordmark { position: relative; width: min(100%, 545px); width: min(100%, 545px, 69svh); }
.wordmark img { display: block; width: 100%; height: auto; }
.tagline { color: #f1e7d7; font: 400 clamp(.85rem, 2vw, 1.05rem)/1.4 var(--serif); font-style: italic; letter-spacing: .1em; text-shadow: 0 2px 8px #020303; margin-top: 14px; }

.game-menu { width: min(100%, 300px); display: grid; gap: 9px; margin-top: clamp(24px, 4.6vh, 42px); }
/* Metin2 arayüzü tarzı buton: altın işlemeli çerçeve, iki uçta kızıl mücevher, oyma süsler */
.game-option {
  --plate-fill: url(#plate-steel);
  --plate-hot: url(#plate-steel-hot);
  --plate-accent: #d8b46e;
  --gem: url(#gem-dim);
  position: relative;
  isolation: isolate;
  min-height: 51px;
  display: grid;
  place-items: center;
  padding: 7px 52px;
  border-radius: 20px;
  color: #efdcb6;
  font: 700 16px/1.2 var(--serif);
  letter-spacing: .06em;
  text-shadow: 0 1px 0 #000, 0 2px 4px #0a0605;
  transition: color .25s ease, transform .2s ease;
}
.game-option > span { position: relative; z-index: 1; }
.game-option.primary {
  --plate-fill: url(#plate-crimson);
  --plate-hot: url(#plate-crimson-hot);
  --plate-accent: #f0c97f;
  --gem: url(#gem-lit);
  color: #fff1d6;
  letter-spacing: .09em;
}
.option-plate {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  stroke: none;
  filter: drop-shadow(0 4px 6px #050303e6);
  transition: filter .3s ease;
}
.plate-frame { fill: url(#gold-edge); }
.plate-frame-dark { fill: #1b0f08; }
.plate-face { fill: var(--plate-fill); transition: opacity .3s ease; }
.plate-face-hot { fill: var(--plate-hot); opacity: var(--hot, 0); transition: opacity .3s ease; }
.plate-gloss { fill: url(#plate-gloss); }
.plate-rim { fill: none; stroke: var(--plate-accent); stroke-opacity: .45; stroke-width: .8; }
.plate-engraving { fill: none; stroke: var(--plate-accent); stroke-opacity: .7; stroke-width: 1.1; }
.plate-socket { fill: url(#gold-edge); stroke: #3a2410; stroke-width: .6; }
.plate-gem { fill: var(--gem); }
.plate-gem-shine { fill: #fff; opacity: .85; }
.plate-crest { fill: url(#gold-edge); stroke: #3a2410; stroke-width: .5; }

/* Üzerine gelince: panel kızarır, mücevherler yanar, ışık süpürür */
.game-option::after {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 6px 14px;
  clip-path: polygon(0 50%, 5% 8%, 95% 8%, 100% 50%, 95% 92%, 5% 92%);
  background: linear-gradient(105deg, transparent 38%, rgba(255, 236, 200, .32) 50%, transparent 62%) 160% 0 / 260% 100% no-repeat;
  pointer-events: none;
  transition: background-position 0s;
}
.game-option:is(:hover, :focus-visible) { color: #fff6e6; transform: translateY(-2px); }
.game-option:is(:hover, :focus-visible)::after { background-position: -60% 0; transition: background-position .75s ease; }
.game-option:is(:hover, :focus-visible) { --gem: url(#gem-lit); --hot: 1; }
.game-option:is(:hover, :focus-visible) .option-plate { filter: drop-shadow(0 0 7px rgba(230, 50, 20, .55)) drop-shadow(0 4px 6px #050303e6); }
.game-option:active { transform: translateY(1px); }
.game-option.primary .option-plate { animation: ember-pulse 2.6s ease-in-out 2.4s infinite; }
@keyframes ember-pulse {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(230, 50, 20, .35)) drop-shadow(0 4px 6px #050303e6); }
  50% { filter: drop-shadow(0 0 11px rgba(255, 70, 25, .7)) drop-shadow(0 4px 6px #050303e6); }
}

.gateway-cast {
  --cast-inset: max(clamp(32px, 5vw, 86px), calc((100% - 1440px) / 2));
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}
.cast-side {
  position: absolute;
  bottom: clamp(38px, 7svh, 80px);
  width: min(31vw, calc((100% - 480px) / 2), 550px);
}
.cast-left { left: var(--cast-inset); }
.cast-right { right: var(--cast-inset); }
.cast-figure {
  position: absolute;
  bottom: 0;
  aspect-ratio: 2 / 3;
}
.cast-side .cast-front { z-index: 1; width: min(79%, 52svh); }
.cast-side .cast-back { bottom: clamp(18px, 5svh, 55px); width: min(68%, 46.6svh); }
.cast-left .cast-front, .cast-right .cast-back { left: 0; }
.cast-right .cast-front, .cast-left .cast-back { right: 0; }
.cast-ninja { transform: scaleX(-1); }
/* Yüzü/silahı sahnenin ortasına çevirmek için yansıtma (giriş animasyonuyla çakışmaz) */
.cast-flip { position: relative; width: 100%; height: 100%; transform: scaleX(-1); }

/* Hafif canlılık: nefes alma + ağırlık aktarma salınımı (ayaklar sabit) */
.cast-sway, .cast-body { position: relative; width: 100%; height: 100%; transform-origin: 50% 97%; }
.cast-sway { animation: cast-sway 7.6s ease-in-out var(--phase, 0s) infinite; }
.cast-body { animation: cast-breathe 4.4s ease-in-out var(--phase, 0s) infinite; }
@keyframes cast-sway {
  0%, 100% { transform: rotate(0deg) translateX(0); }
  25% { transform: rotate(.85deg) translateX(.7%); }
  50% { transform: rotate(.1deg) translateX(.1%); }
  75% { transform: rotate(-.8deg) translateX(-.65%); }
}
@keyframes cast-breathe {
  0%, 100% { transform: scale(1, 1); }
  45% { transform: scale(1.0035, 1.0075); }
}
.cast-figure img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
/* Botların temas gölgeleri, karakterlerle birlikte ölçeklenir. */
.cast-body::before, .cast-body::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: var(--boot-left);
  top: var(--boot-left-y, 99%);
  width: 24%;
  height: 4%;
  transform: translate(-50%, -35%);
  background: radial-gradient(ellipse, #0a0605e8 16%, #1109078c 43%, transparent 73%);
}
.cast-body::after { left: var(--boot-right); top: var(--boot-right-y, 99%); }
.cast-left .cast-front { --boot-left: 28.8%; --boot-right: 82.9%; }
.cast-left .cast-back { --boot-left: 55%; --boot-right: 62%; }
.cast-right .cast-back { --boot-left: 42.3%; --boot-right: 74.7%; }
.cast-right .cast-front { --boot-left: 19%; --boot-right: 58%; }
.cast-img { filter: drop-shadow(0 8px 14px #1006049c); }
/* Etek, pelerin ve kumaş: belden aşağısı rüzgârda çok hafif dalgalanır */
.cast-cloth {
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, transparent 0 46%, #000 60%, #000 84%, transparent 93%);
  mask-image: linear-gradient(180deg, transparent 0 46%, #000 60%, #000 84%, transparent 93%);
  transform-origin: 50% 50%;
  animation: cloth-wave 5.2s ease-in-out var(--phase, 0s) infinite;
}
@keyframes cloth-wave {
  0%, 100% { transform: skewX(0deg) scaleX(1); }
  25% { transform: skewX(-.55deg) scaleX(1.004); }
  55% { transform: skewX(.4deg) scaleX(.998); }
  80% { transform: skewX(-.2deg) scaleX(1.002); }
}

/* Kılıç parlaması: sadece bıçak maskesi içinde ışık süpürmesi + nabız gibi aura + uçta yıldız parıltısı */
.blade {
  --glow: #e0201a;
  --core: rgba(255, 215, 200, .95);
  --aura: rgba(200, 20, 15, .85);
  --dur: 4.8s;
  --delay: 0s;
  --mask: linear-gradient(#0000, #0000); /* gerçek maske silah-maskeleri*.css ile sonradan gelir */
  position: absolute;
  left: var(--l); top: var(--t); width: var(--w); height: var(--h);
  pointer-events: none;
  filter: drop-shadow(0 0 1.5px rgba(255, 110, 90, .9)) drop-shadow(0 0 6px rgba(220, 25, 15, .7)) drop-shadow(0 0 15px rgba(140, 0, 0, .55));
}
.blade::before, .blade::after {
  content: '';
  position: absolute;
  inset: 0;
  -webkit-mask: var(--mask) center / 100% 100% no-repeat;
  mask: var(--mask) center / 100% 100% no-repeat;
}
.blade::after {
  background: var(--aura);
  opacity: .1;
  mix-blend-mode: plus-lighter;
  animation: blade-pulse 3.4s ease-in-out var(--phase, 0s) infinite;
}
.blade::before {
  z-index: 1;
  background: linear-gradient(var(--angle), transparent 0 40%, rgba(210, 25, 15, .45) 45%, var(--core) 48.5%, rgba(210, 25, 15, .45) 52%, transparent 57% 100%);
  background-size: 300% 300%;
  background-position: var(--from);
  animation: blade-sweep var(--dur) cubic-bezier(.55, .05, .35, 1) var(--delay) infinite;
}
@keyframes blade-pulse {
  0%, 100% { opacity: .06; }
  50% { opacity: .2; }
}
@keyframes blade-sweep {
  0% { background-position: var(--from); }
  30%, 100% { background-position: var(--to); }
}
.glint {
  position: absolute;
  z-index: 2;
  left: var(--tx); top: var(--ty);
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  background:
    radial-gradient(circle, #fff 0 6%, rgba(255, 120, 100, .8) 14%, transparent 40%),
    linear-gradient(90deg, transparent 0 48%, rgba(255, 170, 150, .95) 49% 51%, transparent 52%) center / 100% 2px no-repeat,
    linear-gradient(0deg, transparent 0 48%, rgba(255, 170, 150, .95) 49% 51%, transparent 52%) center / 2px 100% no-repeat;
  opacity: 0;
  transform: scale(.2) rotate(0deg);
  animation: blade-glint var(--dur) ease-out var(--delay) infinite;
}
@keyframes blade-glint {
  0%, 24% { opacity: 0; transform: scale(.2) rotate(0deg); }
  30% { opacity: 1; transform: scale(1) rotate(25deg); }
  42%, 100% { opacity: 0; transform: scale(.3) rotate(60deg); }
}
.blade-savasci {
  --l: 38.379%; --t: 51.432%; --w: 60.84%; --h: 22.331%;
  --angle: 118deg; --from: 100% 100%; --to: 0% 0%;
  --tx: 99%; --ty: 97%;
  --delay: .6s;
}
.blade-sura {
  --l: 4.199%; --t: 54.948%; --w: 22.168%; --h: 35.612%;
  --angle: 201deg; --from: 0% 100%; --to: 100% 0%;
  --tx: 2%; --ty: 99%;
  --dur: 5.4s;
  --delay: 2.2s;
}
.blade-ninja-l, .blade-ninja-r { --dur: 4.2s; }
.blade-saman {
  --l: 7.422%; --t: 12.044%; --w: 45.996%; --h: 21.94%;
  --angle: 0deg; --from: 50% 0%; --to: 50% 100%;
  --tx: 53.9%; --ty: 25.8%;
  --dur: 4.6s;
  --delay: 1s;
}

/* Kabzadan uca sarmal gibi kıvrılarak akan kızıl enerji (parilti.js konumlandırır) */
.flow {
  position: absolute;
  z-index: 3;
  left: 0; top: 0;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffe9e2 0 16%, #ff4a30 38%, rgba(190, 8, 0, .65) 60%, transparent 72%);
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}
.flow-head { background: radial-gradient(circle, #fff 0 20%, #ff7a60 40%, rgba(220, 20, 10, .7) 60%, transparent 72%); }

/* +9 silah parıltısı: bıçak çevresinde yanıp sönen kızıl yıldızlar (parilti.js üretir) */
.spark {
  position: absolute;
  z-index: 3;
  width: calc(var(--size, 10px) * var(--k, 1));
  height: calc(var(--size, 10px) * var(--k, 1));
  margin: calc(var(--size, 10px) * var(--k, 1) / -2) 0 0 calc(var(--size, 10px) * var(--k, 1) / -2);
  background: radial-gradient(circle, #fff0ea 0 12%, #ff7a5e 30%, #e81e10 62%, #7a0005 100%);
  clip-path: polygon(50% 0, 57% 43%, 100% 50%, 57% 57%, 50% 100%, 43% 57%, 0 50%, 43% 43%);
  opacity: 0;
  pointer-events: none;
  animation: spark-twinkle 1.1s ease-in-out infinite;
}
.spark.spark-dust {
  clip-path: none;
  border-radius: 50%;
  width: calc(var(--size, 10px) * var(--k, 1) * .45);
  height: calc(var(--size, 10px) * var(--k, 1) * .45);
  background: radial-gradient(circle, #ffe2da 0 30%, #e0281a 55%, transparent 72%);
}
@keyframes spark-twinkle {
  0% { opacity: 0; transform: translate(0, 0) rotate(var(--rot, 0deg)) scale(.1); }
  40% { opacity: 1; transform: translate(calc(var(--drift, 0px) * .4), calc(var(--rise, -8px) * .4)) rotate(calc(var(--rot, 0deg) + 25deg)) scale(1); }
  100% { opacity: 0; transform: translate(var(--drift, 0px), var(--rise, -8px)) rotate(calc(var(--rot, 0deg) + 70deg)) scale(.15); }
}
.blade-ninja-l {
  --l: 3.809%; --t: 47.396%; --w: 17.188%; --h: 6.445%;
  --angle: 245deg; --from: 0% 100%; --to: 100% 0%;
  --tx: 2%; --ty: 97%;
  --delay: 1.4s;
}
.blade-ninja-r {
  --l: 82.227%; --t: 55.664%; --w: 15.527%; --h: 7.096%;
  --angle: 123deg; --from: 100% 100%; --to: 0% 0%;
  --tx: 98%; --ty: 96%;
  --delay: 1.75s;
}


/* ===== Yeni giriş karakterleri (giris2-*) — silah maskeleri ===== */
.blade-g-savasci {
  --l: 8.984%; --t: 0.911%; --w: 23.438%; --h: 33.919%;
  --angle: 15deg; --from: 50% 0%; --to: 50% 100%;
  --tx: 26.7%; --ty: 1.0%;
  --dur: 4.8s;
  --delay: .6s;
}
.blade-g-ninja {
  --l: 50.977%; --t: 51.953%; --w: 39.941%; --h: 23.633%;
  --angle: 118deg; --from: 100% 100%; --to: 0% 0%;
  --tx: 99.1%; --ty: 99.2%;
  --dur: 4.2s;
  --delay: 1.4s;
}
.blade-g-sura {
  --l: 4.59%; --t: 53.385%; --w: 34.277%; --h: 42.708%;
  --angle: 201deg; --from: 0% 100%; --to: 100% 0%;
  --tx: 1.8%; --ty: 99.1%;
  --dur: 5.4s;
  --delay: 2.2s;
}
.blade-g-saman {
  --l: 15.625%; --t: 38.346%; --w: 27.832%; --h: 28.646%;
  --angle: 0deg; --from: 50% 0%; --to: 50% 100%;
  --tx: 1.6%; --ty: 40.6%;
  --dur: 4.6s;
  --delay: 1s;
}

/* ===== Sunucu açılış geri sayımı ===== */
.launch-timer { width: min(100%, 320px); margin-top: clamp(18px, 3.2vh, 30px); text-align: center; }
.launch-timer[hidden] { display: none; }
.timer-title {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  color: #e9c78b; font: 700 11px/1 var(--sans); letter-spacing: .26em;
  text-shadow: 0 1px 3px #000;
}
.timer-title i { flex: 1; max-width: 46px; height: 1px; background: linear-gradient(90deg, transparent, #b58a4a); }
.timer-title i:last-child { transform: scaleX(-1); }
.timer-units { display: flex; justify-content: center; align-items: flex-start; gap: 5px; margin-top: 10px; }
.timer-unit {
  position: relative;
  width: 62px;
  padding: 7px 0 6px;
  border-radius: 4px;
  background:
    linear-gradient(180deg, #ffffff14, transparent 45%, #0000003d) padding-box,
    linear-gradient(180deg, #2a1712, #120a08) padding-box,
    linear-gradient(180deg, #f2d58e, #a87b34 40%, #5c3a12 60%, #c39443) border-box;
  border: 1.5px solid transparent;
  box-shadow: 0 4px 10px #000c, inset 0 0 12px #8a14082e;
}
.timer-unit::before, .timer-unit::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 6px; height: 6px;
  margin-left: -3px;
  background: linear-gradient(135deg, #f2d58e, #8d5f24);
  transform: rotate(45deg);
}
.timer-unit::before { top: -4px; }
.timer-unit::after { bottom: -4px; }
.timer-unit b {
  display: block;
  font: 700 26px/1.05 var(--serif);
  font-variant-numeric: tabular-nums;
  color: #ffe2b0;
  background: linear-gradient(180deg, #fff3d6 10%, #f0b45e 55%, #c2621f);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px #ff3c1a66) drop-shadow(0 1px 1px #000);
}
.timer-unit b.tick { animation: timer-tick .45s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes timer-tick {
  from { transform: translateY(-35%) scale(1.1); opacity: .2; }
  to { transform: none; opacity: 1; }
}
.timer-unit small { display: block; margin-top: 3px; color: #b9a587; font: 700 8.5px/1 var(--sans); letter-spacing: .16em; }
.timer-sep { padding-top: 9px; color: #c39443; font: 700 20px/1 var(--serif); text-shadow: 0 0 6px #ff3c1a88; animation: sep-blink 1s steps(2, jump-none) infinite; }
@keyframes sep-blink { 50% { opacity: .35; } }
.timer-date { margin-top: 9px; color: #cdbfa8; font: italic 400 12px/1.3 var(--serif); letter-spacing: .06em; text-shadow: 0 1px 3px #000; }
.launch-timer.is-open .timer-title { color: #ff8a5c; }
.launch-timer { animation: intro-button .8s cubic-bezier(.3, 1.4, .5, 1) 2s backwards; }

/* ===== Giriş animasyonu (sayfa açılışında bir kez) =====
   0.0s sahne karanlıktan açılıp kamera geri çekilir
   0.35s logo büyükten yakınlaşarak yerine oturur, oturduğu an kızıl ışık patlar
   0.9s karakterler iki yandan yakınlaşarak gelir
   1.5s butonlar sırayla zıplayarak belirir */
.scenery { animation: intro-scene 2.4s cubic-bezier(.2, .7, .2, 1) both; transform-origin: 50% 60%; }
@keyframes intro-scene {
  from { transform: scale(1.22); filter: brightness(.15) saturate(.6); }
  to { transform: scale(1); filter: none; }
}
.frame { animation: intro-fade .8s ease-out 1.7s backwards; }
.gateway-footer { animation: intro-fade .8s ease-out 2.1s backwards; }
@keyframes intro-fade { from { opacity: 0; } }

.wordmark img { animation: intro-logo 1.05s cubic-bezier(.3, .6, .25, 1) .35s backwards; }
@keyframes intro-logo {
  0% { opacity: 0; transform: scale(2.4); filter: blur(14px) brightness(2); }
  55% { opacity: 1; transform: scale(.93); filter: blur(0) brightness(1.6); }
  75% { transform: scale(1.035); filter: brightness(1.15); }
  100% { opacity: 1; transform: scale(1); filter: none; }
}
.wordmark::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: -20% -10%;
  background: radial-gradient(closest-side, #ffd2a8e6, #ff4a1fa0 35%, #9a0a0040 60%, transparent 75%);
  opacity: 0;
  pointer-events: none;
  animation: intro-burst 1.1s ease-out .9s backwards;
}
@keyframes intro-burst {
  0% { opacity: 0; transform: scale(.3); }
  18% { opacity: .95; }
  100% { opacity: 0; transform: scale(1.7); }
}
.tagline { animation: intro-tagline 1s ease-out 1.15s backwards; }
@keyframes intro-tagline {
  from { opacity: 0; letter-spacing: .6em; filter: blur(4px); }
}

.cast-figure { animation: intro-cast-left 1s cubic-bezier(.16, .84, .3, 1) .9s backwards; }
.cast-right .cast-figure { animation-name: intro-cast-right; }
.cast-left .cast-front { animation-delay: .9s; }
.cast-right .cast-front { animation-delay: 1s; }
.cast-left .cast-back { animation-delay: 1.15s; }
.cast-right .cast-back { animation-delay: 1.25s; }
@keyframes intro-cast-left {
  from { opacity: 0; translate: -14% 3%; scale: 1.16; filter: brightness(.3) blur(5px); }
  to { opacity: 1; translate: 0 0; scale: 1; filter: none; }
}
@keyframes intro-cast-right {
  from { opacity: 0; translate: 14% 3%; scale: 1.16; filter: brightness(.3) blur(5px); }
  to { opacity: 1; translate: 0 0; scale: 1; filter: none; }
}

.game-option { animation: intro-button .7s cubic-bezier(.3, 1.5, .5, 1) backwards; }
.game-option:nth-child(1) { animation-delay: 1.5s; }
.game-option:nth-child(2) { animation-delay: 1.64s; }
.game-option:nth-child(3) { animation-delay: 1.78s; }
@keyframes intro-button {
  from { opacity: 0; scale: .55; translate: 0 14px; filter: brightness(2.2); }
  to { opacity: 1; scale: 1; translate: 0 0; filter: none; }
}

.gateway-footer { display: flex; justify-content: center; align-items: center; gap: 12px; padding-bottom: clamp(13px, 1.6vh, 21px); text-align: center; }
.gateway-footer > span { width: clamp(12px, 4.5vw, 50px); height: 1px; background: linear-gradient(90deg, transparent, #977950); }
.gateway-footer > span:last-child { transform: scaleX(-1); }
.gateway-footer p { color: #ded0b8; font-size: 9px; line-height: 1.45; font-weight: 680; letter-spacing: .15em; }
.gateway-footer i { display: inline-block; width: 4px; height: 4px; transform: translateY(-2px) rotate(45deg); margin-inline: 4px; background: #d1a96d; }

.game-dialog {
  position: fixed;
  width: min(500px, calc(100% - 36px));
  max-height: calc(100dvh - 36px);
  padding: clamp(23px, 4vw, 34px);
  border: 1px solid var(--edge);
  border-radius: 9px;
  background: linear-gradient(150deg, #25241f, #161818 70%);
  box-shadow: inset 0 0 0 3px #c69d5b14, 0 16px 70px #000b;
  color: var(--ink);
}
.game-dialog::backdrop { background: #090c10cc; backdrop-filter: blur(4px); }
.game-dialog h2 { margin-block: 8px 13px; font: 700 clamp(1.6rem, 4.4vw, 2.4rem)/1.08 var(--serif); }
.game-dialog p:not(.dialog-kicker) { color: var(--soft); }
.dialog-kicker { color: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: .16em; padding-right: 28px; }
.close-button { position: absolute; right: 10px; top: 10px; display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid #796143; border-radius: 5px; background: #211e17; color: var(--gold); cursor: pointer; }
.close-button:hover { border-color: var(--gold); }
.dialog-link { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); margin-top: 16px; font-size: 13px; font-weight: 700; }
.dialog-link:hover { text-decoration: underline; }
.dialog-link svg { width: 15px; height: 15px; }

@media (max-width: 900px) {
  .gateway { grid-template-rows: 1fr auto auto; }
  .gateway-cast {
    position: relative;
    z-index: auto;
    justify-self: center;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(4px, 2vw, 16px);
    width: min(calc(100% + 40px), 590px);
    margin-bottom: 14px;
  }
  .cast-side { position: static; width: auto; display: flex; align-items: end; }
  .cast-side .cast-figure.cast-front, .cast-side .cast-figure.cast-back { position: relative; width: 50%; }
  .cast-side .cast-figure.cast-back { bottom: auto; margin-bottom: 5%; }
  .glint { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
  .spark { --k: .55; }
}
@media (max-width: 640px) {
  .gateway { padding: 31px 31px 18px; }
  .gateway-content { padding-bottom: 24px; }
  .scenery { --scenery-position: 74% 100%; }
  .scenery::after {
    background:
      radial-gradient(ellipse at 50% 48%, #170b0b66 9%, #160b0b4a 58%, #1008099e 100%),
      linear-gradient(0deg, #100809b8 0%, transparent 16%, transparent 84%, #13090950);
  }
  .game-menu { width: min(100%, 272px); }
  .game-option { padding-inline: 44px; font-size: 15px; }
  .timer-unit { width: 54px; }
  .timer-unit b { font-size: 22px; }
  .gateway-footer { padding-bottom: 11px; gap: 8px; }
  .gateway-footer p { font-size: 8px; letter-spacing: .105em; }
}
@media (max-height: 860px) and (min-width: 901px) {
  .gateway { padding-top: clamp(22px, 3.5vh, 40px); }
  .wordmark { width: min(100%, 545px, 52svh); }
  .tagline { margin-top: 8px; }
  .game-menu { gap: 6px; margin-top: clamp(14px, 2.6vh, 26px); }
  .game-option { min-height: 46px; }
  .launch-timer { margin-top: 14px; }
  .timer-units { margin-top: 7px; }
  .timer-unit { padding: 5px 0 4px; }
  .timer-unit b { font-size: 23px; }
  .timer-date { margin-top: 5px; }
}
@media (max-height: 700px) and (min-width: 901px) {
  .wordmark { width: min(100%, 545px, 44svh); }
  .timer-date { display: none; }
}
@media (max-height: 520px) and (min-width: 641px) {
  .gateway { padding-top: 24px; padding-bottom: 11px; }
  .gateway-content { padding-bottom: 14px; }
  .game-menu { gap: 6px; margin-top: 17px; }
  .game-option { min-height: 44px; }
  .launch-timer { margin-top: 12px; }
  .timer-units { margin-top: 6px; }
  .timer-unit { padding: 4px 0; }
  .timer-unit b { font-size: 20px; }
  .timer-date { display: none; }
  .gateway-footer { padding-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .meteor-shower, .impact-light, .cast-cloth, .scenery-flags { display: none; }
}

/* Giriş ekranı ince ayar: Savaşçı Ninja ile aynı boyda, Şaman biraz daha sağda */
.cast-left .cast-front { width: min(90%, 59svh); }
.cast-left .cast-back { right: -13%; }
.cast-left .cast-front { left: -10%; }
.cast-left .cast-back { right: -16%; }

/* ===== Yeni menü düğmeleri (görsel çerçeve) ===== */
.game-option {
  min-height: 0;
  aspect-ratio: 900 / 164;
  padding: 0 14%;
  border-radius: 0;
  background: url('./assets/buton-demir.webp') center / 100% 100% no-repeat;
  filter: drop-shadow(0 4px 6px #050303e6);
  transition: color .25s ease, transform .2s ease, filter .3s ease;
}
.game-option .option-plate { display: none; }
.game-option::before {
  content: '';
  position: absolute;
  z-index: 0;
  inset: 0;
  background: url('./assets/buton-kizil.webp') center / 100% 100% no-repeat;
  opacity: 0;
  transition: opacity .3s ease;
  pointer-events: none;
}
.game-option::after { inset: 22% 7.5%; clip-path: none; }
.game-option:is(:hover, :focus-visible)::before { opacity: 1; }
.game-option:is(:hover, :focus-visible) { filter: drop-shadow(0 0 9px rgba(230, 50, 20, .6)) drop-shadow(0 4px 6px #050303e6); }
.game-option.primary::before { opacity: 1; }
.game-option.primary { animation: intro-button .7s cubic-bezier(.3, 1.5, .5, 1) 1.5s backwards, btn-ember 2.6s ease-in-out 2.4s infinite; }
@keyframes btn-ember {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(230, 50, 20, .35)) drop-shadow(0 4px 6px #050303e6); }
  50% { filter: drop-shadow(0 0 12px rgba(255, 70, 25, .75)) drop-shadow(0 4px 6px #050303e6); }
}
@media (max-width: 760px) { .game-option { min-height: 0; padding-inline: 14%; } }

/* Ekran dışındaki silahlarda efektler bekler (parilti.js işaretler) */
.blade[data-idle], .blade[data-idle] *, .blade[data-idle]::before, .blade[data-idle]::after { animation-play-state: paused !important; }

/* Dikey telefonlarda arka planın yalnızca görünen kare bölümü yüklenir (aynı konum, aynı görüntü) */
@media (max-width: 640px) and (orientation: portrait) {
  .scenery { background-image: url('./assets/metin-vadisi-uc-koy-dikey.webp'); }
}
/* Geri sayım yeri baştan ayrılır; tarih yazısı gelince sayfa kaymaz */
.timer-date { min-height: 1.3em; }

/* Slogan tek satırda kalır: açılıştaki harf aralığı animasyonu alttaki menüyü ve karakterleri itmez */
.tagline { display: flex; justify-content: center; width: 100%; min-width: 0; white-space: nowrap; }
@media (max-width: 340px) { .tagline { white-space: normal; } }
