/* Oyunlar bölümü (www/oyunlar). Sitenin stil dosyalarından bağımsız. */
:root {
    --anarenk: #0c6f03;
    --anarenk-acik: #2fb344;
    --sonuc-perde: rgba(16, 24, 40, .5);
    --sonuc-kart: #fff;
    --sonuc-golge: 0 24px 60px rgba(16, 24, 40, .35);
    --sonuc-kazan-1: #2fb344;
    --sonuc-kazan-2: #0c6f03;
    --sonuc-kayip-1: #ff9f43;
    --sonuc-kayip-2: #e8590c;
    --sonuc-konfeti-1: #ffd43b;
    --sonuc-konfeti-2: #ff6b9a;
    --sonuc-konfeti-3: #4dabf7;
    --tehlike: #e03131;
    --zemin: #eef1f6;
    --yazi: #333;
    --beyaz: #fff;
    --oyun-zemin: #bbada0;
    --oyun-bos: #cdc1b4;
    --oyun-koyu: #3c3a32;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--zemin);
    color: var(--yazi);
    font-family: 'Titillium Web', system-ui, sans-serif;
    font-size: 16px;
}

h1, h2, p, ul {
    margin: 0;
}

ul {
    padding: 0;
    list-style: none;
}

h1 {
    margin: 16px 0 8px;
    font-size: 28px;
}

h2 {
    margin: 20px 0 6px;
    font-size: 20px;
}

/* Üst ve alt */
.oy-ust {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: var(--anarenk);
}

.oy-ust a {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--beyaz);
    font-weight: 700;
    text-decoration: none;
}

.oy-logo img {
    width: 36px;
    height: 36px;
}

/* Başlık çubuğu ana renkte: site logosu beyaz siluet. Koyu görünüm logosu (açık renkli çizim) olduğu gibi. */
.oy-logo img:not(.oy-koyu) {
    filter: brightness(0) invert(1);
}

.oy-alt {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 20px;
    padding: 20px 16px;
    background: #222;
}

.oy-alt a {
    color: #ccc;
    font-size: 14px;
    text-decoration: none;
}

.oy-gizli {
    display: none;
}

/* Oyun ekranı (html.oy-oyunda): uygulama gibi tam ekran; sayfa kaymaz, çekip yenileme ve çift dokunuşla yakınlaşma yok.
   Kabuk: başlık çubuğu + .oy-oyun (sütun). Oyunun satırları sabit yükseklikte, .oy-sahne kalan alanı alır;
   tahta sahneye container query ile sığdırılır (cqw/cqh), böylece mesaj/ödül düğmesi belirince hiçbir şey kaymaz. */
.oy-oyunda, .oy-oyunda body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

/* Gövde ekrana sabit (position: fixed, inset 0): AdSense otomatik reklamları html ve body'ye satır içi "height: auto !important"
   ve üst çapa reklamı için padding-top ekler, kapanınca her zaman geri almaz; yükseklik bu yüzden height'a değil inset'e bağlı.
   Kalan padding-top'u js/ortak.js temizler. */
