/* Merycare Şans Çarkı — fuar kiosk arayüzü */

/* Yazı tipleri uygulamayla birlikte sunulur: dışarıya bağlanılmaz, internet
   olmasa da çalışır ve Türkçe karakterlerin tamamı tek dosyada bulunur.
   Dosyaları yeniden üretmek için: python3 tools/build_fonts.py */

@font-face {
  font-family: 'Baloo 2';
  src: url('../assets/fonts/baloo2.woff2') format('woff2-variations'),
       url('../assets/fonts/baloo2.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/poppins-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/poppins-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Poppins';
  src: url('../assets/fonts/poppins-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --bordo: #882830;
  --bordo-mid: #6E1F27;
  --bordo-dark: #4E141B;
  --bordo-deep: #350C11;
  --krem: #FDF6EC;
  --krem-soft: #F6E5D2;
  --altin: #D9A441;
  --altin-light: #F5D98C;
  --ink: #3A1015;

  --font-display: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --radius: 24px;
  --shadow-lift: 0 24px 60px rgba(30, 6, 10, 0.45);
}

* { box-sizing: border-box; }

/* display tanımlı bileşenlerde de hidden niteliği geçerli olsun. */
[hidden] { display: none !important; }

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

body {
  font-family: var(--font-body);
  color: var(--krem);
  background: var(--bordo-deep);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* Zemin: derin bordo ışık havuzu + yumuşak pati deseni */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 72% 42%, rgba(168, 52, 60, 0.55), transparent 58%),
    radial-gradient(circle at 12% 88%, rgba(217, 164, 65, 0.18), transparent 50%),
    linear-gradient(160deg, var(--bordo-mid) 0%, var(--bordo-dark) 45%, var(--bordo-deep) 100%);
  z-index: -2;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='%23FDF6EC'%3E%3Cellipse cx='40' cy='52' rx='13' ry='11'/%3E%3Cellipse cx='26' cy='33' rx='5.5' ry='7'/%3E%3Cellipse cx='39' cy='27' rx='5.5' ry='7'/%3E%3Cellipse cx='52' cy='33' rx='5.5' ry='7'/%3E%3Cellipse cx='59' cy='45' rx='5' ry='6'/%3E%3Cellipse cx='104' cy='118' rx='10' ry='8.5'/%3E%3Cellipse cx='93' cy='103' rx='4.2' ry='5.4'/%3E%3Cellipse cx='103' cy='98' rx='4.2' ry='5.4'/%3E%3Cellipse cx='113' cy='103' rx='4.2' ry='5.4'/%3E%3Cellipse cx='119' cy='112' rx='3.8' ry='4.6'/%3E%3C/g%3E%3C/svg%3E");
  z-index: -1;
  pointer-events: none;
}

/* ---------- düzen ---------- */

.app {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(8px, 1.1vh, 14px) clamp(12px, 1.8vw, 28px);
  gap: clamp(4px, 0.7vh, 10px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  background: none;
  border: 0;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.brand__logo {
  height: clamp(34px, 4.6vh, 58px);
  width: auto;
  filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
  opacity: 0.96;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.counter {
  font-size: clamp(11px, 1.4vh, 14px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(253, 246, 236, 0.6);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(253, 246, 236, 0.16);
  white-space: nowrap;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(253, 246, 236, 0.18);
  background: rgba(253, 246, 236, 0.07);
  color: var(--krem);
  font-size: 17px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.2s;
}

.icon-btn:hover { background: rgba(253, 246, 236, 0.16); transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.94); }

.icon-btn--quiet {
  width: 26px;
  height: 26px;
  margin-left: auto;
  opacity: 0.22;
  border-color: rgba(253, 246, 236, 0.1);
  background: transparent;
}

.icon-btn--quiet:hover,
.icon-btn--quiet:focus-visible {
  opacity: 0.65;
  background: rgba(253, 246, 236, 0.08);
  transform: none;
}

.icon-btn--quiet .icon {
  width: 13px;
  height: 13px;
}

/* ---------- ikonlar ---------- */

.icon {
  width: 20px;
  height: 20px;
  display: block;
  flex: none;
}

.icon-btn .icon { width: 19px; height: 19px; }

.icon--result {
  width: clamp(54px, 9vh, 92px);
  height: clamp(54px, 9vh, 92px);
  stroke-width: 1.5;
}

.icon--row { width: 17px; height: 17px; }

.stage {
  display: grid;
  grid-template-columns: minmax(240px, 30%) minmax(0, 1fr);
  /* Kolonlar satır yüksekliğini doldurur; çarkın ölçüsü buradan hesaplanır.
     "center" kullanılırsa kolon yüksekliği içeriğe bağlı kalır ve çark kendi
     kapsayıcısını taşırır. */
  align-items: stretch;
  gap: clamp(10px, 2vw, 28px);
  min-height: 0;
}

/* ---------- sol panel ---------- */

.panel {
  position: relative;
  min-height: 0;
  min-width: 0;
  display: grid;
  align-content: center;
}

.screen {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.45s;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.6vh, 20px);
  align-items: flex-start;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

/* Pasif adımlar akıştan çıkarılır: aksi hâlde panelin yüksekliğini en uzun adım
   (QR ekranı) belirler ve diğer adımlarda çarka boşuna yer kalmaz. */
.screen:not(.is-active) {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.eyebrow {
  margin: 0;
  font-size: clamp(11px, 1.5vh, 14px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--altin-light);
  font-weight: 600;
}

.headline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(34px, 6.4vh, 74px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-shadow: 0 6px 26px rgba(28, 6, 10, 0.5);
}

.headline--sm { font-size: clamp(30px, 5.4vh, 60px); }

.headline em {
  font-style: normal;
  color: var(--altin-light);
}

.claim {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(13px, 1.9vh, 19px);
  letter-spacing: 0.3em;
  color: var(--krem);
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(217, 164, 65, 0.5);
  background: rgba(217, 164, 65, 0.12);
}

.lede {
  margin: 0;
  font-size: clamp(14px, 1.95vh, 19px);
  line-height: 1.6;
  color: rgba(253, 246, 236, 0.86);
  max-width: 46ch;
}

.fineprint {
  margin: 0;
  font-size: clamp(11px, 1.5vh, 14px);
  color: rgba(253, 246, 236, 0.55);
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.steps li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px 8px 8px;
  border-radius: 999px;
  background: rgba(253, 246, 236, 0.08);
  border: 1px solid rgba(253, 246, 236, 0.12);
  font-size: clamp(12px, 1.6vh, 15px);
  font-weight: 500;
  backdrop-filter: blur(6px);
}

.steps__num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--altin);
  color: var(--bordo-deep);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
}

/* ---------- QR adımı ---------- */

.qr {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
  padding: clamp(14px, 2vh, 22px);
  border-radius: var(--radius);
  background: rgba(253, 246, 236, 0.1);
  border: 1px solid rgba(253, 246, 236, 0.16);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lift);
}

.qr__image {
  width: clamp(120px, 19vh, 186px);
  height: auto;
  border-radius: 16px;
  background: #fff;
  padding: 8px;
  flex: none;
}

.qr__text {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.qr__text strong {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.9vh, 30px);
  color: var(--altin-light);
}

.qr__text span {
  font-size: clamp(12px, 1.7vh, 16px);
  line-height: 1.55;
  color: rgba(253, 246, 236, 0.85);
}

.qr__text a {
  color: rgba(253, 246, 236, 0.6);
  font-size: clamp(11px, 1.5vh, 14px);
  text-decoration: none;
  border-bottom: 1px dotted rgba(253, 246, 236, 0.4);
  align-self: flex-start;
}

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

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(14px, 1.9vh, 18px);
  letter-spacing: 0.02em;
  border: 0;
  border-radius: 999px;
  padding: 14px 30px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s, filter 0.22s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.96); }

