/* ============================================
   TOURNOI DES SORCIERS - Invitation Web
   ============================================ */

/* -- Font custom ------------------------------ */
@font-face {
    font-family: 'Jolly Lodger';
    src: url('../assets/fonts/JollyLodger-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* -- Variables -------------------------------- */
:root {
    --color-bg-dark:        #0a0a1a;
    --color-gold:           #d4a843;
    --color-gold-light:     #f5d88e;
    --color-parchment:      #f5e6c8;
    --color-text:           #e8e8e8;

    --font-title:           'Jolly Lodger', 'Cinzel', Georgia, serif;
    --font-body:            'Cinzel', Georgia, serif;

    /* Lumos - mis à jour par JS */
    --lumos-x:              50%;
    --lumos-y:              50%;
    --lumos-radius-inner:   80px;
    --lumos-radius-outer:   180px;

    /* Lumos idle (avant interaction) */
    --lumos-radius-inner-idle: 35px;
    --lumos-radius-outer-idle: 80px;

    /* Offset baguette (ajustable) */
    --wand-offset-x:        -12px;
    --wand-offset-y:        -10px;

    --transition-view:      0.8s ease-in-out;
}

/* -- Reset ------------------------------------ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
    font-family: var(--font-body);
    background: var(--color-bg-dark);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* -- Système de vues -------------------------- */
.view {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-view), visibility var(--transition-view);
    z-index: 1;
}

.view--active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* =============================================
   VUE 0 : IDENTITÉ
   ============================================= */

#identite {
    background:
        radial-gradient(1px 1px at 10% 20%,  #fff, transparent),
        radial-gradient(1px 1px at 30% 70%,  #ccc, transparent),
        radial-gradient(1.5px 1.5px at 50% 10%, #fff, transparent),
        radial-gradient(1px 1px at 70% 40%,  #ddd, transparent),
        radial-gradient(1px 1px at 90% 80%,  #fff, transparent),
        radial-gradient(1.5px 1.5px at 15% 55%, #eee, transparent),
        radial-gradient(1px 1px at 60% 90%,  #fff, transparent),
        radial-gradient(1px 1px at 85% 15%,  #ccc, transparent),
        radial-gradient(1px 1px at 5% 85%,   #fff, transparent),
        radial-gradient(1px 1px at 40% 35%,  #ddd, transparent),
        radial-gradient(1.5px 1.5px at 75% 75%, #fff, transparent),
        radial-gradient(1px 1px at 55% 50%,  #eee, transparent),
        linear-gradient(180deg, #0a0a2e 0%, #0a0a1a 100%);
    overflow-y: auto;
}

/* Éclairs */
#identite::before,
#identite::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    background-repeat: no-repeat;
    background-size: 120px auto;
}

#identite::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 240'%3E%3Cpath d='M40 0 L28 60 L50 55 L20 120 L44 115 L8 240 L36 110 L14 115 L46 55 L24 60 Z' fill='%23cce0ff' opacity='0.95'/%3E%3Cpath d='M38 4 L28 60 L46 56 L24 115 L40 112 L14 225 L33 108 L18 112 L42 56 L26 60 Z' fill='white' opacity='0.85'/%3E%3Cpath d='M60 30 L52 75 L66 72 L48 130 L62 127 L38 200 L56 122 L44 127 L62 72 L50 75 Z' fill='%23cce0ff' opacity='0.6'/%3E%3C/svg%3E");
    background-position: 12% 2%;
    background-size: 140px auto;
    animation: lightning-a 1.2s ease-in-out infinite;
}

#identite::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 240'%3E%3Cpath d='M40 0 L28 60 L50 55 L20 120 L44 115 L8 240 L36 110 L14 115 L46 55 L24 60 Z' fill='%23cce0ff' opacity='0.95'/%3E%3Cpath d='M38 4 L28 60 L46 56 L24 115 L40 112 L14 225 L33 108 L18 112 L42 56 L26 60 Z' fill='white' opacity='0.85'/%3E%3Cpath d='M55 20 L48 65 L60 62 L44 120 L56 117 L36 190 L50 112 L40 117 L58 62 L48 65 Z' fill='%23cce0ff' opacity='0.6'/%3E%3C/svg%3E");
    background-position: 80% 3%;
    background-size: 130px auto;
    animation: lightning-b 1.8s ease-in-out 0.3s infinite;
}

/* Éclairs supplémentaires (divs) */
.lightning {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    background-repeat: no-repeat;
}

.lightning--top-left {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 240'%3E%3Cpath d='M40 0 L28 60 L50 55 L20 120 L44 115 L8 240 L36 110 L14 115 L46 55 L24 60 Z' fill='%23cce0ff' opacity='0.95'/%3E%3Cpath d='M38 4 L28 60 L46 56 L24 115 L40 112 L14 225 L33 108 L18 112 L42 56 L26 60 Z' fill='white' opacity='0.85'/%3E%3C/svg%3E");
    background-position: 35% 1%;
    background-size: 100px auto;
    animation: lightning-c 2s ease-in-out 0.6s infinite;
}

.lightning--bottom-right {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 240'%3E%3Cpath d='M40 0 L28 60 L50 55 L20 120 L44 115 L8 240 L36 110 L14 115 L46 55 L24 60 Z' fill='%23cce0ff' opacity='0.95'/%3E%3Cpath d='M38 4 L28 60 L46 56 L24 115 L40 112 L14 225 L33 108 L18 112 L42 56 L26 60 Z' fill='white' opacity='0.85'/%3E%3C/svg%3E");
    background-position: 75% 97%;
    background-size: 105px auto;
    transform: rotate(180deg);
    animation: lightning-a 1.6s ease-in-out 0.4s infinite;
}

/* --- Keyframes éclairs (flash fréquent, multi-cluster) --- */
@keyframes lightning-a {
    0%, 100% { opacity: 0; }
    4%  { opacity: 1; }
    8%  { opacity: 0; }
    12% { opacity: 0.9; }
    16% { opacity: 0.1; }
    20% { opacity: 0.7; }
    24% { opacity: 0; }
}

@keyframes lightning-b {
    0%, 100% { opacity: 0; }
    5%  { opacity: 0.8; }
    10% { opacity: 0; }
    15% { opacity: 1; }
    18% { opacity: 0.1; }
    22% { opacity: 0.6; }
    30% { opacity: 0; }
    50% { opacity: 0; }
    54% { opacity: 0.9; }
    58% { opacity: 0.1; }
    62% { opacity: 0.7; }
    66% { opacity: 0; }
}

@keyframes lightning-c {
    0%, 100% { opacity: 0; }
    3%  { opacity: 0.7; }
    7%  { opacity: 0; }
    10% { opacity: 1; }
    14% { opacity: 0; }
    40% { opacity: 0; }
    43% { opacity: 0.8; }
    47% { opacity: 0.1; }
    50% { opacity: 0.9; }
    55% { opacity: 0; }
}

/* Indication son */
.sound-hint {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-body);
    font-size: clamp(0.65rem, 1.5vw, 0.8rem);
    color: rgba(245, 230, 200, 0.5);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    z-index: 2;
    pointer-events: none;
    animation: sound-hint-pulse 2.5s ease-in-out infinite alternate;
}

.sound-hint--top {
    top: 1.2rem;
}

.sound-hint--bottom {
    bottom: 1.2rem;
}

@keyframes sound-hint-pulse {
    0%   { opacity: 0.35; }
    100% { opacity: 0.7; }
}

.identite__content {
    text-align: center;
    padding: 2rem;
    z-index: 2;
    max-width: 600px;
    width: 100%;
}

.identite__greeting {
    font-family: var(--font-title);
    font-size: clamp(1.3rem, 4vw, 2rem);
    color: var(--color-parchment);
    margin-bottom: 0.3em;
}

.identite__title {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: clamp(1.6rem, 5vw, 2.5rem);
    color: var(--color-gold);
    text-shadow: 0 0 15px rgba(212, 168, 67, 0.4);
    margin-bottom: 1.5em;
}

.identite__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
}

.identite__name {
    font-family: var(--font-body);
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    color: var(--color-parchment);
    background: rgba(212, 168, 67, 0.1);
    border: 1px solid rgba(212, 168, 67, 0.3);
    padding: 0.6em 1.2em;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.identite__name:hover,
.identite__name:focus-visible {
    background: rgba(212, 168, 67, 0.25);
    box-shadow: 0 0 15px rgba(212, 168, 67, 0.3);
    transform: scale(1.05);
    outline: none;
}

/* =============================================
   VUE 1 : L'ANTICHAMBRE
   ============================================= */

#antichambre {
    background:
        radial-gradient(1px 1px at 10% 20%,  #fff, transparent),
        radial-gradient(1px 1px at 30% 70%,  #ccc, transparent),
        radial-gradient(1.5px 1.5px at 50% 10%, #fff, transparent),
        radial-gradient(1px 1px at 70% 40%,  #ddd, transparent),
        radial-gradient(1px 1px at 90% 80%,  #fff, transparent),
        radial-gradient(1.5px 1.5px at 15% 55%, #eee, transparent),
        radial-gradient(1px 1px at 60% 90%,  #fff, transparent),
        radial-gradient(1px 1px at 85% 15%,  #ccc, transparent),
        radial-gradient(1px 1px at 5% 85%,   #fff, transparent),
        radial-gradient(1px 1px at 40% 35%,  #ddd, transparent),
        radial-gradient(1.5px 1.5px at 75% 75%, #fff, transparent),
        radial-gradient(1px 1px at 55% 50%,  #eee, transparent),
        linear-gradient(180deg, #0a0a2e 0%, #0a0a1a 100%);
    overflow: hidden;
}

/* Scintillement */
#antichambre::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(2px 2px at 25% 35%, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 75% 65%, rgba(255,255,255,0.6), transparent),
        radial-gradient(1.5px 1.5px at 45% 85%, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 65% 15%, rgba(255,255,255,0.5), transparent),
        radial-gradient(2px 2px at 20% 75%, rgba(255,255,255,0.6), transparent);
    animation: twinkle 3s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes twinkle {
    0%   { opacity: 0.3; }
    100% { opacity: 1; }
}

.antichambre__content {
    text-align: center;
    padding: 2rem;
    z-index: 2;
}

.antichambre__decree {
    font-family: var(--font-title);
    font-size: clamp(0.75rem, 2vw, 1rem);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-gold);
    opacity: 0.7;
    margin-bottom: 0.3em;
}

.antichambre__title {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: clamp(2rem, 6vw, 4rem);
    color: var(--color-gold);
    text-shadow: 0 0 20px rgba(212, 168, 67, 0.5),
                 0 0 40px rgba(212, 168, 67, 0.2);
    margin-bottom: 0.5em;
    letter-spacing: 0.05em;
}

.antichambre__subtitle {
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: var(--color-parchment);
    margin-bottom: 2.5rem;
}

/* -- Countdown -------------------------------- */
.countdown {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.countdown__block {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
}

.countdown__number {
    font-family: var(--font-body);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    color: var(--color-gold-light);
    line-height: 1;
}

.countdown__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-text);
    opacity: 0.7;
    margin-top: 0.3em;
}

/* -- Hedwig animée ---------------------------- */
.owl {
    position: absolute;
    z-index: 5;
    top: 6%;
    left: -160px;
    pointer-events: none;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.3));
}

.owl img {
    display: block;
    width: clamp(100px, 18vw, 160px);
    height: auto;
}

.owl--fly {
    animation: owl-fly 3.5s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

@keyframes owl-fly {
    0%   { left: -160px; top: 3%;  transform: rotate(0deg); }
    15%  { left: 5%;     top: 8%;  transform: rotate(-3deg); }
    30%  { left: 20%;    top: 14%; transform: rotate(-1deg); }
    45%  { left: 40%;    top: 18%; transform: rotate(-3deg); }
    60%  { left: 60%;    top: 14%; transform: rotate(2deg); }
    75%  { left: 80%;    top: 9%;  transform: rotate(-1deg); }
    90%  { left: 98%;    top: 5%;  transform: rotate(1deg); }
    100% { left: 110%;   top: 3%;  transform: rotate(0deg); }
}

/* -- Bouton CTA ------------------------------- */
.cta-button {
    font-family: var(--font-body);
    font-size: clamp(0.9rem, 2.5vw, 1.2rem);
    font-weight: 700;
    color: var(--color-bg-dark);
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-light));
    border: 2px solid var(--color-gold);
    padding: 0.9em 2.2em;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(-80px) scale(0.8);
    pointer-events: none;
}

.cta-button--dropped {
    animation: cta-drop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    pointer-events: auto;
}

@keyframes cta-drop {
    0%   { opacity: 0; transform: translateY(-80px) scale(0.8); }
    50%  { opacity: 1; transform: translateY(6px) scale(1.02); }
    75%  { transform: translateY(-3px) scale(0.99); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.cta-button--dropped:hover,
.cta-button--dropped:focus-visible {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(212, 168, 67, 0.6);
    outline: none;
}

.cta-button--dropped:active {
    transform: scale(0.98);
}

/* =============================================
   VUE 2 : LA RÉVÉLATION
   ============================================= */

#revelation {
    background: var(--color-bg-dark);
    overflow: hidden;
    cursor: none;
}

/* -- Contenu invitation ----------------------- */
.revelation__content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
    max-width: 550px;
    width: 100%;
    color: var(--color-parchment);
}

.revelation__title {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: clamp(2rem, 5.5vw, 3rem);
    color: var(--color-gold);
    margin-bottom: 1em;
    text-shadow: 0 0 15px rgba(212, 168, 67, 0.4);
}

.revelation__scroll {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
}

.revelation__text {
    font-size: clamp(0.85rem, 2.2vw, 1.05rem);
    line-height: 1.7;
}

.revelation__event {
    font-family: var(--font-title);
    font-weight: 700;
    font-size: clamp(1.3rem, 3.5vw, 2rem);
    color: var(--color-gold);
    text-shadow: 0 0 12px rgba(212, 168, 67, 0.4);
    margin: 0.3em 0;
}

.revelation__details {
    margin: 0.5em 0;
    line-height: 2;
    font-size: clamp(0.85rem, 2.2vw, 1.05rem);
}

.revelation__label {
    color: var(--color-gold-light);
    font-weight: 700;
}

.revelation__accessory-notice,
.revelation__accessory-reminder {
    font-size: clamp(0.8rem, 2.1vw, 1rem);
    color: var(--color-gold-light);
    font-style: italic;
    line-height: 1.6;
    padding: 0.4em 0;
}

.revelation__accessory-notice {
    border-bottom: 1px solid rgba(212, 168, 67, 0.2);
    padding-bottom: 0.8em;
    margin-bottom: 0.3em;
}

.revelation__accessory-reminder {
    border-top: 1px solid rgba(212, 168, 67, 0.2);
    padding-top: 0.8em;
    margin-top: 0.3em;
}

.revelation__footer {
    margin-top: 0.5em;
    opacity: 0.85;
    font-size: clamp(0.8rem, 2vw, 0.95rem);
}

/* -- Calque Lumos ----------------------------- */
.lumos-overlay {
    position: fixed;
    inset: 0;
    z-index: 5;
    background: #000;
    pointer-events: none;

    -webkit-mask-image: radial-gradient(
        circle at var(--lumos-x, 50%) var(--lumos-y, 50%),
        transparent     var(--lumos-radius-inner),
        rgba(0,0,0,0.3) calc(var(--lumos-radius-inner) + 30px),
        black           var(--lumos-radius-outer)
    );
    mask-image: radial-gradient(
        circle at var(--lumos-x, 50%) var(--lumos-y, 50%),
        transparent     var(--lumos-radius-inner),
        rgba(0,0,0,0.3) calc(var(--lumos-radius-inner) + 30px),
        black           var(--lumos-radius-outer)
    );
}

/* -- Lumos idle (petit cercle centré avant interaction) */
.lumos-overlay--idle {
    -webkit-mask-image: radial-gradient(
        circle at 50% 50%,
        transparent     var(--lumos-radius-inner-idle),
        rgba(0,0,0,0.3) calc(var(--lumos-radius-inner-idle) + 20px),
        black           var(--lumos-radius-outer-idle)
    );
    mask-image: radial-gradient(
        circle at 50% 50%,
        transparent     var(--lumos-radius-inner-idle),
        rgba(0,0,0,0.3) calc(var(--lumos-radius-inner-idle) + 20px),
        black           var(--lumos-radius-outer-idle)
    );
}

/* -- Baguette magique ------------------------- */
.wand {
    position: fixed;
    z-index: 10;
    pointer-events: none;
    left: var(--lumos-x, 50%);
    top: var(--lumos-y, 50%);
    transform: translate(var(--wand-offset-x), var(--wand-offset-y)) rotate(-30deg);
    transform-origin: top center;
    filter: drop-shadow(0 0 8px rgba(212, 168, 67, 0.5));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wand svg {
    display: block;
    width: 20px;
    height: auto;
}

.wand--visible {
    opacity: 1;
}

/* -- Lueur autour de la pointe ---------------- */
.wand--visible::after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 16px;
    background: radial-gradient(circle, rgba(255,251,230,0.8), transparent 70%);
    border-radius: 50%;
    animation: glow-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes glow-pulse {
    0%   { opacity: 0.5; transform: translateX(-50%) scale(1); }
    100% { opacity: 1;   transform: translateX(-50%) scale(1.5); }
}

/* -- Tooltip onboarding ----------------------- */
.tooltip {
    position: fixed;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    background: rgba(212, 168, 67, 0.12);
    border: 1px solid rgba(212, 168, 67, 0.4);
    color: var(--color-parchment);
    padding: 1em 2em;
    border-radius: 8px;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    text-align: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 1;
    transition: opacity 0.8s ease-out;
    pointer-events: none;
    white-space: nowrap;
}

.tooltip--hidden {
    opacity: 0;
}

/* Afficher le bon texte selon le device */
.tooltip__mobile { display: none; }
.tooltip__desktop { display: inline; }

@media (hover: none) and (pointer: coarse) {
    .tooltip__mobile { display: inline; }
    .tooltip__desktop { display: none; }
}

/* -- Body lock pour Vue 2 --------------------- */
body.revelation-active {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    -webkit-overflow-scrolling: none;
    touch-action: none;
}

/* =============================================
   RESPONSIVE
   ============================================= */

@media (max-width: 480px) {
    :root {
        --lumos-radius-inner: 55px;
        --lumos-radius-outer: 130px;
        --lumos-radius-inner-idle: 25px;
        --lumos-radius-outer-idle: 60px;
    }

    .countdown {
        gap: 0.8rem;
    }

    .countdown__block {
        min-width: 55px;
    }

    .revelation__content {
        padding: 1.5rem 1rem;
    }

    #identite::before,
    #identite::after {
        background-size: 65px auto;
    }

    .lightning--top-left {
        background-size: 50px auto;
    }

    .lightning--bottom-right {
        background-size: 50px auto;
    }

    .wand svg {
        width: 16px;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    :root {
        --lumos-radius-inner: 65px;
        --lumos-radius-outer: 150px;
        --lumos-radius-inner-idle: 30px;
        --lumos-radius-outer-idle: 70px;
    }
}

@media (min-width: 769px) {
    :root {
        --lumos-radius-inner: 80px;
        --lumos-radius-outer: 200px;
    }
}
