:root {
    --bg: #0f1115;
    --card: #181b22;
    --text: #e6e8ee;
    --muted: #9aa0b4;
    --accent: #4f7cff;
    --accent-hover: #6a90ff;
    --border: #2a2f3a;
    --radius: 14px;
    --def-width: min(1000px, 80vw);
}

body {
    margin: 0;
    min-height: 100vh;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    align-items: center;

    background: radial-gradient(circle at top, #1a1f2b, var(--bg));
    font-family: Inter, system-ui, sans-serif;
    color: var(--text);

    padding: 40px 0;
    overflow-y: auto;
}

.back-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 40px;
    height: 40px;

    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 10px;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    backdrop-filter: blur(6px);
    transition: background 0.2s ease, transform 0.15s ease;
    z-index: 1000;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.16);
    transform: translateX(-2px);
}

.back-btn::before {
    content: "←";
    font-size: 20px;
    color: #fff;
}

#toast-container {
    padding: 24px;
    z-index: 20;
    pointer-events: none;
    width: var(--def-width);
}

.toast {
    background: oklch(62.7% 0.194 149.214);
    color: #e6e8ee;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(-10px);
    animation: toast-in 0.25s ease forwards;
}

@keyframes toast-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .toast {
        font-size: 15px;
        padding: 14px 22px;
    }
}

.card {
    width: var(--def-width);
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.project-desc {
    margin-right: 10px;
}

.title {
    font-size: 22px;
    font-weight: 600;
}

.subtitle {
    color: var(--muted);
    font-size: 14px;
}

.hidden {
    display: none !important;
}

.controls {
    display: flex;
    gap: 12px;
}

button {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: .2s;
    background: var(--accent);
    border: none;
    color: #fff;
}

button:hover {
    background: var(--accent-hover);
}

button.disabled {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
    opacity: .6;
    cursor: not-allowed;
}

/* hide native checkbox */
.toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 44px;
    height: 24px;
    background: #2a2d38;
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
}

/* knob */
.toggle::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #9aa0b4;
    border-radius: 50%;
    transition: transform 0.2s ease, background 0.2s ease;
}

/* checked state */
.toggle:checked {
    background: var(--accent);
}

.toggle:checked::before {
    transform: translateX(20px);
    background: white;
}

/* focus (keyboard accessibility) */
.toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

#canvas-wrap {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
}

canvas {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

@media (max-width: 768px) {

    body {
        font-size: 16px;
    }

    h1 {
        font-size: 24px;
    }

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

    button {
        width: 100%;
        font-size: 16px;
        padding: 14px 16px;
        border-radius: 12px;
    }
}
