:root {
    color-scheme: light;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f4f6fb;
    color: #1f2937;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 24px;
}

.app-shell {
    max-width: 960px;
    margin: 0 auto;
}

.hero {
    margin-bottom: 24px;
}

.hero h1 {
    margin: 0 0 12px;
    font-size: clamp(2rem, 2.5vw, 2.8rem);
}

.hero p {
    margin: 0;
    color: #4b5563;
    line-height: 1.6;
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
    align-items: center;
}

.controls select,
.controls button {
    min-width: 160px;
}

.controls label {
    font-weight: 600;
}

.controls select,
.controls button {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 1rem;
    background: #ffffff;
    color: #111827;
}

.controls button {
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.controls button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.controls button:not(:disabled):hover {
    background: #eef2ff;
    border-color: #6366f1;
}

.status {
    padding: 14px 18px;
    margin-bottom: 24px;
    border-radius: 16px;
    min-height: 56px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.status.error {
    border-color: #fca5a5;
    background: #fff1f2;
    color: #b91c1c;
}

.status.success {
    border-color: #86efac;
    background: #ecfdf5;
    color: #166534;
}

.results {
    display: grid;
    gap: 20px;
}

.contest-card {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    padding: 22px 26px;
    background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.06);
}

.contest-card.high-priority {
    border: 2px solid #fbbf24;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    box-shadow: 0 24px 50px rgba(251, 191, 36, 0.15);
}

.priority-badge {
    display: inline-block;
    background: #fbbf24;
    color: #78350f;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.contest-card::before {
    content: "";
    position: absolute;
    top: -30px;
    right: -30px;
    width: 140px;
    height: 140px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50%;
}

.contest-capture {
    position: relative;
    z-index: 1;
}

.contest-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.platform-logo img {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    object-fit: cover;
}

.brand-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
}

.contest-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 12px;
}

.card-action {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    padding: 10px 16px;
    background: #ffffff;
    color: #1f2937;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.card-action:hover:not(:disabled) {
    background: #eef2ff;
    border-color: #6366f1;
}

.card-action:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.contest-preview {
    display: grid;
    gap: 10px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 18px;
    padding: 14px;
}

.preview-image {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 16 / 10;
    display: block;
    border-radius: 16px;
    object-fit: cover;
    background: #e2e8f0;
}

.preview-status {
    margin: 0;
    font-size: 0.95rem;
    color: #475569;
}

.card-title {
    margin: 0 0 12px;
    font-size: 1.25rem;
    font-weight: 700;
}

.card-meta,
.card-link,
.card-platform {
    margin: 0;
    line-height: 1.75;
    color: #374151;
}

.card-platform {
    font-size: 0.95rem;
    color: #4f46e5;
    margin-bottom: 14px;
}

.card-link a {
    color: #1d4ed8;
    text-decoration: none;
}

.card-link a:hover {
    text-decoration: underline;
}

.preformatted {
    margin: 0;
    padding: 18px;
    border-radius: 18px;
    background: #111827;
    color: #f8fafc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    white-space: pre-wrap;
}

@media (max-width: 700px) {
    body {
        padding: 16px;
    }

    .app-shell {
        padding: 0 6px;
    }

    .hero h1 {
        font-size: clamp(1.8rem, 9vw, 2.4rem);
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .controls label {
        width: 100%;
    }

    .controls select,
    .controls button {
        width: 100%;
        min-width: auto;
    }

    .contest-card {
        padding: 18px;
    }

    .contest-actions {
        gap: 10px;
    }

    .contest-brand {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .contest-preview {
        padding: 12px;
    }

    .preview-image {
        max-width: 100%;
        height: auto;
    }
}