/* ===== QUEST CREATION TUTORIAL ===== */

/* ===== JOUER TUTORIAL (COMPACT VERSION) ===== */
.jouer-tutorial {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    margin-top: var(--spacing-xxl);
}

/* Green highlight badge (same style idea as Jouer .highlight, but turquoise) */
.highlight-green {
    background-color: var(--turquoise-medium);
    color: var(--white);
    padding: 0.15em 0.45em;
    border-radius: 6px;
    font-weight: 700;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(68, 190, 170, 0.25);
}

/* Step badge container consistency */
.creation-step-viewer .step-badge span,
.creation-steps--compact .step-badge span {
    background-color: var(--turquoise-medium);
    color: var(--white);
    padding: 0.15em 0.45em;
    border-radius: 6px;
    font-weight: 700;
    display: inline-block;
}

.jouer-tutorial .tutorial-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.jouer-tutorial .tutorial-header h3 {
    font-size: 1.8rem;
    color: var(--violet-dark);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

.jouer-tutorial .tutorial-header p {
    color: var(--gray-medium);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto;
}

.steps--compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.steps--compact .step-card {
    background: rgba(178, 177, 217, 0.05);
    border: 2px solid rgba(178, 177, 217, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    transition: all 0.3s ease;
}

.steps--compact .step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--orange);
}

.steps--compact .step-badge {
    margin-bottom: var(--spacing-md);
}

.steps--compact .step-badge .highlight {
    background-color: var(--orange);
    color: var(--white);
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
}

