/* MyMatchMix - World Cup 2026 */
/* Mobile-first responsive design — Gold/Green/Blue branding */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #1a1a2e;
    --secondary: #16213e;
    --accent: #1a5fb4;
    --accent-hover: #154d94;
    --green: #2d8a4e;
    --green-light: #35a05a;
    --gold: #f5c518;
    --gold-warm: #f7c948;
    --gold-light: #fdf6e3;
    --light: #f5f0e8;
    --white: #ffffff;
    --text: #1a1a2e;
    --text-light: #555;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-gold: 0 4px 20px rgba(245, 197, 24, 0.15);
    --nav-height: 60px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(170deg, #fdf6e3 0%, #ffffff 40%, #ffffff 100%);
    min-height: 100vh;
    color: var(--text);
    padding-top: var(--nav-height);
}

/* =============================================
   SITE NAVIGATION
   ============================================= */

.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid var(--gold);
    z-index: 1000;
}

.nav-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 10px;
}

.nav-logo img {
    height: 36px;
    width: auto;
}

.nav-brand-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .nav-inner {
        position: relative;
    }
    .nav-brand-name {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-size: 1.5rem;
        white-space: nowrap;
        pointer-events: none;
    }
}

.nav-links {
    display: flex;
    gap: 4px;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.nav-links a:hover {
    color: var(--gold);
    background: rgba(245, 197, 24, 0.1);
}

.nav-links a.active {
    color: var(--gold);
    background: rgba(245, 197, 24, 0.15);
    font-weight: 600;
}

/* Hamburger toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(26, 26, 46, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        padding: 8px 20px 20px;
        gap: 2px;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
        border-bottom: 2px solid var(--gold);
    }

    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-links a {
        padding: 12px 14px;
        font-size: 1rem;
    }
}

/* =============================================
   APP CONTAINER & HEADER
   ============================================= */

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* App-specific header (index page) */
.app-header {
    text-align: center;
    padding: 32px 20px 24px;
    color: var(--primary);
    background: linear-gradient(180deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 0 0 var(--radius) var(--radius);
    margin: 0 -20px 20px;
}

.app-header h1 {
    color: var(--white);
}

.app-header .subtitle {
    color: var(--gold);
}

.app-header .brand-name {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

/* New Logo */
.animated-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.animated-logo img,
.shield-logo {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 4px 16px rgba(245, 197, 24, 0.5));
}

.shield-star {
    animation: starPulse 3s ease-in-out infinite;
    transform-origin: 32px 20px;
}
.split-line {
    animation: lineShimmer 3s ease-in-out infinite;
}
@keyframes starPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.15); opacity: 0.8; }
}
@keyframes lineShimmer {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

.app-header h1 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.app-header .subtitle {
    font-size: 0.95rem;
    font-weight: 500;
}

/* =============================================
   PAGE LAYOUT (for content pages)
   ============================================= */

.page-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    text-align: center;
    padding: 40px 0 30px;
    color: var(--primary);
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.page-header p {
    font-size: 1rem;
    color: var(--text-light);
}

.page-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
    line-height: 1.7;
    color: var(--text);
    border: 1px solid rgba(245, 197, 24, 0.2);
}

.page-content h2 {
    font-size: 1.3rem;
    color: var(--primary);
    margin: 28px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--gold-light);
}

.page-content h2:first-child {
    margin-top: 0;
}

.page-content h3 {
    font-size: 1.1rem;
    color: var(--primary);
    margin: 20px 0 8px;
}

.page-content p {
    margin-bottom: 14px;
    font-size: 0.95rem;
}

.page-content ul, .page-content ol {
    margin: 0 0 14px 20px;
}

