/* Les couleurs du film d'ouverture : ciel de l'aube, soleil, mer de Link's Awakening DX */
:root {
    --sky1: #1b3f8f;
    --sky2: #3f7fd8;
    --sky3: #8fc8f5;
    --sun: #ffd23f;
    --sun2: #f7a531;
    --sea1: #2b5fc0;
    --sea2: #183f8a;
    --sea3: #0d2459;
    --foam: #e8f4ff;
    --sand: #f6dfa4;
    --sand2: #e8c27a;
    --wood: #a5662e;
    --ink: #1d1a2b;
    --text: #fdfaf2;
    --muted: #c7d6f2;
    --heart: #e8283c;
    --dream: #9db7e8;
    --box: #0b0b14;
    --pix: "Pixelify Sans", "Courier New", monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--sea3);
}

body {
    margin: 0;
    color: var(--text);
    font: 17px/1.6 Nunito, system-ui, sans-serif;
    overflow-x: hidden;
    background: linear-gradient(180deg, var(--sea1) 0, var(--sea2) 900px, var(--sea3) 100%);
}

.sky {
    background: linear-gradient(180deg, var(--sky1) 0, var(--sky2) 45%, var(--sky3) 82%, #ffe7a8 100%);
}

main {
    position: relative;
    z-index: 0;
    border-top: 4px solid var(--foam);
}

/* vagues de la mer, comme les tirets blancs du jeu */
main::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .22;
    background-image:
        linear-gradient(90deg, transparent 0 14px, rgba(232, 244, 255, .7) 14px 30px, transparent 30px 64px),
        linear-gradient(90deg, transparent 0 44px, rgba(232, 244, 255, .45) 44px 56px, transparent 56px 64px);
    background-size: 64px 2px, 64px 2px;
    background-position: 0 0, 22px 18px;
    background-repeat: repeat;
    -webkit-mask-image: repeating-linear-gradient(180deg, #000 0 2px, transparent 2px 36px);
    mask-image: repeating-linear-gradient(180deg, #000 0 2px, transparent 2px 36px);
    animation: waves 6s linear infinite;
}

@keyframes waves {
    to {
        background-position: 64px 0, 86px 18px;
    }
}

a {
    color: #ffe08a;
}

img.px {
    image-rendering: pixelated;
}

.wrap {
    width: min(1000px, 100% - 32px);
    margin: 0 auto;
}

nav .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
}

nav .brand {
    font: 700 18px var(--pix);
    color: var(--text);
    text-decoration: none;
    text-shadow: 2px 2px 0 var(--sky1);
}

nav .right {
    display: flex;
    gap: 8px;
}

#lang,
.gh {
    font: 600 15px var(--pix);
    color: var(--ink);
    background: var(--sand);
    border: 3px solid var(--ink);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 3px 0 var(--ink);
}

#lang:hover,
.gh:hover {
    background: #fff3c8;
}

/* ── En-tête : le ciel, le soleil, les nuages et la mouette ── */
header {
    position: relative;
    padding: 30px 0 150px;
    text-align: center;
    overflow: hidden;
}

.sun {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 220px;
    height: 110px;
    transform: translateX(-50%);
    border-radius: 110px 110px 0 0;
    background: repeating-linear-gradient(180deg, var(--sun) 0 12px, var(--sun2) 12px 14px);
    box-shadow: 0 0 60px rgba(255, 210, 63, .55);
    opacity: .95;
}

.cloud {
    position: absolute;
    width: 120px;
    height: 34px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 6px 0 #cfe3ff;
    opacity: .92;
    animation: drift 40s linear infinite;
}

.cloud::before,
.cloud::after {
    content: "";
    position: absolute;
    background: #fff;
    border-radius: 50%;
}

.cloud::before {
    width: 50px;
    height: 50px;
    left: 18px;
    top: -26px;
}

.cloud::after {
    width: 38px;
    height: 38px;
    left: 58px;
    top: -18px;
}

.c1 {
    top: 70px;
    left: 6%;
}

.c2 {
    top: 150px;
    right: 8%;
    scale: .7;
    animation-duration: 55s;
}

.c3 {
    top: 30px;
    right: 30%;
    scale: .5;
    animation-duration: 70s;
}

header .wrap {
    position: relative;
    z-index: 1;
}

@media (max-width: 640px) {
    .cloud {
        opacity: .5;
    }

    .c1 {
        top: 24px;
        left: -30px;
        scale: .6;
    }

    .c2 {
        top: 300px;
        right: -20px;
        scale: .5;
    }

    .c3 {
        display: none;
    }
}

@keyframes drift {
    50% {
        translate: 40px 0;
    }
}

.kicker {
    font: 600 15px var(--pix);
    letter-spacing: .25em;
    text-transform: uppercase;
    color: #ffe08a;
    text-shadow: 2px 2px 0 var(--sky1);
}

h1 {
    margin: 6px 0 0;
    font: 700 clamp(44px, 9vw, 96px)/.95 var(--pix);
    color: #fff;
    letter-spacing: .02em;
    text-shadow: 4px 4px 0 var(--sky1), 0 0 30px rgba(255, 255, 255, .35);
}

h1 em {
    display: block;
    font-style: normal;
    font-size: .38em;
    color: #ffe08a;
    margin-top: 10px;
    letter-spacing: .06em;
}

.ballad {
    font: italic 600 18px Nunito, serif;
    color: #fff;
    opacity: .9;
    margin-top: 10px;
}

.gull {
    position: absolute;
    top: 120px;
    left: -80px;
    width: 64px;
    image-rendering: pixelated;
    animation: fly 18s linear infinite;
    z-index: 2;
}

.gull svg {
    width: 100%;
    height: auto;
    display: block;
}

.gull .wing {
    transform-origin: 50% 70%;
    animation: flap .5s steps(2) infinite;
}

@keyframes fly {
    0% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(55vw, 40px);
    }

    100% {
        transform: translate(115vw, -20px);
    }
}

