/* Oyunlar bölümü (www/oyunlar). Sitenin stil dosyalarından bağımsız. */
:root {
    --anarenk: #0c6f03;
    --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;
}

.oy-ana {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px 24px;
}

.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-giris {
    margin-bottom: 20px;
}

.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:hover, .oy-dugme:focus-visible {
    filter: brightness(1.15);
}

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

.oy-odul {
    background: #c27c00;
}

/* Liste */
.oy-liste {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.oy-kart {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    padding: 14px;
    border-radius: 8px;
    background: var(--beyaz);
    color: var(--yazi);
    text-decoration: none;
}

.oy-kart:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
}

.oy-kart strong {
    font-size: 18px;
}

.oy-kart-simge {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    font-size: 40px;
    font-weight: 700;
}

.o2048-simge {
    background: #edc22e;
    color: var(--beyaz);
}

/* Panel reklamları (sistem/reklam.asp). Reklam ile oyun kontrolleri arasında boşluk: kaydırma hareketi reklama denk gelmesin */
.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; }

/* 2048 */
.o2048 {
    width: 100%;
    max-width: 440px;
    margin: 10px auto 0;
}

.o2048-ust {
    display: flex;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 10px;
}

.o2048-sayac {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px;
    border-radius: 6px;
    background: var(--oyun-zemin);
    color: var(--beyaz);
}

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

.o2048-sayac strong {
    font-size: 20px;
}

.o2048-alan {
    position: relative;
}

.o2048-tahta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 10px;
    aspect-ratio: 1;
    border-radius: 8px;
    background: var(--oyun-zemin);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.o2048-tas {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    background: var(--oyun-bos);
    color: var(--oyun-koyu);
    font-size: clamp(20px, 8vw, 40px);
    font-weight: 700;
    line-height: 1;
}

