:root {
  --bg: #0b0d12;
  --panel: #141821;
  --panel2: #1b2130;
  --line: #232a38;
  --txt: #e6ebf2;
  --dim: #8b94a6;
  --faint: #5c6579;
  --acc: #4ade80;
  --danger: #f87171;
  --gold: #fbbf24;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--txt);
  font: 14px/1.5 ui-sans-serif, system-ui, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

/* ---------- ecrans ---------- */

.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 20px;
  background:
    radial-gradient(1200px 620px at 50% -10%, #1a2130 0%, transparent 62%),
    var(--bg);
  overflow-y: auto;
}

.panel {
  width: min(430px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
}
.panel.wide { width: min(780px, 100%); }

h1 {
  font-size: 44px;
  letter-spacing: 9px;
  font-weight: 800;
  text-align: center;
}
h2 { font-size: 22px; margin-bottom: 4px; }

.tag { color: var(--dim); text-align: center; margin-bottom: 20px; font-size: 13px; }
h2 + .tag { text-align: left; }
.note { color: var(--faint); font-size: 11.5px; text-align: center; margin-top: 8px; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12px; color: var(--dim); margin-bottom: 6px; }
.field input {
  width: 100%;
  padding: 11px 13px;
  background: #0e1219;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--txt);
  font-size: 15px;
  font-family: inherit;
}
.field input:focus { outline: none; border-color: var(--acc); }

.actions { display: flex; gap: 10px; margin-top: 16px; }

.btn {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--line);
  background: var(--panel2);
  color: var(--txt);
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: #232b3c; border-color: #3a4357; }
.btn.primary { background: var(--acc); color: #05240f; border-color: transparent; }
.btn.primary:hover { background: #6ee79a; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); width: 100%; margin-top: 10px; }
.btn.ghost:hover { color: var(--txt); background: rgba(255,255,255,.04); }
.btn.small { padding: 8px 12px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.providers { display: flex; flex-direction: column; gap: 9px; }
.btn.oauth { text-align: center; }
.btn.google:hover { border-color: #4285f4; }
.btn.discord:hover { border-color: #5865f2; }

.sep { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--faint); font-size: 11.5px; }
.sep::before, .sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.status { margin-top: 14px; text-align: center; font-size: 12.5px; color: var(--dim); min-height: 19px; }
.status.err { color: var(--danger); }
.status.ok { color: var(--acc); }

.hint { color: var(--faint); font-size: 12px; text-align: center; max-width: 620px; line-height: 1.7; }

/* ---------- lanceur ---------- */

.launcher {
  display: flex;
  gap: 28px;
  width: min(1080px, 100%);
  align-items: stretch;
}
.side {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.main h1 { font-size: 58px; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}

/* profil : pseudo, rang, barre de RP */
.profile .who { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.profile .avatar {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--panel2);
  border: 1px solid var(--line);
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 17px; color: var(--dim);
}
.profile .who b { display: block; font-size: 16px; line-height: 1.25; }
.profile .who small { color: var(--faint); font-size: 11.5px; }

.rankline { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.rankname { font-weight: 800; font-size: 14px; letter-spacing: .6px; text-transform: uppercase; }
.rankrp { font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; }

.xp {
  height: 9px;
  background: #0e1219;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.xp > div { height: 100%; border-radius: 5px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.xpnote { font-size: 11px; color: var(--faint); margin-top: 6px; }

.profile .stats {
  display: flex; gap: 4px;
  margin-top: 14px; padding-top: 13px;
  border-top: 1px solid var(--line);
}
.profile .stats div { flex: 1; text-align: center; }
.profile .stats b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.profile .stats span { font-size: 10.5px; color: var(--faint); }

.nav { display: flex; flex-direction: column; gap: 9px; }
.navbtn {
  text-align: left;
  padding: 13px 15px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--txt);
  font: inherit;
  cursor: pointer;
}
.navbtn:hover { background: var(--panel2); border-color: #3a4357; }
.navbtn b { display: block; font-size: 14px; }
.navbtn small { color: var(--faint); font-size: 11.5px; }

.btn.play {
  width: min(340px, 100%);
  padding: 22px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 4px;
  background: var(--acc);
  color: #05240f;
  border: none;
  border-radius: 14px;
  box-shadow: 0 10px 34px -12px rgba(74,222,128,.75);
}
.btn.play:hover { background: #6ee79a; }
.btn.play:disabled { box-shadow: none; }

.server-info { color: var(--dim); font-size: 12.5px; text-align: center; }
.server-info b { color: var(--acc); }

/* ---------- equipement ---------- */

.slot-row { margin-bottom: 20px; }
.slot-row > h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--dim);
  margin-bottom: 8px;
  font-weight: 600;
}
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 8px; }
.card-w {
  text-align: left;
  padding: 11px 13px;
  background: #0e1219;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  color: var(--txt);
  font: inherit;
}
.card-w:hover { border-color: #3d465c; }
.card-w.on { border-color: var(--acc); background: #10251a; }
.card-w b { display: block; font-size: 14px; margin-bottom: 3px; }
.card-w small { color: var(--dim); font-size: 11.5px; line-height: 1.35; display: block; }

/* ---------- classement ---------- */

.lb { width: 100%; border-collapse: collapse; font-size: 13px; }
.lb th {
  text-align: left; color: var(--dim); font-size: 10.5px;
  text-transform: uppercase; letter-spacing: 1px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.lb td { padding: 8px 0; border-bottom: 1px solid #1a2029; font-variant-numeric: tabular-nums; }
.lb td:first-child { color: var(--faint); width: 34px; }
.lb td.n { font-weight: 600; }
.lb td:not(:first-child):not(.n):not(.r) { text-align: right; }
.lb td.r { font-weight: 700; font-size: 12px; letter-spacing: .4px; }
.lb .empty { color: var(--faint); text-align: center; padding: 26px 0; }

/* ---------- jeu ---------- */

#game { position: fixed; inset: 0; }
#cv { display: block; width: 100%; height: 100%; cursor: crosshair; }

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.quit {
  position: absolute;
  top: 10px; left: 12px;
  pointer-events: auto;
  background: rgba(10,13,19,.72);
  border: 1px solid var(--line);
  color: var(--dim);
  border-radius: 8px;
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.quit:hover { color: var(--txt); border-color: #3a4357; }

.topbar {
  position: absolute;
  top: 10px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 16px;
  background: rgba(10,13,19,.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12.5px;
  color: var(--dim);
  white-space: nowrap;
}
.topbar span:first-child { color: var(--txt); font-weight: 600; }

.feed {
  position: absolute;
  top: 10px; right: 12px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  font-size: 12.5px;
}
.feed div {
  background: rgba(10,13,19,.72);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 9px;
}
.feed .k { color: var(--acc); font-weight: 600; }
.feed .v { color: var(--danger); }
.feed .sys { color: var(--dim); font-style: italic; }

.bottomleft { position: absolute; left: 14px; bottom: 14px; }
.hp {
  position: relative;
  width: 210px; height: 24px;
  background: rgba(10,13,19,.8);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}
.hp-fill { height: 100%; background: linear-gradient(90deg,#22c55e,#4ade80); transition: width .12s linear; }
.hp span {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; text-shadow: 0 1px 2px #000;
}
.score { margin-top: 6px; font-size: 12.5px; color: var(--dim); }
.score b { color: var(--txt); font-size: 15px; }

.bottomright { position: absolute; right: 14px; bottom: 14px; text-align: right; }
.wname { font-size: 12.5px; color: var(--dim); }
.ammo { font-size: 30px; font-weight: 800; line-height: 1.05; }
.ammo.low { color: var(--danger); }
.ammo small { font-size: 15px; color: var(--dim); font-weight: 600; }
.slots { display: flex; gap: 5px; justify-content: flex-end; margin-top: 6px; }
.slots i {
  font-style: normal;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: rgba(10,13,19,.7);
  color: var(--dim);
}
.slots i.on { border-color: var(--acc); color: var(--acc); }

.reload {
  position: absolute;
  left: 50%; top: 58%;
  transform: translateX(-50%);
  width: 120px; height: 5px;
  background: rgba(255,255,255,.15);
  border-radius: 3px;
  overflow: hidden;
}
#reloadFill { height: 100%; width: 0; background: var(--gold); }

.hitmark {
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 22px;
  margin: -11px 0 0 -11px;
  background:
    linear-gradient(45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%),
    linear-gradient(-45deg, transparent 45%, #fff 45%, #fff 55%, transparent 55%);
  opacity: .9;
}
.hitmark.kill { filter: drop-shadow(0 0 3px #f87171); }

#dmgdir { position: absolute; inset: 0; }
#dmgdir i {
  position: absolute;
  left: 50%; top: 50%;
  width: 5px; height: 58px;
  margin-left: -2.5px;
  border-radius: 3px;
  /* origine en haut de la barre = centre exact de l'ecran, puis on l'ecarte
     de 90px dans la direction du tireur */
  transform-origin: 50% 0;
  background: linear-gradient(180deg, rgba(248,113,113,.95) 0%, rgba(248,113,113,0) 100%);
}

.overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  background: rgba(6,8,13,.72);
  text-align: center;
}
.overlay h3 { font-size: 30px; font-weight: 800; }
.overlay p { color: var(--dim); }
.overlay .big { font-size: 56px; font-weight: 800; color: var(--gold); }

/* ---------- podium ---------- */

.podium { display: flex; align-items: flex-end; gap: 14px; margin: 22px 0 6px; }
.pod {
  width: 128px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px 12px 0 0;
  padding: 14px 10px 12px;
  text-align: center;
}
.pod .pos { font-size: 26px; font-weight: 800; line-height: 1; }
.pod .nm {
  font-weight: 700; font-size: 13.5px; margin-top: 7px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pod .kd { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.pod.p1 { height: 168px; border-color: var(--gold); }
.pod.p1 .pos { color: var(--gold); }
.pod.p2 { height: 138px; border-color: #b9c2cc; }
.pod.p2 .pos { color: #b9c2cc; }
.pod.p3 { height: 118px; border-color: #c08457; }
.pod.p3 .pos { color: #c08457; }

.rpline { font-size: 15px; font-weight: 700; margin-top: 4px; }
.rpline.up { color: var(--acc); }
.rpline.down { color: var(--danger); }
.rpline.flat { color: var(--dim); }

.myresult {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px 20px;
  margin-top: 6px;
  min-width: 290px;
}
.myresult .row { display: flex; justify-content: space-between; gap: 20px; font-size: 13px; }
.myresult .row span { color: var(--dim); }
.myresult .xp { margin-top: 9px; }

.board {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%,-50%);
  border-collapse: collapse;
  background: rgba(10,13,19,.94);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  min-width: 400px;
  font-size: 13px;
}
.board th, .board td { padding: 7px 16px; text-align: left; }
.board th { color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--line); }
.board td { border-bottom: 1px solid #1a2029; }
.board tr.me td { background: rgba(74,222,128,.1); color: var(--acc); }
.board td.n { font-weight: 600; }
.board td.n em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 4px;
  margin-left: 7px;
  vertical-align: 1px;
}

/* ---------- tactile ---------- */

#touch { position: absolute; inset: 0; pointer-events: none; }
.stick {
  position: absolute;
  bottom: 26px;
  width: 130px; height: 130px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  opacity: 0;
  transition: opacity .12s;
}
.stick.on { opacity: 1; }
#stickMove { left: 26px; }
#stickAim { right: 26px; }
.knob {
  position: absolute;
  left: 50%; top: 50%;
  width: 54px; height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: rgba(255,255,255,.3);
}
.tbtns {
  position: absolute;
  right: 20px; top: 50%;
  transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: auto;
}
.tbtn {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(10,13,19,.6);
  color: var(--txt);
  font: 600 15px/1 inherit;
}
.tbtn.on { border-color: var(--acc); color: var(--acc); }

/* ---------- petits ecrans ---------- */

@media (max-width: 880px) {
  .launcher { flex-direction: column; }
  .side { width: 100%; }
  .main h1 { font-size: 42px; }
  .btn.play { width: 100%; }
}