.page-content li {
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.page-content a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.page-content a:hover {
    text-decoration: underline;
}

.page-content .highlight-box {
    background: linear-gradient(135deg, rgba(45, 138, 78, 0.08), rgba(245, 197, 24, 0.12));
    border-left: 4px solid var(--green);
    padding: 16px 20px;
    border-radius: 0 8px 8px 0;
    margin: 20px 0;
}

.page-content .highlight-box p {
    margin-bottom: 0;
}

/* Steps / How it works */
.steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 20px 0;
}

.step {
    text-align: center;
    padding: 20px 12px;
    background: var(--gold-light);
    border-radius: var(--radius);
    border: 1px solid rgba(245, 197, 24, 0.3);
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--green);
    color: var(--white);
    font-weight: 800;
    font-size: 1.1rem;
    border-radius: 50%;
    margin-bottom: 10px;
}

.step h3 {
    font-size: 0.95rem;
    margin-bottom: 6px;
    color: var(--primary);
}

.step p {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .steps {
        grid-template-columns: 1fr;
    }
}

/* FAQ accordion */
.faq-item {
    border-bottom: 1px solid var(--light);
    padding: 16px 0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-question {
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.faq-question::after {
    content: '+';
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--green);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.faq-item.open .faq-question::after {
    content: '\2212';
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding-top: 10px;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Contact form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.form-group input,
.form-group textarea {
    padding: 10px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-submit {
    display: inline-block;
    padding: 12px 28px;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    align-self: flex-start;
}

.form-submit:hover {
    background: var(--green-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 138, 78, 0.3);
}

/* 404 page */
.error-page {
    text-align: center;
    padding: 60px 20px;
}

.error-code {
    font-size: 6rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--gold), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 12px;
}

.error-page p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 24px;
}

.error-page a {
    display: inline-block;
    padding: 12px 28px;
    background: var(--green);
    color: var(--white);
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.error-page a:hover {
    background: var(--green-light);
    transform: translateY(-1px);
}

/* =============================================
   SITE FOOTER
   ============================================= */

.site-footer {
    margin-top: 40px;
    background: var(--primary);
    border-top: 3px solid var(--gold);
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px 20px;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
}

.footer-brand p {
    margin-top: 10px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

.footer-brand img {
    height: 32px;
    opacity: 0.9;
}

.footer-brand-name {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    margin-top: 6px;
}

.footer-links h4 {
    color: var(--gold);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.footer-links a {
    display: block;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    font-size: 0.85rem;
    padding: 3px 0;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--gold);
}

.footer-bottom {
    max-width: 1000px;
    margin: 0 auto;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-bottom p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
}

@media (max-width: 768px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: center;
    }
}

/* =============================================
   MOBILE STEPPER
   ============================================= */

.mobile-stepper {
    display: none; /* Hidden on desktop */
}

@media (max-width: 768px) {
    .mobile-stepper {
        display: block;
        margin-bottom: 16px;
    }

    .stepper-steps {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0;
        padding: 12px 16px;
        background: var(--white);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        border: 1px solid rgba(245, 197, 24, 0.3);
    }

    .stepper-step {
        display: flex;
        align-items: center;
        gap: 6px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 6px 10px;
        border-radius: 20px;
        transition: all 0.25s ease;
        flex-shrink: 0;
    }

    .step-num {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        font-size: 0.8rem;
        font-weight: 800;
        background: var(--light);
        color: var(--text-light);
        transition: all 0.25s ease;
    }

    .step-text {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--text-light);
        transition: all 0.25s ease;
    }

    .stepper-step.active .step-num {
        background: var(--accent);
        color: var(--white);
        box-shadow: 0 2px 8px rgba(26, 95, 180, 0.4);
    }

    .stepper-step.active .step-text {
        color: var(--primary);
    }

    .stepper-step.completed .step-num {
        background: var(--green);
        color: var(--white);
    }

    .stepper-step.completed .step-text {
        color: var(--text-light);
    }

    .stepper-line {
        flex: 1;
        height: 2px;
        background: var(--light);
        margin: 0 4px;
        min-width: 20px;
        border-radius: 1px;
        transition: background 0.25s ease;
    }

    .stepper-line.completed {
        background: var(--green);
    }

    /* Mobile step visibility */
    [data-mobile-step] {
        display: none;
    }

    [data-mobile-step].mobile-active {
        display: block;
        animation: stepFadeIn 0.25s ease;
    }

    /* Result panel needs special handling - only show when visible class AND mobile-active */
    .result-panel[data-mobile-step].mobile-active {
        display: none;
    }

    .result-panel.visible[data-mobile-step].mobile-active {
        display: block;
    }

    /* When on step 3 but no flags selected yet, show controls anyway */
    .split-controls[data-mobile-step].mobile-active {
        display: block;
    }

    @keyframes stepFadeIn {
        from { opacity: 0; transform: translateY(8px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* =============================================
   SELECTION PANEL (App - index.html)
   ============================================= */

.selection-panel {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    margin-bottom: 30px;
    align-items: start;
}

@media (max-width: 768px) {
    .selection-panel {
        grid-template-columns: 1fr;
    }
}

.flag-picker {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(245, 197, 24, 0.2);
}

.flag-picker h2 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: var(--primary);
}

.flag-picker .hint {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 14px;
}

/* Flag Search */
.flag-search {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 10px;
    outline: none;
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.flag-search:focus {
    border-color: var(--accent);
}

.flag-search::placeholder {
    color: #aaa;
}

/* Flag Grid */
.flag-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 14px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Scrollbar styling */
.flag-grid::-webkit-scrollbar {
    width: 5px;
}

.flag-grid::-webkit-scrollbar-track {
    background: transparent;
}

.flag-grid::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.flag-grid::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.flag-card {
    cursor: pointer;
    border: 3px solid transparent;
    border-radius: 8px;
    padding: 6px;
    text-align: center;
    transition: all 0.2s ease;
    background: var(--light);
}

.flag-card:hover {
    border-color: var(--gold);
    transform: scale(1.05);
}

.flag-card.selected {
    border-color: var(--green);
    background: rgba(45, 138, 78, 0.08);
}

.flag-card.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.flag-card.hidden {
    display: none;
}

.flag-card-img {
    position: relative;
    width: 100%;
    padding-bottom: 66.67%;   /* force 3:2 box before image loads */
    overflow: hidden;
    border-radius: 4px;
    background: #e0e0e0;
}

.flag-card-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.flag-card .country-name {
    font-size: 0.65rem;
    font-weight: 600;
    margin-top: 4px;
    color: var(--text);
    line-height: 1.2;
}

/* Selected Team Display */
.selected-team {
    background: var(--light);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.selected-team .selected-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
}

.selected-team.has-selection .selected-label {
    color: var(--green);
}

/* =============================================
   SPLIT CONTROLS (center column)
   ============================================= */

.split-controls {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    align-self: center;
    min-width: 180px;
    border: 1px solid rgba(245, 197, 24, 0.2);
}

.control-group {
    margin-bottom: 18px;
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group h2 {
    font-size: 1rem;
    margin-bottom: 10px;
    color: var(--primary);
}

/* Ratio Slider */
.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.slider-label-left,
.slider-label-right {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 32px;
    text-align: center;
}

.ratio-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: linear-gradient(to right, var(--green), var(--accent));
    outline: none;
    cursor: pointer;
}

.ratio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--gold);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ratio-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--gold);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ratio-description {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Angle Buttons */
.angle-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 6px;
}

.angle-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--primary);
    background: var(--white);
    border-radius: 8px;
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.angle-btn:hover {
    background: var(--gold-light);
}

.angle-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

.angle-suggestion {
    font-size: 0.7rem;
    color: var(--green);
    font-weight: 600;
    min-height: 1.2em;
}

/* Line Style Buttons */
.style-buttons {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 6px;
}

.style-btn {
    width: 44px;
    height: 44px;
    border: 2px solid var(--primary);
    background: var(--white);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.style-btn:hover {
    background: var(--gold-light);
}

.style-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

/* =============================================
   RESULT PANEL
   ============================================= */

.result-panel {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow-gold);
    text-align: center;
    display: none;
    border: 2px solid rgba(245, 197, 24, 0.3);
    overflow: hidden;
}

.result-panel.visible {
    display: block;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-panel h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--primary);
}

.canvas-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #fff;
    padding: 18px;
    margin-bottom: 20px;
    border-radius: 6px;
}

#flagCanvas {
    display: none;
}

