body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #eef2f5;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 { margin-bottom: 25px; }

/* Başlık Link Stili */
h1 a {
    color: #37474f;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.2s;
}

h1 a:hover {
    color: #2196F3; /* Üzerine gelince mavi olsun */
}

/* Kapsayıcı */
.main-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    width: 100%;
}

/* İşlem Kartı */
.problem-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    padding: 15px;
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.problem-card:hover { transform: translateY(-5px); }

/* --- KART BAŞLIĞI (HEADER) --- */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.tools-left {
    display: flex;
    align-items: center;
    gap: 5px;
}

.student-badge {
    background-color: #37474f;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 5px;
}

/* Sayı Giriş Kutuları ve Oklar */
.tools-left input[type=number] {
    width: 70px;
    padding: 5px;
    font-size: 1.2rem;
    font-weight: bold;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 5px;
    color: #495057;
}

.tools-left input[type=number]::-webkit-inner-spin-button, 
.tools-left input[type=number]::-webkit-outer-spin-button {  
    opacity: 1;
    cursor: pointer;
    height: 100%;
}

.x-sign {
    font-weight: bold;
    color: #888;
    margin: 0 2px;
}

.tools-right {
    display: flex;
    gap: 8px;
}

/* Üst Araç Butonları (Zar, Maske) */
.icon-tool-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.generate-btn { background-color: #e3f2fd; color: #1976d2; }
.generate-btn:hover { background-color: #bbdefb; }

.missing-mode-btn { background-color: #f3e5f5; color: #7b1fa2; }
.missing-mode-btn.active { background-color: #7b1fa2; color: white; box-shadow: 0 0 5px #7b1fa2; }
.missing-mode-btn:hover { opacity: 0.8; }


/* --- GRID ALANI --- */
.grid-container {
    display: grid;
    justify-content: center;
    margin-bottom: 15px;
    padding: 10px;
}

.grid-cell {
    width: 42px;
    height: 42px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #455a64;
    user-select: none;
    position: relative;
}

/* Hücre Renkleri */
.cell-carry { background-color: #E1BEE7; color: #6A1B9A; border-radius: 50%; width: 32px; height: 32px; margin: auto; font-size: 0.9rem; }
.cell-add-carry { background-color: #CFD8DC; color: #546E7A; border-radius: 50%; width: 28px; height: 28px; margin: auto; font-size: 0.8rem; }
.cell-result { background-color: #C8E6C9; color: #2E7D32; border-radius: 4px; }
.cell-sign { color: #78909C; }
.cell-line { border-top: 2px solid #546E7A; height: 1px; width: 100%; align-self: center; }

/* Basamak Renkleri */
.num2-digit-0, .partial-row-0 { background-color: #E3F2FD; color: #1565C0; border-radius: 4px; }
.num2-digit-1, .partial-row-1 { background-color: #FCE4EC; color: #C2185B; border-radius: 4px; }
.num2-digit-2, .partial-row-2 { background-color: #FFF3E0; color: #E65100; border-radius: 4px; }

/* İnteraktif */
.cell-clickable:hover { cursor: pointer; filter: brightness(0.95); }
.highlight-active { box-shadow: 0 0 0 3px #FFD700 inset; transform: scale(1.1); z-index: 5; background-color: #FFFDE7; transition: 0.1s; }

/* Input (Gizli Mod) */
.missing-digit-input {
    width: 100%; height: 100%; text-align: center; font-size: 1.3rem;
    border: 2px dashed #2196F3; border-radius: 4px; outline: none; background: transparent; color: #333;
}
.missing-digit-input.correct { background-color: #E8F5E9; border-color: #4CAF50; color: #2E7D32; }
.missing-digit-input.incorrect { background-color: #FFEBEE; border-color: #F44336; color: #C62828; }

/* --- ALT KONTROL BUTONLARI --- */
.controls-row {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.control-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.1s;
}

.control-btn:active { transform: scale(0.95); }

.start-btn { background-color: #4CAF50; }
.next-btn { background-color: #FF9800; }
.show-btn { background-color: #03A9F4; }
.check-btn { background-color: #9C27B0; }
.reset-btn { background-color: #B0BEC5; color: #37474f; }