/* ============================================================
   Gazete32 Çengel Bulmaca v2.0
   Tüm renkler tema CSS değişkenlerine bağlıdır.
   body.ht-light-mode ile otomatik light mod çalışır.
   ============================================================ */

/* Sitenin genel Google Fonts linki "Roboto Condensed" için sadece
   700/900 ağırlıklarını çekiyor, 400 (normal) hiç yüklenmiyor.
   Bu yüzden font-weight:400 verdiğimizde tarayıcı elindeki en yakın
   ağırlık olan 700'ü kullanıyor ve harfler mobilde kalın kalıyor.
   Aşağıdaki @import SADECE eksik olan 400 ağırlığını ekliyor;
   sitenin mevcut 700/900 tanımlarıyla çakışmıyor, aynı aileye
   otomatik olarak eklenip tamamlıyor. @import CSS dosyasının en
   başında olmak zorunda (yorum satırları hariç başka kural olamaz). */
@import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@400&display=swap&subset=latin,latin-ext');

/* ── Kapsayıcı ── */
.g32-cengel {
    --cw-cell: 44px;
    --cw-gap:  4px;

    font-family: var(--font, 'Roboto', sans-serif);
    color: var(--text, #e8e8e8);
    background: var(--bg2, #141414);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: var(--radius, 4px);
    box-shadow: var(--shadow, 0 2px 12px rgba(0,0,0,.5));
    overflow: hidden;
    position: relative;
    margin: 16px 0;

    /* Mobilde tarayıcının fontu otomatik büyütmesini/kalınlaştırmasını engelle */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Başlık ── */
.cw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 16px;
    background: var(--bg3, #1a1a1a);
    border-bottom: 1px solid var(--border, #2a2a2a);
    flex-wrap: wrap;
}

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

.cw-logo {
    color: var(--primary, #cc0000);
    flex-shrink: 0;
}

.cw-title {
    font-family: var(--font-heading, 'Roboto Condensed', sans-serif);
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text, #e8e8e8);
    line-height: 1.1;
}

.cw-sub {
    font-size: 10px;
    color: var(--text3, #777);
    line-height: 1;
    margin-top: 2px;
}

.cw-score-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.cw-score-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text3, #777);
}

.cw-score-val {
    font-family: var(--font-heading, 'Roboto Condensed', sans-serif);
    font-weight: 700;
    font-size: 16px;
    color: var(--primary, #cc0000);
    font-variant-numeric: tabular-nums;
}

/* ── İlerleme çubuğu ── */
.cw-progress-wrap {
    height: 3px;
    background: var(--bg4, #222);
}

.cw-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary, #cc0000), #ff6666);
    transition: width .5s ease;
    border-radius: 0 2px 2px 0;
}

/* ── Gövde: grid + ipuçları yan yana ── */
.cw-body {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0;
    align-items: start;
}

.cw-left {
    padding: 14px 12px 14px 16px;
    min-width: 0;
}

/* ── Bulmaca Grid ── */
.cw-grid {
    display: grid;
    grid-template-columns: repeat( var(--cw-cols), var(--cw-cell) );
    gap: var(--cw-gap);
    justify-content: start;
}

/* ── Hücre ── */
.cw-cell {
    width:    var(--cw-cell);
    height:   var(--cw-cell);
    position: relative;
    border-radius: var(--radius, 4px);
    overflow: visible;
}

/* Siyah hücre */
.cw-black {
    background: var(--bg, #0d0d0d);
    border-radius: var(--radius, 4px);
}

/* Numara etiketi */
.cw-num {
    position: absolute;
    top: 3px;
    left: 4px;
    font-size: 9px;
    font-weight: 700;
    color: var(--text3, #777);
    pointer-events: none;
    z-index: 2;
    line-height: 1;
}

/* Input */
.cw-cell input {
    direction: ltr;
    unicode-bidi: bidi-override;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: 1px solid var(--border2, #333);
    border-radius: var(--radius, 4px);
    background: var(--bg3, #1a1a1a);
    color: var(--text, #e8e8e8);
    text-align: center;
    font-size: 17px;
    font-weight: 700;
    font-family: var(--font-heading, 'Roboto Condensed', 'Arial Narrow', Arial, sans-serif);
    text-transform: uppercase;
    outline: none;
    transition: background var(--trans, .2s ease), border-color var(--trans, .2s ease);
    cursor: pointer;
    caret-color: var(--primary, #cc0000);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.cw-cell input:focus {
    border-color: var(--primary, #cc0000);
    background: var(--bg4, #222);
}

/* Highlight durumları */
.cw-cell.cw-in-entry input {
    background: rgba(204, 0, 0, .08);
    border-color: rgba(204, 0, 0, .3);
}

.cw-cell.cw-active-cell input {
    background: rgba(204, 0, 0, .2) !important;
    border-color: var(--primary, #cc0000) !important;
    box-shadow: 0 0 0 2px rgba(204, 0, 0, .25);
}

/* Doğru / Yanlış */
.cw-cell input.cw-ok {
    background: rgba(0, 180, 80, .15) !important;
    border-color: rgba(0, 180, 80, .6) !important;
    color: #33cc77 !important;
}

.cw-cell input.cw-bad {
    background: rgba(204, 0, 0, .15) !important;
    border-color: rgba(204, 0, 0, .5) !important;
    color: #ff5555 !important;
    animation: cw-shake .25s ease;
}

@keyframes cw-shake {
    0%, 100% { transform: translateX(0); }
    30%       { transform: translateX(-3px); }
    70%       { transform: translateX(3px); }
}

/* İpucu ile ortaya çıkan hücre */
.cw-cell input.cw-revealed {
    background: rgba(77, 182, 245, .12) !important;
    border-color: rgba(77, 182, 245, .5) !important;
    color: #4db6f5 !important;
}

/* ── Aksiyonlar ── */
.cw-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.cw-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius, 4px);
    font-family: var(--font, 'Roboto', sans-serif);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--trans, .2s ease);
    white-space: nowrap;
}

.cw-btn--primary {
    background: var(--primary, #cc0000);
    border-color: var(--primary, #cc0000);
    color: #fff;
}

.cw-btn--primary:hover {
    background: var(--primary-dark, #990000);
    border-color: var(--primary-dark, #990000);
}

.cw-btn--ghost {
    background: var(--bg4, #222);
    border-color: var(--border2, #333);
    color: var(--text2, #aaa);
}

.cw-btn--ghost:hover {
    background: var(--bg3, #1a1a1a);
    color: var(--text, #e8e8e8);
}

/* ── Hint Bar ── */
.cw-hint-bar {
    margin-top: 10px;
    padding: 7px 10px;
    background: var(--bg3, #1a1a1a);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: var(--radius, 4px);
    font-size: 12px;
    color: var(--text3, #777);
    min-height: 34px;
    line-height: 1.45;
    transition: color var(--trans, .2s ease);
}

.cw-hint-bar.cw-hint--ok  { color: #33cc77; border-color: rgba(0,180,80,.3); }
.cw-hint-bar.cw-hint--bad { color: #ff5555; border-color: rgba(204,0,0,.3); }

/* ── İpuçları Paneli ── */
.cw-clues-wrap {
    padding: 14px 16px 14px 4px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    max-height: calc( var(--cw-cell) * 10 + 60px );
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border2, #333) transparent;
}

.cw-clues-wrap::-webkit-scrollbar       { width: 4px; }
.cw-clues-wrap::-webkit-scrollbar-track { background: transparent; }
.cw-clues-wrap::-webkit-scrollbar-thumb { background: var(--border2, #333); border-radius: 2px; }

.cw-clues-section {
    background: var(--bg3, #1a1a1a);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: var(--radius, 4px);
    overflow: hidden;
}

.cw-clues-title {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: var(--bg4, #222);
    border-bottom: 1px solid var(--border, #2a2a2a);
    font-family: var(--font-heading, 'Roboto Condensed', sans-serif);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--primary, #cc0000);
}

.cw-clues-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.cw-clue {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text2, #aaa);
    border-left: 3px solid transparent;
    transition: all var(--trans, .2s ease);
}

.cw-clue:hover {
    background: var(--bg4, #222);
    color: var(--text, #e8e8e8);
}

.cw-clue.cw-clue--active {
    background: rgba(204, 0, 0, .08);
    border-left-color: var(--primary, #cc0000);
    color: var(--text, #e8e8e8);
    font-weight: 600;
}

.cw-clue-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    background: var(--primary, #cc0000);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 3px;
    flex-shrink: 0;
    line-height: 1;
    padding: 0 3px;
}

.cw-clue--active .cw-clue-num {
    background: var(--primary-dark, #990000);
}

/* ── Kazanma Overlay ── */
.cw-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 20;
    border-radius: inherit;
}

.cw-overlay[hidden] { display: none !important; }

.cw-overlay-card {
    background: var(--bg2, #141414);
    border: 1px solid var(--border, #2a2a2a);
    border-radius: var(--radius, 4px);
    box-shadow: var(--shadow, 0 2px 12px rgba(0,0,0,.5));
    padding: 28px 32px;
    text-align: center;
    max-width: 300px;
    width: 88%;
}

.cw-overlay-icon  { font-size: 44px; margin-bottom: 10px; }
.cw-overlay-title {
    font-family: var(--font-heading, 'Roboto Condensed', sans-serif);
    font-weight: 700;
    font-size: 22px;
    color: var(--text, #e8e8e8);
    margin-bottom: 6px;
}
.cw-overlay-sub {
    font-size: 14px;
    color: var(--text2, #aaa);
    margin-bottom: 18px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .g32-cengel { --cw-cell: 40px; --cw-gap: 3px; }

    .cw-body {
        grid-template-columns: 1fr;
    }

    .cw-left        { padding: 12px; }
    .cw-clues-wrap  { padding: 0 12px 12px; max-height: none; }
    .cw-clues-title { font-size: 10px; }
}

@media (max-width: 600px) {
    .g32-cengel { --cw-cell: 34px; --cw-gap: 2px; }

    .cw-num          { font-size: 8px; top: 2px; left: 3px; }
    .cw-actions      { gap: 4px; }
    .cw-btn          { padding: 7px 10px; font-size: 12px; }
}

@media (max-width: 420px) {
    .g32-cengel { --cw-cell: 30px; --cw-gap: 2px; }

    .cw-num          { font-size: 7px; }
    .cw-btn span:not(.cw-btn svg ~ span) { display: none; }
}


/* ============================================================
   MOBİL HARF KESİLME DÜZELTMESİ (v3.2.3)
   Sorun: Tema/tarayıcı mobilde input'a kendi padding, line-height,
   min-height ve font-size kurallarını uyguluyor; kutu 30-34px'e
   küçülünce harf kutunun içine sığmayıp yarım görünüyordu.
   Çözüm: bu kutular için tüm bu değerleri !important ile sabitle,
   harfi tarayıcı dikey olarak ortalasın.
   ============================================================ */
.g32-cengel .cw-cell input {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: normal !important;
    text-indent: 0 !important;
    letter-spacing: 0 !important;
    overflow: visible !important;
    text-align: center !important;
    vertical-align: top;
}

@media (max-width: 600px) {
    .g32-cengel .cw-cell input { font-size: 16px !important; font-weight: 700 !important; }
}
@media (max-width: 420px) {
    .g32-cengel .cw-cell input { font-size: 15px !important; }
}

/* ── Bulmaca içi fotoğraf ── */
.cw-cell.cw-photo { width: auto; height: auto; overflow: hidden; padding: 0; }
.cw-cell.cw-photo img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }

/* ── Fotoğraf büyütme ── */
.cw-cell.cw-photo img { cursor: zoom-in; }
.cw-lightbox {
    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,.88); cursor: zoom-out; padding: 16px;
}
.cw-lightbox[hidden] { display: none; }
.cw-lightbox img { max-width: 100%; max-height: 92vh; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,.6); }

/* ── Dokunmatik cihazlar için bulmaca klavyesi ── */
.cw-kb {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9998;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background: var(--bg3, #1a1a1a);
    border-top: 1px solid var(--border, #2a2a2a);
    box-shadow: 0 -4px 16px rgba(0,0,0,.35);
    touch-action: manipulation; -webkit-user-select: none; user-select: none;
    font-family: var(--font, 'Roboto', sans-serif);
}
.cw-kb[hidden] { display: none; }
.cw-kb-top { display: flex; align-items: center; gap: 6px; padding: 0 2px 6px; }
.cw-kb-clue {
    flex: 1; min-width: 0; font-size: 13px; line-height: 1.3;
    color: var(--text, #e8e8e8);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cw-kb-nav {
    flex-shrink: 0; width: 38px; height: 34px; padding: 0;
    border: 1px solid var(--border2, #333); border-radius: 6px;
    background: var(--bg4, #222); color: var(--text, #e8e8e8);
    font-size: 20px; line-height: 1; cursor: pointer;
}
.cw-kb-row { display: flex; gap: 4px; margin-bottom: 4px; justify-content: center; }
.cw-kb-key {
    flex: 1 1 0; min-width: 0; height: 46px; padding: 0;
    border: 0; border-radius: 6px;
    background: var(--bg4, #2a2a2a); color: var(--text, #e8e8e8);
    font-size: 18px; font-weight: 700; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.cw-kb-key:active { background: var(--primary, #cc0000); color: #fff; }
.cw-kb-back { flex: 1.6 1 0; }

/* ── Alt bilgi (sürüm) ── */
.cw-footer {
    padding: 8px 16px;
    border-top: 1px solid var(--border, #2a2a2a);
    background: var(--bg3, #1a1a1a);
    color: var(--text3, #777);
    font-size: 11px; text-align: center; letter-spacing: .02em;
}
.cw-footer .cw-ver { margin-left: 6px; font-weight: 700; color: var(--text2, #aaa); }
