body {
    font-family: 'Press Start 2P', Arial, sans-serif;
    background-color: #000;
    color: #fff;
    margin: 0;
    padding: 0;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #5b831d;
    padding: 10px 20px;
}

header .logo {
    font-size: 1.5em;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 15px;
}

nav ul li {
    font-size: 1em;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
}

#hero {
    text-align: center;
    padding: 50px 20px;
    background-color: #e80005;
}

#hero h1 {
    font-size: 2.5em;
}

#hero p {
    font-size: 1.2em;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

#canvas-section {
    text-align: center;
    margin: 0 10px;
}

#canvas-section canvas {
    background-color: #fff;
    border: 2px solid #5b831d;
    max-width: 100%;
    height: auto;
}

#canvas-section button {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #5b831d;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: 'Press Start 2P', Arial, sans-serif;
}

#canvas-section button:hover {
    background-color: #4e7019;
}

#tools-section {
    text-align: center;
    margin-bottom: 20px;
}

#tools-section h2, #tools-section h3 {
    margin-bottom: 10px;
}

.tool-button {
    display: block;
    width: 150px;
    margin: 5px auto;
    padding: 10px;
    background-color: #5b831d;
    color: #fff;
    border: none;
    cursor: pointer;
    font-family: 'Press Start 2P', Arial, sans-serif;
}

.tool-button.active {
    background-color: #e80005;
}

#tools-section input[type=range] {
    margin: 10px 0;
}

#palette-section {
    text-align: center;
    margin-bottom: 20px;
}

#palette-section h2, #palette-section h3 {
    margin-bottom: 10px;
}

#color-palette, #last-colors {
    display: flex;
    flex-wrap: wrap;
    width: 160px;
    margin: 0 auto;
    border: 2px solid #5b831d;
    padding: 5px;
}

#color-palette div, #last-colors div {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

#tutorial {
    text-align: center;
    padding: 20px;
}

#tutorial p {
    max-width: 600px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    main {
        flex-direction: row;
        justify-content: center;
        align-items: flex-start;
        gap: 20px;
    }

    #canvas-section {
        margin: 0;
    }
}

.gallery {
    padding: 20px;
    text-align: center;
}

.gallery-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.gallery-image {
    border: 2px solid #5b831d;
    padding: 5px;
    background-color: #000;
}

.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.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    color: #000;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.modal-content input {
    display: block;
    width: calc(100% - 20px);
    margin: 10px auto;
    padding: 10px;
    font-size: 1em;
}

.modal-content button {
    background-color: #5b831d;
    color: #fff;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
    font-family: 'Press Start 2P', Arial, sans-serif;
}

.modal-content button:hover {
    background-color: #4e7019;
}

#reference-section {
    text-align: center;
    margin-top: 20px;
}

#reference-images {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.reference-image {
    width: 50px;
    height: 50px;
    cursor: pointer;
    border: 2px solid #5b831d;
}

.reference-image:hover {
    border-color: #e80005;
}