.btn--primary {
  background: linear-gradient(155deg, var(--altin-light), var(--altin) 55%, #B9822A);
  color: var(--bordo-deep);
  box-shadow: 0 12px 30px rgba(217, 164, 65, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn--primary:hover { filter: brightness(1.06); transform: translateY(-2px); }

.btn--ghost {
  background: rgba(253, 246, 236, 0.09);
  color: var(--krem);
  border: 1px solid rgba(253, 246, 236, 0.22);
}

.btn--ghost:hover { background: rgba(253, 246, 236, 0.17); }

.btn--danger {
  background: rgba(196, 68, 75, 0.2);
  color: #FFD9D9;
  border: 1px solid rgba(230, 120, 126, 0.45);
}

.btn--danger:hover { background: rgba(196, 68, 75, 0.34); }

.btn--xl {
  padding: clamp(14px, 2.1vh, 21px) clamp(30px, 4vw, 54px);
  font-size: clamp(16px, 2.3vh, 23px);
}

.btn--spin {
  position: relative;
  overflow: hidden;
  animation: pulse 2.6s ease-in-out infinite;
}

.btn--spin::after {
  content: '';
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: sheen 2.8s ease-in-out infinite;
}

.btn--spin.is-busy,
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  animation: none;
  transform: none;
}

.btn--spin.is-busy::after { display: none; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 12px 30px rgba(217, 164, 65, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
  50% { box-shadow: 0 16px 46px rgba(217, 164, 65, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.5); }
}

@keyframes sheen {
  0% { left: -60%; }
  55%, 100% { left: 120%; }
}

.linkish {
  background: none;
  border: 0;
  color: rgba(58, 16, 21, 0.55);
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 2px;
}

/* ---------- çark ---------- */

.wheel-wrap {
  position: relative;
  min-height: 0;
  min-width: 0;
  display: grid;
  place-items: center;
}

/* Ölçü JS tarafından --wheel-size ile verilir; burada boyut tanımlanmaz. */
.wheel {
  display: block;
  touch-action: manipulation;
  cursor: pointer;
}

.wheel-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--wheel-size, 60%);
  height: var(--wheel-size, 60%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 164, 65, 0.32), transparent 68%);
  filter: blur(38px);
  animation: breathe 5.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes breathe {
  0%, 100% { opacity: 0.55; transform: translate(-50%, -50%) scale(0.97); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
}

.attract {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s, visibility 0.5s;
  cursor: pointer;
}

.attract.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.attract__badge {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 18px 34px;
  border-radius: var(--radius);
  background: rgba(53, 12, 17, 0.82);
  border: 1px solid rgba(217, 164, 65, 0.55);
  backdrop-filter: blur(8px);
  animation: bob 2.4s ease-in-out infinite;
  box-shadow: var(--shadow-lift);
}

.attract__badge strong {
  font-family: var(--font-display);
  font-size: clamp(20px, 3.4vh, 36px);
  color: var(--altin-light);
  letter-spacing: 0.06em;
}

.attract__badge span {
  font-size: clamp(11px, 1.6vh, 15px);
  color: rgba(253, 246, 236, 0.75);
}

@keyframes bob {
  0%, 100% { transform: translateY(-6px); }
  50% { transform: translateY(6px); }
}

/* ---------- alt bilgi ---------- */

.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(8px, 1.1vh, 11px);
  letter-spacing: 0.04em;
  text-transform: none;
  color: rgba(253, 246, 236, 0.38);
}

.footer__credit {
  color: inherit;
  background: none;
  border: 0;
  padding: 6px 12px;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: none;
  cursor: default;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- konfeti ---------- */

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 120;
}

/* ---------- modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 20px;
}

.modal.is-open {
  display: grid;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(28, 6, 10, 0.72);
  backdrop-filter: blur(8px);
}

.modal__card {
  position: relative;
  background: linear-gradient(170deg, #FFFDF9, var(--krem-soft));
  color: var(--ink);
  border-radius: 30px;
  box-shadow: var(--shadow-lift), 0 0 0 1px rgba(217, 164, 65, 0.45);
  transform: translateY(26px) scale(0.96);
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal.is-open .modal__card { transform: none; }

/* ---------- kazanan kartı ---------- */

.result {
  position: relative;
  width: min(560px, 100%);
  padding: clamp(22px, 3.4vh, 38px);
  text-align: center;
  align-items: center;
  gap: clamp(8px, 1.2vh, 14px);
  overflow-y: auto;
}

.result__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  color: var(--bordo);
  border-color: rgba(58, 16, 21, 0.2);
  background: rgba(58, 16, 21, 0.06);
}