.oy-oyunda body {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    height: auto;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.oy-cubuk {
    flex: none;
    gap: 4px;
    padding: 4px 4px;
    padding-top: max(4px, env(safe-area-inset-top));
}

.oy-cubuk h1 {
    flex: 1;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    color: var(--beyaz);
    font-size: 19px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.oy-ikon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: inherit;
    cursor: pointer;
}

.oy-ikon svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.oy-cubuk .oy-ikon {
    color: var(--beyaz);
}

.oy-cubuk .oy-ikon:hover, .oy-cubuk .oy-ikon:focus-visible {
    background: rgba(255, 255, 255, .15);
}

.oy-oyun {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 8px 12px max(8px, env(safe-area-inset-bottom));
}

/* Oyun kökü: satırlar + sahne tek blok hâlinde dikeyde ortalanır; sahne tahtanın ihtiyacından fazla uzamaz (max-height, kökün cqw'si) */
.oy-oyun > div:first-child {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    container-type: inline-size;
    width: 100%;
    max-width: none;
    margin: 0;
}

/* Tek satırlık seçenek/bilgi şeridi: yüksekliği sabit, sığmayan metin üç noktayla kısalır */
.oy-sira {
    flex: none;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
}

.oy-sira-ince {
    height: 24px;
    margin-top: -4px;
}

.oy-sira .oy-dugme {
    flex: none;
    padding: 0 12px;
    height: 36px;
}

.oy-sec {
    flex: none;
    height: 36px;
    padding: 0 6px;
    border: 1px solid #bbb;
    border-radius: 6px;
    background: var(--beyaz);
    color: var(--yazi);
    font: inherit;
}

.oy-sahne {
    position: relative;
    flex: 1;
    min-height: 0;
    max-height: 100cqw;
    display: grid;
    place-items: center;
    container-type: size;
}

/* Kısa süreli bildirim (Günün Sözcüğü): tahtanın üstünde belirir, yer kaplamaz */
.oy-bildirim {
    position: absolute;
    top: 8px;
    left: 50%;
    z-index: 2;
    transform: translateX(-50%);
    max-width: 90%;
    padding: 8px 14px;
    border-radius: 6px;
    background: var(--oyun-koyu);
    color: var(--beyaz);
    font-weight: 700;
    text-align: center;
    pointer-events: none;
}

.oy-bildirim:empty {
    display: none;
}

/* Pencere (nasıl oynanır, fotoğraf seç) */
.oy-pencere {
    width: min(560px, calc(100% - 24px));
    max-height: min(85dvh, 760px);
    padding: 8px 20px 20px;
    border: 0;
    border-radius: 12px;
    color: var(--yazi);
    overscroll-behavior: contain;
    user-select: text;
    -webkit-user-select: text;
}

/* Basma hissi: dokunur dokunmaz hafif içe göçer */
.oy-dugme, .oy-ikon, .sd-sekme, .sd-tus-d, .sd-g, .sz-k, .hk-kart, .yb-foto {
    transition: transform .08s, filter .08s;
}

.oy-dugme:active, .oy-ikon:active, .sd-sekme:active, .sd-tus-d:not(:disabled):active, .sd-g:active, .sz-k:active, .yb-foto:active {
    transform: scale(.94);
    filter: brightness(.92);
}

.hk-kart:active {
    transform: scale(.96);
}

@media (hover: hover) {
    .oy-dugme:hover {
        filter: brightness(1.12);
    }
}

@keyframes oy-belir {
    from { opacity: 0; scale: .96; }
}

@keyframes oy-yukari {
    from { transform: translateY(100%); }
}

.oy-pencere[open] {
    animation: oy-belir .2s ease-out;
}

/* Telefonda pencere alttan açılan sayfa (bottom sheet) */
@media (max-width: 600px) {
    .oy-pencere {
        width: 100%;
        max-width: 100%;
        max-height: 88dvh;
        margin: auto 0 0;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        border-radius: 16px 16px 0 0;
    }

    .oy-pencere[open] {
        animation: oy-yukari .25s cubic-bezier(.2, .8, .2, 1);
    }

    /* Tam durak: yukarı çekilince ekran boyu (js/ortak.js sheet). Sürüklerken metin seçilmez */
    .oy-pencere.oy-tam, .oy-sonuc-kart.oy-tam {
        height: calc(100dvh - 12px);
        max-height: none;
    }

    .oy-surukleniyor, .oy-surukleniyor * {
        cursor: grabbing !important;
        user-select: none !important;
        -webkit-user-select: none !important;
    }

    .oy-pencere::before, .oy-sonuc-kart::after {
        cursor: grab;
    }

    /* Tutamaç: yukarı/aşağı çekilir (js/ortak.js) */
    .oy-pencere::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        width: 40px;
        height: 5px;
        border-radius: 3px;
        background: #d0d5dd;
        transform: translateX(-50%);
    }
}

.oy-pencere:focus {
    outline: none;
}

/* Sahne üst sınırı tahta oranına göre (kare tahtalar varsayılan 100cqw) */
.sz .oy-sahne { max-height: calc((100cqw - 24px) * 6 / 5 + 30px); }
.hk:has(.hk-kolay) .oy-sahne { max-height: 75cqw; }
.hk:has(.hk-zor) .oy-sahne { max-height: 150cqw; }

.oy-pencere::backdrop {
    background: rgba(0, 0, 0, .5);
}

.oy-pencere form {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: flex-end;
    height: 0;
}

.oy-kapat {
    background: var(--beyaz);
}

.oy-pencere h2:first-of-type {
    margin-top: 6px;
    padding-right: 44px;
}