.steps--compact h4 {
    font-size: 1.2rem;
    color: var(--violet-dark);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.steps--compact p {
    color: var(--gray-medium);
    font-size: 0.95rem;
    line-height: 1.4;
}

.jouer-screens {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

.jouer-screens .screen-img {
    width: 220px;     /* largeur uniforme */
    height: 420px;    /* hauteur uniforme */
    max-width: 100%;
    object-fit: cover;         /* remplit et coupe l'excédent */
    object-position: top center; /* aligne sur le haut pour éviter bande blanche */
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.jouer-screens .screen-img:hover {
    transform: scale(1.05);
}

/* Responsive - Mobile First Approach */
@media (max-width: 768px) {
    .jouer-tutorial {
        padding: var(--spacing-md);
        margin-top: var(--spacing-xl);
    }
    
    .jouer-tutorial .tutorial-header h3 {
        font-size: 2rem; /* match section title size on mobile */
        line-height: 1.3;
    }
    
    .jouer-tutorial .tutorial-header p {
        font-size: 0.9rem;
        margin-bottom: var(--spacing-md);
    }
    
    /* Mobile: Stack steps vertically with better spacing */
    .steps--compact {
        display: flex;
        flex-direction: column;
        gap: var(--spacing-md);
        margin-bottom: var(--spacing-lg);
    }
    
    .steps--compact .step-card {
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }
    
    .steps--compact h4 {
        font-size: 1.1rem;
        margin-bottom: var(--spacing-xs);
    }
    
    .steps--compact p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Hide desktop steps on mobile */
    .steps--desktop {
        display: none;
    }
    
    /* Mobile: Step-by-step viewer */
    .jouer-step-viewer {
        margin-top: var(--spacing-lg);
        background: rgba(255, 255, 255, 0.95);
        border-radius: var(--radius-lg);
        padding: var(--spacing-md);
        box-shadow: var(--shadow-md);
    }
    
    .step-content {
        position: relative;
        min-height: 400px;
    }
    
    .step-view {
        display: none;
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.3s ease;
    }
    
    .step-view.active {
        display: block;
        opacity: 1;
        transform: translateX(0);
    }
    
    .step-text {
        text-align: center;
        margin-bottom: var(--spacing-lg);
    }
    
    .step-text .step-badge {
        margin-bottom: var(--spacing-sm);
    }
    
    .step-text h4 {
        font-size: 1.2rem;
        color: var(--violet-dark);
        margin-bottom: var(--spacing-xs);
        font-weight: 600;
    }
    
    .step-text p {
        color: var(--gray-medium);
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .step-screen {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }
    
    .step-screen .screen-img {
        width: 160px;
        height: auto;
        max-height: 320px;
        object-fit: contain;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-md);
    }
    
    .screen-caption {
        text-align: center;
        max-width: 250px;
        background: rgba(255, 255, 255, 0.95);
        padding: var(--spacing-sm) var(--spacing-md);
        border-radius: var(--radius-lg);
        border-left: 4px solid var(--orange);
        box-shadow: var(--shadow-sm);
        position: relative;
    }
    
    
    .screen-caption p {
        font-size: 0.85rem;
        color: var(--gray-dark);
        line-height: 1.4;
        margin: 0;
        font-style: italic;
    }
    
    /* Navigation */
    .step-navigation {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: var(--spacing-sm);
        flex-wrap: nowrap;
        margin-top: var(--spacing-md);
        padding: 0; /* remove big card feel */
        background: transparent;
        border: none;
        box-shadow: none;
    }
    
    .nav-btn-orange {
        display: flex;
        align-items: center;
        gap: var(--spacing-xs);
        padding: 6px 10px; /* compact */
        border: 1.5px solid var(--orange);
        border-radius: 999px; /* pill */
        background: transparent; /* subtle */
        color: var(--orange);
        font-family: var(--font-primary);
        font-weight: 600;
        font-size: 0.85rem;
        cursor: pointer;
        transition: all 0.2s ease;
        min-width: 72px;
        justify-content: center;
        line-height: 1;
    }
    
    .nav-btn-orange:hover:not(:disabled) {
        background: var(--orange);
        color: var(--white);
        transform: none;
        box-shadow: none;
    }
    
    .nav-btn-orange:disabled {
        opacity: 0.4;
        cursor: not-allowed;
        border-color: var(--gray-light);
        color: var(--gray-medium);
        background: var(--gray-light);
    }
    
    .step-indicators {
        display: flex;
        align-items: center;
        gap: var(--spacing-xs);
    }
    
    .step-counter {
        font-weight: 700;
        color: var(--violet-dark);
        font-size: 0.8rem;
        background: transparent; /* remove chip background */
        padding: 0 4px;
        border-radius: 0;
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .jouer-tutorial {
        padding: var(--spacing-sm);
        margin-top: var(--spacing-lg);
    }
    
    .jouer-tutorial .tutorial-header h3 {
        font-size: 2rem; /* keep parity with section title on small phones */
    }
    
    .steps--compact .step-card {
        padding: var(--spacing-sm);
    }
    
    .steps--compact h4 {
        font-size: 1rem;
    }
    
    .steps--compact p {
        font-size: 0.85rem;
    }
    
    /* Smaller screens on very small devices */
    .step-screen .screen-img {
        width: 180px;
        max-height: 360px;
    }
    
    .screen-caption {
        max-width: 200px;
        padding: var(--spacing-xs);
    }
    
    .screen-caption p {
        font-size: 0.75rem;
    }
    
    .nav-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.8rem;
    }
}

/* Desktop: Keep original layout with individual screens */
@media (min-width: 769px) {
    /* Hide mobile step viewer on desktop */
    .jouer-step-viewer {
        display: none;
    }
    
    /* Show desktop steps */
    .steps--desktop {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: var(--spacing-xl);
        margin-bottom: var(--spacing-xl);
    }
    
    .steps--desktop .step-card {
        background: rgba(178, 177, 217, 0.05);
        border: 2px solid rgba(178, 177, 217, 0.2);
        border-radius: var(--radius-lg);
        padding: var(--spacing-lg);
        text-align: center;
        transition: all 0.3s ease;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .steps--desktop .step-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-md);
        border-color: var(--orange);
    }
    
    .step-screen-desktop {
        margin-top: var(--spacing-lg);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-sm);
    }
    
    .screen-img-desktop {
        width: 180px;
        height: 340px;
        object-fit: cover;
        object-position: center;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-md);
        transition: transform 0.3s ease;
    }
    
    .screen-img-desktop:hover {
        transform: scale(1.05);
    }
    
    .screen-caption-desktop {
        text-align: center;
        max-width: 200px;
        background: rgba(255, 255, 255, 0.95);
        padding: var(--spacing-sm) var(--spacing-md);
        border-radius: var(--radius-lg);
        border-left: 4px solid var(--orange);
        box-shadow: var(--shadow-sm);
        position: relative;
    }
    
    
    .screen-caption-desktop p {
        font-size: 0.8rem;
        color: var(--gray-dark);
        line-height: 1.3;
        margin: 0;
        font-style: italic;
    }
}

.quest-creation-tutorial {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xxl);
    box-shadow: var(--shadow-lg);
    margin-top: var(--spacing-xxl);
}

.tutorial-header {
    text-align: center;
    margin-bottom: var(--spacing-xxl);
}