.result__close:hover {
  background: rgba(58, 16, 21, 0.13);
}

.result__ribbon {
  align-self: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(11px, 1.6vh, 14px);
  letter-spacing: 0.28em;
  color: #fff;
  background: linear-gradient(120deg, var(--bordo), #B23A42);
  padding: 7px 26px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(136, 40, 48, 0.35);
}

.result__icon {
  display: grid;
  place-items: center;
  color: var(--bordo);
  padding: clamp(10px, 1.6vh, 18px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 164, 65, 0.28), rgba(136, 40, 48, 0.08) 70%);
  animation: popIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal[data-jackpot='true'] .result__icon {
  color: #B9822A;
  background: radial-gradient(circle, rgba(217, 164, 65, 0.5), rgba(217, 164, 65, 0) 72%);
}

@keyframes popIn {
  0% { transform: scale(0.2) rotate(-25deg); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

.result__label {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 4.2vh, 40px);
  line-height: 1.12;
  color: var(--bordo);
}

.modal[data-jackpot='true'] .result__label {
  font-size: clamp(36px, 7vh, 72px);
  letter-spacing: 0.06em;
  color: #B9822A;
}

.result__note {
  margin: 0;
  font-size: clamp(13px, 1.9vh, 17px);
  line-height: 1.55;
  color: rgba(58, 16, 21, 0.75);
  max-width: 40ch;
}

.result__code {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  border-radius: 14px;
  border: 2px dashed rgba(136, 40, 48, 0.32);
  background: rgba(136, 40, 48, 0.05);
}

.result__code span {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(58, 16, 21, 0.5);
}

.result__code strong {
  font-family: var(--font-display);
  font-size: clamp(18px, 2.6vh, 24px);
  letter-spacing: 0.1em;
  color: var(--bordo);
}

/* Kart içeriği ekrana sığmadığında kaydırılır; onay düğmeleri her zaman
   görünür kalsın diye alta sabitlenir. */
.result__actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  width: 100%;
  margin-top: 6px;
  padding: 12px 0 2px;
  background: linear-gradient(to top, var(--krem-soft) 58%, rgba(246, 229, 210, 0));
}

.result__actions:empty { display: none; }

/* Modal zemini açık olduğu için buton varyantları koyu metne çevrilir. */
.modal__card .btn--ghost {
  background: rgba(58, 16, 21, 0.07);
  color: rgba(58, 16, 21, 0.78);
  border-color: rgba(58, 16, 21, 0.18);
}

.modal__card .btn--ghost:hover { background: rgba(58, 16, 21, 0.13); }

.modal__card .btn--danger {
  background: rgba(179, 38, 46, 0.1);
  color: #A81F27;
  border-color: rgba(179, 38, 46, 0.35);
}

.modal__card .btn--danger:hover { background: rgba(179, 38, 46, 0.18); }

/* Büyük ödül vurgusu */
.modal[data-jackpot='true'] .modal__card {
  box-shadow: var(--shadow-lift), 0 0 0 3px var(--altin), 0 0 70px rgba(217, 164, 65, 0.55);
}

.modal[data-jackpot='true'] .result__ribbon {
  background: linear-gradient(120deg, #B9822A, var(--altin-light), #B9822A);
  color: var(--bordo-deep);
}

/* ---------- görevli notu ---------- */

.staff {
  width: 100%;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.3s;
  text-align: left;
}

.staff.is-open {
  max-height: 260px;
  opacity: 1;
}

.staff__theme {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: #fff;
  background: var(--bordo);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.staff__pitch {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(58, 16, 21, 0.8);
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(136, 40, 48, 0.07);
  border-left: 3px solid var(--altin);
}

/* ---------- çekiliş formu ---------- */

.raffle {
  width: 100%;
  text-align: left;
  padding: 16px;
  border-radius: 18px;
  background: rgba(217, 164, 65, 0.14);
  border: 1px solid rgba(217, 164, 65, 0.45);
  transition: transform 0.1s;
}

.raffle.has-error { animation: shake 0.4s; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

.raffle__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--bordo);
}

.raffle__title-icon { display: flex; color: #B9822A; }
.raffle__title-icon .icon { width: 18px; height: 18px; }

.raffle__grid {
  display: grid;
  gap: 10px;
}

.raffle label,
.settings-grid label,
.admin-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(58, 16, 21, 0.65);
}

.raffle input[type='text'],
.raffle input[type='tel'],
.settings-grid input,
.admin-field input,
.admin__pin input {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 13px;
  border-radius: 11px;
  border: 1px solid rgba(58, 16, 21, 0.2);
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.raffle input:focus,
.settings-grid input:focus,
.admin-field input:focus,
.admin__pin input:focus {
  border-color: var(--altin);
  box-shadow: 0 0 0 3px rgba(217, 164, 65, 0.25);
}

.raffle__consent {
  flex-direction: row;
  align-items: flex-start;
  gap: 9px;
  margin-top: 11px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 8px;
  padding: 4px;
}

.raffle__consent.has-error {
  background: rgba(196, 68, 75, 0.2);
  animation: shake 0.4s;
}

.raffle__consent input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--bordo); flex: none; }

/* ---------- yönetim paneli ---------- */

.admin {
  width: min(900px, 100%);
  max-height: calc(100dvh - 40px);
}

.admin__pin {
  padding: 34px;
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.admin__pin h2,
.admin__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--bordo);
  font-size: 24px;
}