.oy-dugme {
    border: 0;
    border-radius: 6px;
    padding: 10px 16px;
    background: var(--anarenk);
    color: var(--beyaz);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.oy-dugme:focus-visible {
    filter: brightness(1.15);
}

.oy-dugme[hidden] {
    display: none;
}

.oy-odul {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #c27c00;
}

.oy-odul svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Sonuç (oyun bitince, js/ortak.js kapatır): masaüstü ve tablette ekran ortasında kart, telefonda alttan gelen panel.
   Üstte konfetili renk bandı ve kupa; .kayip ile turuncu bant ve "yeniden dene" simgesi. Oyun kabının (container) dışında durur. */
.oy-sonuc {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 16px;
    background: var(--sonuc-perde);
    animation: oy-sonuc-perde .25s ease-out;
}

.oy-sonuc[hidden] {
    display: none;
}

.oy-sonuc-kart {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: min(400px, 100%);
    padding: 0 24px 24px;
    overflow: hidden;
    border-radius: 28px;
    background: var(--sonuc-kart);
    box-shadow: var(--sonuc-golge);
    color: var(--yazi);
    text-align: center;
    animation: oy-sonuc-kart .4s cubic-bezier(.2, 1.3, .4, 1);
}

/* Renk bandı: geçişli zemin üstünde konfeti noktaları */
.oy-sonuc-kart::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 92px;
    background:
        radial-gradient(circle at 12% 30%, var(--sonuc-konfeti-1) 0 4px, transparent 5px),
        radial-gradient(circle at 26% 70%, var(--sonuc-konfeti-2) 0 3px, transparent 4px),
        radial-gradient(circle at 78% 24%, var(--sonuc-konfeti-3) 0 4px, transparent 5px),
        radial-gradient(circle at 88% 66%, var(--sonuc-konfeti-1) 0 3px, transparent 4px),
        radial-gradient(circle at 64% 82%, var(--beyaz) 0 2px, transparent 3px),
        radial-gradient(circle at 38% 18%, var(--beyaz) 0 2px, transparent 3px),
        linear-gradient(135deg, var(--sonuc-kazan-1), var(--sonuc-kazan-2));
}

.oy-sonuc.kayip .oy-sonuc-kart::before {
    background: linear-gradient(135deg, var(--sonuc-kayip-1), var(--sonuc-kayip-2));
}

.oy-sonuc-kapat {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 1;
    color: var(--beyaz);
}

.oy-sonuc-ikon {
    position: relative;
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    margin: 40px 0 6px;
    border: 6px solid var(--sonuc-kart);
    border-radius: 50%;
    background: linear-gradient(160deg, var(--sonuc-konfeti-1), var(--sonuc-kayip-1));
    box-shadow: 0 8px 20px rgba(16, 24, 40, .2);
    color: var(--beyaz);
    animation: oy-sonuc-ikon .6s .15s cubic-bezier(.2, 1.6, .4, 1) both;
}

.oy-sonuc.kayip .oy-sonuc-ikon {
    background: linear-gradient(160deg, var(--sonuc-kayip-1), var(--sonuc-kayip-2));
}