@keyframes flap {
    50% {
        transform: scaleY(-1);
    }
}

.hearts {
    margin-top: 18px;
    font-size: 26px;
    letter-spacing: 6px;
    color: var(--heart);
    text-shadow: 2px 2px 0 var(--ink);
}

.hearts span {
    display: inline-block;
    animation: beat 1.6s ease-in-out infinite;
}

.hearts span:nth-child(2) {
    animation-delay: .2s;
}

.hearts span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes beat {

    0%,
    70%,
    100% {
        transform: scale(1);
    }

    35% {
        transform: scale(1.25);
    }
}

/* ── La boîte de dialogue du jeu ── */
.say {
    position: relative;
    max-width: 640px;
    margin: 22px auto 0;
    padding: 16px 22px 20px;
    background: var(--box);
    color: #fff;
    border-radius: 10px;
    border: 4px solid #2b2b40;
    box-shadow: 0 0 0 3px var(--box), 0 10px 0 rgba(0, 0, 0, .25);
    font: 500 clamp(17px, 2.6vw, 22px)/1.5 var(--pix);
    text-align: left;
}

.say b {
    color: var(--heart);
    font-weight: 600;
}

.say::after {
    content: "▼";
    position: absolute;
    right: 14px;
    bottom: 6px;
    color: var(--heart);
    font-size: 14px;
    animation: blink 1s steps(1) infinite;
}

.say.done::after {
    display: block;
}