.admin__pin input {
  width: 170px;
  text-align: center;
  font-size: 26px;
  letter-spacing: 0.4em;
}

.admin__body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.admin__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
}

.admin__head .icon-btn {
  color: var(--bordo);
  border-color: rgba(58, 16, 21, 0.2);
  background: rgba(58, 16, 21, 0.06);
}

.admin__scroll {
  overflow-y: auto;
  padding: 16px 24px 26px;
  display: grid;
  gap: 16px;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(58, 16, 21, 0.12);
  overflow-x: auto;
}

.tab {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border: 0;
  background: none;
  color: rgba(58, 16, 21, 0.55);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.tab.is-active {
  color: var(--bordo);
  border-bottom-color: var(--altin);
}

.muted {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(58, 16, 21, 0.55);
}

.muted code {
  background: rgba(58, 16, 21, 0.08);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 12px;
}

.error { margin: 0; color: #B3262E; font-size: 13px; min-height: 18px; }

.admin-list { display: grid; gap: 8px; }

.admin-row {
  display: grid;
  grid-template-columns: 12px minmax(140px, 1fr) 92px 92px 54px 82px;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 14px;
  background: rgba(58, 16, 21, 0.05);
  border: 1px solid rgba(58, 16, 21, 0.09);
}

.admin-row.is-off { opacity: 0.48; }

.admin-row__swatch { width: 12px; height: 30px; border-radius: 4px; }

.admin-row__name {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
  font-size: 14px;
  color: var(--ink);
}

.admin-row__name .icon { color: var(--bordo); }

.admin-row__chance {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--bordo);
  text-align: right;
}

.admin-field span { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.admin-field input { padding: 7px 9px; font-size: 14px; }

.admin-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: rgba(58, 16, 21, 0.7);
  cursor: pointer;
}

.admin-switch input { width: 17px; height: 17px; accent-color: var(--bordo); }
.admin-switch--block { padding: 10px 2px; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(136, 40, 48, 0.1), rgba(217, 164, 65, 0.14));
  border: 1px solid rgba(136, 40, 48, 0.16);
  display: grid;
  gap: 3px;
}

