:root {
  --bg: #0d0618;
  --panel: rgba(255, 255, 255, .055);
  --panel-b: rgba(255, 255, 255, .1);
  --txt: #f6efff;
  --mut: #b5a6cc;
  --pink: #ff4fa3;
  --violet: #a66bff;
  --cyan: #4fd8ff;
  --ok: #4ff2a0;
  --bad: #ff5c7a;
  --r: 18px;
  --head: 'Unbounded', system-ui, sans-serif;
  --body: 'Outfit', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--txt); font-family: var(--body); font-size: 16px;
  overflow-x: hidden; -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
img { display: block; }

.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.bg i { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .45; animation: float 18s ease-in-out infinite alternate; }
.bg i:nth-child(1) { width: 520px; height: 520px; background: #ff2f92; top: -160px; left: -120px; }
.bg i:nth-child(2) { width: 600px; height: 600px; background: #6a2bff; bottom: -220px; right: -160px; animation-delay: -6s; }
.bg i:nth-child(3) { width: 360px; height: 360px; background: #1fb6ff; top: 40%; left: 55%; opacity: .25; animation-delay: -12s; }
@keyframes float { to { transform: translate(60px, 40px) scale(1.12); } }

/* barre du haut */
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); background: rgba(13, 6, 24, .55); border-bottom: 1px solid var(--panel-b); }
.logo { font-family: var(--head); font-weight: 900; font-size: 20px; letter-spacing: .02em; color: var(--txt); text-decoration: none; }
.logo span { background: linear-gradient(90deg, var(--pink), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; margin-left: 4px; }
.top-right { display: flex; gap: 14px; align-items: center; }
.vol { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.vol input { width: 90px; accent-color: var(--pink); }
.me-chip { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--panel-b); border-radius: 99px; padding: 5px 14px 5px 6px; cursor: pointer; font-weight: 600; }
.me-chip .av { width: 28px; height: 28px; font-size: 16px; }

main { max-width: 1180px; margin: 0 auto; padding: 28px 20px 120px; }
.screen { display: none; animation: in .35s ease; }
.screen.on { display: block; }
@keyframes in { from { opacity: 0; transform: translateY(10px); } }

/* boutons */
.btn { border: 1px solid var(--panel-b); background: var(--panel); border-radius: 14px; padding: 11px 18px; font-weight: 700; cursor: pointer; transition: transform .12s, background .2s, box-shadow .2s; white-space: nowrap; }
.btn:hover { background: rgba(255, 255, 255, .11); }
.btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(135deg, var(--pink), var(--violet)); border-color: transparent; box-shadow: 0 6px 24px -6px rgba(255, 79, 163, .6); }
.btn.primary:hover { box-shadow: 0 8px 30px -4px rgba(255, 79, 163, .8); }
.btn.ghost { background: transparent; }
.btn.small { padding: 7px 12px; font-size: 14px; border-radius: 10px; }
.btn.big { width: 100%; padding: 15px; font-size: 17px; margin-top: 18px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* accueil */
.hero { text-align: center; margin: 30px 0 40px; }
.hero h1 { font-family: var(--head); font-size: clamp(34px, 6vw, 64px); line-height: 1.05; margin: 0 0 14px; font-weight: 900; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, var(--pink), var(--violet), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--mut); font-size: 18px; margin: 0; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mode { position: relative; background: var(--panel); border: 1px solid var(--panel-b); border-radius: 24px; padding: 26px; display: flex; flex-direction: column; overflow: hidden; transition: transform .2s, border-color .2s; }
.mode:hover { transform: translateY(-4px); border-color: rgba(255, 79, 163, .5); }
.mode::before { content: ''; position: absolute; width: 200px; height: 200px; border-radius: 50%; top: -90px; right: -70px; filter: blur(40px); opacity: .5; }
.m-bt::before { background: var(--pink); }
.m-so::before { background: var(--violet); }
.m-ex::before { background: var(--cyan); }
.mode-ico { font-size: 40px; }
.mode h2 { font-family: var(--head); margin: 12px 0 8px; font-size: 24px; }
.mode p { color: var(--mut); margin: 0 0 22px; flex: 1; line-height: 1.5; }
.join { display: flex; gap: 10px; justify-content: center; align-items: center; margin: 36px auto 0; flex-wrap: wrap; }
.join span { color: var(--mut); }
.join input, .ex-head input, .chat-form input, dialog input {
  background: rgba(0, 0, 0, .3); border: 1px solid var(--panel-b); border-radius: 12px; padding: 11px 14px; outline: none;
}
.join input { width: 110px; text-align: center; font-family: var(--head); letter-spacing: .2em; text-transform: uppercase; }
input:focus { border-color: var(--pink) !important; }
.catalog-status { text-align: center; color: var(--mut); font-size: 13px; margin-top: 28px; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--panel-b); border-radius: var(--r); padding: 18px; }
.panel h3 { margin: 0 0 14px; font-family: var(--head); font-size: 15px; font-weight: 700; letter-spacing: .03em; }
.panel h3 small { color: var(--mut); font-family: var(--body); font-weight: 500; margin-left: 6px; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: rgba(255, 79, 163, .16); color: #ff9ccb; }

/* salon */
.lobby-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.code-line { font-family: var(--head); font-size: 30px; margin: 8px 0 0; }
.code-line b { background: linear-gradient(90deg, var(--pink), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .12em; }
.lobby-actions { display: flex; gap: 10px; }
.lobby-grid { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 18px; align-items: start; }
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.players li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, .18); transition: background .3s; }
.players li.off { opacity: .4; }
.players li.me { outline: 1px solid rgba(255, 79, 163, .45); }
.players .nm { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players .pts { font-family: var(--head); font-size: 14px; }
.players .crown { font-size: 14px; }
.players .chk { font-size: 14px; opacity: 0; transition: opacity .2s; }
.players .chk.on { opacity: 1; }
.players .delta { color: var(--ok); font-weight: 700; font-size: 13px; }
.av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; flex: none; border: 2px solid; background: rgba(0, 0, 0, .3); }
.game-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; background: rgba(0, 0, 0, .25); border-radius: 14px; margin-bottom: 16px; }
.game-switch button { border: 0; background: transparent; padding: 10px; border-radius: 10px; font-weight: 700; cursor: pointer; color: var(--mut); }
.game-switch button.on { background: rgba(255, 255, 255, .1); color: var(--txt); }
.game-switch.locked button { cursor: default; }
.setting { margin: 14px 0; }
.setting .label, dialog .label { font-size: 13px; color: var(--mut); font-weight: 600; margin-bottom: 7px; display: block; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--panel-b); background: rgba(0, 0, 0, .2); border-radius: 10px; padding: 7px 12px; cursor: pointer; font-weight: 600; font-size: 14px; }
.seg button.on { background: rgba(255, 79, 163, .2); border-color: var(--pink); }
.seg.locked button { cursor: default; }
.hint { color: var(--mut); font-size: 13px; text-align: center; margin: 10px 0 0; }
.chat-panel { display: flex; flex-direction: column; height: 460px; }
.chat { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; font-size: 15px; }
.chat .msg b { margin-right: 6px; }
.chat .sys { color: var(--mut); font-style: italic; font-size: 13px; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form input { flex: 1; min-width: 0; }

/* en jeu */
.game-top { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.round { font-family: var(--head); font-weight: 700; font-size: 15px; white-space: nowrap; }
.timer { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.timer i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink)); border-radius: 99px; }
.game-layout { display: grid; grid-template-columns: 1fr 280px; gap: 22px; align-items: start; }
.stage { display: flex; flex-direction: column; align-items: center; }
.disc-wrap { position: relative; width: 230px; height: 230px; margin: 4px 0 22px; }
.disc { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle, #2a1a40 0 22%, #120a1f 23% 100%); box-shadow: 0 0 0 6px rgba(255, 255, 255, .05), 0 20px 60px -10px rgba(166, 107, 255, .55); overflow: hidden; position: relative; }
.disc::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 3px, rgba(255, 255, 255, .03) 3px 4px); }
.disc img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s; }
.disc.show img { opacity: 1; }
.disc .hole { position: absolute; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2; box-shadow: 0 0 0 4px rgba(255, 255, 255, .1); }
.disc.spin { animation: spin 2.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--head); font-size: 90px; font-weight: 900; text-shadow: 0 0 30px var(--pink); pointer-events: none; }
.question { font-family: var(--head); font-size: 20px; margin-bottom: 18px; text-align: center; min-height: 28px; }
.reveal-info { text-align: center; min-height: 0; margin-bottom: 14px; }
.reveal-info b { display: block; font-family: var(--head); font-size: 22px; }
.reveal-info span { color: var(--mut); }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 640px; }
.opt { border: 1px solid var(--panel-b); background: var(--panel); border-radius: 16px; padding: 18px 16px; font-weight: 700; font-size: 17px; cursor: pointer; transition: transform .1s, background .2s, border-color .2s; min-height: 64px; position: relative; }
.opt:hover:not(:disabled) { background: rgba(255, 255, 255, .1); border-color: rgba(255, 79, 163, .5); }
.opt:disabled { cursor: default; }
.opt.mine { border-color: var(--violet); background: rgba(166, 107, 255, .2); }
.opt.right { border-color: var(--ok); background: rgba(79, 242, 160, .18); }
.opt.wrong { border-color: var(--bad); background: rgba(255, 92, 122, .16); }
.opt .who { position: absolute; top: -10px; right: 8px; display: flex; gap: 2px; }
.opt .who .av { width: 24px; height: 24px; font-size: 13px; }