.say:not(.done)::after {
    display: none;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

.who {
    display: inline-block;
    margin-bottom: 6px;
    padding: 0 8px;
    border-radius: 4px;
    background: var(--heart);
    color: #fff;
    font-size: .75em;
}

/* ── Sections ── */
section {
    padding: 48px 0;
}

h2 {
    margin: 0 0 6px;
    font: 700 clamp(28px, 4.6vw, 42px)/1.05 var(--pix);
    color: #fff;
    text-shadow: 3px 3px 0 var(--sea3);
}

h2 small {
    display: block;
    font: 600 14px var(--pix);
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #ffe08a;
    text-shadow: none;
    margin-bottom: 4px;
}

.intro {
    max-width: 70ch;
    color: var(--muted);
    margin: 6px 0 22px;
}

.card {
    background: var(--sand);
    color: var(--ink);
    border: 4px solid var(--ink);
    border-radius: 12px;
    box-shadow: 0 6px 0 var(--ink);
    padding: 18px;
}

.card a {
    color: #8a3b0c;
}

.two {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    gap: 26px;
    align-items: center;
}

@media (max-width: 820px) {
    .two {
        grid-template-columns: 1fr;
    }
}

/* écran Game Boy Color */
.gbc {
    margin: 0;
    background: #2b2b40;
    padding: 12px 12px 10px;
    border-radius: 12px 12px 34px 12px;
    box-shadow: 0 6px 0 var(--ink);
}

.gbc .screen {
    position: relative;
    border: 4px solid #111;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
    aspect-ratio: 10 / 9;
}

.gbc img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    transition: opacity .35s;
}

.gbc figcaption {
    margin-top: 8px;
    font: 500 15px var(--pix);
    color: #cfd6f0;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.gbc .led {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--heart);
    box-shadow: 0 0 8px var(--heart);
    flex: none;
}

.dots {
    display: flex;
    gap: 6px;
}

.dots button {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    border: 2px solid #cfd6f0;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.dots button.on {
    background: #ffe08a;
    border-color: #ffe08a;
}

.shots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.shots figure {
    margin: 0;
}

.shots+.shots-title {
    margin-top: 34px;
}

.shots-title {
    margin: 22px 0 12px;
    font: 700 20px var(--pix);
    color: #ffe08a;
    text-shadow: 2px 2px 0 var(--sea3);
}

.shots img {
    width: 100%;
    display: block;
    border: 3px solid var(--ink);
    border-radius: 6px;
    image-rendering: pixelated;
    cursor: zoom-in;
    box-shadow: 0 4px 0 var(--ink);
}

.shots figcaption {
    margin-top: 8px;
    font: italic 600 15px/1.35 Nunito, serif;
    color: var(--muted);
}

@media (max-width: 640px) {
    .shots {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* bouton « Jouer à la démo » */
.play {
    display: inline-block;
    font: 700 clamp(18px, 2.8vw, 22px) var(--pix);
    color: var(--ink);
    background: #ffe08a;
    border: 4px solid var(--ink);
    border-radius: 10px;
    padding: 8px 20px;
    text-decoration: none;
    box-shadow: 0 5px 0 var(--ink);
}

.play:hover {
    background: #fff3c8;
}

.play:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 var(--ink);
}

.play small {
    display: block;
    font: 600 13px var(--pix);
    letter-spacing: .08em;
    opacity: .75;
}

header .play {
    margin-top: 22px;
}

.gbc.hero {
    width: min(400px, 100%);
    margin: 22px auto 0;
}

.gbc.hero figcaption {
    justify-content: center;
}

.shot {
    display: block;
    width: min(320px, 100%);
    margin-top: 16px;
    border: 3px solid var(--ink);
    border-radius: 6px;
    image-rendering: pixelated;
    box-shadow: 0 4px 0 var(--ink);
    cursor: zoom-in;
}

/* les promesses du jeu : pastilles dans l'en-tête, cartes « Ce qui vous attend » */
.tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 16px auto 0;
    padding: 0;
    list-style: none;
    max-width: 640px;
}

.tags li {
    font: 600 15px var(--pix);
    color: var(--ink);
    background: #ffe08a;
    border: 3px solid var(--ink);
    border-radius: 999px;
    padding: 2px 12px;
    box-shadow: 0 3px 0 var(--ink);
}

