/* Cleopatra Ink Diyarbakır — şans çarkı
   Görsel dil logodan gelir: düz renk, kalın siyah kontur, altın, koyu kırmızı. */

:root {
  --black: #0b0909;
  --coal: #151111;
  --red: #8e1118;
  --red-deep: #5c0a10;
  --red-hot: #c21d25;
  /* Altın tonları logodan ölçüldü. */
  --gold: #f2b53a;
  --gold-hi: #fbd36a;
  --gold-deep: #9a6c1c;
  --bone: #f4ecdd;
  --mute: #a89c8d;

  --display: 'Big Shoulders Display', 'Arial Narrow', Impact, sans-serif;
  --sans: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --bounce: cubic-bezier(0.3, 1.45, 0.4, 1);
  --logo-h: clamp(96px, 17dvh, 168px);
  --size: min(92vw, calc(100dvh - var(--logo-h) - 262px), 540px);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--black);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.4;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: column;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

button { font: inherit; color: inherit; }
button:focus-visible,
input:focus-visible { outline: 3px solid var(--bone); outline-offset: 3px; }

/* Zemin: çarkın arkasında yayılan kırmızı baskı noktaları */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(90% 40% at 50% 0%, rgba(142, 17, 24, 0.5), transparent 70%),
    var(--black);
}
.bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--red) 2.1px, transparent 2.6px);
  background-size: 13px 13px;
  -webkit-mask-image: radial-gradient(85% 44% at 50% 62%, #000 20%, transparent 78%);
  mask-image: radial-gradient(85% 44% at 50% 62%, #000 20%, transparent 78%);
  opacity: 0.85;
}

/* ------------------------------------------------------------ açılış */

.splash {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: var(--black);
  display: grid;
  place-items: center;
  transition: opacity 0.7s ease 0.15s;
}
.splash i {
  grid-area: 1 / 1;
  width: 62vw;
  max-width: 300px;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  margin-top: -6dvh;
}
.splash i:nth-child(1) { background: radial-gradient(circle, var(--red) 2.4px, transparent 3px) 0 0 / 14px 14px; -webkit-mask-image: radial-gradient(circle, #000 30%, transparent 70%); mask-image: radial-gradient(circle, #000 30%, transparent 70%); }
.splash i:nth-child(2) { border: 5px solid var(--gold); }
body.is-stamp .splash i:nth-child(1) { animation: burst 1.1s 0.3s var(--ease) forwards; }
body.is-stamp .splash i:nth-child(2) { animation: ring 0.75s 0.3s ease-out forwards; }
body.is-stamp .splash { animation: shake 0.32s 0.3s linear; }
body.is-flying .splash { opacity: 0; pointer-events: none; }
@keyframes burst { 0% { opacity: 0; transform: scale(0.4); } 30% { opacity: 1; } 100% { opacity: 0.9; transform: scale(2.3); } }
@keyframes ring { 0% { opacity: 1; transform: scale(0.7); } 100% { opacity: 0; transform: scale(2.6); border-width: 1px; } }
@keyframes shake {
  0%, 100% { transform: none; }
  20% { transform: translate(-5px, 4px); }
  40% { transform: translate(5px, -3px); }
  60% { transform: translate(-3px, 2px); }
  80% { transform: translate(2px, -1px); }
}

/* ------------------------------------------------------------- üst bant */

.top {
  position: relative;
  z-index: 90;
  display: flex;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 10px) 20px 0;
}
.logo {
  --mark-h: calc(var(--logo-h) * 0.87);
  display: flex;
  transform-origin: 50% 0;
  transition: transform 0.8s var(--ease);
}
.logo__fly { transform: translate(var(--fx, 0px), var(--fy, 0px)) scale(var(--fs, 1)); }
.logo__stamp { display: flex; flex-direction: column; align-items: center; }
.logo__mark { position: relative; height: var(--mark-h); aspect-ratio: 900 / 931; }
.logo img { display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 5px 0 rgba(0, 0, 0, 0.55)); }
/* Logonun yazısıyla aynı karakterde şehir adı: beyaz harf, kalın siyah kontur */
.logo__city {
  margin-top: calc(var(--mark-h) * -0.03);
  font: 900 calc(var(--mark-h) * 0.128) / 1 'Cinzel', Georgia, serif;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: #fff;
  -webkit-text-stroke: 0.24em var(--black);
  paint-order: stroke fill;
  text-shadow: 0 0.13em 0 var(--black);
}
/* Logodaki gibi yalnızca baş ve son harf süslü */
.logo__city b { font-family: 'Cinzel Decorative', 'Cinzel', Georgia, serif; font-weight: 900; font-size: 1.22em; }
.logo__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(112deg, transparent 42%, rgba(255, 255, 255, 0.85) 50%, transparent 58%) no-repeat;
  background-size: 300% 100%;
  background-position: 150% 0;
  -webkit-mask: url('/img/logo.webp') center / contain no-repeat;
  mask: url('/img/logo.webp') center / contain no-repeat;
  mix-blend-mode: soft-light;
  pointer-events: none;
  animation: shine 7s 4s ease-in-out infinite;
}
@keyframes shine { 0% { background-position: 150% 0; } 16%, 100% { background-position: -50% 0; } }

