/* --- ATLA THEME VARIABLES --- */
        :root {
            --bg-parchment: #e6d6ac; 
            --paper-texture: #f4e4bc;
            --ink-color: #3e2723;
            
            /* Nation Colors */
            --fire: #a10000;    /* Fire Nation Crimson */
            --water: #004e89;   /* Water Tribe Blue */
            --earth: #2c5530;   /* Earth Kingdom Green */
            --air: #ff9900;     /* Air Nomad Orange/Yellow */
            
            --border-color: #5d4037;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
            font-family: 'Cinzel', serif; /* ATLA-like font */
        }

        body {
            background-color: var(--bg-parchment);
            color: var(--ink-color);
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            /* Generated subtle texture pattern */
            background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23d7c297' fill-opacity='0.4' fill-rule='evenodd'/%3E%3C/svg%3E");
        }

        .container {
            background-color: var(--paper-texture);
            width: 90%;
            max-width: 700px;
            padding: 3rem 3rem 1.5rem 3rem; /* Adjusted padding for footer */
            text-align: center;
            position: relative;
            border: 4px double var(--border-color);
            box-shadow: 0 0 20px rgba(0,0,0,0.2), inset 0 0 40px rgba(62, 39, 35, 0.1);
            border-radius: 4px;
        }

        /* Corner flourishes using pseudo-elements */
        .container::before, .container::after {
            content: "✦";
            position: absolute;
            font-size: 2rem;
            color: var(--border-color);
        }
        .container::before { top: 10px; left: 10px; }
        .container::after { bottom: 10px; right: 10px; }

        h1 {
            font-family: 'Cinzel Decorative', cursive;
            font-size: 3rem;
            margin-bottom: 10px;
            color: var(--ink-color);
            text-transform: uppercase;
            letter-spacing: 2px;
            border-bottom: 2px solid var(--border-color);
            padding-bottom: 1rem;
            display: inline-block;
        }

        p.subtitle {
            margin-top: 1rem;
            font-size: 1.2rem;
            font-style: italic;
            color: #5d4037;
        }

        /* Intro Image Styling */
        .intro-feature-img {
            width: 100%;
            max-width: 500px;
            height: auto;
            border-radius: 8px;
            margin: 20px auto;
            display: block;
            box-shadow: 0 4px 15px rgba(62, 39, 35, 0.3);
            border: 2px solid var(--border-color);
        }

        /* Progress Bar */
        .progress-track {
            width: 100%;
            height: 12px;
            background-color: rgba(93, 64, 55, 0.2);
            border: 1px solid var(--border-color);
            margin-bottom: 2rem;
            border-radius: 6px;
        }

        .progress-fill {
            height: 100%;
            width: 0%;
            background: linear-gradient(90deg, var(--water), var(--earth), var(--fire), var(--air));
            transition: width 0.4s ease;
        }

        /* Buttons */
        .btn-grid {
            display: grid;
            gap: 15px;
        }

        .btn {
            background-color: transparent;
            border: 2px solid var(--border-color);
            color: var(--ink-color);
            padding: 15px;
            font-size: 1.1rem;
            cursor: pointer;
            transition: all 0.3s;
            text-align: left;
            position: relative;
            font-weight: bold;
        }

        .btn:hover {
            background-color: var(--ink-color);
            color: var(--bg-parchment);
            border-color: var(--ink-color);
        }

        .btn-start, .btn-restart {
            font-family: 'Cinzel Decorative', cursive;
            background-color: var(--border-color);
            color: var(--bg-parchment);
            border: none;
            text-align: center;
            font-size: 1.4rem;
            padding: 1rem 3rem;
            margin-top: 2rem;
            letter-spacing: 1px;
        }

        .btn-start:hover, .btn-restart:hover {
            background-color: var(--ink-color);
            cursor: pointer;
        }

        /* --- UPDATED RESULT CARD STYLING --- */
        .result-card {
            border: 3px solid var(--border-color);
            margin-top: 2rem;
            min-height: 400px; /* Tall enough to show the image */
            border-radius: 12px;
            position: relative;
            overflow: hidden;
            
            /* Logic for background image */
            background-size: cover;
            background-position: right;
            background-repeat: no-repeat;
            
            /* Flexbox to push text to the LEFT side */
            display: flex;
            flex-direction: column;
            justify-content: center; /* Center Vertically */
            align-items: flex-start; /* Align Left */
            padding: 2rem;
            box-shadow: 0 10px 25px rgba(0,0,0,0.4);
        }

        /* The "Popup" text container - Now on the left */
        .result-overlay {
            background: rgba(64, 64, 64, 0.85); /* High contrast backing */
            padding: 1.5rem;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            width: 50%; /* Narrow width so it doesn't cover the whole image */
            min-width: 200px;
            box-shadow: 0 5px 15px rgba(0,0,0,0.3);
            backdrop-filter: blur(5px);
            text-align: left;
            max-height: 320px;
            overflow-y: auto; /* Allow scroll if text is too long */
        }

        #result-desc {
            font-size: 1rem; /* Slightly smaller to fit detailed text */
            color: antiquewhite;
            line-height: 1.5;
            font-weight: 600;
            margin: 0;
        }

        .career-title {
            margin-top: 10px;
            display: block;
            font-weight: bold;
            color: var(--fire);
            font-size: 0.9rem;
            text-transform: uppercase;
        }

        /* Credits Section */
        .credits {
            margin-top: 2rem;
            font-size: 0.8rem;
            color: #795548;
            border-top: 1px solid rgba(93, 64, 55, 0.2);
            padding-top: 1rem;
        }

        .credits a {
            color: var(--fire);
            text-decoration: none;
            font-weight: bold;
        }

        .credits a:hover {
            text-decoration: underline;
        }

        /* Utility Classes */
        .hidden { display: none; }
        .fade-in { animation: fadeIn 0.8s; }
        @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- MOBILE RESPONSIVENESS --- */
    @media (max-width: 600px) {
        .container {
            width: 95%;
            padding: 1.5rem;
        }

        h1 {
            font-size: 2rem; /* Smaller title on mobile */
        }

        .result-card {
            /* On mobile, stack image on top, text below */
            justify-content: flex-end; /* Pushes text to bottom */
            align-items: center;
            background-position: center;
        }

        .result-overlay {
            width: 100%; 
            background: rgba(64, 64, 64, 0.95); 
            max-height: 50vh;
        }
    }

    /* Utility Classes */
    .hidden { display: none; }
    .fade-in { animation: fadeIn 0.8s; }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
