/* Habillage local des cartes publiques d'expédition, chargé uniquement par /aventure. */
:root {
    --expedition-gold: #fde68a;
    --expedition-ink: #10182f;
    --expedition-glass: rgba(18, 29, 58, 0.82);
}

.expedition-level-pill {
    border-color: rgba(253, 230, 138, 0.45);
    background: rgba(18, 29, 58, 0.86);
}

.expedition-level-pill .value {
    color: var(--expedition-gold);
}

.local-adventure-summary {
    display: block;
    margin-top: .65rem;
    padding: .5rem .7rem;
    border: 1px solid rgba(253, 230, 138, .42);
    border-radius: .8rem;
    background: rgba(12, 21, 43, .76);
    color: #fff;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1.35;
}

.local-adventure-summary[hidden],
.local-adventure-resume[hidden],
.local-island-progress[hidden] {
    display: none;
}

.local-adventure-resume {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin: 0 0 1rem;
    padding: .65rem 1rem;
    border: 1px solid #fff2b7;
    border-radius: 999px;
    background: var(--expedition-gold);
    color: var(--expedition-ink);
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .24);
}

.local-adventure-resume:hover {
    background: #fff3bd;
    transform: translateY(-2px);
}

.expedition-count {
    align-items: center;
    gap: .5rem;
    padding-top: .7rem;
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: .9rem;
}

.expedition-count .islands-count {
    color: rgba(255, 255, 255, .9);
}

.expedition-count .stars-count {
    color: var(--expedition-gold);
    font-weight: 900;
}

.main-content {
    isolation: isolate;
}

.story-banner {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .18);
    background: linear-gradient(110deg, rgba(17, 31, 68, .96), rgba(42, 38, 100, .83));
}

.story-banner::after {
    content: '';
    position: absolute;
    top: -5.5rem;
    right: 12%;
    width: 9rem;
    aspect-ratio: 1;
    border: 1px solid rgba(191, 219, 254, .3);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, rgba(253, 230, 138, .46), rgba(100, 116, 255, .12) 45%, transparent 69%);
    box-shadow: 0 0 0 1rem rgba(165, 180, 252, .045), 0 0 2.5rem rgba(129, 140, 248, .18);
    pointer-events: none;
}

.story-banner-content,
.rescued-mascots {
    position: relative;
    z-index: 1;
}

.hero-section {
    position: relative;
    padding: .35rem 0;
}

.hero-text p {
    max-width: 42rem;
    line-height: 1.5;
}

.mascot-bubble {
    border-color: rgba(191, 219, 254, .26);
    background: linear-gradient(145deg, rgba(47, 60, 116, .88), rgba(19, 29, 58, .92));
    box-shadow: 0 12px 34px rgba(0, 0, 0, .22);
}

.world-card {
    min-width: 0;
    min-height: 100%;
    border-color: rgba(255, 255, 255, .2);
    background-color: rgba(14, 23, 48, .86);
    box-shadow: 0 12px 32px rgba(3, 8, 23, .22);
}

.world-card::before {
    content: '';
    position: absolute;
    top: -2.7rem;
    right: -2rem;
    width: 7rem;
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 50%;
    box-shadow: 0 0 0 .8rem rgba(255, 255, 255, .035), 0 0 0 1.7rem rgba(255, 255, 255, .025);
    pointer-events: none;
}

.world-card:hover,
.world-card:focus-visible {
    border-color: var(--expedition-gold);
    box-shadow: 0 15px 36px rgba(1, 5, 20, .36), 0 0 0 2px rgba(253, 230, 138, .3);
}

.world-card:focus-visible,
.arc-selector-btn:focus-visible,
.local-adventure-resume:focus-visible,
.back-btn:focus-visible,
.island-card:focus-visible {
    outline: 3px solid #fff2b7;
    outline-offset: 4px;
}

.world-card .world-header,
.world-card .world-progress {
    position: relative;
    z-index: 1;
}

.world-card .world-subject {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin-top: .2rem;
    padding: .25rem .65rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px;
    background: rgba(5, 12, 30, .4);
    color: #fff;
    font-weight: 800;
    letter-spacing: .04em;
}

.world-card .world-name {
    max-width: 100%;
    line-height: 1.2;
    text-wrap: balance;
}