body.is-intro:not(.is-stamp) .logo { opacity: 0; }
body.is-stamp .logo__stamp { animation: stamp 0.62s cubic-bezier(0.55, 0, 0.9, 0.4) backwards; }
body.is-stamp .logo__shine { animation: shine-once 0.9s 0.62s ease-in-out backwards; }
body.is-flying .logo__fly { transition: transform 0.95s cubic-bezier(0.7, 0, 0.15, 1); }
@keyframes stamp {
  0% { opacity: 0; transform: scale(2.6) rotate(-16deg); }
  50% { opacity: 1; transform: scale(0.9) rotate(2deg); animation-timing-function: var(--bounce); }
  100% { transform: none; }
}
@keyframes shine-once { from { background-position: 150% 0; } to { background-position: -50% 0; } }

.sound {
  position: absolute;
  right: 12px;
  top: calc(env(safe-area-inset-top) + 12px);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding-bottom: 12px;
  background: var(--black);
  border: 2px solid var(--gold);
  border-radius: 50%;
  cursor: pointer;
}
.sound i { width: 3px; height: 14px; background: var(--gold); transform-origin: 50% 100%; animation: eq 1s ease-in-out infinite; }
.sound i:nth-child(2) { animation-delay: -0.4s; }
.sound i:nth-child(3) { animation-delay: -0.7s; }
.sound[aria-pressed='false'] { border-color: #4a403a; }
.sound[aria-pressed='false'] i { animation: none; transform: scaleY(0.22); background: #4a403a; }
@keyframes eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }

/* ------------------------------------------------------------ kayan şerit */

.tape {
  position: relative;
  z-index: 5;
  margin: 10px -12px 0;
  padding: 5px 0 4px;
  background: var(--red);
  border-top: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.6);
  transform: rotate(-2deg);
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 0.35s ease;
}
.tape__track {
  display: inline-flex;
  font: 800 17px/1.2 var(--display);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  animation: tape 24s linear infinite;
  will-change: transform;
}
.tape__track span { padding: 0 12px; }
.tape__track b { font-weight: 800; color: var(--gold-hi); }
@keyframes tape { to { transform: translateX(-50%); } }

/* ---------------------------------------------------------------- sahne */

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  gap: 12px;
  padding: calc(var(--size) * 0.1 + 6px) 20px calc(env(safe-area-inset-bottom) + 18px);
}

.wheel-wrap {
  position: relative;
  width: var(--size);
  aspect-ratio: 1;
  flex: none;
  transition: transform 0.8s var(--ease);
}
.wheel-shadow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #000;
  transform: translateY(3.4%);
  box-shadow: 0 0 60px 10px rgba(142, 17, 24, 0.45);
}
.wheel { position: absolute; inset: 0; border-radius: 50%; will-change: transform; }
.wheel-svg { display: block; width: 100%; height: 100%; }
.seg { transition: opacity 0.6s ease; }
.seg.is-dim { opacity: 0.25; }
.seg-win { opacity: 0; }
.seg-win.is-on { opacity: 1; animation: win-pulse 0.9s steps(2, jump-none) infinite; }
@keyframes win-pulse { 50% { stroke: var(--gold); } }

/* Çemberdeki ampuller sırayla yanıp söner; çark dönerken hızlanır */
.bulb { animation: bulb 1.1s steps(1) infinite; }
.bulb--b { animation-delay: -0.55s; }
body.is-busy .bulb { animation-duration: 0.28s; }
body.is-busy .bulb--b { animation-delay: -0.14s; }
@keyframes bulb { 0% { opacity: 1; } 50% { opacity: 0.22; } }

.pointer {
  position: absolute;
  left: 50%;
  top: -9.4%;
  width: 10.6%;
  margin-left: -5.3%;
  z-index: 3;
  transform-origin: 50% 28%;
  filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.5));
  will-change: transform;
}

.hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 23.2%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  z-index: 2;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--black);
  background: radial-gradient(circle at 38% 30%, var(--gold-hi), var(--gold) 58%, #d9982a);
  box-shadow: inset 0 0 0 3px var(--black), inset 0 0 0 5.5px rgba(255, 233, 168, 0.8), inset 0 -7px 0 3px rgba(122, 82, 16, 0.55);
  transition: transform 0.2s var(--bounce), filter 0.4s ease;
}
.hub span {
  display: block;
  font: 900 calc(var(--size) * 0.064) / 1 var(--display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transform: translateY(-4%);
}
.hub:active { transform: translate(-50%, -50%) scale(0.92); }
.hub::after {
  content: '';
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  border: 3px solid var(--gold-hi);
  opacity: 0;
  animation: pulse 2s ease-out infinite;
}
@keyframes pulse { 0% { opacity: 0.9; transform: scale(0.9); } 100% { opacity: 0; transform: scale(1.5); } }
body.is-busy .hub::after,
body.is-done .hub::after { animation: none; }
body.is-done .hub { cursor: default; filter: saturate(0.55) brightness(0.62); }

.sparks { position: absolute; left: -30%; top: -30%; width: 160%; height: 160%; z-index: 4; pointer-events: none; }

/* --------------------------------------------------------------- butonlar */

.cta { width: 100%; max-width: 420px; text-align: center; transition: opacity 0.35s ease; }
.btn {
  position: relative;
  display: block;
  width: 100%;
  min-height: 60px;
  padding: 10px 20px 8px;
  border: 0;
  border-radius: 14px;
  background: var(--gold);
  color: var(--black);
  font: 900 26px/1 var(--display);
  letter-spacing: 0.035em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--gold-deep), 0 6px 0 4px var(--black), 0 0 0 4px var(--black);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.3s ease;
}
.btn:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow: 0 1px 0 var(--gold-deep), 0 1px 0 4px var(--black), 0 0 0 4px var(--black);
}
.btn:disabled { filter: grayscale(1) brightness(0.55); cursor: default; }
#mainBtn:not(:disabled) { animation: nudge 3.4s 2.4s ease-in-out infinite; }
body.is-busy #mainBtn,
body.is-done #mainBtn { animation: none; }
@keyframes nudge {
  0%, 86%, 100% { rotate: 0deg; scale: 1; }
  89% { rotate: -1.6deg; scale: 1.03; }
  93% { rotate: 1.4deg; scale: 1.03; }
  97% { rotate: -0.6deg; scale: 1; }
}
.btn.is-loading { color: transparent; }
.btn.is-loading::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  margin: -12px;
  border-radius: 50%;
  border: 4px solid var(--black);
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fine { margin: 16px auto 0; max-width: 36ch; font-size: 13px; line-height: 1.45; color: var(--mute); }

/* Açılış bitince içerik sahneye girer */
body.is-intro .tape,
body.is-intro .stage,
body.is-intro .sound { opacity: 0; }
body:not(.is-intro) .tape { animation: tape-in 0.7s 0.25s var(--ease) backwards; }
body:not(.is-intro) .wheel-wrap { animation: wheel-in 1s 0.3s var(--bounce) backwards; }
body:not(.is-intro) .cta { animation: pop-in 0.6s 0.75s var(--bounce) backwards; }
body:not(.is-intro) .sound { animation: pop-in 0.5s 0.9s var(--bounce) backwards; }
@keyframes tape-in { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes wheel-in { from { opacity: 0; transform: scale(0.5) rotate(-120deg); } }
@keyframes pop-in { from { opacity: 0; transform: translateY(26px) scale(0.9); } }

/* ------------------------------------------------------------ alt panel */

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 95;
  max-height: calc(100dvh - 12px);
  display: flex;
  flex-direction: column;
  background: var(--coal);
  transform: translateY(calc(100% + 20px));
  visibility: hidden;
  transition: transform 0.7s var(--ease), visibility 0s 0.7s;
}
/* Yırtılmış bilet kenarı */
.sheet::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -11px;
  height: 12px;
  background:
    linear-gradient(135deg, transparent 50%, var(--coal) 50.5%) 0 0 / 18px 12px repeat-x,
    linear-gradient(225deg, transparent 50%, var(--coal) 50.5%) 0 0 / 18px 12px repeat-x;
}
.sheet.is-open { transform: none; visibility: visible; transition: transform 0.7s var(--ease), visibility 0s; }
.sheet.is-full { top: 12px; }
.sheet__grab { flex: none; width: 100%; height: 24px; background: none; border: 0; cursor: pointer; display: grid; place-items: center; }
.sheet__grab span { width: 44px; height: 4px; background: #3a302c; border-radius: 2px; }
.sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 8px 22px calc(env(safe-area-inset-bottom) + 22px); }
.step { max-width: 420px; margin: 0 auto; text-align: center; }
.step[hidden] { display: none; }

