/* ==========================================================================
   Écrans : chargement, structure commune, salon, résultats, modales, notifications
   (le menu principal, la connexion, les amis et la discussion sont dans menu.css)
   ========================================================================== */

/* --- Chargement ------------------------------------------------------------ */
.boot {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: radial-gradient(1200px 700px at 50% 25%, #14275a 0%, #070e22 58%, #03060f 100%);
  transition: opacity .8s var(--ease), visibility .8s;
}
.boot.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-inner { width: min(440px, 86vw); text-align: center; }
.boot-logo {
  display: grid; place-items: center; width: 98px; height: 109px; margin: 0 auto 22px; font-size: 3.1rem; color: #eaf8ff;
  background: linear-gradient(145deg, #86d4ff, #2468e0);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  animation: float 3.2s ease-in-out infinite;
}
.boot h1 {
  margin-bottom: 8px; font-family: var(--font-display); font-weight: 900; font-size: 1.7rem; letter-spacing: .32em; text-indent: .32em;
  background: linear-gradient(180deg, #fff, #9bd6ff); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.boot p { margin-bottom: 18px; color: var(--text-2); font-weight: 600; letter-spacing: .06em; min-height: 1.2em; }
.boot-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ice-3), var(--ice)); box-shadow: 0 0 14px var(--ice-glow); transition: width .4s var(--ease); }
.boot-tip { display: block; margin-top: 22px; color: var(--text-3); font-weight: 600; letter-spacing: .05em; min-height: 1.2em; }

/* --- Structure commune des écrans ----------------------------------------------- */
#screens { position: relative; z-index: 10; }
.screen {
  position: fixed; inset: 0; z-index: 10; display: none; flex-direction: column; overflow: hidden;
  padding: 16px clamp(16px, 2.6vw, 46px) 18px;
  background:
    radial-gradient(900px 520px at 12% -5%, rgba(40, 110, 255, .2), transparent 60%),
    radial-gradient(900px 620px at 102% 105%, rgba(125, 70, 255, .16), transparent 60%),
    linear-gradient(180deg, rgba(5, 10, 23, .28), rgba(5, 10, 23, .74));
}
.screen.is-active { display: flex; animation: screenIn .6s var(--ease) both; }
#screen-results { background: linear-gradient(180deg, rgba(5, 10, 23, .55), rgba(5, 10, 23, .86)); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: none; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  display: grid; place-items: center; width: 46px; height: 51px; font-size: 1.5rem; color: #eaf8ff;
  background: linear-gradient(145deg, #86d4ff, #2468e0);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  filter: drop-shadow(0 0 10px var(--ice-glow));
}
.brand-text { display: flex; flex-direction: column; gap: 3px; }
.brand-text b { font-family: var(--font-display); font-weight: 900; font-size: 1.28rem; letter-spacing: .26em; background: linear-gradient(180deg, #fff, #9bd6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-text small { font-weight: 700; font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--text-3); }

/* tuile de statistique (profil, résultats) */
.stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; min-width: 0; padding: 10px 12px; border-radius: 12px; background: rgba(6, 14, 34, .55); border: 1px solid var(--line); }
.stat svg { grid-row: 1 / 3; width: 1.5em; height: 1.5em; color: var(--ice); }
.stat b { font-family: var(--font-display); font-size: 1.12rem; font-weight: 700; line-height: 1; }
.stat small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }

/* --- Salon -------------------------------------------------------------------------------- */
.lobby-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); grid-template-areas: "chat main"; gap: 24px; overflow: hidden; }
.lobby-main { grid-area: main; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 22px; overflow: auto; }
.lobby-main > :first-child { margin-top: auto; }
.lobby-main > :last-child { margin-bottom: auto; }
.lobby-chat { grid-area: chat; align-self: end; height: min(100%, 380px); min-height: 0; }
.countdown { position: relative; width: 150px; height: 150px; flex: none; }
.countdown svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.cd-bg { fill: rgba(8, 18, 44, .7); stroke: rgba(143, 190, 255, .18); stroke-width: 7; }
.cd-fg { fill: none; stroke: var(--ice); stroke-width: 7; stroke-linecap: round; stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset .9s linear, stroke .3s; filter: drop-shadow(0 0 8px var(--ice-glow)); }
.countdown[data-state="go"] .cd-fg { stroke: var(--gold); filter: drop-shadow(0 0 10px var(--gold-glow)); }
.cd-num { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.cd-num b { font-family: var(--font-display); font-weight: 900; font-size: 2.9rem; line-height: 1; text-shadow: 0 0 22px var(--ice-glow); }
.cd-num small { margin-top: 4px; font-weight: 700; font-size: .7rem; letter-spacing: .26em; text-transform: uppercase; color: var(--text-2); }
.countdown[data-state="wait"] .cd-num b { font-size: 2rem; animation: pulse 1.8s ease-in-out infinite; }
.countdown[data-state="fill"] .cd-num b { font-size: 2.05rem; letter-spacing: .02em; }
.countdown[data-state="fill"] .cd-fg { stroke: var(--ice-2); }
.countdown.tick .cd-num b { animation: tickPop .5s var(--ease); }
@keyframes tickPop { 0% { transform: scale(1.5); opacity: .4; } 100% { transform: scale(1); opacity: 1; } }

.teams { display: grid; grid-template-columns: repeat(3, minmax(190px, 300px)); gap: 20px; width: 100%; justify-content: center; }
.team-col { position: relative; border-radius: 18px; padding: 14px 14px 16px; background: linear-gradient(180deg, rgba(20, 36, 76, .72), rgba(8, 16, 38, .85)); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; backdrop-filter: blur(12px); }
.team-col::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--tc); box-shadow: 0 0 22px 2px var(--tc); }
.team-col::after { content: ''; position: absolute; inset: 0; background: radial-gradient(260px 160px at 50% 0, color-mix(in srgb, var(--tc) 22%, transparent), transparent 70%); pointer-events: none; }
.team-col.is-mine { border-color: var(--tc); box-shadow: var(--shadow), 0 0 0 1px var(--tc), 0 0 40px -10px var(--tc); }
.team-col header { position: relative; display: flex; align-items: center; gap: 10px; margin-bottom: 12px; z-index: 1; }
.team-col h3 { flex: 1; font-family: var(--font-display); font-weight: 900; font-size: 1.02rem; letter-spacing: .22em; text-transform: uppercase; }
.team-col .count { font-family: var(--font-display); font-size: .78rem; font-weight: 700; color: var(--text-2); }
.team-col .you-tag { padding: .15em .6em; border-radius: 99px; background: var(--tc); color: #04122a; font-weight: 800; font-size: .68rem; letter-spacing: .14em; }
.slots { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 8px; }
.slot { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; min-height: 52px; padding: 6px 12px 6px 10px; border-radius: 12px; background: rgba(6, 14, 34, .6); border: 1px solid var(--line); animation: fadeUp .4s var(--ease) both; }
.slot .avatar { width: 2.1em; height: 2.35em; font-size: .86rem; }
.slot b { display: block; font-weight: 700; font-size: 1rem; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot small { display: flex; align-items: center; gap: .4em; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--text-3); white-space: nowrap; }
.slot.is-new { animation: slotJoin .55s var(--ease) both; }
@keyframes slotJoin {
  0% { opacity: 0; transform: translateX(-18px) scale(.96); box-shadow: 0 0 0 0 var(--tc); }
  55% { opacity: 1; box-shadow: 0 0 26px 2px var(--tc); }
  100% { opacity: 1; transform: none; box-shadow: 0 0 0 0 transparent; }
}
.slot.is-me { border-color: var(--tc); background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 22%, transparent), rgba(6, 14, 34, .6)); }
.slot.is-ally:not(.is-me) { border-color: color-mix(in srgb, var(--tc) 55%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 12%, transparent), rgba(6, 14, 34, .6)); }
.slot.is-empty { border-style: dashed; background: transparent; color: var(--text-3); grid-template-columns: auto 1fr; font-weight: 600; font-size: .86rem; }
.empty-dot { width: 10px; height: 10px; margin: 0 13px; border-radius: 50%; border: 2px solid var(--text-3); animation: pulse 1.8s ease-in-out infinite; }
.tag-bot { padding: .05em .5em; border-radius: 6px; background: rgba(143, 190, 255, .16); color: var(--ice); font-size: .66rem; font-weight: 800; letter-spacing: .12em; }
.tag-party { display: inline-flex; align-items: center; gap: .3em; padding: .05em .5em; border-radius: 6px; background: rgba(143, 190, 255, .1); color: var(--text-2); font-size: .62rem; font-weight: 800; letter-spacing: .1em; }
.tag-party svg { width: 1em; height: 1em; }
.tag-party.mine { background: rgba(255, 211, 77, .16); color: var(--gold); }
.lobby-foot { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.class-pick { display: flex; gap: 10px; }
.class-pick button { display: flex; align-items: center; gap: 10px; padding: .5em 1.1em .5em .6em; border-radius: 12px; background: rgba(10, 22, 52, .7); border: 1px solid var(--line); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .82rem; transition: .2s var(--ease); }
.class-pick button img { width: 78px; height: auto; }
.class-pick button:hover { border-color: var(--line-hi); transform: translateY(-2px); }
.class-pick button.is-on { border-color: var(--ice); background: rgba(36, 80, 160, .5); box-shadow: 0 0 22px -6px var(--ice-glow); }
.lobby-hint { color: var(--text-2); font-weight: 600; letter-spacing: .04em; text-align: center; max-width: 640px; }

/* --- Résultats ----------------------------------------------------------------------------- */
.results { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 18px; width: min(1180px, 100%); margin: 0 auto; overflow: auto; padding: 4px 4px 8px; }
.res-banner { text-align: center; flex: none; padding-top: 6px; }
.res-title { font-family: var(--font-display); font-weight: 900; font-size: clamp(2.2rem, 5.4vw, 4rem); letter-spacing: .3em; text-indent: .3em; animation: titleIn .9s var(--ease) both; }
.res-title.win { background: linear-gradient(180deg, #fff6c8, #ffd34d 50%, #ff9f1c); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 26px var(--gold-glow)); }
.res-title.lose { background: linear-gradient(180deg, #e9f1ff, #8ba5cf); -webkit-background-clip: text; background-clip: text; color: transparent; }
.res-title.draw { background: linear-gradient(180deg, #fff, #9bd6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.res-sub { margin-top: 6px; color: var(--text-2); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .95rem; }
@keyframes titleIn { from { opacity: 0; transform: scale(1.35); letter-spacing: .6em; } to { opacity: 1; transform: none; } }
.res-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 18px; flex: 1; min-height: 0; }
.res-board { display: flex; flex-direction: column; gap: 16px; min-height: 0; }
.res-scroll { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(143, 190, 255, .4) transparent; }
.res-scroll .ptable thead th { position: sticky; top: 0; z-index: 1; background: rgba(13, 26, 58, .97); }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 22px; height: 150px; flex: none; }
.pod { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; width: 110px; height: 100%; }
.pod-score { font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; }
.pod-col { width: 100%; height: var(--h, 40%); border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 85%, #fff), var(--tc)); box-shadow: 0 0 26px -6px var(--tc), inset 0 2px 0 rgba(255, 255, 255, .45); animation: growUp .9s var(--ease) both; transform-origin: bottom; }
@keyframes growUp { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.pod-name { font-weight: 800; font-size: .76rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-2); display: flex; align-items: center; gap: .5em; }
.pod.rank-1 .pod-name { color: var(--gold); }
.pod .crown { color: var(--gold); filter: drop-shadow(0 0 8px var(--gold-glow)); }
.ptable { width: 100%; border-collapse: collapse; font-weight: 600; }
.ptable th { padding: 4px 8px 8px; text-align: right; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.ptable th:first-child { text-align: left; }
.ptable td { padding: 4px 8px; text-align: right; font-family: var(--font-display); font-size: .82rem; }
.ptable td:first-child { text-align: left; font-family: var(--font-ui); font-size: 1rem; }
.ptable tr.team-row td { padding: 10px 8px 3px; font-family: var(--font-display); font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; color: var(--tc); border-bottom: 1px solid color-mix(in srgb, var(--tc) 45%, transparent); }
.ptable tr.me td { background: rgba(255, 211, 77, .09); }
.ptable tr.me td:first-child { border-left: 3px solid var(--gold); }
.pcell { display: flex; align-items: center; gap: 10px; }
.pcell .avatar { width: 1.9em; height: 2.1em; font-size: .72rem; }
.mvp { color: var(--gold); display: inline-flex; align-items: center; gap: .3em; font-size: .7rem; font-weight: 800; letter-spacing: .14em; }
.res-side { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.res-me { display: flex; flex-direction: column; min-height: 0; }
.res-me > .res-scroll { display: flex; flex-direction: column; gap: 14px; }
.me-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.me-grid .stat { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 4px; }
.me-grid .stat svg { grid-row: auto; }
.xp-gain { font-family: var(--font-display); font-weight: 900; font-size: 2rem; color: var(--gold); text-shadow: 0 0 22px var(--gold-glow); animation: pop .7s var(--ease) both .4s; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.xp-parts { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .92rem; color: var(--text-2); }
.xp-parts li { display: flex; justify-content: space-between; opacity: 0; animation: fadeUp .4s var(--ease) both; }
.xp-parts b { color: var(--gold); font-family: var(--font-display); font-size: .8rem; }
.xp-level { display: flex; align-items: center; justify-content: space-between; font-weight: 700; letter-spacing: .1em; font-size: .86rem; color: var(--text-2); }
.levelup { padding: 10px 14px; border-radius: 12px; text-align: center; font-family: var(--font-display); font-weight: 900; letter-spacing: .18em; color: #3a2300; background: linear-gradient(90deg, #ffe27a, #ffb52e); box-shadow: 0 0 34px -4px var(--gold-glow); animation: pop .6s var(--ease) both, glowPulse 1.8s ease-in-out infinite .6s; }
.res-actions { display: flex; flex-direction: column; gap: 10px; }
.res-actions .btn { padding: .9em 1.2em; font-size: .95rem; }
.res-wait { display: flex; align-items: center; justify-content: center; gap: .6em; padding: .7em 1em; border-radius: 12px; background: rgba(6, 14, 34, .6); border: 1px dashed var(--line-hi); font-weight: 700; letter-spacing: .08em; color: var(--text-2); text-transform: uppercase; font-size: .84rem; }
.res-wait b { font-family: var(--font-display); color: var(--ice); }

/* --- Modales ---------------------------------------------------------------------------------- */
.modal-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: rgba(2, 6, 16, .68); backdrop-filter: blur(7px); animation: fade .25s both; }
.modal { position: relative; display: flex; flex-direction: column; width: min(600px, calc(100vw - 40px)); max-height: calc(100vh - 40px); padding: 0; animation: modalIn .35s var(--ease) both; }
.modal-body { flex: 1 1 auto; min-height: 0; padding: 24px 26px; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(143, 190, 255, .4) transparent; }
@keyframes modalIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { display: flex; align-items: center; gap: .6em; font-family: var(--font-display); font-weight: 800; font-size: 1.12rem; letter-spacing: .2em; text-transform: uppercase; }
.modal-sec { margin-bottom: 18px; }
.modal-sec > h4 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 700; font-size: .7rem; letter-spacing: .24em; text-transform: uppercase; color: var(--ice); }
.opt-row { display: grid; grid-template-columns: 1fr minmax(160px, 250px); align-items: center; gap: 18px; padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.opt-row:last-child { border-bottom: 0; }
.opt-row small { display: block; color: var(--text-3); font-weight: 600; font-size: .8rem; margin-top: 2px; }
.opt-row .right { justify-self: end; display: flex; align-items: center; justify-content: flex-end; gap: 10px; width: 100%; }
.opt-row .right .slider { flex: 1; }
.opt-row .right .val { min-width: 2.6em; text-align: right; font-family: var(--font-display); font-size: .78rem; color: var(--ice); }
.opt-row .seg { justify-self: end; }
.modal-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.modal-foot .foot-l { display: flex; gap: 10px; flex-wrap: wrap; }
.bind-btn { min-width: 8.5em; justify-content: center; text-transform: none; }
.bind-btn kbd { margin: 0; min-width: 4.2em; }
.bind-btn.is-listening { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(255, 211, 77, .3), 0 0 18px -4px var(--gold-glow); }
.bind-btn.is-listening kbd { background: transparent; border-color: transparent; color: var(--gold); font-size: .72rem; letter-spacing: .02em; white-space: normal; text-align: center; line-height: 1.2; animation: pulse 1.2s ease-in-out infinite; }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

/* fenêtres courtes : formulaires (pseudo, mot de passe), confirmation de sortie, aide */
.modal-form, .modal-leave { width: min(440px, calc(100vw - 40px)); }
.modal-help { width: min(760px, calc(100vw - 40px)); }
.mform { display: flex; flex-direction: column; gap: 14px; }
.mform-sub { color: var(--text-2); font-weight: 600; line-height: 1.4; }
.leave-box { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; color: var(--text-2); font-weight: 600; line-height: 1.4; }
.leave-box b { color: var(--text); }
.leave-pen { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(255, 176, 32, .1); border: 1px solid rgba(255, 176, 32, .4); }
.leave-pen svg { width: 1.9em; height: 1.9em; color: var(--warn); }
.leave-pen b { display: block; color: var(--warn); font-family: var(--font-display); font-size: .95rem; letter-spacing: .06em; }
.leave-pen small { display: block; margin-top: 2px; color: var(--text-2); font-size: .84rem; }
.leave-note { color: var(--text-3); font-size: .86rem; }
.help { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 26px; }
.help section:last-child { grid-column: 1 / -1; }
.help h4 { display: flex; align-items: center; gap: .6em; margin: 0 0 10px; font-family: var(--font-display); font-weight: 700; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ice); }
.help-steps, .help-list { display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-weight: 600; font-size: .94rem; line-height: 1.35; }
.help-steps { counter-reset: s; }
.help-steps li { position: relative; padding-left: 2em; counter-increment: s; }
.help-steps li::before { content: counter(s); position: absolute; left: 0; top: .05em; display: grid; place-items: center; width: 1.5em; height: 1.65em; font-family: var(--font-display); font-weight: 800; font-size: .72rem; color: #04152e; background: linear-gradient(145deg, #c8f0ff, #4fb2ff); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.help-steps b, .help-list b { color: var(--text); }
.help-list li { position: relative; padding-left: 1.2em; }
.help-list li::before { content: ''; position: absolute; left: .1em; top: .5em; width: .45em; height: .45em; border-radius: 2px; background: var(--ice); box-shadow: 0 0 8px var(--ice-glow); }
.ev-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ev { display: inline-flex; align-items: center; gap: .45em; padding: .28em .8em; border-radius: 99px; font-weight: 700; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line-hi); background: rgba(6, 14, 34, .55); }
.ev.c { color: #d4eaff; }
.ev.g { color: var(--gold); border-color: rgba(255, 211, 77, .4); }
.ev.i { color: #7fe4ff; }
.ev.h { color: #ff9a6a; border-color: rgba(255, 140, 90, .45); }
.keys-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; font-weight: 600; font-size: .9rem; color: var(--text-2); }
.keys-grid span { white-space: nowrap; }
.keys-grid em { font-style: normal; }

/* admin */
.adm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.adm-stat { padding: 10px 12px; border-radius: 12px; background: rgba(6, 14, 34, .6); border: 1px solid var(--line); }
.adm-stat small { display: block; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.adm-stat b { font-family: var(--font-display); font-size: 1.05rem; }
.adm-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.adm-rooms { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.adm-rooms li { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; background: rgba(6, 14, 34, .55); }
.adm-rooms .ph { font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ice); font-weight: 800; }
.adm-err { color: var(--danger); font-weight: 700; min-height: 1.2em; margin-top: 8px; overflow-wrap: anywhere; user-select: text; }

/* --- Notifications --------------------------------------------------------------------------------- */
#toasts { position: fixed; left: 50%; bottom: 26px; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; transform: translateX(-50%); pointer-events: none; }
.toast { display: flex; align-items: center; gap: .7em; max-width: min(620px, calc(100vw - 32px)); padding: .7em 1.2em; border-radius: 12px; background: rgba(8, 16, 36, .94); border: 1px solid var(--line-hi); box-shadow: var(--shadow); font-weight: 600; letter-spacing: .03em; animation: toastIn .4s var(--ease) both; }
.toast.out { animation: toastOut .35s var(--ease) both; }
.toast.ok { border-color: rgba(61, 220, 132, .6); }
.toast.ok svg { color: var(--ok); }
.toast.err { border-color: rgba(255, 84, 112, .65); }
.toast.err svg { color: var(--danger); }
.toast.info svg { color: var(--ice); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.97); } }

/* --- Adaptations ------------------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .lobby-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main"; }
  .lobby-chat { display: none; }
}
@media (max-width: 1020px) {
  .teams { grid-template-columns: repeat(3, minmax(190px, 1fr)); gap: 12px; }
  .res-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .teams { grid-template-columns: 1fr; max-width: 420px; }
  .help { grid-template-columns: 1fr; }
}
@media (max-height: 880px) {
  .brand-mark { width: 38px; height: 42px; }
}
@media (max-height: 780px) {
  .lobby-main { gap: 14px; }
  .countdown { width: 124px; height: 124px; }
  .cd-num b { font-size: 2.4rem; }
  .countdown[data-state="fill"] .cd-num b { font-size: 1.7rem; }
  .countdown[data-state="wait"] .cd-num b { font-size: 1.7rem; }
  .team-col { padding: 12px 12px 12px; }
  .team-col header { margin-bottom: 8px; }
  .slots { gap: 6px; }
  .slot { min-height: 46px; padding-top: 4px; padding-bottom: 4px; }
  .class-pick button img { width: 66px; }
}
@media (max-height: 640px) {
  .lobby-hint { display: none; }
}
/* Résultats : 15 joueurs + 3 équipes = 18 lignes (≈ 620 px). Le classement doit toujours tenir à l'écran, sans barre de défilement :
   les lignes se resserrent à mesure que la fenêtre perd de la hauteur, et le podium (décoratif : les scores d'équipe sont aussi dans
   le tableau) rétrécit puis disparaît sous 1030 px. */
.ptable td { padding-top: var(--row-pad, 4px); padding-bottom: var(--row-pad, 4px); }
.results { --row-pad: clamp(1px, calc((100vh - 750px) / 30), 4px); }
@media (max-height: 1080px) {
  .podium { height: 110px; }
}
@media (max-height: 1029px) {
  .res-board .podium { display: none; }
}
@media (max-height: 940px) {
  .pcell .avatar { font-size: .62rem; }
}
@media (max-height: 800px) {
  .results { gap: 12px; }
  .res-banner { padding-top: 0; }
  .res-title { font-size: clamp(2rem, 4.4vw, 2.8rem); }
  .res-sub { margin-top: 2px; font-size: .85rem; }
  .ptable tr.team-row td { padding: 6px 8px 2px; }
}
@media (max-height: 740px) {
  .ptable td:first-child { font-size: .92rem; }
  .pcell .avatar { font-size: .55rem; }
}
@media (max-height: 680px) {
  .res-sub { display: none; }
  .res-title { font-size: 2rem; }
}
