/* Global layout */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Orbitron', system-ui, sans-serif;
    color: #e6f3ff;

    background: #020617 url('cartoon.jpg') no-repeat center center fixed;
    background-size: cover;
}


/* Background with cartoon.jpg */
body {
    background: #020617 url("cartoon.jpg") center center / cover fixed no-repeat;
    position: relative;
    overflow-y: scroll;
}

/* Blue scrollbars */
body::-webkit-scrollbar {
    width: 10px;
}
body::-webkit-scrollbar-track {
    background: rgba(0, 10, 30, 0.9);
}
body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00b4ff, #0044ff);
    border-radius: 6px;
}
body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ff0044, #00b4ff);
}

/* Dark overlay for readability */
.page-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at top, rgba(0, 80, 255, 0.35), transparent 60%),
                radial-gradient(circle at bottom, rgba(255, 0, 80, 0.25), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Header */
.top-bar {
    position: relative;
    z-index: 2;
    padding: 10px 16px 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.top-banner img {
    max-width: 100%;
    border-radius: 6px;
    box-shadow: 0 0 18px rgba(0, 150, 255, 0.7);
    border: 1px solid rgba(0, 150, 255, 0.8);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.top-banner:hover img {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 0 24px rgba(255, 0, 80, 0.9);
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    padding: 4px 2px;
    color: #9fbfff;
    text-shadow: 0 0 6px rgba(0, 150, 255, 0.8);
}

.home-link {
    text-decoration: none;
}

/* Neon link */
.neon-link {
    color: #7fd4ff;
    position: relative;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}
.neon-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #00b4ff, #ff0044);
    box-shadow: 0 0 8px rgba(0, 180, 255, 0.9);
    transition: width 0.25s ease;
}
.neon-link:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 180, 255, 1);
}
.neon-link:hover::after {
    width: 100%;
}

/* Main */
.main-wrap {
    position: relative;
    z-index: 1;
    min-height: calc(100vh - 120px);
    display: flex;
    justify-content: center;
    padding: 20px 10px 40px;
}

.tool-shell {
    width: 100%;
    max-width: 980px;
    background: rgba(3, 10, 30, 0.92);
    border-radius: 14px;
    border: 1px solid rgba(0, 150, 255, 0.8);
    box-shadow:
        0 0 25px rgba(0, 150, 255, 0.7),
        0 0 40px rgba(255, 0, 80, 0.4);
    padding: 20px 18px 24px;
    backdrop-filter: blur(6px);
}

/* Titles */
.neon-title {
    margin: 0 0 6px;
    font-size: 1.8rem;
    color: #e6f3ff;
    text-align: center;
    text-shadow:
        0 0 10px rgba(0, 180, 255, 1),
        0 0 18px rgba(255, 0, 80, 0.8);
}

.neon-subtitle {
    margin: 0 0 16px;
    text-align: center;
    font-size: 0.9rem;
    color: #a9cfff;
}

/* Controls */
.controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.file-label {
    position: relative;
    overflow: hidden;
    padding: 8px 14px;
    cursor: pointer;
    color: #cfe9ff;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: radial-gradient(circle at top left, rgba(0, 150, 255, 0.25), rgba(2, 6, 23, 0.95));
}

.file-label input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.neon-border {
    border-radius: 999px;
    border: 1px solid rgba(0, 150, 255, 0.9);
    box-shadow: 0 0 12px rgba(0, 150, 255, 0.7);
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.neon-border:hover {
    box-shadow:
        0 0 16px rgba(0, 180, 255, 1),
        0 0 24px rgba(255, 0, 80, 0.8);
    border-color: rgba(255, 0, 80, 0.9);
    transform: translateY(-1px);
}

/* Buttons */
.buttons-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.neon-btn {
    position: relative;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(0, 150, 255, 0.9);
    background: radial-gradient(circle at top, rgba(0, 150, 255, 0.3), rgba(2, 6, 23, 0.95));
    color: #e6f3ff;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow:
        0 0 12px rgba(0, 150, 255, 0.8),
        0 0 18px rgba(255, 0, 80, 0.5);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.neon-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 20% 0, rgba(255, 255, 255, 0.18), transparent 55%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.neon-btn:hover {
    transform: translateY(-1px) scale(1.02);
    border-color: rgba(255, 0, 80, 0.9);
    box-shadow:
        0 0 16px rgba(0, 180, 255, 1),
        0 0 26px rgba(255, 0, 80, 0.9);
}

.neon-btn:hover::before {
    opacity: 1;
}

.neon-btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow:
        0 0 10px rgba(0, 150, 255, 0.7),
        0 0 16px rgba(255, 0, 80, 0.6);
}

/* Button variants */
.neon-btn.secondary {
    border-color: rgba(255, 0, 80, 0.8);
    background: radial-gradient(circle at top, rgba(255, 0, 80, 0.35), rgba(2, 6, 23, 0.95));
}
.neon-btn.success {
    border-color: rgba(0, 255, 180, 0.8);
    background: radial-gradient(circle at top, rgba(0, 255, 180, 0.35), rgba(2, 6, 23, 0.95));
}

/* Slider */
.slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 0.8rem;
    color: #b7d7ff;
}

.slider-row input[type="range"] {
    flex: 1;
    accent-color: #00b4ff;
}

/* Canvas area */
.canvas-wrap {
    position: relative;
    padding: 10px;
    border-radius: 14px;
    background: radial-gradient(circle at top left, rgba(0, 150, 255, 0.18), rgba(2, 6, 23, 0.98));
}

#cartoonCanvas {
    display: block;
    max-width: 100%;
    margin: 0 auto;
    background: rgba(2, 6, 23, 0.9);
    border-radius: 10px;
    border: 1px solid rgba(0, 150, 255, 0.7);
    box-shadow:
        0 0 18px rgba(0, 150, 255, 0.7),
        0 0 26px rgba(255, 0, 80, 0.4);
}

.canvas-hint {
    margin-top: 6px;
    font-size: 0.75rem;
    color: #8fb7ff;
    text-align: center;
}

/* Footer */
.footer-bar {
    position: relative;
    z-index: 1;
    padding: 10px 14px 14px;
    font-size: 0.75rem;
    color: #8fb7ff;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    background: linear-gradient(90deg, rgba(0, 10, 40, 0.95), rgba(20, 0, 40, 0.95));
    border-top: 1px solid rgba(0, 150, 255, 0.7);
    box-shadow: 0 -4px 18px rgba(0, 150, 255, 0.5);
}

.footer-watermark {
    color: #ff7fae;
}

/* Responsive */
@media (max-width: 720px) {
    .tool-shell {
        padding: 16px 12px 18px;
    }
    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }
    .buttons-group {
        justify-content: flex-start;
    }
    .neon-title {
        font-size: 1.5rem;
    }
}
