* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: #0b0c10;
    background-image: 
        radial-gradient(at 15% 15%, rgba(43, 226, 61, 0.18) 0px, transparent 45%),
        radial-gradient(at 85% 85%, rgba(157, 20, 255, 0.15) 0px, transparent 45%);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
}

.settings-wrap {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 20;
}

.settings-btn {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.settings-btn:hover,
.settings-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
    transform: rotate(20deg);
}

.settings-panel {
    position: absolute;
    top: 52px;
    right: 0;
    width: 210px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(20, 21, 28, 0.94);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.settings-panel label {
    display: block;
    margin-bottom: 8px;
    color: #a0a0b0;
    font-size: 0.8rem;
    text-align: left;
}

/* When safety mode is active, apply the border and background */
#qrcode img.qr-center-logo.safety-on {
    border-radius: 8px !important;
    border: 2px solid #ffffff !important;
    background: #ffffff !important;
}

/* When safety mode is OFF, remove border and background container */
#qrcode img.qr-center-logo:not(.safety-on) {
    border-radius: 0px !important;
    border: 0px solid transparent !important;
    background: transparent !important;
}

.safety-mode-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.07);
    cursor: pointer;
    display: inline-grid;
    place-content: center;
    transition: all 0.2s ease;
}

.safety-mode-label input[type="checkbox"]::before {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(-45deg) scale(0);
    transition: transform 0.1s ease-in-out;
    margin-top: -1px;
}

.safety-mode-label input[type="checkbox"]:checked {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.safety-mode-label input[type="checkbox"]:checked::before {
    transform: rotate(-45deg) scale(1);
}

.size-controls {
    display: flex;
    gap: 6px;
}

.size-controls input {
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    outline: none;
    width: 100%;
}

.size-controls input:focus {
    border-color: rgba(255, 255, 255, 0.3);
}

.card {
    position: relative;
    z-index: 10;
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 35px 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    max-width: 500px;
    width: 100%;
    text-align: center;
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #ffffff;
}

p {
    font-size: 0.95rem;
    color: #a0a0b0;
    margin-bottom: 25px;
}

input[type="text"] {
    width: 100%;
    padding: 12px 16px;
    margin: 20px 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
}

input[type="text"]:focus {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

input[type="text"]::placeholder {
    color: #707080;
}

#qrcode {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

#qrcode img {
    border-radius: 0px;
}

#qrcode img.qr-center-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.color-pickers {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 15px 0;
    font-size: 0.85rem;
    color: #a0a0b0;
}

.color-pickers label {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 12px;
    border-radius: 10px;
    flex: 1;
    cursor: pointer;
}

.color-pickers input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    padding: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    background: transparent;
}

.color-pickers input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-pickers input[type="color"]::-webkit-color-swatch {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.color-pickers input[type="color"]::-moz-color-swatch {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.logo-picker {
    margin-bottom: 15px;
}

.custom-file-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #a0a0b0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-file-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

#download-btn {
    width: 100%;
    padding: 12px 16px;
    margin: 15px 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#download-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.3);
}

footer {
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-website, .footer-credit {
    font-size: 0.82rem;
    color: #a0a0b0;
    margin-bottom: 0;
}

.footer-website a {
    color: #04ff00;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.footer-website a:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.footer-credit {
    font-size: 0.75rem;
    color: #707080;
}

#snowCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
}