@font-face {
    font-family: "Mistrully";
    src: url("../font/Mistrully.woff") format("woff"),
    url("../font/Mistrully.ttf") format("truetype"),
    url("../font/Mistrully.otf") format("opentype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Euclid";
    src: url("../font/Euclid Circular A SemiBold.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body.finzzle-galaxie-page {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    color: #ffffff;
}

body.finzzle-galaxie-page #header {
    display: none;
}

body.finzzle-galaxie-page #card-container {
    width: 100vw;
    height: 100vh;
}

.finzzle-galaxie-page #star-canvas {
    position: absolute;
    inset: 0;
    display: block;
    background-image: url("../img/bg_galaxy.png");
    background-size: cover;
    max-width: none;
    margin: 0;
    padding: 0;
}

canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100vw;
    height: 100vh;
}

/* Messages de vœux */
.overlay-message {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.overlay-message.visible {
    opacity: 1;
}

.overlay-message-inner {
    max-width: 900px;
    padding: 2rem 3rem;
    border-radius: 24px;
    text-align: center;
    color: #fff;
}

.overlay-message p {
    max-width: 1020px;
    font-size: 25px;
    line-height: 1.2;
    margin: 0.4rem 0;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.overlay-message .line.show {
    opacity: 1;
    transform: translateY(0);
}

.accent-brand {
    color: #d4af37; /* doré */
    font-weight: 600;
}

.accent-strong {
    font-weight: 700;
    color: #d4af37;
    letter-spacing: 0.03em;
    text-transform: none; /* reste en minuscules */
}



/* Appliquer Mistrully à tout le bloc message 3 */
#message-3 {
    font-family: Mistrully, system-ui, sans-serif;
}

#message-1, #message-2 {
    font-family: Euclid, system-ui, sans-serif;
    line-height: 1.0;
}

/* Message 3 : Mistrully + animation mot par mot */
.mistrully-inner {
    background: transparent;
    box-shadow: none;
    border: none;
    backdrop-filter: none;
    color: #ffffff;
}

.mistrully-line {
    font-family: "Mistrully", "Euclid", system-ui, cursive;
    font-size: clamp(2rem, 4vw, 3rem); /* ajuste si tu veux plus grand */
    color: #ffffff;
    text-shadow: 0 0 18px rgba(0, 0, 0, 0.95);
}

.mistrully-line .word {
    opacity: 0;
    display: inline-block;
    transform: translateY(10px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.mistrully-line .word.show {
    opacity: 1;
    transform: translateY(0);
}

.after-mistrully {
    color: #ffffff;
    font-weight: 500;
    font-size: clamp(1rem, 1.4vw, 1.2rem);
}

/* Panneau de dessin */
.ui-panel {
    position: absolute;
    bottom: 1.5rem;
    left: 30%;
    padding: 1.5rem 1.2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    background-color: rgba(255, 255, 2555, 0.05);
    backdrop-filter: blur(10px);
    color: #ffffff;
    font-size: 0.9rem;
    width: 40%;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hidden {
    display: none;
}

.ui-panel label {
    font-weight: 500;
}

.ui-panel input[type="text"] {
    background: none;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 0.4rem 0.6rem;
    color: #ffffff;
    min-width: 150px;
    font-size: 0.9rem;
}

.ui-panel input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.ui-panel button {
    border-radius: 999px;
    border: none;
    padding: 0.45rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #111111;
    background: linear-gradient(135deg, #f9e39a, #d4af37);
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 217, 102, 0.35);
    transition: transform 0.1s ease, box-shadow 0.1s ease, filter 0.15s ease;
    white-space: nowrap;
}

.ui-panel button.secondary {
    background: none;
    color: #ffffff;
    box-shadow: none;
    margin: 0 10px;
}

.ui-panel button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
    box-shadow: none;
}

.ui-panel button.secondary:hover {
    box-shadow: none;
    background: none!important;
}

#input-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.ui-panel small {
    opacity: 0.6;
}

#status-text {
    font-size: 0.8rem;
    color: #fff;
    flex-basis: 100%;
}

/* Panel univers */
.universe-panel {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 350px;
    max-height: 90vh;
    /* Permalink - use to edit and share this gradient: https://colorzilla.com/gradient-editor/#000000+0,2989d8+20,ffffff+20,e5e5e5+100&0.2+0,0.2+100 */
    background: linear-gradient(to bottom,  rgba(0,0,0,0.2) 0%,rgba(255,255,255,0.2) 20%,rgba(229,229,229,0.2) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
    border-radius: 12px;
    border: 1px solid rgba(120, 132, 255, 0.4);
    padding: 0.75rem 0.9rem;
    font-size: 0.8rem;
    color: #f9fafb;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55);
    transition: width 0.3s ease;
}

#retract-btn {
    position: absolute;
    top: 10%;
    left: -28px;
    color: #ffffff;
    font-size: 1.2rem;
    cursor: pointer;
    background: linear-gradient(to bottom,  rgba(0,0,0,0.2) 0%,rgba(255,255,255,0.2) 20%,rgba(229,229,229,0.2) 100%);
    padding: 10px 5px;
    border-radius: 5px 0 0 5px;
}