/* Carte monde */
.map-container {
    max-width: 860px;
}

.world-info {
    padding-top: 1.35rem;
    padding-bottom: 1.25rem;
}

.expedition-world-mark {
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    margin: 0 auto .55rem;
    border: 1px solid color-mix(in srgb, var(--world-color) 72%, white);
    border-radius: 1.1rem;
    background: color-mix(in srgb, var(--world-color) 32%, transparent);
    box-shadow: 0 0 2rem color-mix(in srgb, var(--world-color) 38%, transparent);
    font-size: 1.8rem;
    position: relative;
    z-index: 1;
}

.world-info h2 {
    margin-bottom: .4rem;
}

.world-info p {
    max-width: 42rem;
    margin: .5rem auto 0;
    line-height: 1.5;
}

.world-info .expedition-world-note {
    display: inline-block;
    padding: .45rem .75rem;
    border: 1px solid rgba(253, 230, 138, .25);
    border-radius: 999px;
    background: rgba(8, 15, 33, .5);
    color: #fff;
    font-size: .9rem;
}

.islands-path {
    gap: 1.35rem;
    max-width: 680px;
    padding: .6rem 0 1.2rem;
}

.path-line {
    opacity: .62;
    filter: drop-shadow(0 0 .45rem var(--world-color));
}

.island-card {
    width: min(100%, 300px);
    min-height: 12rem;
    padding: 1.25rem 1.1rem 1rem;
    border-color: color-mix(in srgb, var(--world-color) 58%, white);
    background: linear-gradient(145deg, rgba(26, 40, 76, .94), rgba(15, 24, 50, .94));
    box-shadow: 0 10px 26px rgba(0, 0, 0, .28), 0 0 1.3rem color-mix(in srgb, var(--world-color) 22%, transparent);
}