.flag-rig {
    display: flex;
    align-items: stretch;
    max-width: 100%;
}

.flag-pole {
    flex: 0 0 7px;
    background: linear-gradient(to right, #555 0%, #ddd 45%, #aaa 70%, #555 100%);
}

#waveCanvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Flag Info */
.flag-info {
    padding: 16px;
    background: var(--gold-light);
    border-radius: 8px;
}

.flag-info .info-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.flag-info .info-item {
    font-size: 0.9rem;
    font-weight: 600;
}

.flag-info .info-item.country1 {
    color: var(--green);
}

.flag-info .info-item.country2 {
    color: var(--accent);
}

.flag-info .info-item.ratio {
    background: var(--primary);
    color: var(--gold);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

/* Download Group */
.download-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-top: 16px;
}

/* Download Button */
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.download-btn:hover {
    background: var(--green-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 138, 78, 0.3);
}

.download-btn:active {
    transform: translateY(0);
}

.download-btn-print {
    background: var(--accent);
}

.download-btn-print:hover {
    background: #1a70d0;
    box-shadow: 0 4px 12px rgba(26, 95, 180, 0.3);
}

.download-btn:disabled {
    opacity: 0.7;
    cursor: wait;
    transform: none !important;
}

.size-select {
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--white);
    color: var(--dark);
    cursor: pointer;
    transition: border-color 0.2s;
}

