/* --- Sudoku X Specific Styles --- */

.sudoku-x-container {
    max-width: 900px;
    justify-content: center;
    gap: 20px;
}

#sudoku-x-grid-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 480px; 
    margin: 0 auto;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    grid-template-rows: repeat(9, 1fr);
    border: 3px solid #333;
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.theme-dark .sudoku-grid { border-color: var(--text-color-dark); }
.theme-paper .sudoku-grid { border-color: var(--text-color-paper); }

.diagonal-cell {
    transition: background-color 0.3s;
}
.theme-light .diagonal-cell { background-color: #e7eef5; }
.theme-dark .diagonal-cell { background-color: #40566e; }
.theme-paper .diagonal-cell { background-color: #f5efd8; }

#sudoku-x-grid-container .cell {
    font-size: clamp(20px, 6vw, 36px);
    transition: background-color 0.2s;
}

#sudoku-x-grid-container .notes-grid {
    font-size: clamp(8px, 2vw, 12px);
}

/* --- Responsive Layout --- */
@media (max-width: 768px) {
    .sudoku-x-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        max-width: 100%;
    }
    #sudoku-x-grid-container {
        max-width: 95vw;
        order: 1;
    }
    .game-controls {
        width: 95vw;
        max-width: 400px;
        order: 2;
        margin-top: -5px;
    }
}

@media (min-width: 769px) {
  .sudoku-x-container {
    display: grid;
    grid-template-columns: minmax(0, 550px) auto;
    gap: 0px;
    align-items: flex-start;
  }
  .difficulty-and-new-game-controls {
    grid-column: 1 / -1;
    grid-row: 1;
    padding-left: 25px; 
  }
  #sudoku-x-grid-container {
    grid-column: 1;
    grid-row: 2;
    margin-top: 10px; /* <--- أضف هذا السطر هنا */
  }
  .game-controls {
    grid-column: 2;
    grid-row: 2;
    width: 240px;
    margin-top: 10px; /* <--- أضف هذا السطر هنا */
  }
}

/* ============================================= */
/* ==  أكواد تحسين زر التلميح (Hint) - أضف هذا  == */
/* ============================================= */

/*
   تمت إضافة متغيرات الألوان للتأثير.
   هذه ستعمل مع الثيمات الموجودة في style.css الرئيسي.
*/
body.theme-light {
    --hint-glow-color: #fef08a; /* لون التوهج: أصفر فاتح */
    --hint-text-color: #4a90E2;  /* لون رقم التلميح: أزرق */
}

body.theme-dark {
    --hint-glow-color: #fde047; /* لون التوهج: أصفر ساطع */
    --hint-text-color: #5DADE2;  /* لون رقم التلميح: أزرق فاتح */
}

body.theme-paper {
    --hint-glow-color: #47f7fd; /* لون التوهج: سماوي */
    --hint-text-color: #B58900;  /* لون رقم التلميح: أصفر داكن */
}

/* --- حركة التوهج (Animation) --- */
.hint-reveal {
    animation: hint-glow 800ms ease-in-out;
}

@keyframes hint-glow {
    0% {
        background-color: var(--cell-bg-color);
        box-shadow: none;
    }
    50% {
        background-color: var(--hint-glow-color);
        box-shadow: 0 0 15px var(--hint-glow-color);
    }
    100% {
        background-color: var(--cell-bg-color);
        box-shadow: none;
    }
}

/* --- التنسيق الدائم للخلية التي تم تلميحها --- */
.cell.hint-cell {
    color: var(--hint-text-color) !important;
    font-weight: bold;
}



/* تأثير الظهور الإبداعي عند الضغط على Solve */
.reveal-pulse {
    animation: solvePulse 0.5s ease-out;
    color: var(--hint-text-color) !important; /* لون مميز للأرقام التي كشفها النظام */
}

@keyframes solvePulse {
    0% {
        transform: scale(0.5);
        background-color: rgba(74, 144, 226, 0.3);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        background-color: rgba(74, 144, 226, 0.1);
    }
    100% {
        transform: scale(1);
        background-color: transparent;
        opacity: 1;
    }
}

