/* BAM BAM BABAM mini oyunlar — ortak stil. Renkler uygulama/stil.css ile aynı. */
:root {
  --zemin: #fff8ec;
  --zemin2: #ffe9c7;
  --yazi: #2b2140;
  --soluk: #6d6383;
  --kart: #ffffff;
  --golge: 0 6px 0 rgba(43, 33, 64, .18), 0 12px 24px rgba(43, 33, 64, .12);
  --vurgu: #ff5d8f;
  --sari: #ffc93c;
  --yesil: #2ec27e;
  --turuncu: #ff8c42;
  --mor: #8b5cf6;
  --kirmizi: #ef4444;
  --mavi: #3a86ff;
  --odak: #3a86ff;
  --p1: #ff5d8f;
  --p2: #3a86ff;
  --p3: #2ec27e;
  --p4: #ffb000;
  --ust: clamp(64px, 9vh, 88px);
  --emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-family: "Nunito", ui-rounded, "SF Pro Rounded", "Segoe UI Rounded", "Segoe UI", Roboto, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="acik"]) {
    --zemin: #1b1530; --zemin2: #2a2148; --yazi: #fff4e0; --soluk: #b9aed6; --kart: #2f2650;
    --golge: 0 6px 0 rgba(0, 0, 0, .35), 0 12px 24px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: radial-gradient(circle at 15% 0%, var(--zemin2), transparent 45%), var(--zemin);
  color: var(--yazi);
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus { outline: none; }
:focus-visible, body.klavye-kipi :focus { outline: 6px solid var(--odak); outline-offset: 4px; }

/* ---------- Üst bar ---------- */
.mini-ust { flex: none; display: flex; align-items: center; gap: 12px; padding: 10px 16px; min-height: var(--ust); position: relative; z-index: 5; }
.mini-geri {
  min-width: 64px; height: 64px; border: 0; border-radius: 22px; padding: 0 18px; background: var(--kart); box-shadow: var(--golge);
  display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 900; flex: none;
}
.mini-geri b { font-size: 32px; line-height: 1; font-family: var(--emoji); }
.mini-geri:active, .mini-yuvarlak:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.mini-baslik { flex: 1; margin: 0; text-align: center; font-size: clamp(22px, 3.4vw, 42px); font-weight: 900; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-baslik .simge { display: inline-block; font-family: var(--emoji); animation: mini-salla-sonsuz 2.6s ease-in-out infinite; }
.mini-sag { display: flex; gap: 10px; flex: none; }
.mini-yuvarlak { width: 64px; height: 64px; border: 0; border-radius: 22px; background: var(--kart); box-shadow: var(--golge); font-size: 30px; font-family: var(--emoji); display: grid; place-items: center; padding: 0; }

.mini-sahne { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; }

/* ---------- Düğmeler ---------- */
.mini-dugme {
  min-height: 72px; min-width: 72px; border: 0; border-radius: 22px; padding: 12px 26px;
  font-size: clamp(20px, 2.6vw, 30px); font-weight: 900; background: var(--yesil); color: #fff;
  box-shadow: 0 6px 0 rgba(0, 0, 0, .2); transition: transform .1s;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.mini-dugme:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.mini-dugme.ikincil { background: var(--kart); color: var(--yazi); }
.mini-dugme.mavi { background: var(--mavi); }
.mini-dugme.mor { background: var(--mor); }
.mini-dugme.turuncu { background: var(--turuncu); }
.mini-dugme.pembe { background: var(--vurgu); }
.mini-dugme.sari { background: var(--sari); color: #2b2140; }
.mini-dugme[disabled] { opacity: .45; cursor: default; }

/* Menü ekranı: büyük seçim kartları */
.mini-menu { display: flex; flex-direction: column; align-items: center; gap: clamp(12px, 2.4vh, 26px); padding: 12px 16px 24px; width: 100%; max-height: 100%; overflow: auto; }
.mini-menu h2 { margin: 0; font-size: clamp(22px, 3.2vw, 38px); text-align: center; }
.mini-secenekler { display: flex; flex-wrap: wrap; gap: clamp(10px, 1.6vw, 20px); justify-content: center; }
.mini-secim {
  border: 5px solid transparent; border-radius: 28px; background: var(--kart); box-shadow: var(--golge);
  min-width: clamp(110px, 15vw, 190px); min-height: clamp(110px, 15vw, 180px); padding: 12px 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-size: clamp(17px, 2vw, 24px); font-weight: 900; transition: transform .12s;
}
.mini-secim .s { font-size: clamp(44px, 6vw, 76px); line-height: 1; font-family: var(--emoji); }
.mini-secim small { font-size: .75em; color: var(--soluk); font-weight: 800; }
.mini-secim:hover { transform: translateY(-3px) rotate(-1deg); }
.mini-secim.secili { border-color: var(--sari); background: color-mix(in srgb, var(--sari) 22%, var(--kart)); }
.mini-secim:active { transform: scale(.96); }

/* ---------- Katman (kazanma vb.) ---------- */
.mini-katman { position: fixed; inset: 0; z-index: 40; background: rgba(27, 21, 48, .62); display: grid; place-items: center; padding: 16px; animation: mini-belir .25s ease-out; }
.mini-pencere {
  background: var(--kart); color: var(--yazi); border-radius: 34px; padding: clamp(18px, 3vw, 34px); text-align: center;
  width: min(760px, 100%); max-height: 100%; overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
  animation: mini-yayla .55s cubic-bezier(.2, 1.6, .4, 1);
}
.mini-pencere h2 { margin: 10px 0 6px; font-size: clamp(28px, 4.4vw, 52px); line-height: 1.1; }
.mini-pencere p { margin: 4px 0 18px; font-size: clamp(18px, 2.4vw, 28px); font-weight: 800; color: var(--soluk); }
.mini-dans { display: flex; justify-content: center; gap: clamp(4px, 1.2vw, 16px); font-size: clamp(52px, 11vmin, 130px); line-height: 1.1; font-family: var(--emoji); }
.mini-dans span { display: inline-block; animation: mini-dans .55s ease-in-out infinite alternate; }
.mini-dans span:nth-child(2n) { animation-delay: .27s; animation-direction: alternate-reverse; }
.mini-dans span:nth-child(3n) { animation-duration: .7s; }

/* ---------- Tepki balonu ---------- */
.mini-balon {
  position: fixed; left: 50%; top: 16%; z-index: 70; pointer-events: none; max-width: 92vw; text-align: center;
  background: #fff; color: #2b2140; border: 6px solid #2b2140; border-radius: 34px; padding: 12px 28px;
  font-size: clamp(24px, 4.4vw, 54px); font-weight: 900; line-height: 1.15;
  box-shadow: 0 8px 0 rgba(0, 0, 0, .18); animation: mini-tepki 1.9s ease-out forwards;
}
.mini-balon.dogru { border-color: var(--yesil); color: #137a4b; }
.mini-balon.yanlis { border-color: var(--turuncu); color: #b3480f; }
.mini-balon.kazan { border-color: var(--mor); color: #5b2fc9; }
.mini-balon.berabere { border-color: var(--mavi); color: #1d4fb8; }
.mini-balon.erken { border-color: var(--kirmizi); color: #b91c1c; }

/* ---------- Konfeti / patlama ---------- */
.mini-konfeti { position: fixed; inset: 0; pointer-events: none; z-index: 65; overflow: hidden; }
.mini-konfeti i { position: absolute; top: -30px; width: 12px; height: 18px; border-radius: 3px; animation: mini-dus var(--t, 3s) linear forwards; }
.mini-parca { position: fixed; z-index: 66; pointer-events: none; width: 16px; height: 16px; border-radius: 50%; margin: -8px 0 0 -8px; animation: mini-sac .7s ease-out forwards; }
.mini-parca.emoji { width: auto; height: auto; background: none !important; font-size: 34px; margin: -20px 0 0 -20px; font-family: var(--emoji); }
.mini-bum { position: fixed; z-index: 67; pointer-events: none; font-size: 90px; font-family: var(--emoji); transform: translate(-50%, -50%); animation: mini-bum .6s ease-out forwards; }

/* ---------- Maskot ---------- */
.mini-maskot { width: clamp(80px, 14vmin, 150px); aspect-ratio: 1; flex: none; }
.mini-maskot svg { width: 100%; height: 100%; display: block; overflow: visible; animation: mini-nefes 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
.mini-maskot .m-goz { transform-box: fill-box; transform-origin: center; animation: mini-kirp 4.2s infinite; }
.mini-maskot[data-ifade="sasir"] svg { animation: mini-titre .12s linear 6; }

/* ---------- Tek seferlik animasyon sınıfları (Mini.anim) ---------- */
.a-zipla { animation: mini-zipla .6s cubic-bezier(.3, 1.8, .5, 1); }
.a-salla { animation: mini-salla .6s ease-in-out; }
.a-boing { animation: mini-boing .7s ease-out; }
.a-titre { animation: mini-titre .1s linear 5; }
.a-donus { animation: mini-donus .7s ease-in-out; }
.a-yayla { animation: mini-yayla .5s cubic-bezier(.2, 1.6, .4, 1); }
.a-nabiz { animation: mini-nabiz .5s ease-in-out 2; }
.sonsuz-zipla { animation: mini-zipla-sonsuz 1.2s ease-in-out infinite; }
.sonsuz-salla { animation: mini-salla-sonsuz 1.6s ease-in-out infinite; }
.sonsuz-nabiz { animation: mini-nabiz 1s ease-in-out infinite; }

/* Oyuncu rozetleri */
.mini-oyuncu { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--renk, var(--mavi)); color: #fff; font-weight: 900; font-size: clamp(16px, 2vw, 24px); box-shadow: 0 4px 0 rgba(0, 0, 0, .18); }
.mini-oyuncu .s { font-size: 1.4em; font-family: var(--emoji); }
.mini-oyuncu.sirada { animation: mini-nabiz 1s ease-in-out infinite; outline: 5px solid var(--sari); }
.mini-ipucu { font-size: clamp(15px, 1.6vw, 20px); color: var(--soluk); font-weight: 800; text-align: center; }
.emoji { font-family: var(--emoji); }

@keyframes mini-belir { from { opacity: 0; } }
@keyframes mini-yayla { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
@keyframes mini-zipla { 0% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-28%) scale(.92, 1.1); } 60% { transform: translateY(0) scale(1.12, .88); } 100% { transform: none; } }
@keyframes mini-zipla-sonsuz { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14%); } }
@keyframes mini-salla { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(5deg); } }
@keyframes mini-salla-sonsuz { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes mini-boing { 0% { transform: scale(1, 1); } 20% { transform: scale(1.35, .7); } 40% { transform: scale(.8, 1.25); } 60% { transform: scale(1.12, .9); } 80% { transform: scale(.96, 1.04); } 100% { transform: scale(1, 1); } }
@keyframes mini-titre { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px) rotate(-2deg); } 75% { transform: translateX(6px) rotate(2deg); } }
@keyframes mini-donus { from { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.2); } to { transform: rotate(360deg) scale(1); } }
@keyframes mini-nabiz { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes mini-dans { from { transform: translateY(0) rotate(-14deg) scale(1); } to { transform: translateY(-22%) rotate(14deg) scale(1.08); } }
@keyframes mini-nefes { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.04, .97); } }
@keyframes mini-kirp { 0%, 90%, 96%, 100% { transform: scaleY(1); } 93% { transform: scaleY(.08); } }
@keyframes mini-tepki { 0% { transform: translate(-50%, 30px) scale(.3) rotate(-8deg); opacity: 0; } 14% { transform: translate(-50%, 0) scale(1.12) rotate(3deg); opacity: 1; } 24% { transform: translate(-50%, 0) scale(.96) rotate(-2deg); } 32% { transform: translate(-50%, 0) scale(1) rotate(0); } 80% { transform: translate(-50%, -10px) scale(1); opacity: 1; } 100% { transform: translate(-50%, -60px) scale(.9); opacity: 0; } }
@keyframes mini-dus { to { transform: translate(var(--x, 0), 110vh) rotate(var(--r, 720deg)); } }
@keyframes mini-sac { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
@keyframes mini-bum { 0% { transform: translate(-50%, -50%) scale(.2); opacity: 1; } 60% { transform: translate(-50%, -50%) scale(1.4); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } }

@media (max-width: 640px), (max-height: 460px) {
  /* telefon: üst bar ekranın 5'te 1'ini yemesin (Android yatay 360 px yükseklik) */
  .mini-ust { padding: 6px 10px; gap: 8px; }
  .mini-geri span { display: none; }
  .mini-geri { padding: 0; justify-content: center; }
  .mini-geri, .mini-yuvarlak { min-width: 48px; width: 48px; height: 48px; border-radius: 16px; font-size: 24px; }
  .mini-geri b { font-size: 26px; }
  .mini-baslik { font-size: clamp(18px, 2.6vw, 28px); }
  .mini-sag { gap: 6px; }
}
/* ---------- Oyun ekranı (html.mini-oyunda, Mini.kur): başlık şeridi yer kaplamaz, oyun alanı ekranı doldurur ---------- */
html.mini-oyunda .mini-ust { min-height: 0; padding: 4px 8px; gap: 8px; }
html.mini-oyunda .mini-geri, html.mini-oyunda .mini-yuvarlak {
  min-width: 48px; width: 48px; height: 48px; padding: 0; border-radius: 16px; font-size: 24px; justify-content: center;
  box-shadow: 0 4px 0 rgba(43, 33, 64, .18), 0 6px 14px rgba(43, 33, 64, .14);
}
html.mini-oyunda .mini-geri span { display: none; }
html.mini-oyunda .mini-geri b { font-size: 26px; }
html.mini-oyunda .mini-baslik { font-size: clamp(18px, 2.6vw, 30px); }
html.mini-oyunda .mini-sag { gap: 6px; }
/* yatay ekran: düğmeler oyunun üstünde köşelerde yüzer, başlık gizlenir.
   --ust-sol / --ust-sag: oyunların üst sıradaki yazılarının yüzen düğmelerin altında kalmaması için bırakacağı boşluk */
html.mini-oyunda { --ust-sol: 0px; --ust-sag: 0px; }
@media (orientation: landscape) {
  html.mini-oyunda { --ust-sol: 64px; --ust-sag: 116px; }
  html.mini-oyunda .mini-ust {
    position: absolute; top: env(safe-area-inset-top); left: env(safe-area-inset-left); right: env(safe-area-inset-right);
    padding: 6px 8px; pointer-events: none;
  }
  html.mini-oyunda .mini-ust > * { pointer-events: auto; }
  html.mini-oyunda .mini-baslik { visibility: hidden; }
  html.mini-oyunda .mini-geri, html.mini-oyunda .mini-yuvarlak { background: color-mix(in srgb, var(--kart) 82%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
}

@media (prefers-reduced-motion: reduce) {
  .mini-maskot svg, .mini-baslik .simge { animation: none; }
}

/* Kim oynuyor: 1. ve 2. oyuncu için Ömiş, Eliş, Anniş, Babiş */
.ar-kimler { display: grid; gap: 8px; width: 100%; }
.ar-kim-sira { display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ar-kim-no { min-width: 86px; font-size: 16px; }
.ar-kim { display: grid; justify-items: center; gap: 2px; width: 84px; padding: 6px 4px; border: 3px solid transparent; border-radius: 18px; background: rgba(255,255,255,.85); cursor: pointer; font: inherit; color: #333; transition: transform .15s; }
.ar-kim img { width: 52px; height: 64px; object-fit: contain; }
.ar-kim span { font-weight: 800; font-size: 15px; }
.ar-kim small { font-size: 11px; opacity: .7; }
.ar-kim.secili { border-color: #ff5d8f; background: #fff; transform: scale(1.06); box-shadow: 0 4px 14px rgba(255,93,143,.35); }
.ar-aile-ac { justify-self: center; font-size: 15px; padding: 8px 16px; }
/* Ailem penceresi: kişi listesi, rol ızgarası, yüz kırpma */
.ar-aile { max-height: 92vh; overflow: auto; }
.ar-aile-liste, .ar-aile-roller { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 8px 0 14px; }
.ar-aile-kisi, .ar-aile-rol { position: relative; display: grid; justify-items: center; gap: 2px; width: 104px; padding: 8px 4px; border: 3px solid #eee; border-radius: 18px; background: #fff; font: inherit; color: #333; }
.ar-aile-kisi img { width: 64px; height: 80px; object-fit: contain; }
.ar-aile-kisi small { font-size: 12px; opacity: .7; }
.ar-aile-sil { position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: #ff5d5d; color: #fff; font-size: 14px; cursor: pointer; }
.ar-aile-ekle, .ar-aile-rol { cursor: pointer; }
.ar-aile-ekle span, .ar-aile-rol span { font-size: 40px; line-height: 1.2; }
.ar-aile-ekle { border-style: dashed; }
.ar-aile-rol:hover, .ar-aile-ekle:hover { border-color: #ff5d8f; }
.ar-aile-kirp-satir { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; }
.ar-aile-onizle-kutu { display: grid; justify-items: center; gap: 4px; }
.ar-aile-onizle { width: min(150px, 34vw); aspect-ratio: 312 / 480; object-fit: contain; background: #f6f1ff; border-radius: 16px; }
.ar-aile-kirp { width: min(300px, 70vw); aspect-ratio: 1; border-radius: 16px; background: #333; cursor: grab; display: block; }
.ar-aile-ad-satir { display: block; margin: 10px 0; font-weight: 800; font-size: 18px; }
.ar-aile-ad { font: inherit; font-size: 18px; padding: 6px 10px; border-radius: 10px; border: 2px solid #ccc; width: 12ch; }
.ar-aile .mini-satir { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Serbest kontrolcü düzeni (Mini.kolKaydet) ---------- */
html.mini-oyunda.mk-var { --ust-sag: 170px; }
html.mk-duzenle .mk-hedef { outline: 3px dashed rgba(255, 255, 255, .95); outline-offset: 4px; border-radius: 18px; pointer-events: auto !important; touch-action: none; }
html.mk-duzenle .mk-hedef * { pointer-events: none; }
html.mk-duzenle .mk-hedef.mk-secili { outline-color: var(--sari); }
.mk-panel { position: fixed; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 95; display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 16px; background: var(--kart); box-shadow: var(--golge); max-width: calc(100vw - 16px); flex-wrap: wrap; justify-content: center; }
.mk-panel b { font-size: 15px; padding: 0 4px; }
.mk-panel button { min-width: 44px; height: 44px; padding: 0 12px; border: 1px solid rgba(43, 33, 64, .15); border-radius: 12px; background: var(--zemin); font-size: 16px; font-weight: 800; font-family: inherit, var(--emoji); }
.mk-panel button.tamam { background: var(--yesil); color: #fff; border-color: transparent; }