.stat-card strong {
  font-family: var(--font-display);
  font-size: 30px;
  color: var(--bordo);
  line-height: 1;
}

.stat-card span { font-size: 12px; color: rgba(58, 16, 21, 0.6); }

.stat-bars { display: grid; gap: 7px; }

.stat-bar {
  display: grid;
  grid-template-columns: minmax(120px, 1.4fr) 3fr 36px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.stat-bar__label { color: rgba(58, 16, 21, 0.75); }

.stat-bar__track {
  height: 10px;
  border-radius: 999px;
  background: rgba(58, 16, 21, 0.09);
  overflow: hidden;
}

.stat-bar__fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--bordo), var(--altin));
  transition: width 0.5s ease;
}

.stat-bar__value {
  font-family: var(--font-display);
  color: var(--bordo);
  text-align: right;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 9px 11px;
  border-bottom: 1px solid rgba(58, 16, 21, 0.1);
}

.admin-table th {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--bordo);
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

/* ---------- uyarlanabilir düzen ---------- */

/* Dar ya da dikey ekranlarda çark üste alınır.
   Çark alanı en az %30 yükseklik alır, panel kalanı kullanır ve gerekirse
   kendi içinde kayar; böylece hiçbir koşulda üst üste binme olmaz. */
@media (max-width: 1024px), (orientation: portrait) {
  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(46vh, 1fr) auto;
    gap: clamp(8px, 1.6vh, 22px);
  }

  .wheel-wrap { order: -1; }

  .panel {
    max-height: 56vh;
    overflow: hidden;
  }

  .screen {
    align-items: center;
    text-align: center;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 2px;
  }

  .lede, .steps { justify-content: center; }
  .lede { max-width: 40ch; }
  .qr { flex-direction: column; text-align: center; }
  .qr__text { align-items: center; }
  .headline { font-size: clamp(26px, 5vh, 46px); }
  .headline--sm { font-size: clamp(24px, 4.4vh, 40px); }

  .topbar {
    position: relative;
    justify-content: center;
  }

  .icon-btn--quiet {
    position: absolute;
    right: 0;
    top: 50%;
    margin-left: 0;
    transform: translateY(-50%);
  }

  .icon-btn--quiet:hover,
  .icon-btn--quiet:focus-visible,
  .icon-btn--quiet:active {
    transform: translateY(-50%);
  }
}

