/* =========================================
   GENEL DEĞİŞKENLER VE SAYFA YAPISI
   ========================================= */
:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --bg-color: #F3F4F6;
    --card-bg: #FFFFFF;
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --success: #10B981;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    padding: 15px;
    box-sizing: border-box;
    overscroll-behavior-y: none;
}

.page-wrapper {
    width: 100%;
    max-width: 450px;
    display: flex;
    flex-direction: column;
}

/* =========================================
   ANA OYUN KARTI VE 3'LÜ KUTULAR
   ========================================= */
.question-card {
    background-color: var(--card-bg);
    padding: 25px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.instruction-note {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.digit-inputs-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.digit-box {
    width: 60px !important;
    height: 60px !important;
    font-size: 32px !important;
    text-align: center;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    background: #FAFAFA;
    color: var(--primary-color);
    font-weight: 800;
    caret-color: transparent;
    user-select: none;
    pointer-events: none;
    box-sizing: border-box;
    padding: 0;
}

.digit-box.filled {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.15);
}

.feedback {
    min-height: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-main);
    font-size: 0.95rem;
}

.feedback-success { color: var(--success); }
.feedback-error { color: #E74C3C; }

/* =========================================
   TUŞ TAKIMI (GÜNCELLENMİŞ EŞİT BOYUT DÜZENİ)
   ========================================= */
.custom-keypad {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.key-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.key-btn {
    flex: 1; /* Satırdaki tüm butonların genişliğini tamamen eşitler */
    height: 55px;
    font-size: 1.2rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    color: white;
    transition: transform 0.1s;
    user-select: none;
    touch-action: manipulation;
}

/* Rakam Tuşları (Mavi) */
.num-btn {
    background-color: var(--primary-color);
    box-shadow: 0 4px 0 var(--primary-hover);
}

.num-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* Eylem Tuşları (Sil ve Onay) */
.action-btn {
    flex: 1; /* GÜNCELLEME: Rakam butonlarıyla aynı büyüklükte olması için 1 yapıldı */
    font-size: 1rem;
}

.action-btn.del-btn {
    background-color: #E74C3C;
    box-shadow: 0 4px 0 #C0392B;
}

.action-btn.del-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

.action-btn.submit-btn {
    background-color: var(--success);
    box-shadow: 0 4px 0 #059669;
}

.action-btn.submit-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}

/* =========================================
   TAHMİN GEÇMİŞİ VE YENİDEN BAŞLAT
   ========================================= */
.history-panel {
    background-color: #F9FAFB;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.history-panel summary {
    padding: 12px 15px;
    font-weight: 600;
    cursor: pointer;
    color: var(--primary-color);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-panel summary::after {
    content: "▼";
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-panel[open] summary::after {
    content: "▲";
}

#historyList {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--border-color);
}

#historyList li {
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#historyList li:last-child {
    border-bottom: none;
}

.hidden {
    display: none !important;
}

.main-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--primary-hover);
    transition: transform 0.1s;
    margin-top: 15px;
}

.main-btn:active {
    transform: translateY(4px);
    box-shadow: none;
}



/* Html etiketine de eklemek tüm cihazlarda garanti sonuç verir. Dosyanın en üstüne ekleyebilirsin: */
html {
    overscroll-behavior-y: none;
}

/* =========================================
   YENİ: NOT ALMA (İPUCU) BUTONLARI
   ========================================= */
.scratchpad-container {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Tam 5 sütun yapar, böylece 10 buton 2 satıra bölünür */
    gap: 8px; /* Butonlar arası boşluk */
    margin-bottom: 20px;
    width: 100%;
    max-width: 320px; /* Çok geniş ekranda dağılmaması için sınırlar */
    margin-left: auto;
    margin-right: auto; /* Konteyneri ortalar */
}

.scratch-btn {
    width: 100%; /* Grid hücresini tam kaplar */
    height: 45px; /* Önceki 32px'ti, hem mobil hem PC için daha basılabilir boyuta geldi */
    border: 2px solid var(--border-color);
    background-color: #e99e9e;
    color: black;
    font-size: 1.3rem; /* Rakamlar daha okunaklı olsun diye büyütüldü */
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.scratch-btn:active {
    transform: scale(0.9);
}