.size-select:hover {
    border-color: var(--accent);
}

.size-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(26, 95, 180, 0.15);
}

/* Order Bar — primary CTA */
.order-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    justify-content: center;
    margin-top: 28px;
    padding: 24px 20px;
    background: linear-gradient(135deg, rgba(45, 138, 78, 0.10), rgba(245, 197, 24, 0.12));
    border: 3px solid var(--green);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.order-bar::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    animation: orderShimmer 3s ease-in-out infinite;
}

@keyframes orderShimmer {
    0% { left: -60%; }
    100% { left: 120%; }
}

.order-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 48px;
    background: linear-gradient(135deg, var(--green), #248a4a);
    color: var(--white);
    border: none;
    border-radius: 14px;
    font-size: 1.3rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 16px rgba(45, 138, 78, 0.4);
    text-transform: none;
    position: relative;
    z-index: 1;
}

.order-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 28px rgba(45, 138, 78, 0.5);
    background: linear-gradient(135deg, #34a85a, var(--green));
}

.order-btn:active {
    transform: translateY(0) scale(1);
}

.order-btn svg {
    width: 22px;
    height: 22px;
}

.order-size-select {
    padding: 10px 16px;
    border: 2px solid rgba(45, 138, 78, 0.3);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    background: var(--white);
    color: var(--dark);
    cursor: pointer;
    transition: border-color 0.2s;
    position: relative;
    z-index: 1;
}

.order-size-select:hover,
.order-size-select:focus {
    border-color: var(--green);
    outline: none;
    box-shadow: 0 0 0 3px rgba(45, 138, 78, 0.15);
}

@media (max-width: 768px) {
    .order-btn {
        width: 100%;
        justify-content: center;
        font-size: 1.2rem;
        padding: 16px 32px;
    }
    .order-size-select {
        width: 100%;
    }
}

/* Spinner animation for generating state */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

@media (max-width: 768px) {
    .download-group {
        flex-direction: column;
    }

    .download-btn {
        width: 100%;
        justify-content: center;
    }

    .size-select {
        width: 100%;
    }
}