.feats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

@media (max-width: 860px) {
    .feats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .feats {
        grid-template-columns: 1fr;
    }
}

.feat {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 4px 14px;
    align-content: start;
}

.feat .ico {
    grid-row: span 2;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    font: 700 26px/1 var(--pix);
    color: #fff;
    background: var(--sea1);
    border: 3px solid var(--ink);
    border-radius: 10px;
    box-shadow: 0 3px 0 var(--ink);
}

.feat:nth-child(2) .ico {
    background: var(--heart);
}

.feat:nth-child(3) .ico {
    background: var(--sun2);
}

.feat:nth-child(4) .ico {
    background: #6a4fb3;
}

.feat:nth-child(5) .ico {
    background: #2f9d5a;
}

.feat:nth-child(6) .ico {
    background: var(--wood);
}

.feat h3 {
    margin: 0;
    font: 700 20px/1.2 var(--pix);
}

.feat p {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.5;
}

.news {
    margin: 4px 0 0;
    padding-left: 20px;
}

.news li {
    margin: 5px 0;
}

.keys {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
}

.keys li {
    display: grid;
    grid-template-columns: 8.5em 1fr;
    gap: 8px;
    align-items: baseline;
}

.keys b {
    font: 600 15px var(--pix);
}

.keys small {
    opacity: .7;
}

.steps {
    margin: 4px 0 0;
    padding-left: 22px;
}

.steps li {
    margin: 6px 0;
}

.map img {
    display: block;
    width: 100%;
    border: 4px solid var(--ink);
    border-radius: 12px;
    box-shadow: 0 6px 0 var(--ink);
    cursor: zoom-in;
}

/* repliables : détails du patch, coulisses techniques */
details>summary {
    cursor: pointer;
    list-style: none;
    font: 600 16px var(--pix);
}

details>summary::-webkit-details-marker {
    display: none;
}

details>summary::before {
    content: "▶";
    display: inline-block;
    margin-right: 8px;
    font-size: .8em;
    transition: transform .2s;
}

details[open]>summary::before {
    transform: rotate(90deg);
}

.card details {
    margin-top: 14px;
    border-top: 2px dashed rgba(29, 26, 43, .25);
    padding-top: 10px;
}

.tech {
    background: rgba(11, 11, 20, .35);
    border: 3px solid rgba(232, 244, 255, .25);
    border-radius: 12px;
    padding: 14px 18px;
}

.tech>summary {
    color: #ffe08a;
    font-size: 18px;
}

.tech[open]>summary {
    margin-bottom: 14px;
}

.tech p {
    color: var(--muted);
    max-width: 70ch;
}

/* journal : cœurs pleins (fait) et vides (à faire) */
.quest {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.quest li {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 10px;
    align-items: start;
    padding: 8px 10px;
    background: rgba(255, 255, 255, .55);
    border: 2px solid rgba(29, 26, 43, .25);
    border-radius: 8px;
}

.quest li::before {
    content: "♥";
    font: 700 22px/1 var(--pix);
    color: var(--heart);
    text-shadow: 1px 1px 0 var(--ink);
}

.quest li.todo::before {
    content: "♡";
    color: #9b8b6a;
    text-shadow: none;
}

.quest li.todo {
    opacity: .8;
}

.tally {
    font: 600 16px var(--pix);
    margin: 0 0 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

td {
    padding: 8px 10px;
    border-bottom: 2px dashed rgba(29, 26, 43, .25);
    vertical-align: top;
}

td:first-child {
    font-weight: 800;
    white-space: nowrap;
}

code {
    font: 14px ui-monospace, Consolas, monospace;
    background: rgba(29, 26, 43, .1);
    padding: 0 4px;
    border-radius: 3px;
}

pre {
    margin: 10px 0 0;
    padding: 12px 14px;
    background: var(--box);
    color: #c9f5c4;
    border-radius: 8px;
    overflow-x: auto;
    font: 14px/1.5 ui-monospace, Consolas, monospace;
}

.tblwrap {
    overflow-x: auto;
}

footer {
    padding: 30px 0 50px;
    color: var(--muted);
    font-size: 14px;
}

footer p {
    margin: 4px 0;
}

dialog {
    padding: 0;
    border: 4px solid var(--ink);
    border-radius: 10px;
    background: #000;
    max-width: min(96vw, 900px);
}

dialog::backdrop {
    background: rgba(5, 10, 30, .85);
}

dialog img {
    display: block;
    max-width: 100%;
    max-height: 86vh;
    image-rendering: pixelated;
}

/* la musique de l'écran titre : bouton flottant, barres qui dansent pendant la lecture */
.music {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    font: 600 15px var(--pix);
    color: var(--ink);
    background: var(--sand);
    border: 3px solid var(--ink);
    border-radius: 999px;
    padding: 6px 14px 6px 10px;
    box-shadow: 0 4px 0 var(--ink);
    cursor: pointer;
}

.music:hover {
    background: #fff3c8;
}

.music:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--ink);
}