.island-card.unlocked {
    border-color: color-mix(in srgb, var(--world-color) 64%, white);
    background: linear-gradient(145deg, color-mix(in srgb, var(--world-color) 22%, #1a284c), rgba(15, 24, 50, .96));
    box-shadow: 0 10px 28px rgba(0, 0, 0, .28), 0 0 1.5rem color-mix(in srgb, var(--world-color) 28%, transparent);
}

.island-card.unlocked:hover,
.island-card.unlocked:focus-visible {
    border-color: #fff2b7;
    box-shadow: 0 14px 32px rgba(0, 0, 0, .38), 0 0 0 2px rgba(255, 242, 183, .24), 0 0 2rem color-mix(in srgb, var(--world-color) 44%, transparent);
}

.island-card.completed {
    border-color: #86efac;
    background: linear-gradient(145deg, rgba(21, 83, 61, .9), rgba(15, 35, 46, .96));
    box-shadow: 0 10px 28px rgba(0, 0, 0, .28), 0 0 1.3rem rgba(74, 222, 128, .2);
}

.island-card.attempted {
    border-color: #fde68a;
    background: linear-gradient(145deg, rgba(84, 66, 38, .82), rgba(20, 29, 50, .96));
}

.island-card:hover {
    transform: translateY(-4px) scale(1.015);
}

.expedition-stop-number {
    position: absolute;
    top: .7rem;
    left: .7rem;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 50%;
    background: rgba(6, 13, 31, .85);
    color: #fff;
    font-size: .85rem;
    font-weight: 900;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .28);
}

.island-card .difficulty-badge {
    position: absolute;
    top: .7rem;
    right: .7rem;
    min-height: 28px;
    padding: .25rem .6rem;
    border-radius: 999px;
    background: rgba(7, 15, 34, .72);
    color: #fff;
    font-size: .72rem;
    font-weight: 900;
}

.island-icon {
    margin-top: 1rem;
    font-size: 2.5rem;
    filter: drop-shadow(0 5px 8px rgba(0, 0, 0, .25));
}

.island-name {
    margin: 0 auto .3rem;
    line-height: 1.25;
    text-wrap: balance;
}

.island-type {
    display: inline-block;
    margin: .1rem auto .5rem;
    padding: .25rem .65rem;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    background: rgba(5, 12, 30, .48);
    color: #fff;
    font-size: .78rem;
    font-weight: 800;
}

.expedition-mission-description {
    position: relative;
    z-index: 1;
    max-width: 28rem;
    margin: .25rem auto .45rem;
    color: rgba(255, 255, 255, .82);
    font-size: .82rem;
    line-height: 1.35;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.expedition-question-count {
    color: #fde68a;
    font-size: .76rem;
    font-weight: 900;
}

.local-island-progress {
    position: relative;
    z-index: 1;
    display: block;
    margin: .55rem auto 0;
    color: #fef08a;
    font-size: .78rem;
    font-weight: 900;
    line-height: 1.3;
}

.local-island-progress[hidden] {
    display: none;
}

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

    .expedition-level-pill {
        display: inline-flex;
    }

    .expedition-count {
        font-size: .78rem;
    }
}

@media (max-width: 600px) {
    .header {
        position: relative;
        flex-wrap: wrap;
        gap: .65rem;
        padding: .7rem .8rem;
    }

    .header-left {
        min-width: 0;
        gap: .65rem;
    }

    .page-title {
        font-size: 1.15rem;
    }

    .header-stats {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        gap: .45rem;
    }

    .header-stats .stat-pill {
        min-height: 36px;
        padding: .35rem .7rem;
        font-size: .76rem;
    }

    .main-content {
        padding: .8rem;
    }

    .hero-section {
        gap: .85rem;
        margin-bottom: 1rem;
    }

    .hero-text h2 {
        font-size: 1.55rem;
    }

    .hero-text p {
        font-size: .95rem;
    }

    .mascot-bubble {
        max-width: 100%;
        padding: .85rem;
    }

    .mascot-image {
        width: 3.4rem;
        height: 3.4rem;
        margin-bottom: .45rem;
        font-size: 2rem;
    }

    .arc-selector-container {
        margin: .65rem 0;
    }

    .arc-selector-label {
        display: block;
        margin-bottom: .35rem;
    }

    .worlds-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: .8rem;
    }

    .world-header {
        padding: 1rem 1rem .65rem;
    }

    .world-icon {
        font-size: 2.3rem;
    }

    .world-progress {
        padding: 0 1rem 1rem;
    }

    .local-adventure-resume {
        max-width: 100%;
        margin: .2rem 0 .75rem;
        font-size: .88rem;
    }

    .map-container {
        padding: .75rem .8rem 1.5rem;
    }

    .world-info {
        margin-bottom: .8rem;
        padding: 1rem .8rem;
        border-radius: 1.1rem;
    }

    .world-info h2 {
        font-size: 1.35rem;
    }

    .world-info .expedition-world-note {
        border-radius: .8rem;
        font-size: .78rem;
    }

    .islands-path {
        gap: .85rem;
        padding-left: 0;
    }

    .path-line {
        display: block;
        left: 1.05rem;
        top: 0;
        bottom: 0;
        width: 3px;
        transform: none;
    }

    .island-row,
    .island-row:nth-child(odd),
    .island-row:nth-child(even) {
        width: 100%;
        justify-content: flex-start;
        padding: 0 0 0 2.4rem;
    }

    .island-card {
        width: 100%;
        min-height: 0;
        padding: .95rem .8rem .8rem;
        border-radius: 1.1rem;
    }

    .island-icon {
        margin-top: .8rem;
        font-size: 2.1rem;
    }
}

@media (max-width: 360px) {
    .header-left {
        width: 100%;
    }

    .world-title h1 {
        max-width: 13rem;
        overflow-wrap: anywhere;
        font-size: 1rem;
    }

    .expedition-count {
        align-items: flex-start;
        flex-direction: column;
    }

    .island-row,
    .island-row:nth-child(odd),
    .island-row:nth-child(even) {
        padding-left: 2rem;
    }

    .path-line {
        left: .8rem;
    }

    .expedition-stop-number {
        top: .55rem;
        left: .55rem;
        width: 1.75rem;
        height: 1.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .story-banner::after,
    .world-card,
    .local-adventure-resume,
    .island-row,
    .island-card,
    .world-info,
    .world-stat {
        animation: none !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }

    .world-card:hover,
    .island-card:hover,
    .local-adventure-resume:hover {
        transform: none;
    }
}
