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

html, body {
    font-family: Arial, sans-serif;
    background-color: #333;
    color: white;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: row;
    height: 100%;
}

.sidebar {
    width: 400px;
    display: flex;
    flex-direction: column;
    padding: 10px;
    text-align: center;
    overflow-y: auto;
    max-height: 100vh;
    justify-content: space-around;
}

.controls {
    padding: 20px 10px;
    border-radius: 8px;
    display: flex;
    flex-flow: column nowrap;
    align-items: center;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    background-color: #333;
    gap: 10px;
    text-align: center;
}

.controls h2 {
    font-size: 1.8rem;
}

.controls > span {
    font-size: 0.9rem;
    color: #ccc;
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0;
}

#timer {
    font-size: 2rem;
    font-weight: bold;
    color: #4CAF50;
}

.controls > div[title] {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    margin-bottom: 2px;
    width: 100%;
    justify-content: center;
}

.controls > div[title] label {
    font-size: 0.9rem;
    color: #ccc;
}

.controls > div[title] output {
    font-size: 0.9rem;
    color: #4CAF50;
    font-weight: bold;
    min-width: 3.5em;
}

input[type="range"]:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-row {
    display: flex;
    justify-content: center;
    width: 100%;
}

.control-btn {
    width: 200px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
    background: linear-gradient(45deg, #4CAF50, #45a049);
    font-size: 1.0em;
}

.control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.instruccions {
    background-color: #333;
    padding: 15px 10px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    text-align: center;
}

.instruccions h3 {
    margin: 10px 0;
}

.instruccions p {
    margin: 8px 0;
    font-size: 0.9rem;
    color: #ccc;
}

.canvas-container {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #222;
    overflow: hidden;
}

canvas {
    display: block;
    background: radial-gradient(circle at center, #0f0f23, #000);
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    touch-action: none;
}

#message {
    font-size: 1rem;
    min-height: 1.5rem;
    color: #4CAF50;
    font-weight: bold;
    margin: 10px 0;
}

.sidebar > a {
    font-size: 0.9em;
    color: #555;
}

@media (max-width: 700px) {
    html, body {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow: auto;
    }

    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: none;
        overflow: visible;
        justify-content: flex-start;
        padding: 8px;
        gap: 6px;
    }

    .controls {
        padding: 10px 6px;
        gap: 4px;
    }

    .controls h2 {
        font-size: 1.3rem;
    }

    .status-row {
        margin: 4px 0;
    }

    #timer {
        font-size: 1.5rem;
    }

    .control-btn {
        width: 160px;
        height: 38px;
        font-size: 0.9em;
    }

    .instruccions {
        padding: 8px 6px;
        max-width: 320px;
        margin: 0 auto;
    }

    .instruccions h3 {
        margin: 4px 0;
    }

    .instruccions p {
        margin: 4px 0;
    }

    #message {
        margin: 6px 0;
        font-size: 0.9rem;
        min-height: 1.2rem;
    }

    .sidebar > a {
        font-size: 0.8em;
    }

    .canvas-container {
        flex: none;
        width: 100%;
        aspect-ratio: 1 / 1;
    }
}