.music .bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}

.music .bars i {
    width: 3px;
    height: 4px;
    background: var(--heart);
    border-radius: 1px;
}

.music.on .bars i {
    animation: eq .9s ease-in-out infinite;
}

.music.on .bars i:nth-child(2) {
    animation-delay: .15s;
}

.music.on .bars i:nth-child(3) {
    animation-delay: .3s;
}

.music.on .bars i:nth-child(4) {
    animation-delay: .45s;
}

@keyframes eq {

    0%,
    100% {
        height: 4px;
    }

    50% {
        height: 16px;
    }
}

.music[hidden] {
    display: none;
}

/* l'écran « PRESS START » : un clic, la musique démarre et la page apparaît */
body.gated {
    overflow: hidden;
}

#gate {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 16px;
    cursor: pointer;
    background: linear-gradient(180deg, #0d1b4a 0, #22408f 38%, #f2a07b 62%, #ffd23f 66%, var(--sea1) 66.5%, var(--sea3) 100%);
    transition: opacity .6s ease, visibility .6s;
}

#gate.gone {
    opacity: 0;
    visibility: hidden;
}

#gate[hidden] {
    display: none;
}

.gate-in {
    display: grid;
    justify-items: center;
    gap: 18px;
    width: min(440px, 100%);
    text-align: center;
}

.gate-in .gbc {
    width: 100%;
}

.press {
    font: 700 clamp(24px, 6vw, 34px) var(--pix);
    letter-spacing: .12em;
    color: #fff;
    background: none;
    border: 0;
    padding: 4px 10px;
    cursor: pointer;
    text-shadow: 3px 3px 0 var(--sky1), 0 0 18px rgba(255, 224, 138, .7);
    animation: blink 1.1s steps(1) infinite;
}

.press::before {
    content: "♥ ";
    color: var(--heart);
}

.press:focus-visible {
    outline: 3px dashed #ffe08a;
    outline-offset: 6px;
}

.gate-hint {
    margin: -8px 0 0;
    font: 600 15px var(--pix);
    color: #fff;
    opacity: .85;
    text-shadow: 2px 2px 0 var(--sky1);
}

.silent {
    font: 600 14px var(--pix);
    color: #fff;
    background: rgba(11, 11, 20, .35);
    border: 2px solid rgba(255, 255, 255, .5);
    border-radius: 999px;
    padding: 4px 14px;
    cursor: pointer;
}

.silent:hover {
    background: rgba(11, 11, 20, .55);
}

@media (prefers-reduced-motion: reduce) {

    main::before,
    .cloud,
    .gull,
    .gull .wing,
    .hearts span,
    .say::after,
    .music.on .bars i,
    .press {
        animation: none;
    }

    #gate {
        transition: none;
    }

    .gull {
        display: none;
    }
}