:root {
  --pembe: #ff7fb0;
  --pembe-koyu: #d94f8a;
  --krem: #fff7fb;
  --mor: #4a2f4f;
  --nane: #8fe3c8;
  --lila: #c3a6ff;
  --altin: #ffc83d;
  --font: 'Baloo 2', ui-rounded, 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #ffe3f0 0%, #ffeedd 55%, #e9e0ff 100%);
  color: var(--mor);
  font-family: var(--font);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button { font-family: inherit; color: inherit; touch-action: manipulation; }

#oyun {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}

/* Üst şerit */
#ust {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 0;
  gap: 8px;
}
.logo { font-weight: 800; font-size: 24px; color: var(--pembe-koyu); letter-spacing: 0.3px; white-space: nowrap; }
.sayaclar { display: flex; gap: 6px; }
@media (max-width: 400px) {
  #ust { padding: 8px 10px 0; gap: 4px; }
  .logo { font-size: 19px; }
  .sayaclar { gap: 4px; }
  .rozet { font-size: 13px; padding: 2px 8px; }
}
.rozet {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.rozet.pembe { background: var(--pembe); color: #fff; }
.rozet.kisi { display: inline-flex; align-items: center; gap: 5px; }
.rozet.kisi i { width: 8px; height: 8px; border-radius: 50%; background: #3fbf7f; box-shadow: 0 0 0 3px rgba(63, 191, 127, 0.25); }

/* Diğer oyuncuların duyurusu (alt kısımda, küçük) */
#akis {
  position: absolute;
  left: 50%;
  bottom: 10px;
  max-width: calc(100% - 32px);
  transform: translate(-50%, 8px);
  background: rgba(74, 47, 79, 0.82);
  color: #fff;
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
#akis.gorunur { opacity: 1; transform: translate(-50%, 0); }

/* 3D sahne */
#sahne { position: relative; flex: 1; min-height: 0; touch-action: none; }
#sahne canvas, #kazanma-sahne canvas { display: block; width: 100%; height: 100%; }

#mesaj {
  position: absolute;
  left: 50%;
  top: 50px;
  max-width: calc(100% - 24px);
  transform: translate(-50%, -8px);
  background: rgba(255, 255, 255, 0.92);
  padding: 6px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 18px;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  width: max-content;
  text-align: center;
  line-height: 1.25;
  box-shadow: 0 4px 14px rgba(217, 79, 138, 0.18);
}
#mesaj.gorunur { opacity: 1; transform: translate(-50%, 0); }

/* Güç çizgisi */
#guc-alani {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  height: 46px;
  transition: opacity 0.2s;
}
#guc-alani.gizli { opacity: 0; }
.guc-baslik { font-weight: 800; font-size: 16px; width: 36px; }
#guc-cubuk {
  position: relative;
  flex: 1;
  height: 22px;
  border-radius: 999px;
  background:
    repeating-linear-gradient(90deg, transparent 0, transparent calc(11.111% - 2px), rgba(74, 47, 79, 0.18) calc(11.111% - 2px), rgba(74, 47, 79, 0.18) 11.111%),
    rgba(255, 255, 255, 0.85);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(74, 47, 79, 0.12);
}
#guc-dolu {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--nane), #ffe07a 55%, var(--pembe));
}
#guc-alani.kilitli #guc-dolu { box-shadow: 0 0 0 3px #fff inset; }
#guc-deger { font-weight: 800; font-size: 20px; width: 40px; text-align: right; font-variant-numeric: tabular-nums; }

