/* Fenêtre « Comment veux-tu jouer ? » : trois bandes en biais comme l'écran de composition et l'intro VS,
   une par mode, avec des héros en pose de combat qui débordent ; le code se tape en bas */
.modes {
    position: absolute; inset: 0; z-index: 9; display: flex; flex-direction: column; justify-content: center; gap: 3cqw;
    padding: calc(6cqw + env(safe-area-inset-top, 0px)) 0 calc(6cqw + env(safe-area-inset-bottom, 0px));
    background: radial-gradient(ellipse at 50% 40%, rgb(60 50 160 / 0.82), rgb(10 8 34 / 0.94));
    backdrop-filter: blur(1.2cqw);
    animation: modes-in 0.3s ease-out both;
}
.modes[hidden] { display: none; }
@keyframes modes-in { from { opacity: 0; } }
.modes-title {
    margin: 0 16cqw 4cqw; text-align: center; font: 8.4cqw/1.05 var(--font-display); color: #fff1b8;
    text-shadow: 0 0.6cqw 0 #8a5a12, 0 0 3cqw rgb(255 220 140 / 0.6);
}
.modes-close {
    position: absolute; top: calc(4cqw + env(safe-area-inset-top, 0px)); right: 4cqw; width: 12cqw; height: 12cqw; border: 0; cursor: pointer;
    background: var(--button-round, url("/themes/fantasy_isle/ui/crystal/button_round.webp")) center / contain no-repeat;
    color: #fff1b8; font: 5.4cqw/1 var(--font-display); text-shadow: 0 0.3cqw 0 #2a1450;
    filter: drop-shadow(0 0.6cqw 1cqw rgb(0 0 0 / 0.45));
}
.modes-list { display: flex; flex-direction: column; --cut: 7cqw; }
.mode {
    position: relative; height: 42cqw; border: 0; padding: 0; background: none; cursor: pointer; text-align: left; color: inherit;
    -webkit-tap-highlight-color: transparent; animation: mode-in 0.5s calc(0.08s + var(--n) * 0.1s) cubic-bezier(.2, 1.2, .4, 1) both;
}
.mode + .mode { margin-top: calc(-1 * var(--cut)); }
.mode::before {
    content: ""; position: absolute; inset: 0;
    clip-path: polygon(0 var(--cut), 100% 0, 100% calc(100% - var(--cut)), 0 100%);
    background:
        repeating-linear-gradient(115deg, rgb(255 255 255 / 0.06) 0 1.2cqw, transparent 1.2cqw 3.6cqw),
        radial-gradient(ellipse at var(--glow-x, 30%) 55%, color-mix(in srgb, var(--tint) 85%, white), color-mix(in srgb, var(--tint) 50%, #0a0820) 72%);
    transition: filter 0.2s;
}
.mode:nth-child(even) { --glow-x: 70%; }
.mode:active::before { filter: brightness(1.15); }
.mode:active .mode-art { scale: 0.96; }
@keyframes mode-in { from { opacity: 0; translate: calc(var(--side) * 60%) 0; } }
.mode:nth-child(odd) { --side: -1; }
.mode:nth-child(even) { --side: 1; }
/* Éclair le long de chaque coupe */
.mode + .mode::after {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--cut); z-index: 1; pointer-events: none;
    background: linear-gradient(to top right, transparent calc(50% - 0.35cqw), #fff calc(50% - 0.12cqw), #9fd4ff 50%, #fff calc(50% + 0.12cqw), transparent calc(50% + 0.35cqw));
    filter: drop-shadow(0 0 0.8cqw #9fd4ff);
}
.mode-art { position: absolute; z-index: 2; inset: -12% auto 4% 2%; width: 50%; pointer-events: none; transition: scale 0.15s; }
.mode:nth-child(even) .mode-art { left: auto; right: 2%; }
.mode-art img { position: absolute; bottom: 0; height: 100%; width: auto; object-fit: contain; filter: drop-shadow(0 0 2cqw rgb(0 0 0 / 0.5)); }
.mode-text { position: absolute; z-index: 3; top: 50%; translate: 0 -50%; right: 5cqw; width: 50%; display: grid; gap: 1.4cqw; text-align: right; justify-items: end; }
.mode:nth-child(even) .mode-text { right: auto; left: 5cqw; text-align: left; justify-items: start; }
.mode-name { font: 7.4cqw/1 var(--font-display); color: #fff8e7; text-shadow: 0 0.5cqw 0 #2a1450, 0 0 2cqw var(--tint); }
.mode-sub { font: 800 3.3cqw/1.25 var(--font-body); color: #fff1b8; text-shadow: 0 0.3cqw 0 rgb(0 0 0 / 0.55); }
.mode-soon {
    padding: 0.8cqw 2.4cqw; border-radius: 99cqw; font: 900 2.8cqw/1 var(--font-body); color: #4a2c06;
    background: linear-gradient(#fff3b0, #f6c94a 50%, #d9921e); box-shadow: 0 0.4cqw 1cqw rgb(0 0 0 / 0.35);
}

/* Illustrations composées avec nos poses */
.art-local .hero-a { left: 0; }
.art-local .hero-b { right: 0; transform: scaleX(-1); height: 86%; }
.art-local .dice { position: absolute; left: 44%; bottom: 8%; width: 13cqw; height: 13cqw; animation: dice-hop 1.6s ease-in-out infinite; }
@keyframes dice-hop { 50% { translate: 0 -2.4cqw; rotate: 18deg; } }
.art-online .orb {
    position: absolute; right: 2%; top: 14%; width: 26cqw; height: 26cqw; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #d9f1ff, #4f86f0 45%, #1d1a6a 75%);
    box-shadow: 0 0 4cqw rgb(120 190 255 / 0.8), inset -2cqw -2cqw 4cqw rgb(0 0 40 / 0.6);
    animation: orb-pulse 2.2s ease-in-out infinite;
}
.art-online .orb::after {
    content: ""; position: absolute; inset: -12%; border-radius: 50%; border: 0.4cqw dashed rgb(200 230 255 / 0.7);
    animation: orb-spin 9s linear infinite;
}
@keyframes orb-pulse { 50% { box-shadow: 0 0 7cqw rgb(120 190 255 / 1), inset -2cqw -2cqw 4cqw rgb(0 0 40 / 0.6); } }
@keyframes orb-spin { to { rotate: 360deg; } }
.art-online .rival { right: 6%; height: 70%; transform: scaleX(-1); filter: brightness(0) drop-shadow(0 0 1.6cqw #9fd4ff) drop-shadow(0 0 0.6cqw #fff); opacity: 0.92; }
.art-online .hero-a { left: 0; }
.art-friends .hero-a { right: 0; transform: scaleX(-1); }
.art-friends .friend {
    position: absolute; width: 14cqw; height: 14cqw; border-radius: 50%; object-fit: cover; background: #1b1840;
    box-shadow: 0 0 0 0.6cqw #e8b84a, 0 0 2.4cqw rgb(255 210 120 / 0.8);
    animation: friend-pop 2.4s ease-in-out infinite;
}
.art-friends .friend.one { left: 2%; top: 10%; }
.art-friends .friend.two { left: 14%; top: 52%; animation-delay: 0.8s; }
.art-friends .friend.three { left: 30%; top: 4%; animation-delay: 1.6s; }
@keyframes friend-pop { 0%, 100% { scale: 1; } 50% { scale: 1.1; } }
.art-friends .link {
    position: absolute; left: 10%; top: 26%; width: 46%; height: 40%; pointer-events: none;
    border-top: 0.5cqw dashed rgb(255 241 184 / 0.9); border-left: 0.5cqw dashed rgb(255 241 184 / 0.9); border-radius: 60% 0 0 0;
    filter: drop-shadow(0 0 1cqw #ffd27a); animation: link-flow 1.4s linear infinite;
}
@keyframes link-flow { 50% { opacity: 0.5; } }

/* « J'ai un code » */
.modes-code { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2cqw; margin: 3cqw 5cqw 0; align-items: center; }
.modes-code input {
    box-sizing: border-box; width: 100%; min-width: 0; padding: 2.6cqw; border-radius: 3cqw; border: 0.5cqw solid #e8b84a;
    background: rgb(10 14 60 / 0.6); color: #fff8e7; font: 5cqw/1 var(--font-display); letter-spacing: 0.2em; text-align: center; text-transform: uppercase;
}
.modes-code input::placeholder { letter-spacing: 0.05em; font-size: 4cqw; color: rgb(255 241 184 / 0.6); }
.modes-code .big-button { padding-inline: 6cqw; white-space: nowrap; }
.modes-toast { margin: 0 5cqw; min-height: 4cqw; text-align: center; font: 800 3.2cqw/1.3 var(--font-body); color: #fff1b8; }
@media (prefers-reduced-motion: reduce) { .modes, .mode, .art-local .dice, .art-online .orb, .art-online .orb::after, .art-friends .friend, .art-friends .link { animation: none; } }