.sheet.is-open .step > *,
.sheet.is-open form > * { animation: pop-in 0.55s var(--bounce) backwards; }
.sheet.is-open .step > :nth-child(1) { animation-delay: 0.22s; }
.sheet.is-open .step > :nth-child(2) { animation-delay: 0.3s; }
.sheet.is-open .step > :nth-child(3) { animation-delay: 0.38s; }
.sheet.is-open form > :nth-child(1) { animation-delay: 0.44s; }
.sheet.is-open form > :nth-child(2) { animation-delay: 0.5s; }
.sheet.is-open form > :nth-child(n + 3) { animation-delay: 0.56s; }

.tag {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 13px 2px;
  background: var(--red);
  color: var(--bone);
  font: 900 19px/1.15 var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: rotate(-3deg);
  box-shadow: 3px 3px 0 #000;
}
.prize {
  margin: 0;
  font: 900 clamp(46px, 15vw, 70px) / 0.92 var(--display);
  letter-spacing: 0.005em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--red);
  text-wrap: balance;
}
.prize__desc { margin: 12px auto 20px; max-width: 32ch; font-size: 15px; color: var(--mute); }

.field {
  display: block;
  text-align: left;
  margin-bottom: 12px;
  border: 2px solid #3a302c;
  border-radius: 12px;
  background: var(--black);
  padding: 9px 14px 8px;
  transition: border-color 0.15s ease;
}
.field:focus-within { border-color: var(--gold); }
.field.is-bad { border-color: var(--red-hot); }
.field span { display: block; font: 800 13px/1.2 var(--display); letter-spacing: 0.1em; text-transform: uppercase; color: var(--mute); }
.field input {
  width: 100%;
  border: 0;
  outline: 0;
  background: none;
  color: var(--bone);
  font-family: var(--sans);
  font-size: 19px; /* 16px altı iOS'ta yakınlaştırma yapar */
  font-weight: 600;
  padding: 2px 0 0;
  border-radius: 0;
}
.field input::placeholder { color: #564b45; }
.form-error { min-height: 19px; margin: 0 0 12px; font-size: 14px; font-weight: 500; color: #ff8f86; text-align: left; }

.ticket {
  margin: 2px auto 22px;
  width: min(100%, calc((100dvh - 270px) * 0.8));
  min-width: 220px;
  aspect-ratio: 4 / 5;
}
.ticket img { display: block; width: 100%; height: 100%; -webkit-touch-callout: default; user-select: auto; }
.sheet.is-open .ticket { animation: ticket-in 0.8s 0.25s var(--bounce) backwards; }
@keyframes ticket-in { from { opacity: 0; transform: translateY(60px) rotate(-7deg) scale(0.85); } }

/* Panel açıkken logo küçülür, çark yukarı çekilir; kazanan dilim görünür kalır */
body.has-sheet .tape,
body.has-sheet .cta { opacity: 0; pointer-events: none; }
body.has-sheet .logo { transform: scale(0.46); }
body.has-sheet .wheel-wrap { transform: translateY(calc(var(--lift, 0px) * -1)); }

/* ---------------------------------------------------------------- bildirim */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 24px);
  z-index: 100;
  width: max-content;
  max-width: calc(100vw - 40px);
  padding: 12px 16px;
  background: var(--bone);
  color: var(--black);
  border-radius: 12px;
  box-shadow: 0 5px 0 var(--red);
  font-size: 15px;
  font-weight: 600;
  transform: translate(-50%, 40px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s var(--bounce), opacity 0.25s ease;
}
.toast.is-on { transform: translate(-50%, 0); opacity: 1; }

@media (min-width: 720px) {
  .sheet { left: 50%; right: auto; width: 480px; margin-left: -240px; }
  .tape { margin-left: 0; margin-right: 0; transform: rotate(-1deg); }
}
@media (max-height: 660px) {
  :root { --size: min(92vw, calc(100dvh - var(--logo-h) - 206px), 540px); }
  #ctaNote { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; }
  .wheel-wrap, .sheet, .logo, .logo__fly { transition-duration: 0.01ms !important; }
}
