/* --- BASE STYLES --- */
body { 
    background-color: white; 
    color: black; 
    font-family: sans-serif; 
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

#game-container {
    width: 100%;
    max-width: 350px; 
    position: relative; /* Essential for the Pause Overlay */
}

/* --- STATS & CONTROLS --- */
.stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 0.85rem;
    color: #333;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}

/* --- Shared Style for All Control Buttons --- */
.control-button {
    padding: 5px 10px;
    border: 1px solid #121df1;
    background: white;
    color: #121df1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* Updated selector to use the shared class */
.controls button {
    background: white
    /* Inherits from .control-button */
}


/* --- THE GRID --- */
#grid { 
    display: grid; 
    grid-template-columns: repeat(9, 1fr); 
    width: 100%; 
    border: 2px solid #121df1;
}

.cell { 
    aspect-ratio: 1 / 1;
    width: 100%; 
    border: 1px solid #ccc; 
    font-size: 1.2rem; 
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.cell.fixed { background-color: #f0f0f0; font-weight: bold; }
.cell.selected { background-color: #bbdefb !important; }
.cell.error { color: #d32f2f; font-weight: bold; }
.cell.hinted { color: #121df1; font-style: italic; }

/* --- PAUSE SYSTEM --- */
#grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(8px);
    display: none; 
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#grid-overlay.active { display: flex; }

.pause-message {
    font-size: 1.5rem;
    font-weight: bold;
    color: #121df1;
    background: white;
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* --- KEYPAD --- */
#number-pad {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

#number-pad button {
    width: 45px;
    height: 45px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 8px;
    background: #e0e0e0;
    border: 1px solid #999;
    cursor: pointer;
}

/* --- BANNERS (Win & Game Over) --- */
.win-banner, .game-over-banner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
    z-index: 9999;
    opacity: 0;
    animation: banner-appear 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.win-banner { border: 3px solid #121df1; }
.win-banner h2 { color: #121df1; margin: 0; }

.game-over-banner { border: 3px solid #d32f2f; }
.game-over-banner h2 { color: #d32f2f; margin: 0; }

/* Styling the button inside the game over banner */
.game-over-banner .control-button {
    margin-top: 20px;
    padding: 10px 20px; /* Slightly larger button for primary action */
    font-size: 1rem;
    border-color: #d32f2f; /* Using the game over color for the button border */
    color: #d32f2f;
}

@keyframes banner-appear {
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* --- ANIMATIONS --- */
@keyframes glow-pulse {
    0% { background-color: transparent; }
    50% { background-color: rgba(18, 29, 241, 0.4); box-shadow: inset 0 0 15px #121df1; }
    100% { background-color: transparent; }
}

.glow-success { animation: glow-pulse 1.2s ease-in-out; }

@keyframes puff-of-smoke {
    0% { transform: scale(1); opacity: 1; filter: blur(0px); }
    50% { transform: scale(1.6); opacity: 0.4; filter: blur(4px); background: #ccc; }
    100% { transform: scale(2.2); opacity: 0; filter: blur(12px); }
  }
  
  .smoke-out {
    animation: puff-of-smoke 0.7s forwards;
    pointer-events: none; /* Can't click it while it's vanishing */
  }

  /* Highlight for matching numbers */
  .same-number-highlight {
      background-color: #bbdefb !important; /* A light blue highlight */
      transition: background-color 0.2s ease;
  }
  
  /* Light highlight for the crosshair effect */
.grid-crosshair {
    background-color: #f0f4ff !important; 
    transition: background-color 0.1s ease;
}