.tutorial-header h3 {
    font-size: 2rem;
    color: var(--violet-dark);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

.tutorial-header p {
    color: var(--gray-medium);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== STEPPER COMPONENT ===== */
.creation-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-xxl);
    padding: var(--spacing-lg);
    background: rgba(178, 177, 217, 0.1);
    border-radius: var(--radius-lg);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    position: relative;
    z-index: 2;
}

.step-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gray-light);
    color: var(--gray-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    transition: all var(--transition-normal);
    border: 3px solid transparent;
}

.step-label {
    font-size: 0.9rem;
    color: var(--gray-medium);
    font-weight: 600;
    text-align: center;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.step.active .step-number {
    background: var(--turquoise-medium);
    color: var(--white);
    border-color: var(--turquoise-dark);
    box-shadow: var(--shadow-md);
    transform: scale(1.1);
}

.step.active .step-label {
    color: var(--turquoise-dark);
    font-weight: 700;
}

.step.completed .step-number {
    background: var(--violet-medium);
    color: var(--white);
    border-color: var(--violet-dark);
}

.step.completed .step-label {
    color: var(--violet-dark);
}

.step-connector {
    flex: 1;
    height: 3px;
    background: var(--gray-light);
    margin: 0 var(--spacing-md);
    border-radius: var(--radius-sm);
    position: relative;
    z-index: 1;
    transition: all var(--transition-normal);
}

.step-connector.completed {
    background: var(--violet-medium);
}

/* ===== TUTORIAL CONTENT ===== */
.tutorial-content {
    position: relative;
}

.tutorial-step {
    display: none;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xxl);
    align-items: center;
    opacity: 0;
    transform: translateX(20px);
    transition: all var(--transition-slow);
}

.tutorial-step.active {
    display: grid;
    opacity: 1;
    transform: translateX(0);
}

/* Special layout for step 2 with brick example */
.tutorial-step[data-step-content="2"] {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: flex-start;
}

.tutorial-step[data-step-content="2"] .tutorial-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Special layout for step 3 with montage */
.tutorial-step[data-step-content="3"] {
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: flex-start;
}

.tutorial-step[data-step-content="3"] .tutorial-content {
    display: contents;
}

.step-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--violet-light) 0%, var(--turquoise-light) 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.creation-screen {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

/* ===== STEP 1 MONTAGE STYLES ===== */
.step-screen-montage {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--violet-light) 0%, var(--turquoise-light) 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.main-screen {
    display: flex;
    justify-content: center;
    align-items: center;
}

.creation-screen-main {
    max-width: 280px;
    max-height: 350px;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-normal), opacity 0.15s ease;
}

.creation-screen-main:hover {
    transform: scale(1.02);
}

.secondary-screens {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.screen-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.screen-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.clickable-screen {
    cursor: pointer;
    position: relative;
}

.clickable-screen:hover {
    background: rgba(68, 190, 170, 0.1);
    border: 2px solid var(--turquoise-medium);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.clickable-screen:hover .screen-label {
    color: var(--turquoise-dark);
    font-weight: 700;
}

.clickable-screen::after {
    content: "Cliquez pour afficher";
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--turquoise-dark);
    color: var(--white);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.clickable-screen:hover::after {
    opacity: 1;
    top: -35px;
}

.active-screen {
    background: rgba(68, 190, 170, 0.2) !important;
    border: 2px solid var(--turquoise-medium) !important;
    box-shadow: var(--shadow-lg) !important;
}

.active-screen .screen-label {
    color: var(--turquoise-dark) !important;
    font-weight: 700 !important;
}

.creation-screen-small {
    max-width: 80px;
    max-height: 100px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.screen-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--violet-dark);
    text-align: center;
}

.step-info {
    padding: var(--spacing-lg);
}

.step-info h4 {
    font-size: 1.5rem;
    color: var(--violet-dark);
    margin-bottom: var(--spacing-md);
    font-weight: 700;
}

.step-explanation {
    background: rgba(68, 190, 170, 0.1);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    border-left: 4px solid var(--turquoise-medium);
}

.step-explanation p {
    margin: 0 0 var(--spacing-sm) 0;
    color: var(--gray-dark);
    font-size: 1rem;
    line-height: 1.6;
}

.step-explanation p:last-child {
    margin-bottom: 0;
    font-weight: 600;
    color: var(--turquoise-dark);
}

.step-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.step-features li {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid rgba(178, 177, 217, 0.2);
}

.step-features li:last-child {
    border-bottom: none;
}

/* Brick Example Styles */
.brick-example {
    padding: var(--spacing-md);
    background: rgba(68, 190, 170, 0.1);
    border-left: 4px solid var(--turquoise-medium);
    border-radius: var(--radius-sm);
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.brick-example p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-dark);
    line-height: 1.5;
}

