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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #111;
    color: #eee;
    text-align: center;
    padding: 2rem 1rem;
}

header {
    margin-bottom: 1.5rem;
}

header img {
    width: 72px;
    height: 72px;
    image-rendering: pixelated;
    display: block;
    margin: 0 auto 0.75rem;
}

header h1 {
    font-size: 2.5rem;
}

hr {
    border: none;
    border-top: 1px solid #333;
    margin-bottom: 1.5rem;
}

main {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

section {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    color: #aaa;
}

input[type="file"],
input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: #222;
    border: 1px solid #333;
    border-radius: 4px;
    color: #eee;
    font-size: 0.95rem;
}

input[type="file"]:focus,
input[type="text"]:focus {
    outline: none;
    border-color: #555;
}

.option-group {
    margin-bottom: 1rem;
}

.option-group input[type="radio"] {
    margin-right: 0.4rem;
}

.option-group label {
    display: inline;
    color: #eee;
    font-size: 0.95rem;
}

.option-group>div {
    margin-top: 0.75rem;
    padding-left: 1.25rem;
}

input[type="range"] {
    width: 100%;
    margin-top: 0.5rem;
}

#output-quality-text {
    margin: 0.75rem 0;
    font-size: 0.95rem;
}

#output-quality-text p {
    margin-bottom: 0.4rem;
}

#output-quality-reduction {
    font-weight: bold;
    color: #fff;
}

.note {
    font-size: 0.85rem;
    color: #888;
}

button {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    background: #eee;
    color: #111;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 0.75rem;
}

button:hover {
    background: #fff;
}

.progress-wrap {
    background: #222;
    border-radius: 4px;
    overflow: hidden;
    height: 1.5rem;
    margin-top: 0.75rem;
}

.progress-wrap>div {
    height: 100%;
    background: #eee;
    color: #111;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.2s ease;
}

.canvas-row {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
}

canvas {
    max-height: 400px;
    max-width: 100%;
    image-rendering: pixelated;
}

#download-form {
    text-align: center;
}