/* save one */
.versus { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: center; }
.card { background: var(--panel); border: 2px solid var(--panel-b); border-radius: 26px; padding: 18px; transition: transform .3s, border-color .3s, opacity .4s, box-shadow .3s; position: relative; }
.card { --pad: 18px; }
.card .cov { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #1b1029; }
.card .cov img { width: 100%; height: 100%; object-fit: cover; }
.card .reel { position: absolute; inset: 0; display: flex; flex-direction: column; animation: reel .14s linear infinite; }
.card .reel img { flex: none; height: 100%; filter: blur(2px) saturate(1.4); }
@keyframes reel { to { transform: translateY(-100%); } }
.card .play { position: absolute; bottom: 12px; right: 12px; width: 54px; height: 54px; border-radius: 50%; border: 0; background: rgba(13, 6, 24, .75); backdrop-filter: blur(6px); font-size: 22px; cursor: pointer; display: grid; place-items: center; }
.card .play.on { background: var(--pink); }
.card h4 { font-family: var(--head); font-size: 20px; margin: 16px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .meta { color: var(--mut); font-size: 15px; }
.card .save { width: 100%; margin-top: 14px; padding: 14px; font-size: 17px; }
.card .pickers { display: flex; gap: 4px; flex-wrap: wrap; min-height: 34px; margin-top: 12px; justify-content: center; }
.card.chosen { border-color: var(--pink); box-shadow: 0 0 50px -10px var(--pink); transform: scale(1.03); }
.card.lost { opacity: .35; transform: scale(.96); }
.card .stamp { position: absolute; top: 34px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-family: var(--head); font-weight: 900; font-size: 30px; padding: 6px 16px; border-radius: 12px; border: 3px solid; z-index: 3; animation: stamp .35s cubic-bezier(.2, 1.6, .4, 1); white-space: nowrap; }
.card .stamp.saved { color: var(--pink); border-color: var(--pink); background: rgba(13, 6, 24, .8); }
.card .stamp.bye { color: var(--mut); border-color: var(--mut); background: rgba(13, 6, 24, .8); }
@keyframes stamp { from { transform: translateX(-50%) rotate(-8deg) scale(2.2); opacity: 0; } }
.card.spinning .info { opacity: .25; }
.clipbox { position: absolute; left: var(--pad); right: var(--pad); top: var(--pad); aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; z-index: 2; pointer-events: none; display: none; background: #000; }
.clipbox.on { display: block; }
.clipbox iframe, .bt-clip iframe { width: 100%; height: 100%; border: 0; display: block; }
.card.playing { border-color: var(--cyan); box-shadow: 0 0 40px -12px var(--cyan); }
.card .stamp { z-index: 4; }
.bt-clip { display: none; width: min(560px, 100%); aspect-ratio: 16 / 9; border-radius: 20px; overflow: hidden; margin-bottom: 18px; box-shadow: 0 20px 60px -10px rgba(166, 107, 255, .55); background: #000; }
.bt-clip.on { display: block; }
.stage.clip-on .disc-wrap { display: none; }
.vs-mid { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.vs { font-family: var(--head); font-weight: 900; font-size: 44px; background: linear-gradient(180deg, var(--pink), var(--violet)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.btn.skip { padding: 13px 22px; }
.keys { color: var(--mut); font-size: 12px; text-align: center; line-height: 1.6; }
.so-status { text-align: center; color: var(--mut); margin-top: 20px; min-height: 24px; }

/* fin */
.end-title { font-family: var(--head); font-size: 36px; text-align: center; margin: 10px 0 28px; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin-bottom: 30px; }
.podium .step { text-align: center; width: 150px; }
.podium .step .av { width: 64px; height: 64px; font-size: 34px; margin: 0 auto 8px; border-width: 3px; }
.podium .block { border-radius: 16px 16px 0 0; background: linear-gradient(180deg, rgba(255, 79, 163, .35), rgba(166, 107, 255, .1)); display: grid; place-items: center; font-family: var(--head); font-size: 34px; font-weight: 900; margin-top: 8px; }
.podium .p1 .block { height: 150px; } .podium .p2 .block { height: 110px; } .podium .p3 .block { height: 80px; }
.podium .nm { font-weight: 700; } .podium .sc { color: var(--mut); font-size: 14px; }
.end-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mini-songs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.mini { background: rgba(0, 0, 0, .2); border-radius: 14px; padding: 8px; cursor: pointer; transition: background .2s; }
.mini:hover { background: rgba(255, 255, 255, .08); }
.mini img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; }
.mini b { display: block; font-size: 14px; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini span { color: var(--mut); font-size: 13px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { display: flex; align-items: center; gap: 6px; border: 1px solid var(--panel-b); background: rgba(0, 0, 0, .2); border-radius: 99px; padding: 5px 14px 5px 5px; cursor: pointer; font-weight: 600; }
.tabs button.on { border-color: var(--pink); background: rgba(255, 79, 163, .15); }
.tabs .av { width: 26px; height: 26px; font-size: 14px; }
.compat { display: flex; flex-direction: column; gap: 10px; }
.compat .row { display: flex; align-items: center; gap: 10px; }
.compat .bar { flex: 1; height: 10px; background: rgba(255, 255, 255, .08); border-radius: 99px; overflow: hidden; }
.compat .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--pink)); }
.compat .pct { font-family: var(--head); font-size: 14px; width: 48px; text-align: right; }
.top-artists { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.top-artists span { background: rgba(166, 107, 255, .18); border-radius: 99px; padding: 5px 12px; font-size: 14px; font-weight: 600; }
.end-actions { display: flex; justify-content: center; gap: 12px; margin-top: 30px; flex-wrap: wrap; align-items: center; }

/* explorer */
.ex-head { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.ex-head h2 { font-family: var(--head); margin: 0 10px 0 0; }
.ex-head input { flex: 1; min-width: 200px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { border: 1px solid var(--panel-b); background: var(--panel); border-radius: 99px; padding: 7px 14px; cursor: pointer; font-weight: 600; font-size: 14px; }
.chips button.on { border-color: var(--pink); background: rgba(255, 79, 163, .18); }
.artists { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin-bottom: 14px; scrollbar-width: thin; }
.artists button { flex: none; border: 1px solid var(--panel-b); background: rgba(0, 0, 0, .25); border-radius: 99px; padding: 6px 13px; font-size: 13px; font-weight: 600; cursor: pointer; }
.artists button.on { background: var(--violet); border-color: var(--violet); }
.songs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.songs .mini.playing { outline: 2px solid var(--pink); }

/* lecteur */
.player-bar { position: fixed; left: 50%; bottom: 16px; transform: translate(-50%, 150%); width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; background: rgba(25, 14, 42, .9); backdrop-filter: blur(16px); border: 1px solid var(--panel-b); transition: transform .35s cubic-bezier(.2, 1.2, .4, 1); z-index: 20; overflow: hidden; }
.player-bar.on { transform: translate(-50%, 0); }
.player-bar img { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; }
.pb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pb-txt b, .pb-txt span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pb-txt span { color: var(--mut); font-size: 14px; }
.pb-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.pb-progress i { display: block; height: 100%; width: 0; background: var(--pink); }

/* profil */
dialog { background: #1a0f2c; color: var(--txt); border: 1px solid var(--panel-b); border-radius: 24px; padding: 26px; width: min(420px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(5, 2, 10, .7); backdrop-filter: blur(4px); }
dialog h3 { font-family: var(--head); margin: 0 0 18px; }
dialog label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--mut); font-weight: 600; margin-bottom: 16px; }
dialog label input { color: var(--txt); font-size: 16px; }
.avatars, .colors { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.avatars button { width: 42px; height: 42px; font-size: 22px; border-radius: 12px; border: 2px solid transparent; background: rgba(0, 0, 0, .25); cursor: pointer; }
.avatars button.on { border-color: var(--pink); }
.colors button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; }
.colors button.on { border-color: #fff; }

.toast { position: fixed; top: 76px; left: 50%; transform: translate(-50%, -20px); background: #2a1640; border: 1px solid var(--pink); padding: 11px 20px; border-radius: 14px; opacity: 0; pointer-events: none; transition: .3s; z-index: 50; font-weight: 600; max-width: calc(100% - 32px); text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.host-only, .guest-only { display: none; }
body.is-host .host-only, body.is-guest .guest-only { display: initial; }

@media (max-width: 900px) {
  .modes, .lobby-grid, .end-cols { grid-template-columns: 1fr; }
  .game-layout { grid-template-columns: 1fr; }
  .chat-panel { height: 340px; }
}
@media (max-width: 640px) {
  main { padding: 18px 16px 110px; }
  .top { padding: 10px 16px; }
  .vol input { width: 60px; }
  .me-chip span { display: none; }
  .versus { grid-template-columns: 1fr 1fr; gap: 10px; }
  .vs-mid { grid-column: 1 / -1; order: 3; flex-direction: row; justify-content: center; }
  .vs { font-size: 26px; }
  .keys { display: none; }
  .card { padding: 10px; border-radius: 18px; --pad: 10px; }
  .clipbox, .card .cov { border-radius: 12px; }
  .card h4 { font-size: 15px; }
  .card .meta { font-size: 13px; }
  .card .save { padding: 11px; font-size: 15px; }
  .card .stamp { font-size: 18px; }
  .options { grid-template-columns: 1fr; }
  .disc-wrap { width: 180px; height: 180px; }
  .podium .step { width: 100px; }
  .code-line { font-size: 24px; }
}