.brick-example strong {
    color: var(--turquoise-dark);
}

/* Ensure step 2 screen container has proper sizing */
.tutorial-step[data-step-content="2"] .step-screen {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, var(--violet-light) 0%, var(--turquoise-light) 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* Feature Explanations Styles */
.feature-explanation {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) 0;
}

.feature-explanation:last-child {
    margin-bottom: 0;
}

.feature-explanation h5 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin: 0 0 var(--spacing-xs) 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--purple-dark);
}

.feature-explanation h5 img {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.feature-explanation p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-medium);
    line-height: 1.4;
    padding-left: 28px;
}

.step-features img {
    width: 24px;
    height: 24px;
    filter: drop-shadow(1px 1px 2px rgba(62, 73, 118, 0.2));
}

.step-features span {
    color: var(--gray-dark);
    font-weight: 500;
    font-size: 1rem;
}

/* ===== NAVIGATION CONTROLS ===== */
.tutorial-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
    background: rgba(178, 177, 217, 0.1);
    border-radius: var(--radius-lg);
    margin-top: var(--spacing-xl); /* add breathing space from the montage/card above */
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-lg);
    border: 2px solid var(--turquoise-medium);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--turquoise-dark);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.nav-btn:hover:not(:disabled) {
    background: var(--turquoise-medium);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--gray-light);
    color: var(--gray-medium);
}

.nav-btn img {
    width: 20px;
    height: 20px;
    filter: drop-shadow(1px 1px 2px rgba(62, 73, 118, 0.2));
}

.nav-btn:hover:not(:disabled) img {
    filter: brightness(0) invert(1) drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.2));
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-weight: 700;
    color: var(--violet-dark);
    font-size: 1.1rem;
}

.current-step {
    color: var(--turquoise-medium);
    font-size: 1.3rem;
}

/* ===== MOBILE RESPONSIVE STYLES ===== */

/* Mobile: Active Step Display */
.creation-steps--compact {
    display: none; /* Hidden by default, shown on mobile */
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.creation-steps--compact .step-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 3px solid var(--turquoise-medium);
    transition: all 0.3s ease;
    max-width: 280px;
    margin: 0 auto;
}

.creation-steps--compact .step-card.active {
    border-color: var(--turquoise-medium);
    background: rgba(68, 190, 170, 0.05);
    box-shadow: var(--shadow-lg);
}

.creation-steps--compact .step-badge {
    margin-bottom: var(--spacing-sm);
}

