/* ==========================================================================
   V MetroWay — Şans Çarkı  |  kiosk / tablet arayüzü
   ========================================================================== */

:root {
  --lacivert: #1F2A5A;
  --lacivert-koyu: #16204A;
  --kirmizi: #ED1C24;
  --kirmizi-koyu: #C4141B;
  --krem: #F6F4EF;
  --kagit: #FFFFFF;
  --metin: #17203F;
  --gri: #6B7392;
  --golge: 0 24px 60px rgba(31, 42, 90, .18);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  color: var(--metin);
  background:
    radial-gradient(1200px 700px at 50% -10%, #FFFFFF 0%, rgba(255,255,255,0) 65%),
    radial-gradient(900px 600px at 12% 105%, rgba(237,28,36,.10) 0%, rgba(237,28,36,0) 60%),
    radial-gradient(900px 600px at 88% 100%, rgba(31,42,90,.12) 0%, rgba(31,42,90,0) 60%),
    var(--krem);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ------------------------------------------------------------------ SAHNE */

.stage {
  position: relative;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(6px, 1.1vh, 14px) 16px clamp(6px, 1vh, 12px);
  gap: clamp(4px, 0.7vh, 10px);
}

/* ------------------------------------------------------------------ BAŞLIK */

.head { text-align: center; flex: 0 0 auto; }

.head__logo {
  height: clamp(32px, 5vh, 56px);
  width: auto;
  display: block;
  margin: 0 auto clamp(3px, 0.6vh, 8px);
}

.head__kicker {
  font-size: clamp(11px, 1.6vh, 15px);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--kirmizi);
  font-weight: 700;
}

.head__title {
  font-size: clamp(18px, 2.9vh, 32px);
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--lacivert);
  margin-top: 2px;
}

/* -------------------------------------------------------------------- ÇARK */

.wheelbox {
  container-type: size;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: clamp(6px, 1.1vw, 18px);
  position: relative;
}

.wheelbox__disc {
  position: relative;
  width: min(100%, 100cqh);
  height: auto;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  border-radius: 50%;
  filter: drop-shadow(0 18px 34px rgba(31, 42, 90, .26));
}

.wheelbox__disc canvas {
  position: absolute;
  inset: 0;
  margin: auto;
  display: block;
}

.wheelbox__pointer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -22%);
  width: clamp(34px, 5.2vh, 58px);
  height: auto;
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .3));
}

.wheelbox__hub {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 24%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--kagit);
  box-shadow: 0 6px 18px rgba(23, 32, 63, .28), 0 0 0 6px rgba(255, 255, 255, .55);
  display: grid;
  place-items: center;
  z-index: 2;
  pointer-events: none;
}

.wheelbox__hub img { width: 78%; height: auto; display: block; }

/* -------------------------------------------------------------------- ALT */

.foot {
  flex: 0 0 auto;
  text-align: center;
  display: grid;
  gap: 5px;
  justify-items: center;
}

.spin {
  font-family: inherit;
  font-size: clamp(17px, 2.7vh, 28px);
  font-weight: 800;
  letter-spacing: .16em;
  color: #fff;
  background: linear-gradient(180deg, #F5323A 0%, var(--kirmizi) 45%, var(--kirmizi-koyu) 100%);
  border: 0;
  border-radius: 999px;
  padding: clamp(11px, 1.7vh, 18px) clamp(40px, 7vw, 80px);
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(237, 28, 36, .34), inset 0 -3px 0 rgba(0, 0, 0, .18);
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease;
  animation: nabiz 2.4s ease-in-out infinite;
}

.spin:active { transform: translateY(3px) scale(.985); }

.spin:disabled {
  background: #B9BECF;
  box-shadow: none;
  animation: none;
  cursor: default;
  filter: saturate(.4);
}

.spin.is-spinning .spin__label::after {
  content: "";
}

@keyframes nabiz {
  0%, 100% { box-shadow: 0 12px 26px rgba(237, 28, 36, .34), inset 0 -3px 0 rgba(0, 0, 0, .18), 0 0 0 0 rgba(237, 28, 36, .35); }
  50%      { box-shadow: 0 12px 26px rgba(237, 28, 36, .34), inset 0 -3px 0 rgba(0, 0, 0, .18), 0 0 0 22px rgba(237, 28, 36, 0); }
}

.foot__hint {
  font-size: clamp(11px, 1.6vh, 15px);
  color: var(--gri);
  font-weight: 600;
}

/* ------------------------------------------------------- STOK ŞERİDİ */

.stockbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 3px 12px;
  max-width: 92vw;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: var(--lacivert);
  opacity: .55;
  pointer-events: none;
}

.stockbar span { white-space: nowrap; }
.stockbar i { font-style: normal; font-weight: 500; opacity: .6; }
.stockbar .is-out { text-decoration: line-through; opacity: .45; }

