/* -----------------------------
   Page layout
----------------------------- */

body {
    font-family: Arial, sans-serif;
    background: #eeeeee;
    text-align: center;
    margin: 0;
    padding: 0;
}

h1 {
    margin-top: 24px;
    margin-bottom: 8px;
}

/* -----------------------------
   Timer
----------------------------- */

#timer {
    display: inline-block;
    margin: 10px 0 18px 0;
    padding: 10px 20px;
    background: #111111;
    color: white;
    border-radius: 999px;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
}

/* -----------------------------
   Toolbar
----------------------------- */

#toolbar {
    margin-bottom: 15px;
}

#palette {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 650px;
    margin: 0 auto 12px auto;
}

.color-button {
    width: 28px;
    height: 28px;
    border: 2px solid #555555;
    cursor: pointer;
    border-radius: 4px;
}

.color-button.selected {
    border: 3px solid black;
    transform: scale(1.12);
}

button {
    padding: 8px 14px;
    margin: 4px;
    cursor: pointer;
    border-radius: 8px;
    border: 1px solid #999999;
    background: white;
}

button:hover {
    background: #dddddd;
}

/* -----------------------------
   Submit button
----------------------------- */

#submitButton {
    background: #222222;
    color: white;
    border: none;
}

#submitButton:disabled {
    background: #999999;
    cursor: not-allowed;
    opacity: 0.6;
}

#submitButton:not(:disabled):hover {
    background: #000000;
}

/* -----------------------------
   Drawing canvas
----------------------------- */

canvas {
    background: white;
    border: 2px solid black;
    image-rendering: pixelated;

    touch-action: none;
    max-width: 100%;
    height: auto;
}
/* -----------------------------
   Welcome modal
----------------------------- */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-box {
    width: min(430px, 90%);
    background: white;
    color: #222222;
    padding: 28px;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    text-align: left;
    animation: modalPop 0.25s ease-out;
}

.modal-box h2 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 28px;
}

.modal-box p {
    line-height: 1.5;
    color: #555555;
}

.modal-controls {
    display: grid;
    gap: 8px;
    margin: 20px 0;
    padding: 14px;
    background: #f2f2f2;
    border-radius: 12px;
}

#closeModalButton {
    width: 100%;
    border: none;
    border-radius: 12px;
    background: #111111;
    color: white;
    padding: 12px 16px;
    font-size: 16px;
    cursor: pointer;
}

#closeModalButton:hover {
    background: #333333;
}

.modal-overlay.hidden {
    display: none;
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* -----------------------------
   Footer
----------------------------- */

.page-footer {
    margin-top: 32px;
    padding: 22px 16px;
    background: #111111;
    color: white;
    text-align: center;
}

.page-footer p {
    margin: 4px 0;
    font-size: 15px;
}

.page-footer .footer-small {
    color: #bbbbbb;
    font-size: 13px;
}
