:root {
  color-scheme: dark;
  --ink: #fffdf8;
  --muted: #d9d5cd;
  --panel: rgb(10 15 29 / .88);
  --line: rgb(255 255 255 / .18);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body { overflow-x: hidden; background: #15172a; color: var(--ink); }
body.console-active { overflow: hidden; }
button, input { font: inherit; }

.room {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: #251c1b url("/salon-reference.webp") center / cover no-repeat;
  transition: filter .35s ease, transform .35s ease;
}
body:not(.console-active) .room {
  filter: blur(8px) brightness(.42) saturate(.85);
  transform: scale(1.035);
}
.room > * { display: none; }

.topbar {
  position: relative;
  z-index: 5;
  height: clamp(76px, 7.8vh, 118px);
  padding: 0 clamp(22px, 3.6vw, 110px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgb(9 13 25 / .48);
  backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: #fff;
  text-decoration: none;
  font-size: clamp(27px, 3vw, 42px);
  font-weight: 850;
  letter-spacing: -.045em;
  transition: opacity .2s ease;
}
.brand i { color: #ffd149; font-style: normal; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  filter: drop-shadow(0 5px 4px rgb(0 0 0 / .28));
}
.brand-mark svg { width: 100%; height: 100%; }
.mark-green { fill: #27bd65; }
.mark-blue { fill: #2f80e8; }
.mark-red { fill: #ea4c48; }
.mark-yellow { fill: #f6d23d; }
.mark-cyan { fill: #37aee9; }
.profile { display: flex; align-items: center; gap: 10px; font-weight: 750; }
.profile-dot { width: 12px; aspect-ratio: 1; border-radius: 50%; background: #53da84; box-shadow: 0 0 18px #53da84; }
.profile button { border: 0; background: transparent; color: #e4e6ed; text-decoration: underline; cursor: pointer; }

main { min-height: calc(100vh - clamp(76px, 7.8vh, 118px)); display: grid; place-items: center; padding: clamp(24px, 5vw, 72px); }
.auth {
  width: min(430px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(24px);
  box-shadow: 0 28px 85px rgb(0 0 0 / .5);
}
.eyebrow { margin: 0 0 8px; color: #ffd45e; text-transform: uppercase; letter-spacing: .2em; font-size: 12px; font-weight: 850; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 66px); line-height: .98; letter-spacing: -.055em; }
.auth h1 { font-size: 46px; }
.intro, .welcome > p:last-child { color: var(--muted); font-size: 17px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 24px 0 20px; padding: 4px; border-radius: 12px; background: rgb(0 0 0 / .27); }
.tabs button { padding: 10px; border: 0; border-radius: 9px; color: #bfc5d1; background: transparent; cursor: pointer; }
.tabs button[aria-selected="true"] { color: #fff; background: #34425f; }
label { display: block; margin: 13px 0 6px; color: #d7dae3; font-size: 13px; font-weight: 700; }
input { width: 100%; padding: 12px 13px; border: 1px solid #52617a; border-radius: 10px; background: #0c1321; color: #fff; outline: none; }
input:focus { border-color: #ffd45e; box-shadow: 0 0 0 3px rgb(255 212 94 / .16); }
.main-button { width: 100%; margin-top: 22px; padding: 13px; border: 0; border-radius: 10px; background: linear-gradient(135deg, #ffd65f, #f0ae32); color: #281a05; font-weight: 850; cursor: pointer; }
.main-button:disabled { opacity: .55; cursor: wait; }
.error { min-height: 20px; margin: 10px 0 0; color: #ff8b83; font-size: 13px; }
.legacy { margin: 4px 0 0; color: #aeb5c3; font-size: 12px; line-height: 1.4; }

/* La scène conserve exactement le cadrage 3:2 de la planche choisie. */
body.console-active .topbar { position: fixed; inset: 0 0 auto; border-bottom: 1px solid rgb(255 255 255 / .2); background: rgb(8 12 25 / .68); backdrop-filter: blur(18px); }
body.console-active .brand { opacity: 1; pointer-events: auto; }
body.console-active .profile { margin-left: auto; padding: 9px 13px; border-radius: 999px; background: rgb(6 11 23 / .58); backdrop-filter: blur(12px); }
body.console-active main { min-height: 100vh; padding: 0; }
.console {
  position: fixed;
  left: 50%;
  top: 50%;
  width: max(100vw, 150vh);
  height: max(66.6667vw, 100vh);
  transform: translate(-50%, -50%);
}
.console .welcome {
  position: absolute;
  z-index: 2;
  left: 8.5%;
  top: 14%;
  width: min(43%, 660px);
  padding: 24px 28px 25px;
  border: 1px solid rgb(255 255 255 / .2);
  border-radius: 24px;
  background: rgb(11 14 24 / .8);
  backdrop-filter: blur(22px);
  box-shadow: 0 20px 55px rgb(0 0 0 / .3), inset 0 1px rgb(255 255 255 / .08);
  text-shadow: 0 4px 25px rgb(0 0 0 / .75);
}
.console .welcome .eyebrow, .mobile-title, .mobile-subtitle { display: none; }
.console .welcome h1 { font-size: clamp(40px, 3.55vw, 68px); white-space: nowrap; }
.console .welcome p { margin: 13px 0 0; color: #dedbe0; font-size: clamp(17px, 1.25vw, 25px); }
.welcome-accent { display: block; width: clamp(52px, 3.3vw, 82px); height: 6px; margin-top: 18px; border-radius: 99px; background: #ffd447; box-shadow: 0 0 18px rgb(255 212 71 / .4); }
.launch-note { position: absolute; clip: rect(0 0 0 0); width: 1px; height: 1px; overflow: hidden; }
.cartridges { position: absolute; inset: 0; }
.cartridge {
  position: absolute;
  top: 31.5%;
  height: 42.5%;
  color: #fff;
  text-decoration: none;
  border-radius: 12% 12% 9% 9%;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
  isolation: isolate;
}
.cartridge.zelda { left: 14.8%; width: 23.4%; }
.cartridge.smash { left: 38.2%; width: 23.8%; }
.cartridge.kart { left: 62.2%; width: 23.2%; }
.cartridge:hover, .cartridge:focus-visible {
  transform: translateY(-.6%);
  outline: 3px solid rgb(255 255 255 / .92);
  outline-offset: 5px;
  background: linear-gradient(180deg, rgb(255 255 255 / .08), rgb(255 214 80 / .08));
  box-shadow: 0 10px 35px rgb(0 0 0 / .25), 0 0 38px rgb(255 220 128 / .5), inset 0 0 28px rgb(255 255 255 / .08);
}
.cartridge-shell { width: 100%; height: 100%; opacity: 0; }
.game-icon svg { width: 100%; height: 100%; fill: currentColor; }
.game-icon .cut { fill: #fff; }

[hidden] { display: none !important; }

.launch-loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(rgb(7 10 18 / .6), rgb(7 10 18 / .82)), url("/salon-reference.webp") center / cover no-repeat;
  backdrop-filter: blur(4px);
  animation: launch-in .28s ease-out both;
}
.launch-loading-card {
  width: min(520px, 100%);
  padding: 18px 22px 25px;
  border: 1px solid rgb(255 255 255 / .24);
  border-radius: 28px;
  background: rgb(10 14 26 / .88);
  box-shadow: 0 30px 90px rgb(0 0 0 / .55), inset 0 1px rgb(255 255 255 / .09);
  text-align: center;
}
.launch-loading-art {
  height: 230px;
  margin: -4px -8px 22px;
  border: 5px solid rgb(226 222 216 / .8);
  border-radius: 24px 24px 16px 16px;
  background-image: linear-gradient(180deg, transparent 50%, rgb(5 10 20 / .7)), url("/salon-reference.webp");
  background-size: 100% 100%, 520% auto;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 32px rgb(0 0 0 / .25);
}
.launch-loading[data-game="zelda"] .launch-loading-art { background-position: center, 19% 33%; }
.launch-loading[data-game="smash"] .launch-loading-art { background-position: center, 50% 33%; }
.launch-loading[data-game="kart"] .launch-loading-art { background-position: center, 80% 33%; }
.launch-loading h2 { margin: 0; font-size: clamp(30px, 5vw, 46px); letter-spacing: -.045em; }
.launch-loading p:not(.eyebrow) { margin: 9px 0 20px; color: #d7d4cd; }
.launch-loading-track { height: 8px; overflow: hidden; border-radius: 99px; background: rgb(255 255 255 / .12); }
.launch-loading-track span { display: block; width: 38%; height: 100%; border-radius: inherit; background: #ffd447; animation: launch-progress 1.15s ease-in-out infinite; }
.launch-loading[data-game="zelda"] .launch-loading-track span { background: #2d9ee8; }
.launch-loading[data-game="smash"] .launch-loading-track span { background: #f04a3e; }
.launch-loading[data-game="kart"] .launch-loading-track span { background: #35c66d; }
@keyframes launch-in { from { opacity: 0; } }
@keyframes launch-progress { from { transform: translateX(-110%); } to { transform: translateX(365%); } }

@media (max-width: 900px) {
  body.console-active { overflow: auto; }
  .room { background-position: 51% top; }
  body.console-active .room { filter: blur(5px) brightness(.18) saturate(.8); transform: scale(1.04); }
  .topbar { height: 72px; padding-inline: 18px; }
  body.console-active .topbar { position: relative; background: rgb(8 12 23 / .72); backdrop-filter: blur(16px); }
  body.console-active .brand { opacity: 1; pointer-events: auto; }
  body.console-active .profile { padding: 0; background: transparent; backdrop-filter: none; }
  .profile button { display: none; }
  #profile-name { display: none; }
  main, body.console-active main { min-height: calc(100vh - 72px); padding: 34px 16px 48px; align-items: start; }
  .auth { margin-top: 10px; padding: 26px 22px; }
  .auth h1 { font-size: 40px; }
  .console { position: relative; left: auto; top: auto; width: min(520px, 100%); height: auto; transform: none; }
  .console .welcome { position: static; clip: auto; width: auto; height: auto; overflow: visible; margin: 0 0 28px; text-shadow: 0 3px 22px #000; }
  .console .welcome .eyebrow, .mobile-title, .mobile-subtitle { display: block; }
  .desktop-title, .desktop-subtitle, .welcome-accent { display: none; }
  .console .welcome h1 { font-size: clamp(42px, 13vw, 62px); }
  .cartridges { position: static; display: grid; grid-template-columns: 1fr; gap: 24px; }
  .cartridge, .cartridge.zelda, .cartridge.smash, .cartridge.kart { position: relative; inset: auto; width: 100%; height: auto; border-radius: 25px; }
  .cartridge::before { display: none; }
  .cartridge:hover, .cartridge:focus-visible { transform: translateY(-5px); outline-offset: 3px; }
  .cartridge-shell { position: relative; width: 100%; height: auto; padding: 14px 14px 17px; opacity: 1; border-radius: 31px 31px 20px 20px; background: linear-gradient(145deg, #e3ded6, #999aa1 48%, #686b74); box-shadow: inset 0 2px 1px #fff, inset 0 -8px 16px rgb(39 42 50 / .55), 0 20px 35px rgb(0 0 0 / .42); }
  .cartridge-notch { display: block; width: 34%; height: 11px; margin: -15px auto 8px; border-radius: 0 0 12px 12px; background: #85878d; }
  .label { min-height: 225px; padding: 18px; display: flex; flex-direction: column; justify-content: flex-end; border: 4px solid rgb(255 255 255 / .45); border-radius: 18px; background-image: linear-gradient(180deg, transparent 35%, rgb(5 10 20 / .2) 62%, rgb(5 10 20 / .9) 100%), url("/salon-reference.webp"); background-size: 100% 100%, 520% auto; background-repeat: no-repeat; box-shadow: inset 0 0 30px rgb(0 0 0 / .25); }
  .zelda .label { background-position: center, 19% 33%; }
  .smash .label { background-position: center, 50% 33%; }
  .kart .label { background-position: center, 80% 33%; }
  .game-icon, .label strong, .label small { display: none; }
  .play { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid rgb(255 255 255 / .45); font-size: 18px; font-weight: 850; text-shadow: 0 2px 6px #000; }
  .play b { font-size: 30px; }
  .launch-note { position: static; clip: auto; width: auto; height: auto; overflow: visible; margin: 28px 10px 0; color: #e9e3d9; text-align: center; line-height: 1.45; text-shadow: 0 2px 10px #000; }
  .launch-loading { padding: 16px; }
  .launch-loading-card { padding: 14px 15px 22px; }
  .launch-loading-art { height: 210px; margin-inline: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .launch-loading { animation: none; }
  .launch-loading-track span { animation-duration: 2.4s; }
}