#universe-panel.active #retract-btn {
    top: 50%;
}
.rectracted #retract-btn {
    top: 2rem;
}
#retract-btn svg {
    width: auto;
    height: 30px;
    fill: #fff;
}
.universe-panel.rectracted {
    transition: 0.2s ease all;
    width: 0;
    padding: 0;
}
.universe-panel.active {
    height: 90vh;
}

.universe-panel h2 {
    font-size: 0.9rem;
    margin: 0 0 0.35rem 0;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #d4af37;
}

.universe-panel ul {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0 0;
    overflow-y: auto;
    position: relative;
    max-height: calc(90vh - 110px);
}

.universe-panel .hidden {
    display: none;
}

.universe-panel li {
    cursor: pointer;
    padding: 10px;
    margin: 5px 0;
    border: none;
    background: rgba(2555, 255, 255, 0.1);
    border-radius: 5px;
}

.universe-panel li span.name {
    font-weight: 600;
    color: #ffffff;
}

.universe-panel li span.count {
    opacity: 0.8;
}

#universe-list li {
    position: relative;
}
#universe-list li::after {
    content: "✨";
    display: inline-block;
    position: absolute;
    right: 10px;
    z-index: 100;
    width: 16px;
    height: 16px;
    opacity: 0;
    transition: 0.3s ease all;
}

#universe-list li.selected::after,
#universe-list li:hover::after {
    opacity: 1;
    transition: 0.3s ease all;
}

.universe-panel .empty {
    font-style: italic;
    opacity: 0.7;
}

#link-output {
    width: 100%;
    margin-top: 0.3rem;
    background: rgba(15, 20, 50, 0.9);
    border-radius: 8px;
    border: 1px solid rgba(120, 132, 255, 0.6);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 0.3rem 0.4rem;
}

/* Bouton galaxie */
#galaxy-toggle {
    position: relative;
    z-index: 100;
    border-radius: 999px;
    border: 2px solid #DAB455;
    background: rgba(6, 10, 25, 0.5);
    color: #ffffff;
    padding: 0.45rem 0.9rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.08em;
    cursor: pointer;
    backdrop-filter: blur(10px);
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

#galaxy-toggle.active {
    background: linear-gradient(135deg, #111111, #020617);
}

#galaxy-toggle span {
    opacity: 0.9;
}

/* Overlay info galaxie */
#galaxy-hint {
    position: absolute;
    top: 3.4rem;
    right: 1.1rem;
    max-width: 240px;
    font-size: 0.78rem;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 10px;
    padding: 0.4rem 0.6rem;
    border: 1px solid rgba(148, 163, 255, 0.4);
    backdrop-filter: blur(10px);
}

#galaxy-hint.hidden {
    display: none;
}

/* Signature logo + liseret bas de page à droite, animés */
#signature {
    position: absolute;
    top: 0;
    left: 0;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    overflow: hidden;
    z-index: 1000; /* Au-dessus du canvas */
    pointer-events: auto; /* Active les clics */
}

#signature-logo a,
#signature-logo img {
    pointer-events: auto;
    display: block;
}

#signature-logo {
    padding-left: 1em; /* zone de protection ≈ hauteur du e */
    pointer-events: auto; /* Héritage + confirmation */
    z-index: 1001;
}

#signature-logo img {
    height: 45px;
    display: block;
    filter: drop-shadow(0 0 6px rgba(0,0,0,0.6));
}

#reset-btn-container {
    position: absolute;
    top: 40px;
    left: -50px;
}

.reset-btn {
    background: transparent;
    color: #ffffff;
    border: 1px solid #ffffff;
    border-radius: 0px;
    width: 40px;
    height: 40px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    transition: all 0.2s ease;
}

.reset-btn:hover {
    background: #ffffff;
    color: #000000;
    transform: scale(1.1);
}


@keyframes logoSlide {
    0%   { transform: translateX(-120%); opacity: 0; }
    60%  { transform: translateX(0); opacity: 1; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes lineSlide {
    0%   { width: 0; opacity: 0; transform: translateX(-120%); }
    40%  { width: 140px; opacity: 1; transform: translateX(0); }
    80%  { width: 60px; opacity: 1; transform: translateX(0); }
    100% { width: 0; opacity: 0; transform: translateX(0); }
}

@media (max-width: 768px) {
    .ui-panel {
        width: calc(100% - 1rem);
        bottom: 0.5rem;
        left: auto;
        right: 0;
        padding: 0.5rem;
        border-radius: 10px;
    }
    .ui-panel button.secondary {
        margin: 0 5px;
    }
    .universe-panel {
        top: 5rem;
        border: none;
    }
    #galaxy-toggle {
        margin-bottom: 0;
    }
    #universe-list-description,
    #universe-info {
        display: none;
    }
    #galaxy-hint {
    }
    #signature {
    }
    #reset-btn-container {
        position: absolute;
        top: 10px;
        left: -35px;
    }
    .retracted #reset-btn-container {
        top: 50%;
    }
    #retract-btn {
        padding: 4px 3px;
        left: -19px;
        background: rgba(255, 255, 255, 0.2);
        top: 10px;
        line-height: 14px;
    }
    #retract-btn svg {
        height: 20px;
    }
    .reset-btn {
        width: 30px;
        height: 30px;
    }
}
@media (max-width: 425px) {
    .universe-panel {
        top: 5rem;
        border: none;
        width: 90%;
        right: 1%;
    }
}