/* Kontroller */
#kontroller {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 20px 16px;
}
#yon {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(3, 50px);
  gap: 4px;
}
.yon {
  border: 0;
  border-radius: 16px;
  background: #fff;
  font-size: 22px;
  color: var(--pembe-koyu);
  box-shadow: 0 4px 0 #f3c6da;
  touch-action: none;
}
.yon:active, .yon.basili { transform: translateY(3px); box-shadow: 0 1px 0 #f3c6da; background: #ffe9f3; }
.yon:disabled { opacity: 0.4; }
.yon[data-yon='ileri'] { grid-column: 2; grid-row: 1; }
.yon[data-yon='sol'] { grid-column: 1; grid-row: 2; }
.yon[data-yon='sag'] { grid-column: 3; grid-row: 2; }
.yon[data-yon='geri'] { grid-column: 2; grid-row: 3; }

#ana-buton {
  flex: 0 0 auto;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 35% 30%, #ffb3d1, var(--pembe) 55%, var(--pembe-koyu));
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  box-shadow: 0 7px 0 #b23d70, 0 12px 24px rgba(217, 79, 138, 0.35);
  touch-action: none;
}
#ana-buton:active { transform: translateY(5px); box-shadow: 0 2px 0 #b23d70; }
#ana-buton.tut { background: radial-gradient(circle at 35% 30%, #fff1a8, var(--altin) 55%, #e09a1a); box-shadow: 0 7px 0 #b97710; animation: nabiz 0.6s ease-in-out infinite alternate; }
#ana-buton:disabled { opacity: 0.55; }
@keyframes nabiz { to { transform: scale(1.05); } }

/* Kazanma ekranı */
#kazanma {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background:
    repeating-conic-gradient(from 0deg at 50% 38%, rgba(255, 255, 255, 0.35) 0 10deg, transparent 10deg 20deg),
    radial-gradient(circle at 50% 38%, #fff6c9, #ffd1e6 55%, #d9c6ff);
  z-index: 10;
  animation: belir 0.35s ease-out;
}
#kazanma.gizli, #yukleniyor.gizli { display: none; }
#kazanma-sahne { flex: 1; min-height: 0; }
.kazanma-kart {
  margin: 0 16px calc(20px + env(safe-area-inset-bottom));
  padding: 18px 16px 20px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 28px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(217, 79, 138, 0.2);
}
.kazandin { font-size: 40px; font-weight: 800; color: var(--pembe-koyu); line-height: 1.1; }
#charm-adi { font-size: 22px; font-weight: 800; margin-top: 4px; }
#nadirlik-etiketi {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
}
#nadirlik-etiketi.sik { background: #3fbf8f; }
#nadirlik-etiketi.nadir { background: #8f6bff; }
#nadirlik-etiketi.cokNadir { background: linear-gradient(90deg, #ffb200, #ffd75e, #ffb200); color: #6b4200; }
#tekrar {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 14px;
  border: 0;
  border-radius: 18px;
  background: var(--pembe);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  box-shadow: 0 5px 0 #b23d70;
}
#tekrar:active { transform: translateY(4px); box-shadow: 0 1px 0 #b23d70; }
@keyframes belir { from { opacity: 0; transform: scale(1.04); } }

/* Yükleniyor */
#yukleniyor {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  background: linear-gradient(180deg, #ffe3f0, #e9e0ff);
}
.yukleniyor-logo { font-size: 42px; font-weight: 800; color: var(--pembe-koyu); }
#yukleniyor-yazi { font-size: 18px; max-width: 320px; }