.oy-sonuc-ikon svg {
    width: 46px;
    height: 46px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.oy-sonuc .oy-sonuc-kayip, .oy-sonuc.kayip .oy-sonuc-kazan {
    display: none;
}

.oy-sonuc.kayip .oy-sonuc-kayip {
    display: block;
}

.oy-sonuc-kart strong {
    font-size: 30px;
    line-height: 1.15;
}

.oy-sonuc-metin {
    max-width: 30ch;
    color: #5b6470;
    font-size: 17px;
    line-height: 1.4;
}

.oy-sonuc-dugmeler {
    display: grid;
    gap: 8px;
    width: 100%;
    margin-top: 14px;
}

.oy-sonuc-dugmeler .oy-dugme {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 50px;
    border-radius: 14px;
    font-size: 17px;
}

.oy-sonuc-dugmeler .oy-dugme:not(.oy-ikincil):not(.oy-odul):not(.oy-tehlike) {
    background: linear-gradient(135deg, var(--sonuc-kazan-1), var(--sonuc-kazan-2));
    box-shadow: 0 4px 12px rgba(12, 111, 3, .3);
}

@keyframes oy-sonuc-perde {
    from { opacity: 0; }
}

@keyframes oy-sonuc-kart {
    from { opacity: 0; transform: translateY(24px) scale(.92); }
}

@keyframes oy-sonuc-ikon {
    from { transform: scale(0) rotate(-30deg); }
}

@keyframes oy-sonuc-alttan {
    from { transform: translateY(100%); }
}

/* Telefonda alttan gelen panel: tutamaç çizgisi, alt çentik payı */
@media (max-width: 600px) {
    .oy-sonuc {
        place-items: end stretch;
        padding: 0;
    }

    .oy-sonuc-kart {
        width: 100%;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        border-radius: 28px 28px 0 0;
        animation: oy-sonuc-alttan .35s cubic-bezier(.2, .8, .2, 1);
    }

    .oy-sonuc-kart::after {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        width: 40px;
        height: 5px;
        border-radius: 3px;
        background: rgba(255, 255, 255, .7);
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .oy-sonuc, .oy-sonuc-kart, .oy-sonuc-ikon {
        animation: none;
    }
}

/* Panel reklamları (sistem/reklam.asp, oyunlara api/reklam.asp ile gelir) */
.rk { margin: 40px auto 20px; text-align: center; overflow: hidden; }
.rk img, .rk video { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.rk-gizli { display: none !important; }
.rk-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.rk-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.rk-detay { display: inline-block; margin-top: 6px; padding: 6px 14px; border-radius: 4px; background: #222; color: #fff; font-size: 13px; text-decoration: none; }
.gkutu::before { content: 'Reklam'; display: block; font-size: 11px; color: #999; margin-bottom: 4px; letter-spacing: .5px; }
.gkutu .adsbygoogle { display: block; }

/* Alt reklam alanı (js/ortak.js): ekranın en altında, sabit yükseklikte; içerik ne olursa olsun taşmaz ve oyunu kaydırmaz.
   Telefonda 320×50, geniş ve yüksek ekranda 728×90 AdSense birimi. Kendi görsel reklamlarımız alana orantılı sığar
   (önerilen görsel: 640×100 ya da 1456×180). Video ve embed bu alana uygun değildir. */
.oy-reklam {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(50px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    overflow: hidden;
    background: #e3e7ee;
}

.oy-reklam[hidden] {
    display: none;
}

/* Reklam görünürken telefonun alt çentik payını reklam alanı karşılar */
.oy-oyun:has(+ .oy-reklam:not([hidden])) {
    padding-bottom: 8px;
}

.oy-reklam .rk, .oy-reklam .rk-oge, .oy-reklam .rk a, .oy-reklam .gkutu {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin: 0;
}

/* Masaüstü/mobil görselli reklam <picture> içinde gelir (sistem/reklam.asp): img yüksekliği doğrudan alandan alsın */
.oy-reklam .rk picture {
    display: contents;
}

.oy-reklam .rk img, .oy-reklam .rk video {
    width: auto;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
}

.oy-reklam .gkutu::before {
    display: none;
}

.oy-reklam .gkutu .adsbygoogle {
    display: inline-block;
    width: 320px;
    height: 50px;
}

.oy-reklam .rk-embed {
    width: auto;
    height: 100%;
}

@media (min-width: 760px) and (min-height: 700px) {
    .oy-reklam {
        height: calc(90px + env(safe-area-inset-bottom));
    }

    .oy-reklam .gkutu .adsbygoogle {
        width: 728px;
        height: 90px;
    }
}

/* 2048 */
.o2048-ust {
    flex: none;
    display: flex;
    gap: 6px;
    align-items: stretch;
    height: 44px;
}

.o2048-ust .oy-dugme {
    padding: 0 12px;
}

.o2048-sayac {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 4px;
    border-radius: 6px;
    background: var(--oyun-zemin);
    color: var(--beyaz);
    line-height: 1.1;
}

.o2048-sayac span {
    font-size: 10px;
    font-weight: 700;
    opacity: .85;
}

.o2048-sayac strong {
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

/* Kaydırma tahtanın çevresinde de çalışır (js/2048.js sahneyi dinler) */
.o2048 .oy-sahne {
    touch-action: none;
}

/* Tahta: 4×4 sabit zemin hücreleri + üstte taş katmanı. Taş konumu x0-3/y0-3 sınıflarıyla, kendi boyu + aralık kadar kayar */
.o2048-tahta {
    --ara: clamp(6px, 2.6cqmin, 12px);
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    gap: var(--ara);
    width: min(100cqw, 100cqh);
    aspect-ratio: 1;
    padding: var(--ara);
    border-radius: 10px;
    background: var(--oyun-zemin);
}

.o2048-hucre {
    border-radius: 6px;
    background: var(--oyun-bos);
}

.o2048-katman {
    position: absolute;
    inset: var(--ara);
}

.o2048-tas {
    --x: 0;
    --y: 0;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc((100% - 3 * var(--ara)) / 4);
    height: calc((100% - 3 * var(--ara)) / 4);
    border-radius: 6px;
    color: var(--oyun-koyu);
    font-size: clamp(20px, 9cqmin, 44px);
    font-weight: 700;
    line-height: 1;
    transform: translate(calc(var(--x) * (100% + var(--ara))), calc(var(--y) * (100% + var(--ara))));
    transition: transform .1s ease-in-out;
}

.o2048-tas.x1 { --x: 1; }
.o2048-tas.x2 { --x: 2; }
.o2048-tas.x3 { --x: 3; }
.o2048-tas.y1 { --y: 1; }
.o2048-tas.y2 { --y: 2; }
.o2048-tas.y3 { --y: 3; }

.o2048-tas.giden {
    z-index: 0;
}

.o2048-tas.birlesti {
    z-index: 2;
}

.o2048-tas.t2 { background: #eee4da; } /* yazı her taşta koyu (--oyun-koyu): beyaz açık taşlarda 1.5–2.6 (AA altı), koyu en az 3.57 (büyük kalın) */
.o2048-tas.t4 { background: #ede0c8; }
.o2048-tas.t8 { background: #f2b179; }
.o2048-tas.t16 { background: #f59563; }
.o2048-tas.t32 { background: #f67c5f; }
.o2048-tas.t64 { background: #f65e3b; }
.o2048-tas.t128 { background: #edcf72; font-size: clamp(18px, 7.5cqmin, 34px); }
.o2048-tas.t256 { background: #edcc61; font-size: clamp(18px, 7.5cqmin, 34px); }
.o2048-tas.t512 { background: #edc850; font-size: clamp(18px, 7.5cqmin, 34px); }
.o2048-tas.t1024 { background: #edc53f; font-size: clamp(15px, 6cqmin, 28px); }
.o2048-tas.t2048 { background: #edc22e; font-size: clamp(15px, 6cqmin, 28px); }
.o2048-tas.tbuyuk { background: var(--anarenk); color: var(--beyaz); font-size: clamp(13px, 5cqmin, 24px); }

/* Büyüme/belirme "scale" ile: konumu taşıyan transform'a dokunmaz */
.o2048-tas.yeni {
    animation: o2048-belir .15s ease-out;
}

.o2048-tas.birlesti {
    animation: o2048-birles .15s ease-out;
}

@keyframes o2048-belir {
    from { scale: 0; opacity: 0; }
}

@keyframes o2048-birles {
    50% { scale: 1.18; }
}

@media (prefers-reduced-motion: reduce) {
    .o2048-tas {
        transition: none;
    }

    .o2048-tas.yeni, .o2048-tas.birlesti {
        animation: none;
    }
}

.oy-nasil h2 {
    margin-top: 18px;
}

/* Yeni oyun onayı (js/ortak.js Oyun.onayla): küçük, ortalı pencere; telefonda diğer pencereler gibi alttan gelir */
.oy-pencere.oy-onay {
    width: min(380px, calc(100% - 24px));
    padding: 24px;
    border-radius: 24px;
    text-align: center;
}

.oy-onay h2:first-of-type {
    margin: 0;
    padding: 0;
    font-size: 24px;
    line-height: 1.2;
}

.oy-onay p {
    margin: 8px 0 0;
    color: #5b6470;
    font-size: 17px;
}

.oy-onay .oy-tehlike {
    background: var(--tehlike);
}

@media (max-width: 600px) {
    .oy-pencere.oy-onay {
        width: 100%;
        padding: 28px 16px max(16px, env(safe-area-inset-bottom));
        border-radius: 24px 24px 0 0;
    }
}

.oy-nasil p {
    margin: 8px 0;
    line-height: 1.5;
}

.oy-ikincil {
    background: #e0e4ea;
    color: var(--yazi);
}

.oy-ikincil[aria-pressed="true"] {
    background: var(--anarenk);
    color: var(--beyaz);
}

/* Sudoku (sudoku.html, js/sudoku.js). Tahta ve tuşlar --n sütunlu; izler minmax(0, 1fr), içerik hücre boyunu değiştirmez */
.sd-n9 { --n: 9; }
.sd-n6 { --n: 6; }

.sd-mod {
    flex: none;
    display: flex;
    border-radius: 8px;
    overflow: hidden;
}

.sd-sekme {
    height: 36px;
    border: 0;
    padding: 0 10px;
    background: #e0e4ea;
    color: var(--yazi);
    font: inherit;
    cursor: pointer;
}

.sd-sekme[aria-pressed="true"] {
    background: var(--anarenk);
    color: var(--beyaz);
    font-weight: 700;
}

.sd-seviye {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.sd-seviye[hidden] {
    display: none;
}

.sd-bilgi {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sd-sure {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sd-tahta {
    display: grid;
    grid-template: repeat(var(--n), minmax(0, 1fr)) / repeat(var(--n), minmax(0, 1fr));
    width: min(100cqw, 100cqh);
    aspect-ratio: 1;
    overflow: hidden;
    border: 3px solid #2d3748;
    border-radius: 10px;
    background: var(--beyaz);
    box-shadow: 0 4px 14px rgba(30, 50, 80, .12);
}

.sd-h {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-right: 1px solid #d3d8e0;
    border-bottom: 1px solid #d3d8e0;
    background: var(--beyaz);
    color: #1e5b9c;
    font: inherit;
    font-size: 6.4cqmin;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color .12s;
}

.sd-n6 .sd-h { font-size: 9.5cqmin; }

.sd-n9 .sd-h:nth-child(9n), .sd-n6 .sd-h:nth-child(6n) { border-right: 0; }
.sd-n9 .sd-h:nth-last-child(-n+9), .sd-n6 .sd-h:nth-last-child(-n+6) { border-bottom: 0; }
.sd-h.sag { border-right: 2px solid #2d3748; }
.sd-h.alt { border-bottom: 2px solid #2d3748; }

.sd-h.sabit { background: #f4f6f9; color: #1f2933; font-weight: 700; }
.sd-h.iliskili { background: #e6eef8; }
.sd-h.ayni { background: #c6dbf4; }
.sd-h.secili { background: #9fc4ee; }
.sd-h.hata { color: #d32f2f; background-color: #fde3e0; }
.sd-h.hata.secili { background: #f6bdb6; }

.sd-d {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.sd-h svg {
    width: 68%;
    height: 68%;
}

.sd-e {
    font-size: 1.1em;
    line-height: 1;
}

/* Şekil göstergesi: oyuncunun girdikleri yarı saydam, hatalı giriş kırmızı çerçeve */
.sd-sekil .sd-h:not(.sabit) svg {
    fill-opacity: .4;
    stroke-width: 2;
}

.sd-sekil .sd-h.hata svg {
    stroke: #d32f2f !important;
}

/* Emoji göstergesi: oyuncunun girdikleri biraz küçük */
.sd-meyve .sd-h:not(.sabit) .sd-d .sd-e, .sd-hayvan .sd-h:not(.sabit) .sd-d .sd-e {
    font-size: .95em;
}

/* Notlar: 9×9'da 3×3, 6×6'da 3×2 aday */
.sd-not {
    display: grid;
    grid-template: repeat(3, minmax(0, 1fr)) / repeat(3, minmax(0, 1fr));
    width: 100%;
    height: 100%;
    padding: 1px;
    color: #5f6b7a;
    font-size: 2.9cqmin;
    font-weight: 600;
}

.sd-n6 .sd-not {
    grid-template-rows: repeat(2, minmax(0, 1fr));
    font-size: 4.2cqmin;
}

.sd-not span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
}

.sd-not svg {
    width: 80%;
    height: 80%;
}

.sd-not .sd-e {
    font-size: 1.1em;
}

/* Yazınca içerik hafifçe büyüyerek oturur */
@keyframes sd-gir {
    from { transform: scale(.5); opacity: .2; }
    70% { transform: scale(1.12); }
}

.sd-h.gir .sd-d {
    animation: sd-gir .22s ease-out;
}

/* Satır, sütun ya da kutu tamamlanınca dalga: hücreler sırayla yeşil parlar (d0-d8 gecikme, js kutla) */
@keyframes sd-dalga {
    35% { background-color: #9edc8f; }
}

@keyframes sd-dalga-ic {
    35% { transform: scale(1.22); }
}

.sd-h.dalga {
    animation: sd-dalga .6s ease-out both;
}

.sd-h.dalga .sd-d {
    animation: sd-dalga-ic .6s ease-out both;
}

.sd-h.d1, .sd-h.d1 .sd-d { animation-delay: 45ms; }
.sd-h.d2, .sd-h.d2 .sd-d { animation-delay: 90ms; }
.sd-h.d3, .sd-h.d3 .sd-d { animation-delay: 135ms; }
.sd-h.d4, .sd-h.d4 .sd-d { animation-delay: 180ms; }
.sd-h.d5, .sd-h.d5 .sd-d { animation-delay: 225ms; }
.sd-h.d6, .sd-h.d6 .sd-d { animation-delay: 270ms; }
.sd-h.d7, .sd-h.d7 .sd-d { animation-delay: 315ms; }
.sd-h.d8, .sd-h.d8 .sd-d { animation-delay: 360ms; }

@media (prefers-reduced-motion: reduce) {
    .sd-h.gir .sd-d, .sd-h.dalga, .sd-h.dalga .sd-d { animation: none; }
}

/* Araçlar: simge + etiket; Not açıkken ve ipucu sayısında rozet */
.sd-arac {
    flex: none;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    height: 52px;
}

.sd-a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: none;
    color: #4a5568;
    font: inherit;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .08s, background-color .08s;
}

.sd-a:active {
    transform: scale(.92);
    background: #e0e4ea;
}

.sd-a svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sd-a:disabled {
    opacity: .4;
    cursor: default;
}

.sd-a[hidden] {
    display: none;
}

.sd-rozet {
    position: absolute;
    top: 0;
    left: calc(50% + 6px);
    min-width: 18px;
    padding: 1px 5px;
    border-radius: 9px;
    background: #1e5b9c;
    color: var(--beyaz);
    font-size: 11px;
    line-height: 16px;
}

#sd-not .sd-rozet { display: none; }
#sd-not[aria-pressed="true"] { color: var(--anarenk); font-weight: 700; }
#sd-not[aria-pressed="true"] .sd-rozet { display: block; background: var(--anarenk); }

/* Reklamlı ipucu, ücretsizler bitince ipucu düğmesinin yerine geçer */
.sd-a-odul {
    grid-column: 4;
    grid-row: 1;
    background: var(--zemin);
}

.sd-a-odul .sd-rozet { background: #c27c00; }

.sd-tus {
    flex: none;
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    gap: 5px;
}

.sd-tus-d {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: clamp(48px, 8dvh, 64px);
    min-width: 0;
    padding: 0 0 8px;
    border: 0;
    border-radius: 10px;
    background: var(--beyaz);
    box-shadow: 0 1px 3px rgba(30, 50, 80, .18);
    color: #1e5b9c;
    font: inherit;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.sd-tus-d > span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 30px;
}

.sd-tus-d svg {
    width: 28px;
    height: 28px;
}

.sd-tus-d .sd-e {
    font-size: 24px;
}

.sd-tus-d small {
    position: absolute;
    bottom: 3px;
    color: #8a94a3;
    font-size: 11px;
    font-weight: 600;
}

/* Tahtada yerini tamamlamış işaret pasif */
.sd-tus-d:disabled {
    background: #e7eaef;
    box-shadow: none;
    opacity: .35;
    cursor: default;
}

/* Ayarlar penceresi: gösterge seçimi önizlemeli */
.oy-nasil h3 {
    margin: 16px 0 4px;
    font-size: 16px;
}

.sd-gosterge {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 10px 0 16px;
}

.sd-g {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border: 2px solid #d3d8e0;
    border-radius: 10px;
    background: var(--beyaz);
    color: var(--yazi);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.sd-g[aria-pressed="true"] {
    border-color: var(--anarenk);
    background: #eef7ec;
}

.sd-g > span {
    display: flex;
    gap: 6px;
}

.sd-g i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f1f3f6;
    color: #1e5b9c;
    font-size: 22px;
    font-style: normal;
}

.sd-g svg {
    width: 24px;
    height: 24px;
}

.sd-hata-k {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
}

/* Şekil renkleri: her sembolün şekli de ayrı, renk tek başına ayırt edici değil */
.sb1 { fill: #e53935; stroke: #e53935; }
.sb2 { fill: #1e88e5; stroke: #1e88e5; }
.sb3 { fill: #43a047; stroke: #43a047; }
.sb4 { fill: #f9a825; stroke: #f9a825; }
.sb5 { fill: #d81b60; stroke: #d81b60; }
.sb6 { fill: #8e24aa; stroke: #8e24aa; }
.sb7 { fill: #00acc1; stroke: #00acc1; }
.sb8 { fill: #3949ab; stroke: #3949ab; }
.sb9 { fill: #6d4c41; stroke: #6d4c41; }

svg[class^="sb"] {
    stroke-width: 0;
    stroke-linejoin: round;
}

/* Günün Sözcüğü (gunun-sozcugu.html, js/sozcuk.js). Renkler: s2 doğru yer, s1 yanlış yer, s0 yok */
:root {
    --sz-s2: #3f8f3a;
    --sz-s1: #c9a227;
    --sz-s0: #7a7f87;
}

.sz-tahta {
    display: grid;
    width: min(100cqw, (100cqh - 30px) * 5 / 6 + 24px);
    grid-template-rows: repeat(6, 1fr);
    gap: 6px;
}

.sz-satir {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.sz-satir.salla {
    animation: sz-salla .4s;
}

@keyframes sz-salla {
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.sz-h {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border: 2px solid #c8ccd4;
    background: var(--beyaz);
    font-size: clamp(18px, 8cqmin, 32px);
    font-weight: 700;
    line-height: 1;
}

.sz-h.dolu {
    border-color: #6b7078;
}

.sz-h.s0, .sz-h.s1, .sz-h.s2, .sz-k.s0, .sz-k.s1, .sz-k.s2 {
    border-color: transparent;
    color: var(--beyaz);
}

.sz-h.s0, .sz-k.s0 { background: var(--sz-s0); }
.sz-h.s1, .sz-k.s1 { background: var(--sz-s1); }
.sz-h.s2, .sz-k.s2 { background: var(--sz-s2); }

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

.sz-ist {
    font-size: 14px;
}

.sz-ipucu-metin {
    flex: none;
    height: 20px;
    overflow: hidden;
    white-space: nowrap;
    color: #c27c00;
    font-weight: 700;
    text-align: center;
}

.sz-klavye {
    flex: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    user-select: none;
    -webkit-user-select: none;
}

.sz-k-satir {
    display: flex;
    gap: 4px;
}

.sz-k {
    flex: 1 1 0;
    min-width: 0;
    height: clamp(42px, 7dvh, 56px);
    padding: 0;
    border: 0;
    border-radius: 5px;
    background: #d3d6da;
    color: var(--yazi);
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

.sz-k-genis {
    flex-grow: 1.6;
    font-size: 14px;
}

/* İçi boş şekil (Hafıza Kartları zor seviye) */
svg.cerceve {
    fill: none;
    stroke-width: 2.2;
}

/* Hafıza Kartları (hafiza-kartlari.html, js/hafiza.js) */
/* --k sütun, --s satır; zor seviyede sahne yataysa 6×4 */
.hk-tahta {
    --k: 4;
    --s: 4;
    display: grid;
    grid-template-columns: repeat(var(--k), 1fr);
    grid-template-rows: repeat(var(--s), 1fr);
    gap: 8px;
    width: min(100cqw, 100cqh * var(--k) / var(--s));
    aspect-ratio: var(--k) / var(--s);
}

.hk-kolay { --s: 3; }
.hk-zor { --s: 6; }

@container (orientation: landscape) {
    .hk-zor { --k: 6; --s: 4; }
}

.hk-kart {
    position: relative;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    perspective: 600px;
}

.hk-arka, .hk-on {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transition: transform .3s;
}

.hk-arka {
    background: var(--anarenk) repeating-linear-gradient(45deg, transparent 0 8px, rgba(255, 255, 255, .08) 8px 16px);
}

.hk-on {
    background: var(--beyaz);
    border: 2px solid #e0e4ea;
    transform: rotateY(180deg);
}

.hk-on svg {
    width: 62%;
    height: 62%;
}

.hk-kart.acik .hk-arka, .bakis .hk-arka {
    transform: rotateY(180deg);
}

.hk-kart.acik .hk-on, .bakis .hk-on {
    transform: rotateY(0);
}

.hk-kart.bulundu .hk-on {
    border-color: var(--anarenk);
    opacity: .75;
}

@media (prefers-reduced-motion: reduce) {
    .hk-arka, .hk-on {
        transition: none;
    }
}

/* Yapboz (yapboz.html, js/yapboz.js) */
.yb-onizleme {
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 6px;
    object-fit: cover;
    background: #e0e4ea;
}

.yb-tahta {
    display: grid;
    width: min(100cqw, 100cqh);
    gap: 2px;
    aspect-ratio: 1;
    padding: 2px;
    border-radius: 6px;
    background: var(--oyun-koyu);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.yb-tahta.yb-n3 { grid-template: repeat(3, 1fr) / repeat(3, 1fr); }
.yb-tahta.yb-n4 { grid-template: repeat(4, 1fr) / repeat(4, 1fr); }
.yb-tahta.yb-n5 { grid-template: repeat(5, 1fr) / repeat(5, 1fr); }
.yb-tahta.yb-n6 { grid-template: repeat(6, 1fr) / repeat(6, 1fr); }

.yb-parca {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    cursor: grab;
    touch-action: none;
}

/* Birleşik komşular: parça aradaki 2 px'lik boşluğu da kaplar, çizgi kaybolur (js/yapboz.js j-sag / j-alt) */
.yb-parca.j-sag {
    width: calc(100% + 2px);
}

.yb-parca.j-alt {
    height: calc(100% + 2px);
}

.yb-parca.secili, .yb-parca.tutulan {
    outline: 3px solid #ffc107;
    outline-offset: -3px;
}

/* Sürüklenen parçanın boşalan yeri ve bırakılacağı hedef */
.yb-parca.kalkan {
    opacity: .25;
    outline: 0;
}

.yb-parca.hedef {
    outline: 3px solid var(--beyaz);
    outline-offset: -3px;
    filter: brightness(1.15);
}

.yb-parca.oturdu {
    animation: yb-otur .3s ease-out;
}

@keyframes yb-otur {
    40% { filter: brightness(1.35); }
}

/* Sürüklenen parça bu katmana çizilir (js/yapboz.js) */
.yb-ust {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

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

.yb-galeri {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.yb-foto {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: var(--beyaz);
    color: var(--yazi);
    font: inherit;
    font-size: 13px;
    text-align: center;
    cursor: pointer;
}

.yb-foto[aria-pressed="true"] {
    border-color: var(--anarenk);
}

.yb-foto img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 5px;
    object-fit: cover;
}

.yb-kendi {
    justify-content: center;
    border: 2px dashed #b8bec8;
}

.yb-kendi-ikon {
    font-size: 36px;
    line-height: 1;
    color: var(--anarenk);
}

.yb-not {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}