/* Telefon: üst çubuk ve tipografi sıkılaştırılır, çarka daha çok yer kalır. */
@media (max-width: 560px) {
  .app { padding: 10px 14px; gap: 8px; }

  .brand__logo { height: 32px; }
  .counter { display: none; }
  .icon-btn { width: 38px; height: 38px; }
  .icon-btn--quiet { width: 26px; height: 26px; }

  .headline { font-size: clamp(25px, 4.6vh, 34px); }
  .headline--sm { font-size: clamp(23px, 4.2vh, 31px); }
  .claim { font-size: 12px; letter-spacing: 0.2em; padding: 6px 14px; }
  .lede { font-size: 14px; line-height: 1.5; }
  .eyebrow { font-size: 11px; letter-spacing: 0.16em; }

  .steps { gap: 6px; }
  .steps li { padding: 5px 11px 5px 5px; font-size: 12px; gap: 6px; }
  .steps__num { width: 21px; height: 21px; font-size: 12px; }

  .btn--xl { padding: 13px 30px; font-size: 17px; }
  .qr__image { width: 140px; }
  .footer { font-size: 9px; letter-spacing: 0.1em; }
}

/* Telefonda tanıtım paragrafı gizlenir; öne çıkan şey çarkın kendisi olmalı.
   Daha da alçak ekranlarda adım rozetleri de kaldırılır. */
@media (max-width: 560px) {
  .lede { display: none; }
}

@media (max-width: 560px) and (max-height: 700px) {
  .steps { display: none; }
  .stage { grid-template-rows: minmax(48vh, 1fr) auto; }
}

/* Telefon yatay: ekran çok alçak, iki kolona dönülür. */
@media (orientation: landscape) and (max-height: 500px) {
  .stage {
    grid-template-columns: 1fr minmax(0, 1.05fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 14px;
  }

  .wheel-wrap { order: 0; }
  .panel { max-height: none; overflow: visible; }
  .screen { align-items: flex-start; text-align: left; }

  .topbar {
    position: static;
    justify-content: space-between;
  }

  .icon-btn--quiet {
    position: static;
    top: auto;
    right: auto;
    margin-left: auto;
    transform: none;
  }
  .lede, .steps, .fineprint { display: none; }
  .headline, .headline--sm { font-size: clamp(20px, 7vh, 30px); }
  .footer { display: none; }
}

/* Yatay ama alçak ekranlarda (dizüstü) dikey boşlukları kıs. */
@media (orientation: landscape) and (max-height: 760px) {
  .steps li { padding: 6px 13px 6px 6px; }
  .steps__num { width: 22px; height: 22px; font-size: 12px; }
}

@media (max-width: 720px) {
  .admin-row {
    grid-template-columns: 10px minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      'swatch name   name'
      'swatch weight stock'
      'swatch toggle chance';
    gap: 9px 10px;
    align-items: center;
  }

  .admin-row__swatch { grid-area: swatch; height: 100%; }
  .admin-row__name { grid-area: name; }
  .admin-field--weight { grid-area: weight; }
  .admin-field--stock { grid-area: stock; }
  .admin-row__chance { grid-area: chance; }
  .admin-switch { grid-area: toggle; }

  .stat-bar { grid-template-columns: 1fr 2fr 30px; font-size: 12px; }
}

/* Telefonda pencereler ekranı daha verimli kullansın. */
@media (max-width: 560px) {
  .modal { padding: 10px; }
  .modal__card { max-height: calc(100dvh - 20px); border-radius: 24px; }

  .result { padding: 18px 16px 14px; }
  .result__label { font-size: 25px; }
  .result__note { font-size: 14px; }
  .result__actions .btn { flex: 1 1 100%; }

  .raffle { padding: 13px; }
  .raffle__consent { font-size: 11.5px; }

  .admin__head { padding: 16px 16px 10px; }
  .admin__scroll { padding: 14px 16px 20px; }
  .tabs { padding: 0 16px; }
  .tab { padding: 9px 12px; font-size: 13px; }
  .admin__pin { padding: 26px 18px; }

  .stat-cards { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .stat-card { padding: 12px 9px; }
  .stat-card strong { font-size: 22px; }
  .stat-card span { font-size: 10.5px; }

  .admin-table { font-size: 12px; }
  .admin-table th, .admin-table td { padding: 7px 6px; }
}

/* Hareket azaltma tercihi */
@media (prefers-reduced-motion: reduce) {
  .btn--spin, .btn--spin::after, .wheel-glow, .attract__badge, .result__icon {
    animation: none;
  }
}