/* Start Over Button */
.start-over-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 24px;
    background: none;
    color: var(--text-light);
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.start-over-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--light);
    transform: translateY(-1px);
}

/* Share Bar */
.share-bar {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.share-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.share-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: var(--white);
    font-size: 0.8rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text);
}

.share-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.share-btn.whatsapp:hover {
    border-color: #25d366;
    color: #25d366;
}

.share-btn.twitter:hover {
    border-color: #1d9bf0;
    color: #1d9bf0;
}

.share-btn.copy-link:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.share-btn.copy-link.copied {
    border-color: var(--green);
    color: var(--green);
    background: #f0fdf4;
}

/* =============================================
   UTILITY CLASSES
   ============================================= */

/* Compatibility Warning */
.compatibility-warning {
    margin-top: 12px;
    padding: 10px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.compatibility-warning .warning-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.compatibility-warning .warning-text {
    font-size: 0.8rem;
    color: #664d03;
    line-height: 1.4;
}

/* Smart suggestion (blue hint) */
.angle-suggestion-hint {
    margin-top: 12px;
    padding: 10px 16px;
    background: rgba(26, 95, 180, 0.08);
    border: 1px solid var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.angle-suggestion-hint .hint-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.angle-suggestion-hint .hint-text {
    font-size: 0.8rem;
    color: var(--accent);
    line-height: 1.4;
}

/* =============================================
   REDESIGN 2026 — additions
   ============================================= */

/* Remove logo from app-header on index (moved to nav) */
.app-header .animated-logo { display: none; }

/* Trust badges */
.trust-badges {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    justify-content: center;
    background: var(--white);
    border-bottom: 1px solid rgba(245,197,24,0.2);
    flex-wrap: nowrap;
}
.trust-badge {
    background: var(--light);
    border: 1px solid rgba(245,197,24,0.35);
    border-radius: 20px;
    padding: 5px 9px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary);
    white-space: nowrap;
}

/* Popular Combinations */
.popular-section {
    padding: 18px 20px 0;
}
.popular-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}
.combos-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin: 0 -20px;
    padding-left: 20px;
    padding-right: 20px;
    scrollbar-width: none;
}
.combos-scroll::-webkit-scrollbar { display: none; }
.combo-card {
    flex: 0 0 160px;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1.5px solid rgba(245,197,24,0.2);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.combo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.combo-card:active { transform: scale(0.97); }
.combo-img {
    display: block;
    width: 100%;
    height: 96px;
    object-fit: cover;
    object-position: center;
}
.combo-info {
    padding: 8px 10px 10px;
}
.combo-badge {
    display: inline-block;
    background: var(--gold);
    color: var(--primary);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-radius: 4px;
    padding: 2px 6px;
    margin-bottom: 4px;
}
.combo-flags { font-size: 1rem; margin-bottom: 2px; }
.combo-name {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}
.combo-meta { font-size: 0.65rem; color: #999; margin-top: 2px; }

/* Section intro */
.section-intro {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
    padding: 16px 20px 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Mobile: reorder selection panel (picker1 → picker2 → controls) */
@media (max-width: 768px) {
    .selection-panel {
        display: flex !important;
        flex-direction: column;
    }
    #picker1 { order: 1; }
    #picker2 { order: 2; }
    .split-controls { order: 3; }
}

/* Controls dark card */
.controls-card {
    background: var(--primary);
    border-radius: var(--radius);
    padding: 18px 16px;
}
.controls-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 16px;
}
.ctrl-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.ctrl-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--primary);
    font-size: 0.65rem;
    font-weight: 800;
    flex-shrink: 0;
    line-height: 1;
}

/* Slider emoji ends */
.sl-emoji {
    font-size: 1.3rem;
    flex-shrink: 0;
    line-height: 1;
}
.slider-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ratio-slider {
    flex: 1;
}