.creation-steps--compact h4 {
    color: var(--violet-dark);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.creation-steps--compact p {
    color: var(--gray-medium);
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Mobile: Multi-screen step viewer */
.creation-step-viewer {
    display: none; /* Hidden by default, shown on mobile */
    margin-top: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--shadow-md);
}

.creation-step-viewer .step-content {
    position: relative;
    min-height: 500px;
}

.creation-step-viewer .step-view {
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.creation-step-viewer .step-view.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.creation-step-viewer .step-text {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.creation-step-viewer .step-text .step-badge {
    margin-bottom: var(--spacing-sm);
}

.creation-step-viewer .step-text h4 {
    font-size: 1.2rem;
    color: var(--violet-dark);
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
}

.creation-step-viewer .step-text p {
    color: var(--gray-medium);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Main screen layout */
.step-main-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.main-screen-img {
    width: 200px;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.main-screen-img:hover {
    transform: scale(1.02);
}

/* Single screen layout */
.step-single-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
}

.single-screen-img {
    width: 170px; /* narrower to remove side white margins */
    height: auto;
    max-height: 340px;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.single-screen-img:hover {
    transform: scale(1.02);
}

/* Secondary screens gallery */
.secondary-screens-mobile {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-top: var(--spacing-md);
}

.screen-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs);
    background: rgba(68, 190, 170, 0.1);
    border: 2px solid rgba(68, 190, 170, 0.2);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 90px;
}

.screen-mini:hover {
    transform: translateY(-2px);
    border-color: var(--turquoise-medium);
    box-shadow: var(--shadow-sm);
}

.screen-mini.active-mini {
    border-color: var(--turquoise-medium);
    background: rgba(68, 190, 170, 0.2);
    box-shadow: var(--shadow-md);
}

.screen-mini.active-mini .mini-label {
    color: var(--turquoise-dark);
    font-weight: 700;
}

.mini-screen-img {
    width: 80px;
    height: auto;
    max-height: 160px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.mini-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--turquoise-dark);
    text-align: center;
}

.creation-step-viewer .screen-caption {
    text-align: center;
    max-width: 280px;
    background: rgba(255, 255, 255, 0.95);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--turquoise-medium);
    box-shadow: var(--shadow-sm);
    position: relative;
    margin-top: var(--spacing-sm);
}

.creation-step-viewer .screen-caption p {
    font-size: 0.85rem;
    color: var(--gray-dark);
    line-height: 1.4;
    margin: 0;
    font-style: italic;
}

/* Specific adjustment for Step 4 final recap to avoid side white margins */
.creation-step-viewer .step-view[data-step="4"] .single-screen-img {
    width: 160px;
    max-width: 85%;
}

/* Navigation for creation step viewer */
.creation-step-viewer .step-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    flex-wrap: nowrap;
    margin-top: var(--spacing-md);
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.nav-btn-green {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 6px 10px;
    border: 1.5px solid var(--turquoise-medium);
    border-radius: 999px;
    background: transparent;
    color: var(--turquoise-medium);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 72px;
    justify-content: center;
    line-height: 1;
}

.nav-btn-green:hover:not(:disabled) {
    background: var(--turquoise-medium);
    color: var(--white);
    transform: none;
    box-shadow: none;
}

.nav-btn-green:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--gray-light);
    color: var(--gray-medium);
    background: var(--gray-light);
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .quest-creation-tutorial {
        padding: var(--spacing-lg);
    }
    
    /* Hide desktop elements on mobile */
    .creation-stepper--desktop,
    .tutorial-content--desktop,
    .tutorial-navigation--desktop {
        display: none;
    }
    
    /* Show mobile elements */
    .creation-steps--compact,
    .creation-step-viewer {
        display: flex;
    }

    /* Larger subtitle for creation tutorial on mobile */
    .quest-creation-tutorial .tutorial-header h3 {
        font-size: 2rem; /* match section title size on mobile */
        line-height: 1.3;
    }
    
    .creation-steps--compact {
        flex-direction: column;
    }
    
    .creation-step-viewer {
        flex-direction: column;
    }
    
    /* Mobile: Stack steps vertically with better spacing */
    .creation-steps--compact .step-card {
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }
    
    .creation-steps--compact h4 {
        font-size: 1.1rem;
        margin-bottom: var(--spacing-xs);
    }
    
    .creation-steps--compact p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

@media (max-width: 480px) {
    .quest-creation-tutorial {
        padding: var(--spacing-sm);
        margin-top: var(--spacing-lg);
    }
    
    /* Scope to creation tutorial to avoid shrinking other headers */
    .quest-creation-tutorial .tutorial-header h3 {
        font-size: 2rem; /* keep parity with section title on small phones */
    }
    
    .creation-steps--compact .step-card {
        padding: var(--spacing-sm);
    }
    
    .creation-steps--compact h4 {
        font-size: 1rem;
    }
    
    .creation-steps--compact p {
        font-size: 0.85rem;
    }
    
    /* Smaller screens on very small devices */
    .creation-step-viewer .step-screen .screen-img {
        width: 180px;
        max-height: 360px;
    }
    
    .creation-step-viewer .screen-caption {
        max-width: 200px;
        padding: var(--spacing-xs);
    }
    
    .creation-step-viewer .screen-caption p {
        font-size: 0.75rem;
    }
}

/* Desktop: Keep original layout */
@media (min-width: 769px) {
    /* Hide mobile elements on desktop */
    .creation-steps--compact,
    .creation-step-viewer {
        display: none;
    }
    
    /* Show desktop elements */
    .creation-stepper--desktop,
    .tutorial-content--desktop,
    .tutorial-navigation--desktop {
        display: flex;
    }
    
    .tutorial-content--desktop {
        position: relative;
    }
    
    .creation-stepper--desktop {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        margin-bottom: var(--spacing-xxl);
        padding: var(--spacing-lg);
        background: rgba(178, 177, 217, 0.1);
        border-radius: var(--radius-lg);
    }
    
    .tutorial-navigation--desktop {
        align-items: center;
        justify-content: space-between;
        padding: var(--spacing-lg);
        background: rgba(178, 177, 217, 0.1);
        border-radius: var(--radius-lg);
        margin-top: var(--spacing-xl);
    }
}
