body {
    font-family: 'Press Start 2P', cursive;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #2c3e50;
    color: #ecf0f1;
}

#game-container {
    background-color: #34495e;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    color: #f1c40f;
    text-shadow: 2px 2px #2c3e50;
    margin-bottom: 20px;
}

#game-wrapper {
    display: flex;
    flex-direction: row;
    max-width: 100%;
    max-height: 80vh;
}

#maze-container {
    flex: 2;
    max-width: 70vw;
    max-height: 80vh;
    border-radius: 10px;
    overflow: hidden;
}

#status-container {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#status {
    font-size: 0.8rem;
    background-color: #2c3e50;
    padding: 10px;
    border-radius: 5px;
}

#controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

#controls button {
    font-size: 1.5rem;
    padding: 0.5rem;
    background-color: #3498db;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#controls button:hover {
    background-color: #2980b9;
}

#up { grid-column: 2; }
#left { grid-column: 1; grid-row: 2; }
#right { grid-column: 3; grid-row: 2; }
#down { grid-column: 2; grid-row: 3; }

#save-load {
    margin-top: 1rem;
}

#save-load input,
#save-load button,
#how-to {
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    font-family: 'Press Start 2P', cursive;
    background-color: #e74c3c;
    border: none;
    border-radius: 5px;
    color: #ecf0f1;
    cursor: pointer;
    transition: background-color 0.3s;
}

#save-load input {
    background-color: #ecf0f1;
    color: #2c3e50;
}

#save-load button:hover,
#how-to:hover {
    background-color: #c0392b;
}

.hidden {
    display: none;
}

#dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #34495e;
    padding: 1rem;
    border: 2px solid #f1c40f;
    border-radius: 10px;
    z-index: 1000;
    max-width: 80%;
}

#dialog-content {
    margin-bottom: 1rem;
}

#dialog-close {
    font-family: 'Press Start 2P', cursive;
    background-color: #e74c3c;
    border: none;
    border-radius: 5px;
    color: #ecf0f1;
    cursor: pointer;
    padding: 0.5rem;
    transition: background-color 0.3s;
}

#dialog-close:hover {
    background-color: #c0392b;
}

#speech-bubble {
    position: fixed;
    background-color: #fff;
    border: 2px solid #000;
    border-radius: 10px;
    padding: 5px 10px;
    font-size: 0.8rem;
    color: #2c3e50;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    pointer-events: none;
}

#speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #fff transparent;
    transform: translateX(-50%);
}

@media (max-width: 768px) {
    #game-wrapper {
        flex-direction: column;
    }

    #maze-container {
        max-width: 100vw;
        max-height: 60vh;
    }

    #status-container {
        width: 100%;
    }
}