/* Angle buttons in dark card */
.controls-card .angle-buttons {
    display: flex;
    gap: 7px;
}
.controls-card .angle-btn {
    flex: 1;
    padding: 9px 4px 8px;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}
.controls-card .angle-btn.active,
.controls-card .angle-btn:hover {
    border-color: var(--gold);
    background: rgba(245,197,24,0.14);
    color: var(--gold);
}

/* Style buttons in dark card */
.controls-card .style-buttons {
    display: flex;
    gap: 7px;
}
.controls-card .style-btn {
    flex: 1;
    padding: 9px 4px 8px;
    background: rgba(255,255,255,0.06);
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}
.controls-card .style-btn.active,
.controls-card .style-btn:hover {
    border-color: var(--gold);
    background: rgba(245,197,24,0.14);
    color: var(--gold);
}
.controls-card .ratio-description {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gold);
    text-align: center;
    margin-top: 7px;
}
.controls-card .angle-suggestion { display: none; }

/* Size select in controls */
.ctrl-size-select {
    width: 100%;
    padding: 11px 12px;
    border: 1.5px solid rgba(255,255,255,0.15);
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--white);
    background: rgba(255,255,255,0.07);
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='rgba(245,197,24,0.8)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
}
.ctrl-size-select option { background: var(--primary); }

/* Result section redesign */
.result-panel { padding: 0 0 20px; }
.result-panel > h2 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    color: var(--primary);
    margin-bottom: 14px;
    padding: 18px 0 0;
}

/* Order button (primary CTA) */
.order-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
    padding: 15px;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 12px;
    box-shadow: 0 4px 14px rgba(45,138,78,0.3);
    transition: background 0.15s ease, transform 0.1s ease;
}
.order-btn:hover { background: var(--green-light); }
.order-btn:active { transform: scale(0.99); }

.delivery-hint {
    font-size: 0.74rem;
    color: #888;
    text-align: center;
    margin: 8px 0 12px;
    line-height: 1.4;
    padding: 0 10px;
}

/* Download + Share row */
.download-group {
    display: flex !important;
    flex-direction: row !important;
    gap: 8px;
    margin-bottom: 14px;
}
.download-group .download-btn,
.share-btn-main {
    flex: 1;
    width: auto !important;
    padding: 11px 8px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s;
}
.download-group .download-btn {
    background: var(--green);
    color: var(--white);
    border: none;
    box-shadow: 0 2px 8px rgba(45,138,78,0.2);
}
.download-group .download-btn:hover { background: var(--green-light); }
.share-btn-main {
    background: var(--light);
    color: var(--primary);
    border: 1.5px solid rgba(245,197,24,0.4);
}
.share-btn-main:hover { border-color: var(--gold); background: rgba(245,197,24,0.08); }

/* Start Over — real button */
.start-over-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px auto 0;
    padding: 10px 22px;
    background: var(--white);
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s ease;
}
.start-over-btn:hover { border-color: var(--gold); }

/* Gold selected state for flag cards (replace blue) */
.flag-card.selected {
    border-color: var(--gold) !important;
    background: rgba(245,197,24,0.1) !important;
    box-shadow: 0 0 0 2px rgba(245,197,24,0.25);
}
.flag-search:focus { border-color: var(--gold) !important; }

/* Sticky flag-ready bar */
.sticky-flag-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--primary);
    border-top: 2px solid var(--gold);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 200;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    cursor: pointer;
}
.sticky-flag-bar.sticky-bar--show {
    transform: translateY(0);
}
.sticky-flag-icon { font-size: 1.2rem; flex-shrink: 0; }
.sticky-flag-text {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--white);
    flex: 1;
}
.sticky-flag-cta {
    background: var(--gold);
    color: var(--primary);
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-family: 'Inter', sans-serif;
    font-size: 0.79rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Result panel fade-in animation */
@keyframes resultFadeIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.result-panel.result-fade-in {
    animation: resultFadeIn 0.35s ease forwards;
}
