:root {
    color-scheme: dark;
}

/* GLOBAL LAYOUT */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column; /* nav (top) -> main (middle) -> footer (bottom) */
    background: #111;
    color: #eee;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* NAVBAR */

.navbar {
    width: 100%;
    background: #181818;
    padding: 12px 20px;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #222;
}

.navbar > div {
    max-width: 960px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.nav-right a {
    margin-left: 18px;
    text-decoration: none;
    color: #bbb;
    font-size: 14px;
}

.nav-right a:hover {
    color: #fff;
}

/* MAIN AREA */

.main {
    flex: 1; /* pushes footer to bottom when content is short */
    display: flex;
    justify-content: center;
    padding: 20px;
}

.app {
    width: 100%;
    max-width: 960px;
    background: #181818;
    padding: 20px 24px 24px;
    border-radius: 14px;
    box-shadow: 0 0 25px rgba(0,0,0,0.5);
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    margin: 0 0 6px 0;
    font-size: 24px;
}

header p {
    margin: 0;
    font-size: 14px;
    color: #b5b5b5;
}

/* DROP ZONE */

.drop-zone {
    text-align: center;
    padding: 40px;
    background: #202020;
    border: 2px dashed #555;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
}

.drop-zone:hover {
    border-color: #7aa2ff;
    background: #252525;
}

.drop-zone strong {
    display: block;
    margin-bottom: 4px;
}

.hidden {
    display: none;
}

/* CONTROLS */

.controls {
    margin-top: 20px;
    padding: 15px;
    background: #202020;
    border-radius: 10px;
}

.row {
    margin-bottom: 14px;
}

.row label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
}

input[type="number"] {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    border: none;
    background: #151515;
    color: #fff;
}

input[type="number"]:focus {
    outline: 1px solid #7aa2ff;
}

input[type="range"] {
    width: 100%;
    accent-color: #7aa2ff;
}

/* BUTTONS */

.btn {
    display: inline-block;
    padding: 10px 25px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    font-size: 14px;
}

.primary {
    background: #2563eb;
    color: white;
}

.primary:hover {
    background: #1d4ed8;
}

.secondary {
    background: #2c2c2c;
    color: white;
}

.secondary:hover {
    background: #363636;
}

/* PREVIEWS */

.previews {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.panel {
    flex: 1 1 260px;
    background: #202020;
    padding: 12px;
    border-radius: 10px;
    text-align: center;
}

.panel h3 {
    margin: 4px 0 8px 0;
}

.panel img {
    width: 100%;
    max-height: 250px;
    object-fit: contain;
    background: #111;
    padding: 8px;
    border-radius: 8px;
}

.meta {
    font-size: 12px;
    color: #bbb;
}

.diff {
    color: #4ade80;
    font-weight: bold;
}

/* FOOTER */

.footer {
    width: 100%;
    text-align: center;
    padding: 14px 10px;
    color: #666;
    font-size: 13px;
    border-top: 1px solid #222;
    background: #111;
}

.footer a {
    color: #9ca3af;
    text-decoration: none;
}

.footer a:hover {
    color: #e5e7eb;
}

/* GENERIC PAGE WRAPPER (for about/privacy/terms pages) */

.page {
    max-width: 960px;
    margin: 20px auto;
    background: #181818;
    padding: 20px 24px;
    border-radius: 14px;
    box-shadow: 0 0 25px rgba(0,0,0,0.5);
}

.page h1 {
    margin-top: 0;
}

.page p,
.page li {
    font-size: 14px;
    line-height: 1.6;
    color: #ddd;
}

.page ul {
    padding-left: 18px;
}

@media (max-width: 640px) {
    .navbar > div {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .nav-right a {
        margin-left: 0;
        margin-right: 12px;
    }

    .app {
        padding: 16px;
    }
}


/* MOBILE RESPONSIVE FIXES */
@media (max-width: 768px) {

    /* NAVIGATION STACKS NICELY ON MOBILE */
    .navbar .nav-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .nav-right a {
        margin-left: 0;
        margin-right: 15px;
        font-size: 14px;
    }

    /* MAIN APP BOX SHRINKS FOR SMALL SCREENS */
    .app {
        padding: 12px;
        border-radius: 10px;
    }

    header h1 {
        font-size: 18px;
        text-align: center;
    }

    header p {
        font-size: 13px;
        text-align: center;
    }

    /* PREVIEW PANELS STACK VERTICALLY */
    .previews {
        flex-direction: column;
    }

    .panel img {
        max-height: 200px;
    }

    /* BUTTONS FIT MOBILE WIDTH */
    .btn {
        width: 100%;
        padding: 12px;
        border-radius: 10px;
        margin-top: 8px;
    }

    /* AD BLOCK MOBILE SIZING */
    .ad-container {
        margin-left: auto;
        margin-right: auto;
        width: 100%;
    }

    /* FOOTER CENTERED & SMALLER */
    .footer p {
        font-size: 13px;
        line-height: 1.4;
        text-align: center;
    }
}

@media (max-width: 480px) {
    /* SUPER SMALL SCREENS (IPHONES / ANDROID) */
    .nav-left {
        font-size: 18px;
    }

    header h1 {
        font-size: 16px;
    }

    .drop-zone {
        padding: 30px 10px;
    }

    .panel img {
        max-height: 160px;
    }
}