.o2048-tas.t2 { background: #eee4da; }
.o2048-tas.t4 { background: #ede0c8; }
.o2048-tas.t8 { background: #f2b179; color: var(--beyaz); }
.o2048-tas.t16 { background: #f59563; color: var(--beyaz); }
.o2048-tas.t32 { background: #f67c5f; color: var(--beyaz); }
.o2048-tas.t64 { background: #f65e3b; color: var(--beyaz); }
.o2048-tas.t128 { background: #edcf72; color: var(--beyaz); font-size: clamp(18px, 7vw, 34px); }
.o2048-tas.t256 { background: #edcc61; color: var(--beyaz); font-size: clamp(18px, 7vw, 34px); }
.o2048-tas.t512 { background: #edc850; color: var(--beyaz); font-size: clamp(18px, 7vw, 34px); }
.o2048-tas.t1024 { background: #edc53f; color: var(--beyaz); font-size: clamp(15px, 5.5vw, 28px); }
.o2048-tas.t2048 { background: #edc22e; color: var(--beyaz); font-size: clamp(15px, 5.5vw, 28px); }
.o2048-tas.tbuyuk { background: var(--anarenk); color: var(--beyaz); font-size: clamp(13px, 4.5vw, 24px); }

.o2048-tas.yeni {
    animation: o2048-belir .2s ease-out;
}

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

@keyframes o2048-belir {
    from { transform: scale(0); }
}

@keyframes o2048-birles {
    50% { transform: scale(1.15); }
}

@media (prefers-reduced-motion: reduce) {
    .o2048-tas.yeni, .o2048-tas.birlesti {
        animation: none;
    }
}

.o2048-perde {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    border-radius: 8px;
    background: rgba(238, 228, 218, .85);
    color: var(--oyun-koyu);
    text-align: center;
}

.o2048-perde[hidden] {
    display: none;
}

.o2048-perde strong {
    font-size: 28px;
}

.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 ve Nesnel Sudoku (inc/sudoku.asp, js/sudoku.js) */
.sd-simge {
    background: #1e5b9c;
    color: var(--beyaz);
}

.nesnel-simge {
    gap: 6px;
    background: var(--beyaz);
    border: 2px solid #e0e4ea;
}

.nesnel-simge svg {
    width: 40px;
    height: 40px;
}

.sd {
    width: 100%;
    max-width: 480px;
    margin: 10px auto 0;
}

.sd-ust {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

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

.sd-sekme {
    border: 0;
    padding: 8px 12px;
    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;
    gap: 6px;
}

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

.sd-seviye select {
    padding: 6px;
    border: 1px solid #bbb;
    border-radius: 6px;
    font: inherit;
}

.sd-bilgi {
    flex: 1;
    font-size: 14px;
    color: #666;
}

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

.sd-alan {
    position: relative;
}

.sd-tahta {
    display: grid;
    aspect-ratio: 1;
    border: 3px solid var(--oyun-koyu);
    background: var(--beyaz);
    user-select: none;
    -webkit-user-select: none;
}

.sd-tahta.sd-n9 { grid-template-columns: repeat(9, 1fr); }
.sd-tahta.sd-n6 { grid-template-columns: repeat(6, 1fr); }

.sd-h {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0;
    border: 0;
    border-right: 1px solid #c8ccd4;
    border-bottom: 1px solid #c8ccd4;
    background: var(--beyaz);
    color: #1e5b9c;
    font: inherit;
    font-size: clamp(18px, 6vw, 28px);
    line-height: 1;
    cursor: pointer;
}

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

.sd-h.sabit { color: var(--oyun-koyu); font-weight: 700; }
.sd-h.iliskili { background: #eef3fa; }
.sd-h.ayni { background: #cfe0f5; }
.sd-h.secili { background: #a9c9ef; }
.sd-h.hata { color: #d32f2f; background-color: #fdecea; }
.sd-h.hata.secili { background: #f8c9c4; }

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

/* Nesnel Sudoku: sabit şekiller dolu, oyuncunun girdikleri çerçeveli; hatalı giriş kırmızı çerçeve */
.sd-nesne .sd-h:not(.sabit) > svg {
    fill-opacity: .35;
    stroke-width: 2;
}

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

.sd-not {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    padding: 1px;
    color: #666;
    font-size: clamp(8px, 2.4vw, 11px);
}

.sd-n6 .sd-not { grid-template-rows: repeat(2, 1fr); }

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

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

.sd-perde {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: rgba(255, 255, 255, .9);
    text-align: center;
}

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

.sd-perde strong {
    font-size: 28px;
}

.sd-tus {
    display: grid;
    gap: 6px;
    margin-top: 12px;
}

.sd-tus.sd-n9 { grid-template-columns: repeat(9, 1fr); }
.sd-tus.sd-n6 { grid-template-columns: repeat(6, 1fr); }

.sd-tus-d {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1.15;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: #e0e4ea;
    color: #1e5b9c;
    font: inherit;
    font-size: clamp(18px, 6vw, 26px);
    font-weight: 700;
    cursor: pointer;
}

.sd-tus-d svg {
    width: 70%;
    height: 70%;
}

.sd-arac {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.sd-arac .oy-dugme {
    flex: 1 1 auto;
}

.sd-hata-k {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 14px;
}

/* Ş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üğü (inc/sozcuk.asp, js/sozcuk.js). Renkler: s2 doğru yer, s1 yanlış yer, s0 yok */
:root {
    --sz-s2: #3f8f3a;
    --sz-s1: #c9a227;
    --sz-s0: #7a7f87;
}

.sz-simge {
    gap: 6px;
    background: var(--beyaz);
    border: 2px solid #e0e4ea;
}

.sz-simge b {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 4px;
    color: var(--beyaz);
    font-size: 26px;
}

.sz {
    width: 100%;
    max-width: 480px;
    margin: 10px auto 0;
}

.sz-alan {
    position: relative;
    max-width: 330px;
    margin: 0 auto;
}

.sz-tahta {
    display: grid;
    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(24px, 8vw, 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, .sz-simge .s0, .sz-simge .s1, .sz-simge .s2 {
    border-color: transparent;
    color: var(--beyaz);
}

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

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

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

.sz-mesaj {
    min-height: 24px;
    margin: 8px 0 0;
    font-weight: 700;
    text-align: center;
}

.sz-ipucu-metin {
    min-height: 20px;
    color: #c27c00;
    font-weight: 700;
    text-align: center;
}

.sz-klavye {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 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: 52px;
    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ı (inc/hafiza.asp, js/hafiza.js) */
.hk-simge {
    gap: 8px;
    background: var(--beyaz);
    border: 2px solid #e0e4ea;
}

.hk-simge i, .hk-simge svg {
    width: 36px;
    height: 48px;
    border-radius: 4px;
}

.hk-simge i {
    background: var(--anarenk);
}

.hk {
    width: 100%;
    max-width: 440px;
    margin: 10px auto 0;
}

.hk-alan {
    max-width: none;
}

.hk-tahta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (min-width: 700px) {
    .hk:has(.hk-zor) {
        max-width: 620px;
    }

    .hk-tahta.hk-zor {
        grid-template-columns: repeat(6, 1fr);
    }
}

.hk-kart {
    position: relative;
    aspect-ratio: 1;
    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;
    }
}

/* Taraklı Yapbozu (inc/yapboz.asp, js/yapboz.js) */
.yb-simge {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    padding: 0;
    overflow: hidden;
    background: var(--beyaz);
}

.yb-simge i {
    width: 100%;
    height: 100%;
    background: #7aa36f;
}

.yb-simge i:nth-child(2), .yb-simge i:nth-child(3) {
    background: #a1683a;
}

.yb {
    width: 100%;
    max-width: 520px;
    margin: 10px auto 0;
}

.yb-onizleme {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    background: #e0e4ea;
}

.yb-baslik {
    min-height: 22px;
    margin-bottom: 6px;
    font-weight: 700;
    text-align: center;
}

.yb-alan {
    max-width: none;
}

.yb-tahta {
    display: grid;
    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-columns: repeat(3, 1fr); }
.yb-tahta.yb-n4 { grid-template-columns: repeat(4, 1fr); }
.yb-tahta.yb-n5 { grid-template-columns: repeat(5, 1fr); }
.yb-tahta.yb-n6 { grid-template-columns: repeat(6, 1fr); }

.yb-parca {
    display: block;
    width: 100%;
    height: auto;
    cursor: grab;
}

.yb-parca.yerinde {
    outline: 2px solid rgba(255, 255, 255, .55);
    outline-offset: -2px;
}

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

.yb-galeri-baslik {
    margin-top: 24px;
}

.yb-galeri {
    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;
}
