:root {
    --parchment: #F5DEB3;
    --wood-dark: #8B4513;
    --wood-light: #DEB887;
    --accent: #800000;
}

body {
    background-color: #46c3f4;
    font-family: "New Rocker", system-ui;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.navbar {
    background-color: var(--wood-dark);
    padding: 10px;
    text-align: center;
    border-radius: 10px;
}

.navbar a {
    color: var(--parchment);
    text-decoration: none;
    margin: 0 25px;
    font-size: 1.7em;
}

.navbar a:hover {
    color: var(--accent);
}

.container {
    background-color: rgba(245, 222, 179, 0.9);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    max-width: 800px;
    margin: 0 auto;
    border: 3px solid var(--wood-dark);
    position: relative;
    z-index: 2;
}

h1 {
    color: var(--wood-dark);
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.canvas-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

canvas {
    border: 8px solid var(--wood-dark);
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
    cursor: crosshair;
    flex: 1;
    max-width: 400px;
    height: auto;
}

.editor-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.editor-wrapper {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.editor-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.toolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: rgba(139, 69, 19, 0.1);
    border-radius: 10px;
}

.toolbar button {
    width: 35px;
    height: 35px;
    font-size: 1.2em;
    padding: 5px;
}

.toolbar button.active {
    border: 2px solid var(--accent);
    border-color: var(--accent);
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--parchment);
    padding: 20px;
    border-radius: 10px;
    border: 3px solid var(--wood-dark);
}

.size-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.size-options button {
    padding: 15px;
    font-size: 1.2em;
}

.size-options button.active {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: rgba(139, 69, 19, 0.1);
    border-radius: 10px;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex-direction: row;
    align-items: center;
}

.control-group.buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.control-group.buttons button {
    flex: 1;
    min-width: 120px;
    max-width: 200px;
}

label {
    font-size: 1.2em;
    color: var(--wood-dark);
}

button {
    background-color: var(--wood-dark);
    color: var(--parchment);
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-family: "New Rocker", system-ui;
    font-size: 1.1em;
    transition: all 0.3s ease;
    margin: 5px;
}

button:hover {
    background-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

input[type="color"] {
    width: 60px;
    height: 40px;
    border: 3px solid var(--wood-dark);
    border-radius: 5px;
    cursor: pointer;
}

#fileInput {
    display: none;
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #1a3f5c;
}

::-webkit-scrollbar-thumb {
    background: #2c5c84;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3d7daf;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 0.6; }
}

.wave-img {
    position: fixed;
    width: 400px;
    height: 200px;
    pointer-events: none;
    z-index: -1;
    opacity: 0;
    animation: fadeIn 1s forwards;
}

.wave-img:nth-of-type(1) {
    bottom: 5%;
    left: 5%;
    animation-delay: 0s;
}

.wave-img:nth-of-type(2) {
    top: 10%;
    right: 5%;
    animation-delay: 2s;
}

.wave-img:nth-of-type(3) {
    bottom: 15%;
    right: 10%;
    animation-delay: 4s;
}

@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
        width: 90%;
    }

    h1 {
        font-size: 1.8em;
    }

    .controls {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .control-group {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        justify-content: center;
    }

    input[type="color"] {
        width: 100%;
        height: 60px;
        margin: 5px 0;
    }

    button {
        width: 100%;
        padding: 15px;
        font-size: 1.2em;
        margin: 5px 0;
    }

    label {
        font-size: 1.4em;
    }

    .wave-img {
        display: none;
    }

    .editor-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .toolbar {
        margin-top: 10px;
        flex-direction: row;
        justify-content: center;
        width: 100%;
    }

    .editor-controls {
        flex-direction: column-reverse;
        align-items: center;
    }

    .toolbar {
        flex-direction: row;
        justify-content: center;
        width: 100%;
    }

    canvas {
        width: 100%;
        height: auto;
    }

    .controls {
        width: 100%;
    }

    .control-group.buttons {
        flex-direction: column;
        margin-left: 0;
    }
}

@media screen and (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }

    .canvas-container {
        margin: 10px -15px;
    }

    canvas {
        width: 90%;
        height: auto;
        border-width: 4px;
    }
}

.gallery-img {
    width: 100px;
    height: 100px;
    margin: 10px;
    border: 2px solid var(--wood-dark);
    border-radius: 5px;
}

.control-group.colors {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.color-input {
    display: flex;
    align-items: center;
    gap: 10px;
}