button.rozet { border: 0; cursor: pointer; box-shadow: 0 3px 0 #c74d84; }
button.rozet:active { transform: translateY(2px); box-shadow: 0 1px 0 #c74d84; }

/* Yapboz hapı (sahnenin sol üstü) */
#yapboz-hap {
  position: absolute;
  left: 12px;
  top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 3px 0 #f3c6da;
  cursor: pointer;
}
#yapboz-hap.parladi { animation: parla 0.7s ease-out; }
@keyframes parla { 40% { transform: scale(1.18); background: #fff3b0; } }
.yapboz-simge {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background:
    radial-gradient(circle at 50% 0, var(--krem) 3px, transparent 3.5px),
    radial-gradient(circle at 100% 50%, var(--krem) 3px, transparent 3.5px),
    var(--lila);
}

/* Kayıt daveti */
#davet {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 44px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(217, 79, 138, 0.25);
  font-size: 15px;
  animation: belir 0.3s ease-out;
}
#davet.gizli { display: none; }
#davet b { font-size: 18px; color: var(--pembe-koyu); }
.davet-dugmeler { display: flex; gap: 8px; margin-top: 6px; }
.davet-dugmeler button { flex: 1; padding: 8px; border: 0; border-radius: 12px; font-size: 16px; font-weight: 800; }
#davet-evet { background: var(--pembe); color: #fff; box-shadow: 0 3px 0 #b23d70; }
#davet-sonra { background: #f6eef3; }

/* Panel: koleksiyon, yapboz, hesap */
#panel {
  position: fixed;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #fff2f8, #f3edff);
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  animation: belir 0.25s ease-out;
  -webkit-user-select: text;
  user-select: text;
}
#panel.gizli { display: none; }
.panel-ust { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px 16px; }
.sekmeler { flex: 1; display: flex; gap: 4px; background: rgba(255, 255, 255, 0.7); border-radius: 999px; padding: 4px; }
.sekmeler button { flex: 1; border: 0; background: none; padding: 7px 4px; border-radius: 999px; font-size: 15px; font-weight: 800; }
.sekmeler button.secili { background: var(--pembe); color: #fff; }
#panel-kapat { width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; font-size: 18px; font-weight: 800; }
#panel-icerik { flex: 1; overflow-y: auto; padding: 8px 16px 24px; -webkit-overflow-scrolling: touch; }
#panel h3 { margin: 18px 0 2px; font-size: 19px; }
.bilgi { margin: 6px 0; line-height: 1.35; }
.bilgi.kucuk { font-size: 14px; opacity: 0.8; }
.bilgi.bos { text-align: center; margin-top: 40px; font-size: 17px; }
.not { background: #fff3b0; border-radius: 14px; padding: 10px 12px; margin: 4px 0 8px; }

.oranlar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; margin: 4px 0 12px; }
.oran { padding: 1px 10px; border-radius: 999px; font-weight: 800; color: #fff; }
.oran.sik, .etiket.sik { background: #3fbf8f; }
.oran.nadir, .etiket.nadir { background: #8f6bff; }
.oran.cokNadir, .etiket.cokNadir { background: linear-gradient(90deg, #ffb200, #ffd75e, #ffb200); color: #6b4200; }

.kartlar { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.kart { position: relative; background: #fff; border-radius: 20px; padding: 8px 8px 10px; text-align: center; box-shadow: 0 4px 0 #f3d5e4; }
.kart img { width: 100%; max-width: 120px; aspect-ratio: 1; display: block; margin: 0 auto; }
.kart-ad { font-weight: 800; font-size: 16px; line-height: 1.2; }
.kart-ad.buyuk { font-size: 22px; }
.etiket { display: inline-block; margin: 4px 0; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 800; color: #fff; }
.adet { position: absolute; top: 8px; right: 10px; font-weight: 800; color: var(--pembe-koyu); }
.gercek { margin-top: 4px; width: 100%; padding: 6px; border: 2px solid var(--pembe); border-radius: 12px; background: #fff; color: var(--pembe-koyu); font-weight: 800; font-size: 13px; }
.istendi { margin-top: 6px; font-size: 13px; font-weight: 800; color: #2f9e6f; }

.yapboz-ust { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: 22px; padding: 12px; box-shadow: 0 4px 0 #f3d5e4; }
.parcalar { flex: 0 0 132px; display: grid; gap: 3px; aspect-ratio: 1; }
.parca { border-radius: 7px; }
.parca.dolu { background-color: #fff6fb; box-shadow: inset 0 0 0 1px rgba(217, 79, 138, 0.25); }
.parca.bos { background: #f3eaf0; border: 2px dashed #e2c9d7; }
.parca.yok { visibility: hidden; }
.sayac { margin: 6px 0 0; font-size: 17px; }

.secici { background: #fff; border-radius: 22px; padding: 12px; margin-top: 8px; box-shadow: 0 4px 0 #f3d5e4; }
.secenekler { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.secenekler button { padding: 6px 12px; border: 2px solid #f0d7e4; border-radius: 999px; background: #fff; font-weight: 800; font-size: 14px; }
.secenekler button.secili { border-color: var(--pembe); background: #ffe6f1; }
.secenekler button.renk { width: 36px; height: 36px; padding: 0; border: 3px solid #fff; box-shadow: 0 0 0 2px #f0d7e4; }
.secenekler button.renk.secili { box-shadow: 0 0 0 3px var(--pembe-koyu); }
.secenekler.kapali { opacity: 0.3; pointer-events: none; }
.onizleme { display: flex; align-items: center; gap: 12px; }
.onizleme img { width: 96px; height: 96px; }

button.ana, button.ikincil { width: 100%; margin-top: 8px; padding: 12px; border: 0; border-radius: 16px; font-size: 18px; font-weight: 800; }
button.ana { background: var(--pembe); color: #fff; box-shadow: 0 4px 0 #b23d70; }
button.ana:disabled { background: #e9cddb; box-shadow: none; }
button.ikincil { background: #fff; color: var(--pembe-koyu); border: 2px solid var(--pembe); }

.hesap-kart { background: #fff; border-radius: 22px; padding: 4px 14px 14px; margin-top: 10px; box-shadow: 0 4px 0 #f3d5e4; }
.hesap-kart form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.hesap-kart label { display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 600; }
.hesap-kart input {
  font: inherit;
  font-size: 17px;
  padding: 9px 12px;
  border: 2px solid #f0d7e4;
  border-radius: 12px;
  background: #fffafc;
  color: var(--mor);
}
.hesap-kart input:focus { outline: none; border-color: var(--pembe); }
.hata { margin: 0; min-height: 1.2em; color: #c0392b; font-size: 14px; font-weight: 600; }
.yakinda { margin-top: 10px; text-align: center; }

/* ---------- 4. aşama: makine seçici, kupon ---------- */
#makine-sec {
  position: absolute;
  right: 12px;
  top: 12px;
  max-width: 48%;
  padding: 3px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 3px 0 #f3c6da;
}
#makine-sec.tek { display: none; }
#makine-liste {
  position: absolute;
  right: 12px;
  top: 44px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(74, 47, 79, 0.2);
}
#makine-liste.gizli { display: none; }
#makine-liste button { border: 0; background: none; padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 15px; text-align: left; }
#makine-liste button.secili { background: #ffe6f1; color: var(--pembe-koyu); }
#kazanma-kupon { margin-top: 6px; font-weight: 600; color: #b8572f; }
#kazanma-kupon:empty { display: none; }
.kazanma-dugmeler { display: flex; gap: 8px; margin-top: 12px; }
.kucuk-dugme { flex: 1; padding: 10px 6px; border: 2px solid var(--pembe); border-radius: 14px; background: #fff; color: var(--pembe-koyu); font-size: 16px; font-weight: 800; }
#kazanma.kupon #hediye-et, #kazanma.kupon #kamerada-gor { display: none; }
#ana-ekran {
  position: absolute; left: 16px; right: 16px; bottom: 44px; z-index: 4;
  display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 20px;
  background: #fff; box-shadow: 0 8px 24px rgba(217, 79, 138, 0.25); font-size: 15px;
}
#ana-ekran.gizli, #ana-ekran-ios.gizli { display: none; }
#ana-ekran b { font-size: 18px; color: var(--pembe-koyu); }
#ana-ekran .kucuk { font-size: 13px; opacity: 0.8; }
#ana-ekran-ekle { flex: 1; background: var(--pembe); color: #fff; box-shadow: 0 3px 0 #b23d70; }
#ana-ekran-kapat { flex: 1; background: #f6eef3; }

.sekmeler { overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
.sekmeler::-webkit-scrollbar { display: none; }
.sekmeler button { flex: 0 0 auto; padding: 7px 12px; }

.kupon-kart { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: 20px; padding: 12px; margin-bottom: 10px; box-shadow: 0 4px 0 #f3d5e4; border-left: 8px solid var(--mekan, var(--pembe)); }
.kupon-kart.pasif { opacity: 0.55; }
.kupon-kart > div { flex: 1; min-width: 0; }
.kupon-kart .mekan-ad { font-size: 13px; font-weight: 600; opacity: 0.75; }
.kupon-kart button { flex: 0 0 auto; width: auto; margin: 0; padding: 10px 16px; font-size: 16px; }
.durum-etiket { display: inline-block; margin-top: 4px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #eee; }
.durum-etiket.aktif { background: #d9f7e8; color: #1f6b47; }
.durum-etiket.kullanildi { background: #e8e0f5; color: #5b3f8c; }
.durum-etiket.suresi_doldu { background: #ffe0e0; color: #9b2c2c; }

#kupon-goster {
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 24px; background: #fff; text-align: center; animation: belir 0.25s ease-out;
}
#kupon-goster.gizli { display: none; }
#kupon-goster .qr-kutu { width: min(72vw, 300px); aspect-ratio: 1; }
#kupon-goster .qr-kutu img, #kupon-goster .qr-kutu svg { width: 100%; height: 100%; image-rendering: pixelated; }
#kupon-goster .kod { font-size: 34px; font-weight: 800; letter-spacing: 3px; font-variant-numeric: tabular-nums; }
#kupon-goster .afiyet { font-size: 40px; font-weight: 800; color: #2f9e6f; }
#kupon-goster button { max-width: 320px; }

.pasaport-kart { background: #fff; border-radius: 20px; padding: 12px; margin-bottom: 10px; box-shadow: 0 4px 0 #f3d5e4; }
.pasaport-ust { display: flex; gap: 12px; align-items: center; }
.pasaport-ust img { width: 72px; height: 72px; }
.ilerleme { height: 10px; border-radius: 999px; background: #f3eaf0; overflow: hidden; margin: 6px 0; }
.ilerleme i { display: block; height: 100%; background: linear-gradient(90deg, var(--nane), var(--altin)); border-radius: 999px; }
#harita { height: 260px; border-radius: 20px; overflow: hidden; margin-bottom: 12px; background: #eee; }
.harita-noktasi { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); }

/* ---------- 5. aşama: hediye ve kamera ---------- */
.ust-katman {
  position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #fff2f8, #f3edff); padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
  overflow-y: auto; animation: belir 0.25s ease-out;
}
.ust-katman.gizli { display: none; }
.ust-katman h2 { margin: 16px 0 4px; font-size: 26px; color: var(--pembe-koyu); }
.ust-katman .kapat-x { position: absolute; right: 12px; top: calc(10px + env(safe-area-inset-top)); width: 40px; height: 40px; border: 0; border-radius: 50%; background: #fff; font-size: 18px; font-weight: 800; }
.hediye-onizleme { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 20px; padding: 10px; margin: 8px 0; }
.hediye-onizleme img { width: 80px; height: 80px; }
.ust-katman form { display: flex; flex-direction: column; gap: 8px; }
.ust-katman label { display: flex; flex-direction: column; gap: 2px; font-size: 14px; font-weight: 600; }
.ust-katman input, .ust-katman textarea, .ust-katman select {
  font: inherit; font-size: 17px; padding: 9px 12px; border: 2px solid #f0d7e4; border-radius: 12px; background: #fffafc; color: var(--mor);
}
.ust-katman textarea { min-height: 70px; resize: vertical; }
.kutular { display: flex; gap: 8px; flex-wrap: wrap; }
.kutular button { width: 64px; height: 64px; border-radius: 16px; border: 3px solid #fff; box-shadow: 0 0 0 2px #f0d7e4; }
.kutular button.secili { box-shadow: 0 0 0 3px var(--pembe-koyu); }
.kutular button:disabled { opacity: 0.35; }
.link-kutusu { display: flex; gap: 6px; margin-top: 8px; }
.link-kutusu input { flex: 1; min-width: 0; font-size: 14px; }

#kamera { background: #000; padding: 0; }
#kamera video, #kamera canvas.kamera-3d { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#kamera canvas.kamera-3d { pointer-events: none; }
.kamera-alt { position: absolute; left: 0; right: 0; bottom: calc(20px + env(safe-area-inset-bottom)); display: flex; justify-content: center; align-items: center; gap: 24px; }
.deklansor { width: 76px; height: 76px; border-radius: 50%; border: 6px solid #fff; background: var(--pembe); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); }
.kamera-alt .kucuk-dugme { flex: 0 0 auto; background: rgba(255, 255, 255, 0.9); }
.kamera-uyari { position: absolute; left: 16px; right: 16px; top: 40%; color: #fff; text-align: center; font-size: 17px; }
#kamera .kapat-x { z-index: 2; }
.foto-onizleme { max-width: 100%; max-height: 60vh; border-radius: 16px; display: block; margin: 0 auto; }

.bildirim-listesi .bildirim { background: #fff; border-radius: 14px; padding: 8px 12px; margin-bottom: 6px; font-size: 15px; }
.gonderilen { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 8px 10px; margin-bottom: 8px; }
.gonderilen img { width: 52px; height: 52px; }
.gonderilen > div { flex: 1; min-width: 0; font-size: 14px; }
.gonderilen button { width: auto; margin: 0; padding: 6px 10px; font-size: 13px; }

/* ---------- 6. aşama: canlı mesaj balonları ---------- */
#baloncuklar { position: absolute; inset: 0; pointer-events: none; overflow: hidden; transition: opacity 0.3s; }
#baloncuklar.soluk { opacity: 0.25; }
#baloncuklar.gizli { display: none; }
.balon {
  position: absolute; bottom: 70px; max-width: 46%; padding: 6px 12px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.94); font-size: 14px; line-height: 1.25; box-shadow: 0 4px 12px rgba(74, 47, 79, 0.18);
  pointer-events: auto; animation: suzul 7s linear forwards; word-break: break-word;
}
.balon.sol { left: 8px; border-bottom-left-radius: 4px; }
.balon.sag { right: 8px; border-bottom-right-radius: 4px; text-align: right; }
.balon b { display: block; font-size: 12px; color: var(--pembe-koyu); }
.balon.oyun { background: rgba(255, 243, 176, 0.96); font-weight: 600; }
@keyframes suzul { 0% { transform: translateY(20px); opacity: 0; } 8% { opacity: 1; transform: translateY(0); } 85% { opacity: 1; } 100% { transform: translateY(-260px); opacity: 0; } }
#mesaj-ac { position: absolute; right: 12px; bottom: 12px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #fff; font-size: 20px; box-shadow: 0 3px 0 #f3c6da; }
#mesaj-ac.gizli, #mesaj-formu.gizli { display: none; }
#balon-gizle { position: absolute; left: 12px; bottom: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.85); font-size: 17px; }
#balon-gizle.kapali { opacity: 0.4; }
#mesaj-formu { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; gap: 6px; z-index: 3; }
#mesaj-formu input { flex: 1; min-width: 0; font: inherit; font-size: 16px; padding: 8px 12px; border: 2px solid var(--pembe); border-radius: 999px; }
#mesaj-formu button { border: 0; border-radius: 999px; padding: 0 14px; background: var(--pembe); color: #fff; font-weight: 800; }
.balon-menu { position: absolute; z-index: 5; display: flex; gap: 4px; padding: 4px; background: #fff; border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); pointer-events: auto; }
.balon-menu button { border: 0; background: #f6eef3; border-radius: 8px; padding: 6px 10px; font-weight: 600; font-size: 13px; }

/* ---------- 7. aşama: makinem, vitrin, sıralama ---------- */
.vitrin { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.vitrin button { position: relative; background: #fff; border: 2px solid #f0d7e4; border-radius: 14px; padding: 4px; }
.vitrin button.secili { border-color: var(--pembe-koyu); background: #ffe6f1; }
.vitrin img { width: 100%; aspect-ratio: 1; }
.siralama { width: 100%; border-collapse: collapse; background: #fff; border-radius: 16px; overflow: hidden; }
.siralama td { padding: 6px 10px; border-bottom: 1px solid #f6eef3; }
.siralama td:first-child { width: 32px; font-weight: 800; color: var(--pembe-koyu); }
.siralama td:last-child { text-align: right; font-weight: 800; }
.pro-rozet { display: inline-block; padding: 0 8px; border-radius: 999px; background: linear-gradient(90deg, #ffb200, #ffd75e); color: #6b4200; font-size: 12px; font-weight: 800; }
.kilitli-not { font-size: 13px; opacity: 0.7; }

/* Kısa ekranlar */
@media (max-height: 640px) {
  #ana-buton { width: 108px; height: 108px; font-size: 26px; }
  #yon { grid-template-columns: repeat(3, 50px); grid-template-rows: repeat(3, 42px); }
  #kontroller { padding-bottom: 10px; }
}
