:root {
    --bg-0: #0b0d12;
    --bg-1: #131722;
    --bg-2: #1b2030;
    --fg: #f4f6fb;
    --fg-dim: #9aa3b6;
    --accent: #ff6a3d;
    --accent-2: #ffd166;
    --hot: #2ecc71;
    --not: #ff3b30;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --radius-lg: 28px;
}

@media (prefers-color-scheme: light) {
    :root {
        --bg-0: #f4f5f9;
        --bg-1: #ffffff;
        --bg-2: #fbfbfd;
        --fg: #15171c;
        --fg-dim: #5a6273;
        --border: rgba(0, 0, 0, 0.08);
        --shadow: 0 12px 40px rgba(15, 20, 40, 0.08);
    }
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(255, 106, 61, 0.18), transparent 60%),
        radial-gradient(900px 500px at 110% 10%, rgba(255, 209, 102, 0.12), transparent 60%),
        var(--bg-0);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Text", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100dvh;
}

body {
    display: flex;
    justify-content: center;
    padding: max(env(safe-area-inset-top), 16px) 16px max(env(safe-area-inset-bottom), 24px);
}

.shell {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Hero */
.hero {
    text-align: center;
    padding: 8px 0 4px;
}
.logo {
    font-size: 56px;
    line-height: 1;
    filter: drop-shadow(0 6px 16px rgba(255, 106, 61, 0.45));
    animation: bob 4s ease-in-out infinite;
}
@keyframes bob {
    0%, 100% { transform: translateY(0) rotate(-3deg); }
    50%      { transform: translateY(-6px) rotate(3deg); }
}
.hero h1 {
    margin: 8px 0 2px;
    font-size: 34px;
    letter-spacing: -0.02em;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.tagline {
    margin: 0;
    color: var(--fg-dim);
    font-size: 15px;
}

/* Dropzone */
.dropzone {
    position: relative;
    background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
    border: 1.5px dashed var(--border);
    border-radius: var(--radius-lg);
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
    box-shadow: var(--shadow);
}
.dropzone:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.dropzone.dragover {
    border-color: var(--accent);
    transform: scale(1.01);
    box-shadow: 0 0 0 4px rgba(255, 106, 61, 0.18), var(--shadow);
}
.dropzone-inner {
    text-align: center;
    padding: 24px;
    color: var(--fg-dim);
    transition: opacity .2s ease;
}
.dropzone.has-image .dropzone-inner { opacity: 0; }
.dropzone-icon { font-size: 42px; margin-bottom: 8px; }
.dropzone-title { margin: 0; font-weight: 700; color: var(--fg); font-size: 17px; }
.dropzone-sub { margin: 4px 0 0; font-size: 13px; }

#preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}
.dropzone.has-image #preview { display: block; }

/* Action buttons */
.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.btn {
    appearance: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    font-size: 15px;
    padding: 14px 16px;
    border-radius: 14px;
    transition: transform .08s ease, box-shadow .2s ease, background .2s ease, opacity .2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--fg);
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
    background: linear-gradient(180deg, #2a3142, #1b2030);
    border: 1px solid var(--border);
}
.btn-secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
}
.btn-go {
    width: 100%;
    font-size: 17px;
    color: #1a0c00;
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    box-shadow: 0 10px 24px rgba(255, 106, 61, 0.35);
    padding: 16px;
    min-height: 56px;
    position: relative;
}
.btn-go[disabled] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-go.loading .btn-go-text { opacity: 0; }
.btn-go .spinner {
    position: absolute;
    width: 22px; height: 22px;
    border: 3px solid rgba(26, 12, 0, 0.25);
    border-top-color: #1a0c00;
    border-radius: 50%;
    display: none;
    animation: spin 0.7s linear infinite;
}
.btn-go.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Result */
.result {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 4px;
}
.verdict {
    border-radius: var(--radius);
    padding: 22px 18px;
    text-align: center;
    color: white;
    font-weight: 800;
    letter-spacing: -0.01em;
    box-shadow: var(--shadow);
    animation: pop .35s cubic-bezier(.2,.9,.3,1.3);
    position: relative;
    overflow: hidden;
}
.verdict .big {
    display: block;
    font-size: 30px;
    margin-bottom: 4px;
}
.verdict .reason {
    display: block;
    font-weight: 500;
    font-size: 14px;
    opacity: 0.92;
    margin-top: 6px;
}
.verdict .confidence {
    display: inline-block;
    margin-top: 10px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
}
.verdict.hotdog {
    background: radial-gradient(120% 120% at 20% 0%, #34d36a, #129447);
}
.verdict.not {
    background: radial-gradient(120% 120% at 80% 0%, #ff6b61, #c81d1d);
}
.verdict.error {
    background: linear-gradient(135deg, #3a3f55, #232839);
    color: var(--fg);
}
@keyframes pop {
    0%   { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1);    opacity: 1; }
}

/* Footer */
.foot {
    margin-top: 8px;
    text-align: center;
    color: var(--fg-dim);
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.foot a { color: var(--accent-2); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.dot { opacity: 0.5; }

/* Tablet+ tweaks */
@media (min-width: 720px) {
    .hero h1 { font-size: 42px; }
    .logo { font-size: 64px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .logo { animation: none; }
    .verdict { animation: none; }
}
