:root {
    --bg: #f8f5f0;
    --surface: #ece7dd;
    --text: #1a1a1a;
    --muted: #6b6b6b;
    --accent: #d32f2f;
    --border: #1a1a1a;
    --border-soft: #e0ddd7;
    --font: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1a1a;
        --surface: #232323;
        --text: #f8f5f0;
        --muted: #a3a3a3;
        --border: #f8f5f0;
        --border-soft: #3a3a3a;
    }
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* --- Fenêtre "custom" --- */
.win {
    width: 100%;
    max-width: 420px;
    background: var(--bg);
    border: 3px solid var(--accent);
    border-radius: 18px;
    box-shadow: 8px 8px 0 var(--accent);
    position: relative;
    z-index: 5;
    overflow: hidden;
}

.win::after {
    /* Decorative folded corner that stays in place: using only positional CSS */
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 28px 28px;
    border-color: transparent transparent var(--accent) transparent;
    opacity: 0.55;
    pointer-events: none;
}

.win-titlebar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: var(--surface);
    border-bottom: 2px solid var(--border);
}

.win-btn {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    color: var(--text);
    flex-shrink: 0;
}

.win-title {
    margin-left: 0.3rem;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.win-lines {
    margin-left: auto;
    width: 64px;
    height: 12px;
    background: repeating-linear-gradient(to bottom,
            var(--border-soft) 0 2px,
            transparent 2px 5px);
    opacity: 0.7;
}

.win-body {
    background: var(--surface);
    padding: 1.6rem 1.4rem 2rem;
}

.hero {
    text-align: center;
    padding: 6px 8px 18px;
}

.avatar {
    width: 88px;
    height: 88px;
    object-fit: cover;
    display: block;
    margin: 0 auto 12px;
    border: 2px solid var(--border);
    border-radius: 6px;
    filter: grayscale(60%);
}

.name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
}

/* Picture with drag & drop function */
#decorative-images {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.decorative-image {
    position: absolute;
    cursor: grab;
    opacity: 0.75;
    transition: opacity 0.3s ease, transform 0.1s ease;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    z-index: 2;
    animation: float 4s ease-in-out infinite;
}

.decorative-image:hover {
    opacity: 1;
    transform: scale(1.08);
}

.decorative-image.dragging {
    cursor: grabbing;
    opacity: 1;
    z-index: 10;
    transform: scale(1.15);
    animation: none;
}

.decorative-image.small {
    width: 32px;
    height: auto;
}

.decorative-image.medium {
    width: 46px;
    height: auto;
}

.decorative-image.large {
    width: 64px;
    height: auto;
}

@media (max-width: 768px) {
    .decorative-image {
        opacity: 0.55;
    }

    .decorative-image.small {
        width: 26px;
    }

    .decorative-image.medium {
        width: 30px;
    }

    .decorative-image.large {
        width: 34px;
    }

    .decorative-image:hover {
        opacity: 0.8;
        transform: scale(1.1);
    }

    .decorative-image.dragging {
        opacity: 0.9;
        transform: scale(1.15);
    }
}

@keyframes float {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0);
    }
}

.links {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1rem;
    background: var(--bg);
    border: 2px solid var(--border);
    box-shadow: 4px 4px 0 var(--border);
    color: var(--text);
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.1s;
}

.btn:hover {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.btn:active {
    outline: 2px dashed var(--accent) !important;
    outline-offset: 4px;
}

.btn .label {
    flex: 1;
    text-align: left;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.btn .meta {
    font-size: 0.7rem;
    color: var(--muted);
}

.footer {
    margin-top: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 0.7rem;
    border-top: 1px dashed var(--border-soft);
    padding-top: 14px;
}

.footer svg {
    margin-top: 8px;
}

/* --- POPIN / MODALE --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.5);
    animation: modal-fade 0.15s ease-out;
}

.modal-overlay[hidden] {
    display: none;
}

@keyframes modal-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- CITATIONS --- */
blockquote {
    margin: 1.2rem 0 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--accent);
    background: rgba(0, 0, 0, 0.03);
    font-style: italic;
}

@media (prefers-color-scheme: dark) {
    blockquote {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* --- CARTE --- */
.card {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    border: 2px solid var(--border);
    box-shadow: 6px 6px 0px var(--border);
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--border);
    background: var(--surface);
}

.card-header h3 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    font-size: 0.95rem;
    line-height: 1.5;
}

.card-content p {
    margin: 0;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px dashed var(--border-soft);
    background: var(--bg);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.card-link {
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--accent);
    border-bottom: 2px solid transparent;
    transition: 0.2s;
}

.card-link:hover {
    border-bottom-color: var(--accent);
}

.card-link:active {
    outline: 2px dashed var(--accent) !important;
    outline-offset: 4px;
}



/* ==========================================================================
   EASTER EGG - STREET FIGHTER (HADOUKEN)
   ========================================================================== */

/* Completely isolate the Easter egg to prevent it from affecting the rest of the page */
#easter-egg-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    /* Empêche de bloquer les clics sur la page */
    z-index: 99999;
    overflow: hidden;
}

/* Character Ken */
#easter-egg-container .ken-character {
    position: absolute;
    bottom: 20px;
    left: 50%;
    width: 70px;
    height: 80px;
    background-image: url('https://raw.githubusercontent.com/jkneb/street-fighter-css/master/images/ken.png');
    background-repeat: no-repeat;
    transform: translateX(-50%);
    will-change: background-position;
}

/* Hadouken mouv */
#easter-egg-container .ken-character.hadoken {
    animation: ken-hadoken-sprite 0.5s steps(4) forwards;
}

/* fireball container for mouv */
#easter-egg-container .fireball-projectile {
    position: absolute;
    bottom: 35px;
    left: 50%;
    width: 70px;
    height: 70px;
    will-change: transform;
    /* Using translate3d to Force GPU Acceleration */
    animation: fireball-trajectory 1.8s linear forwards;
}

/* fireball (sprite) */
#easter-egg-container .fireball-sprite {
    width: 100%;
    height: 100%;
    background-image: url('https://raw.githubusercontent.com/jkneb/street-fighter-css/master/images/ken.png');
    background-repeat: no-repeat;
    will-change: background-position;
    animation: fireball-flip 0.15s steps(2) infinite;
}

/* --- KEYFRAMES --- */

/* Ken's Movements (Hadouken Line)  */
@keyframes ken-hadoken-sprite {
    from {
        background-position: 0px -0px;
    }

    to {
        background-position: -280px -0px;
    }
}

/* Fireball Animation */
@keyframes fireball-flip {
    from {
        background-position: 0px -320px;
    }

    to {
        background-position: -140px -320px;
    }
}

/* The ball's smooth path as it travels across the screen to the right */
@keyframes fireball-trajectory {
    0% {
        transform: translate3d(20px, 0, 0);
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translate3d(60vw, 0, 0);
        opacity: 0;
    }
}