.secret-zone {
  position: fixed;
  left: 0; bottom: 0;
  width: 90px; height: 90px;
  z-index: 40;
}

/* ---------------------------------------------------------------- SONUÇ */

.result {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(23, 32, 63, .55);
  backdrop-filter: blur(6px);
  animation: fade .28s ease both;
  padding: 20px;
}

.result[hidden] { display: none; }

.result__confetti {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.result__card {
  position: relative;
  background: var(--kagit);
  border-radius: 28px;
  padding: clamp(26px, 4.4vh, 46px) clamp(24px, 5vw, 58px);
  text-align: center;
  box-shadow: var(--golge);
  max-width: 560px;
  width: 100%;
  animation: yukari .42s cubic-bezier(.16, 1, .3, 1) both;
  border-top: 7px solid var(--kirmizi);
}

.result__eyebrow {
  font-size: clamp(12px, 1.8vh, 16px);
  letter-spacing: .3em;
  font-weight: 800;
  color: var(--kirmizi);
}

.result__icon {
  font-size: clamp(52px, 9vh, 92px);
  line-height: 1.1;
  margin: clamp(6px, 1.4vh, 14px) 0;
  animation: zipla .7s ease both .1s;
}

.result__name {
  font-size: clamp(26px, 4.6vh, 46px);
  font-weight: 800;
  color: var(--lacivert);
  line-height: 1.15;
}

.result__sub {
  font-size: clamp(14px, 2vh, 19px);
  color: var(--gri);
  margin-top: 2px;
}

.result__note {
  margin-top: clamp(10px, 1.8vh, 18px);
  font-size: clamp(12px, 1.7vh, 15px);
  color: var(--gri);
  line-height: 1.5;
}

.result__ok {
  margin-top: clamp(16px, 2.6vh, 26px);
  font-family: inherit;
  font-size: clamp(15px, 2.1vh, 20px);
  font-weight: 800;
  letter-spacing: .14em;
  color: #fff;
  background: var(--lacivert);
  border: 0;
  border-radius: 999px;
  padding: 14px 54px;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(31, 42, 90, .3);
}

.result__ok:active { transform: translateY(2px); }

.result--empty { background: rgba(246, 244, 239, .96); backdrop-filter: none; }
.result--empty .result__card { border-top-color: var(--lacivert); }

/* -------------------------------------------------------- GÖREVLİ MENÜSÜ */

.admin {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(23, 32, 63, .62);
  padding: 20px;
}

.admin[hidden] { display: none; }

.admin__card {
  background: #fff;
  border-radius: 22px;
  padding: 26px;
  width: min(440px, 100%);
  box-shadow: var(--golge);
}

.admin__card h3 {
  font-size: 18px;
  color: var(--lacivert);
  margin-bottom: 14px;
}

.admin__stock { display: grid; gap: 6px; margin-bottom: 18px; }

.admin__stock div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 7px 10px;
  border-radius: 9px;
  background: #F4F6FB;
}

.admin__stock b { color: var(--lacivert); }

.admin__total {
  margin-top: 6px;
  background: #FDECEC !important;
  font-weight: 700;
}

.admin__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.admin__btn {
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 13px 8px;
  border-radius: 12px;
  border: 2px solid var(--lacivert);
  background: #fff;
  color: var(--lacivert);
  cursor: pointer;
}

.admin__btn--danger { border-color: var(--kirmizi); color: var(--kirmizi); }

.admin__close {
  width: 100%;
  margin-top: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 13px;
  border: 0;
  border-radius: 12px;
  background: var(--lacivert);
  color: #fff;
  cursor: pointer;
}

/* ------------------------------------------------------------ ANİMASYON */

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@keyframes yukari {
  from { opacity: 0; transform: translateY(26px) scale(.96); }
  to   { opacity: 1; transform: none; }
}

@keyframes zipla {
  0%   { transform: scale(.3); opacity: 0; }
  60%  { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); }
}

/* Geniş ekran (yatay tablet / TV): başlık ile çark yan yana durmasın,
   sadece çark büyüsün. */
