* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: monospace;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    font-size: 14px;
    padding: 2rem;
    background: repeating-linear-gradient(
        45deg,
        white,
        white 8px,
        #f0f0f0 8px,
        #f0f0f0 16px
    );
    background-color: white;
}

.game-container {
    display: flex;
    gap: 3rem;
    max-width: 1200px;
    width: 100%;
    height: calc(100vh - 4rem);
    position: relative;
    z-index: 1;
}

.sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 0;
}

.header {
    text-align: left;
    border: 1px solid black;
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
    background: white;
}

h1 {
    color: black;
    margin-bottom: 0.75rem;
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.1rem;
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

h1 .emoji {
    font-size: 1.2em;
}

h2 {
    color: black;
    font-family: monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    font-weight: normal;
    margin-bottom: 0.75rem;
}

p {
    letter-spacing: 0.5px;
}

.controls {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.75rem;
    width: 100%;
}

button {
    padding: 0.25rem 0.75rem;
    border: 1px solid black;
    border-radius: 0;
    font-family: monospace;
    background: white;
    font-size: 0.9rem;
    cursor: pointer;
    text-transform: lowercase;
    white-space: nowrap;
}

button:hover {
    background-color: #f0f0f0;
}

button.difficulty {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    min-width: 60px;
    text-align: center;
}

button.difficulty.active {
    background-color: black;
    color: white;
}

.maze-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    border: 1px solid black;
}

#maze {
    display: grid;
    gap: 0;
    border: 1px solid black;
    padding: 0;
    margin: 0;
    width: fit-content;
    line-height: 0;
    background: white;
}

.cell {
    width: 16px;
    height: 16px;
    background-color: white;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    position: relative;
}

.wall {
    background-color: black;
}

.path {
    background-color: white;
}

.trace {
    background-color: rgba(255, 223, 0, 0.4);
}

.game-stats {
    display: flex;
    gap: 2rem;
    border: 1px solid black;
    padding: 0.75rem;
    width: 100%;
    font-size: 0.85rem;
    font-family: monospace;
    letter-spacing: 1px;
    text-transform: lowercase;
    background: white;
}

.game-stats span {
    font-family: monospace;
    letter-spacing: 1px;
}

.instructions {
    font-size: 0.8rem;
    color: black;
    text-align: center;
    margin-top: auto;
    padding-top: 1rem;
    font-family: monospace;
    letter-spacing: 1px;
    text-transform: lowercase;
}

.instructions-box {
    margin: 1rem 0;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-family: monospace;
}

.instructions-box ul {
    list-style: none;
    padding: 0;
}

.instructions-box li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.instructions-box li::before {
    content: "·";
    color: black;
    font-weight: bold;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.success-modal {
    background: white;
    padding: 2rem;
    border: 1px solid black;
    font-family: monospace;
    text-align: center;
    position: relative;
    max-width: 90%;
    width: 300px;
    letter-spacing: 1px;
}

.success-modal h2 {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    font-weight: normal;
    letter-spacing: 2px;
}

.success-stats {
    display: inline-flex;
    gap: 2.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    border: 1px solid black;
    font-size: 0.85rem;
    text-transform: lowercase;
}

.success-modal button {
    padding: 0.5rem 1.5rem;
    margin: 0;
    text-transform: lowercase;
    transition: all 0.15s ease;
    background: white;
    border: 1px solid black;
    font-family: monospace;
    font-size: 0.85rem;
    cursor: pointer;
}

.success-modal button:hover {
    background: black;
    color: white;
}

.success-emoji {
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
    line-height: 1;
}
