:root {
    --bg-color: #f0f0f0;
    --text-color: #333;
    --cell-bg: white;
    --cell-fixed-bg: #e0e0e0;
    --neon-color: #4CAF50;
    --neon-glow: 0 0 5px #4CAF50, 0 0 10px #4CAF50, 0 0 15px #4CAF50, 0 0 20px #4CAF50;
}

.dark-theme {
    --bg-color: #0a1a2f; /* Slightly blue dark background */
    --text-color: #f0f0f0;
    --cell-bg: #1a2a3f;
    --cell-fixed-bg: #2a3a4f;
}

body {
    font-family: 'Press Start 2P', cursive;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

#game-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

#game-board {
    display: inline-grid;
    gap: 1px;
    background-color: #ccc;
    padding: 1px;
    margin: 20px auto;
}

.cell {
    width: 40px;
    height: 40px;
    background-color: var(--cell-bg);
    color: var(--text-color);
    border: 1px solid var(--neon-color);
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    cursor: pointer;
}

.cell.fixed {
    background-color: var(--cell-fixed-bg);
    cursor: not-allowed;
}

button {
    margin: 10px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
}

.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    z-index: 1000;
}

.notification.success {
    background-color: #4CAF50;
}

.notification.error {
    background-color: #f44336;
}

#loading-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
    z-index: 1000;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#tips-button, #fullscreen-button {
    position: static;
    padding: 0;
    background-color: transparent;
}

#tips-button {
    left: 10px;
    bottom: 10px;
}

#fullscreen-button {
    right: 10px;
    bottom: 10px;
}

#game-header {
    position: fixed;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.icon-button {
    color: var(--neon-color);
    transition: color 0.3s;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
}

.icon-button:hover {
    color: var(--text-color);
    text-shadow: var(--neon-glow);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
    transition: background-color 0.3s;
}

.dark-theme .modal {
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 15% auto;
    padding: 20px;
    border: 1px solid var(--neon-color);
    width: 80%;
    max-width: 600px;
    transition: background-color 0.3s, color 0.3s;
}

.close {
    color: var(--text-color);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: var(--neon-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-content h2 {
    color: var(--neon-color);
    margin-bottom: 20px;
}

.modal-content ul {
    list-style-type: none;
    padding-left: 0;
}

.modal-content li {
    margin-bottom: 10px;
}

#refresh-button {
    display: none; /* Initially hidden */
    background: none;
    border: none;
    font-size: 24px;
    color: var(--neon-color);
    cursor: pointer;
    transition: color 0.3s, text-shadow 0.3s;
    margin-top: 20px;
}

#refresh-button:hover {
    color: var(--text-color);
    text-shadow: var(--neon-glow);
}

#home-button {
    display: none; /* Initially hide only the home button */
    background: none;
    border: none;
    font-size: 24px;
    color: var(--neon-color); /* Changed to use the neon color variable */
    cursor: pointer;
    transition: color 0.3s;
}

#home-button:hover {
    color: var(--text-color);
    text-shadow: var(--neon-glow);
}

#start-screen h1 {
    font-size: 72px;
    color: var(--neon-color);
    margin-bottom: 40px;
    line-height: 1.2;
}

#start-button, .size-button {
    background-color: var(--neon-color);
    color: var(--bg-color);
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Press Start 2P', cursive;
    text-shadow: none;
}

#start-button:hover, .size-button:hover {
    box-shadow: var(--neon-glow);
}