@media (min-aspect-ratio: 3/2) {
  .head__title { font-size: clamp(18px, 4.4vh, 34px); }
  .stage { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .spin { animation: none; }
}

/* ==========================================================================
   KATILIM FORMU (1. ekran)
   ========================================================================== */

/* display:flex/grid tanımlı öğelerde hidden özniteliği ezilmesin */
[hidden] { display: none !important; }

/* Form, çarkın üzerinde duran bir katmandır (çark arkada dönmeye devam eder). */
.formbox {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 16px;
}

/* Form ekranındayken çark geri plana çekilir, ÇEVİR butonu gizlenir
   (yerini korur ki çarkın boyutu iki ekranda da aynı kalsın). */
.stage.is-form .wheelbox {
  opacity: .72;
  filter: blur(1.1px);
  pointer-events: none;
}

.stage.is-form .foot { visibility: hidden; }

.stage .wheelbox { transition: opacity .45s ease, filter .45s ease; }

.form {
  width: min(680px, 100%);
  background: var(--kagit);
  border-radius: 24px;
  border-top: 7px solid var(--kirmizi);
  box-shadow: var(--golge);
  padding: clamp(18px, 3vh, 34px) clamp(18px, 4vw, 40px);
  display: grid;
  gap: clamp(12px, 1.8vh, 20px);
}

.form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(10px, 1.6vh, 18px);
}

.form__field { display: grid; gap: 6px; }

.form__field span {
  font-size: clamp(11px, 1.5vh, 14px);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gri);
}

.form__field input {
  font-family: inherit;
  font-size: clamp(16px, 2.2vh, 21px);
  font-weight: 600;
  color: var(--metin);
  background: #F4F6FB;
  border: 2px solid #DDE2F0;
  border-radius: 14px;
  padding: clamp(11px, 1.7vh, 16px) 16px;
  width: 100%;
  transition: border-color .15s ease, background .15s ease;
}

.form__field input:focus {
  outline: none;
  border-color: var(--lacivert);
  background: #fff;
}

.form__field input::placeholder { color: #A9B2D0; font-weight: 500; }

.form__check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: clamp(12px, 1.7vh, 15px);
  line-height: 1.45;
  color: var(--metin);
  cursor: pointer;
}

.form__check input {
  flex: 0 0 auto;
  width: clamp(22px, 2.8vh, 28px);
  height: clamp(22px, 2.8vh, 28px);
  margin-top: 1px;
  accent-color: var(--kirmizi);
  cursor: pointer;
}

.form__kvkk {
  font-size: clamp(11px, 1.5vh, 13px);
  color: var(--gri);
  border-top: 1px solid #E9EDF8;
  padding-top: 10px;
}

.form__kvkk summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--lacivert);
  list-style: none;
}

.form__kvkk summary::before { content: "ⓘ "; }
.form__kvkk summary::-webkit-details-marker { display: none; }
.form__kvkk p { margin-top: 8px; line-height: 1.55; }

.form__err {
  margin: 0;
  padding: 11px 16px;
  border-radius: 12px;
  background: #FDECEC;
  color: var(--kirmizi-koyu);
  font-size: clamp(12px, 1.7vh, 15px);
  font-weight: 700;
}

.spin--form { justify-self: center; animation: none; }

/* Dar / dikey ekranlarda form tek sütuna insin */
@media (max-width: 560px) {
  .form__grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   QR KARTLARI (çark ekranının iki yanı)
   ========================================================================== */

.qr {
  display: grid;
  justify-items: center;
  gap: 6px;
  background: var(--kagit);
  border-radius: 18px;
  padding: clamp(10px, 1.6vh, 16px) clamp(10px, 1.2vw, 18px);
  box-shadow: 0 12px 30px rgba(31, 42, 90, .13);
  width: clamp(116px, 13vw, 200px);
  text-align: center;
}

.qr__ikon {
  width: clamp(20px, 2.6vh, 28px);
  height: clamp(20px, 2.6vh, 28px);
  color: var(--kirmizi);
}

.qr--maps .qr__ikon { color: #2FA37C; }

.qr__baslik {
  font-size: clamp(11px, 1.5vh, 14px);
  font-weight: 800;
  color: var(--lacivert);
  line-height: 1.2;
}

/* QR görselleri kare değil (altında marka şeridi var) — oran serbest bırakıldı. */
.qr__kod {
  width: 100%;
  max-width: 176px;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #fff;
}

.qr__alt {
  font-size: clamp(10px, 1.3vh, 12px);
  font-weight: 600;
  color: var(--gri);
  line-height: 1.25;
  word-break: break-word;
}

/* Dar veya dikey ekran: çark üstte, iki QR altında yan yana */
@media (max-width: 899px), (max-aspect-ratio: 4/5) {
  .wheelbox {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    align-content: stretch;
    gap: clamp(8px, 1.4vh, 16px);
  }
  .wheelbox__disc {
    grid-row: 1;
    grid-column: 1 / -1;
    height: 100%;
    width: auto;
    aspect-ratio: 1 / 1;
    max-width: 100%;
    justify-self: center;
    align-self: center;
  }
  .qr--maps  { grid-row: 2; grid-column: 1; }
  .qr--insta { grid-row: 2; grid-column: 2; }
  .qr        { width: min(100%, 240px); align-self: end; }
  .qr__kod   { max-width: 160px; }
}
