* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #0d1017;
  color: #e6e9ef;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

[hidden] { display: none !important; }

button, input, select { font: inherit; color: inherit; }

select {
  padding: 10px 8px;
  background: #151a24;
  border: 1px solid #2a3242;
  border-radius: 8px;
}
.stepper { align-items: center; }
.field small { display: block; margin-top: 6px; color: #626c7e; }
.stepper button { width: 44px; font-weight: 700; }
.stepper output { flex: 1; text-align: center; font-size: 18px; font-weight: 700; }

input:not([type=range]) {
  width: 100%;
  padding: 10px 12px;
  background: #151a24;
  border: 1px solid #2a3242;
  border-radius: 8px;
  outline: none;
}
input:not([type=range]):focus { border-color: #ff5c5c; }
input[type=range] { width: 100%; accent-color: #ff5c5c; }

button {
  padding: 10px 16px;
  background: #1c2331;
  border: 1px solid #2a3242;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover:not(:disabled) { background: #252e40; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: #ff5c5c; border-color: #ff5c5c; color: #14060a; font-weight: 700; }
button.primary:hover:not(:disabled) { background: #ff7676; }
.wide { width: 100%; }
.row { display: flex; gap: 8px; }
.field { display: block; margin: 14px 0; }
.field > span { display: block; margin-bottom: 6px; font-size: 13px; color: #8b95a7; }

a.hub { display: inline-block; margin-bottom: 14px; color: #8b95a7; text-decoration: none; font-size: 14px; }
a.hub:hover { color: #e6e9ef; }
/* botão do HUB fixo no canto superior direito do lobby */
a.hub.corner {
  position: fixed; top: 14px; right: 16px; z-index: 5; margin: 0;
  padding: 9px 16px; border-radius: 10px; font-weight: 700; color: #e6e9ef;
  background: #1c2331; border: 1px solid #2a3242;
}
a.hub.corner:hover { background: #252e40; border-color: #ff5c5c; }
a.btn {
  display: block; padding: 10px 16px; text-align: center; text-decoration: none; color: inherit;
  background: #1c2331; border: 1px solid #2a3242; border-radius: 8px;
}
a.btn.hub { margin: 8px 0 0; color: #e6e9ef; }
a.btn.primary { background: #ff5c5c; border-color: #ff5c5c; color: #14060a; font-weight: 700; }
.login { padding: 16px; margin: 8px 0 16px; background: #151a24; border: 1px solid #ff5c5c; border-radius: 10px; }
.login p { margin: 0 0 12px; }
#ranking { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; counter-reset: pos; }
#ranking li { display: flex; gap: 12px; padding: 8px 12px; background: #151a24; border: 1px solid #2a3242; border-radius: 8px; counter-increment: pos; }
#ranking li::before { content: counter(pos) "º"; color: #ffd166; font-weight: 700; min-width: 26px; }
#ranking .name { flex: 1; font-weight: 600; }
#ranking .count { color: #8b95a7; }

/* aviso de atualização ao vivo, por cima de tudo */
#updating {
  position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 100;
  padding: 16px 26px; border-radius: 12px; font-size: 18px; font-weight: 700; text-align: center;
  background: #0d1017f2; border: 1px solid #ffd166; color: #ffd166; box-shadow: 0 10px 40px #000a;
}

/* ---------- lobby ---------- */

#lobby { max-width: 520px; margin: 0 auto; padding: 48px 20px; }
#lobby h1 { margin: 0; font-size: 44px; letter-spacing: 2px; }
#lobby h1 span { color: #ff5c5c; }
#lobby h2 { margin: 28px 0 10px; font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase; color: #8b95a7; }
.sub { margin: 6px 0 24px; color: #8b95a7; }
.msg { padding: 10px 12px; margin-bottom: 8px; background: #3a1a20; border: 1px solid #7a2c38; border-radius: 8px; }
.keys { margin-top: 32px; font-size: 13px; color: #626c7e; }

#rooms { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
#rooms li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: #151a24; border: 1px solid #2a3242; border-radius: 8px;
}
#rooms li.empty { color: #626c7e; justify-content: center; }
#rooms li.invited { border-color: #ff5c5c; }
#rooms .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
#rooms .bots { color: #626c7e; font-size: 13px; }
#rooms .map { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: #8b95a7; }
#rooms .count { color: #8b95a7; font-variant-numeric: tabular-nums; }

/* ---------- jogo ---------- */

#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#hud { position: fixed; inset: 0; pointer-events: none; user-select: none; text-shadow: 0 1px 3px #000c; }

#crosshair {
  position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px;
  background:
    linear-gradient(#fff, #fff) center top / 2px 7px no-repeat,
    linear-gradient(#fff, #fff) center bottom / 2px 7px no-repeat,
    linear-gradient(#fff, #fff) left center / 7px 2px no-repeat,
    linear-gradient(#fff, #fff) right center / 7px 2px no-repeat;
  filter: drop-shadow(0 0 1px #000);
}

#hit {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px;
  opacity: 0; transform: rotate(45deg);
  background:
    linear-gradient(currentColor, currentColor) center top / 3px 9px no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 3px 9px no-repeat,
    linear-gradient(currentColor, currentColor) left center / 9px 3px no-repeat,
    linear-gradient(currentColor, currentColor) right center / 9px 3px no-repeat;
  color: #fff;
}
#hit.head { color: #ff4040; }
#hit.show { animation: hit .22s ease-out; }
@keyframes hit { from { opacity: 1; scale: 1.25; } to { opacity: 0; scale: 1; } }

#hurt { position: absolute; inset: 0; opacity: 0; box-shadow: inset 0 0 160px 40px #d00000; }
#hurt.show { animation: hurt .5s ease-out; }
@keyframes hurt { from { opacity: .85; } to { opacity: 0; } }

#top-left { position: absolute; left: 16px; top: 12px; font-size: 13px; color: #d6dbe5; }
#room-label { font-weight: 700; }
#ping { opacity: .7; }

#feed { position: absolute; right: 16px; top: 12px; display: grid; gap: 4px; justify-items: end; font-size: 14px; }
#feed div { padding: 3px 8px; background: #0009; border-radius: 6px; }
#feed .me { color: #ffd166; font-weight: 700; }
#feed .hs { color: #ff5c5c; }

#bottom-left, #bottom-right { position: absolute; bottom: 16px; display: flex; align-items: baseline; gap: 8px; }
#bottom-left { left: 20px; }
#bottom-right { right: 20px; }
#weapons { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 6px; font-size: 13px; }
#weapons div { padding: 4px 10px; background: #0008; border: 1px solid transparent; border-radius: 6px; opacity: .6; white-space: nowrap; }
#weapons div.on { opacity: 1; border-color: #ffd166; color: #ffd166; font-weight: 700; }

#scope {
  position: absolute; inset: 0;
  background:
    linear-gradient(#000, #000) center / 2px 100% no-repeat,
    linear-gradient(#000, #000) center / 100% 2px no-repeat,
    radial-gradient(circle at center, transparent 0, transparent 36vh, #000 36.4vh);
}

#hp, #ammo { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; }
#hp.low { color: #ff5c5c; }
#stance { margin-left: 10px; color: #ffd166; }
label.check { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; color: #c5ccd8; cursor: pointer; }
label.check input { width: 16px; height: 16px; accent-color: #ff5c5c; }
#create { flex-wrap: wrap; }
#create #room-name { flex: 1 1 140px; min-width: 0; }
#create label.check { flex: 0 0 100%; order: 10; margin-top: 4px; }
#create label.check input { flex: none; width: 16px; }
#map-select { flex: 1; min-width: 0; }
.kit { display: grid; gap: 6px; }
.kit label { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 8px; font-size: 13px; color: #8b95a7; }
.kit select { width: 100%; min-width: 0; }
#pause .panel { max-height: 92vh; overflow-y: auto; }
.label { font-size: 13px; letter-spacing: 1px; opacity: .75; }

#center {
  position: absolute; left: 50%; top: 30%; transform: translateX(-50%);
  padding: 14px 24px; background: #000a; border-radius: 10px;
  font-size: 22px; font-weight: 700; text-align: center; white-space: pre-line;
}

#score { position: absolute; inset: 0; display: grid; place-items: center; }
#score table { min-width: 380px; border-collapse: collapse; background: #0b0e14e0; border-radius: 10px; overflow: hidden; }
#score th, #score td { padding: 8px 16px; text-align: left; }
#score th { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: #8b95a7; background: #151a24; }
#score th:not(:first-child), #score td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
#score tr.me td { color: #ffd166; font-weight: 700; }

#pause { position: absolute; inset: 0; display: grid; place-items: center; background: #0008; pointer-events: auto; text-shadow: none; }
#pause .panel { width: min(380px, 90vw); padding: 22px; background: #0d1017; border: 1px solid #2a3242; border-radius: 12px; }
#pause h2 { margin: 0 0 14px; font-size: 20px; }

/* ---------- Criar Classe (estilo Black Ops 2) ---------- */
.lo-open { font-weight: 800; letter-spacing: 1.5px; background: #1b1f26; border-color: #f2a51a; color: #f2a51a; }
.lo-open small { opacity: .7; font-weight: 400; }
#kit-now { display: block; margin-top: 6px; font-size: 12px; color: #8b95a7; }
#loadout {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: radial-gradient(ellipse at 30% 20%, #2a313bcc, #07090cf2 70%);
  color: #e9edf2; font-family: inherit; user-select: none;
}
.lo-panel { width: min(1180px, 96vw); height: min(680px, 92vh); display: flex; flex-direction: column; }
.lo-head { display: flex; align-items: flex-end; justify-content: space-between; padding: 0 4px 10px; border-bottom: 2px solid #f2a51a; }
.lo-eyebrow { font-size: 11px; letter-spacing: 3px; color: #f2a51a; }
.lo-head h2 { margin: 2px 0 0; font-size: 34px; letter-spacing: 4px; font-weight: 800; }
.lo-close { background: none; border: 1px solid #ffffff33; color: #fff; width: 38px; height: 38px; padding: 0; border-radius: 4px; }
.lo-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 210px 1fr 380px; gap: 14px; padding-top: 14px; }
.lo-classes { display: grid; align-content: start; gap: 6px; }
.lo-cls {
  display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 12px;
  background: #ffffff0d; border: 1px solid transparent; border-radius: 2px; color: #cfd6df;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 94% 100%, 0 100%);
}
.lo-cls .n { font-weight: 800; color: #6c7684; width: 14px; }
.lo-cls .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.lo-cls:hover { background: #ffffff1a; }
.lo-cls.on { background: #f2a51a; color: #101215; }
.lo-cls.on .n { color: #101215; }
.lo-cls.using::after { content: 'EM USO'; font-size: 10px; letter-spacing: 1px; opacity: .75; }
.lo-class, .lo-pick { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.lo-name {
  background: transparent !important; border: none !important; border-bottom: 1px solid #ffffff33 !important; border-radius: 0 !important;
  font-size: 22px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; padding: 6px 2px !important; color: #fff;
}
.lo-slots { display: grid; gap: 10px; }
.lo-slot {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; text-align: left; gap: 2px 12px;
  padding: 16px 18px; background: linear-gradient(90deg, #ffffff14, #ffffff05); border: 1px solid #ffffff1f; border-radius: 2px; color: #fff;
}
.lo-slot:hover { border-color: #f2a51a; background: linear-gradient(90deg, #f2a51a2e, #ffffff05); }
.lo-slot .lbl { grid-column: 1 / -1; font-size: 11px; letter-spacing: 2.5px; color: #f2a51a; text-transform: uppercase; }
.lo-slot .wn { font-size: 24px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.lo-slot .wc { align-self: end; font-size: 12px; color: #8b95a7; text-transform: uppercase; letter-spacing: 1px; }
.lo-use { margin-top: auto; padding: 14px; font-weight: 800; letter-spacing: 2px; background: #f2a51a !important; border-color: #f2a51a !important; color: #101215 !important; }
.lo-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.lo-tab { padding: 8px 12px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; background: #ffffff0d; border: 1px solid transparent; color: #cfd6df; border-radius: 2px; }
.lo-tab.on { border-color: #f2a51a; color: #f2a51a; }
.lo-tab.back { margin-left: auto; }
.lo-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; overflow-y: auto; align-content: start; }
.lo-item { padding: 14px 12px; text-align: left; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; background: #ffffff0d; border: 1px solid #ffffff14; color: #fff; border-radius: 2px; }
.lo-item:hover { border-color: #f2a51a; }
.lo-item.on { background: #f2a51a; color: #101215; }
.lo-preview { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; background: #ffffff08; border: 1px solid #ffffff14; min-height: 0; }
.lo-canvas { width: 100%; height: 210px; display: block; background: radial-gradient(ellipse at center, #ffffff14, transparent 70%); }
.lo-wname { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.lo-wclass { font-size: 12px; letter-spacing: 2px; color: #f2a51a; text-transform: uppercase; margin-top: -4px; }
.lo-bars { display: grid; gap: 7px; margin-top: 6px; }
.lo-bar { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 10px; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: #cfd6df; }
.lo-bar i { position: relative; display: block; height: 8px; background: #ffffff22; }
.lo-bar b { display: block; height: 100%; background: #fff; }
/* 10 gomos, como no BO2 */
.lo-bar i::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 2px), #0b0e12 calc(10% - 2px) 10%); }
.lo-facts { display: grid; gap: 4px; margin-top: auto; font-size: 13px; }
.lo-facts div { display: flex; justify-content: space-between; border-top: 1px solid #ffffff12; padding-top: 4px; }
.lo-facts span { color: #8b95a7; }
.lo-foot { padding-top: 10px; font-size: 12px; color: #6c7684; letter-spacing: 1px; }
@media (max-width: 900px) {
  .lo-body { grid-template-columns: 1fr; overflow-y: auto; }
  .lo-classes { grid-template-columns: repeat(5, 1fr); }
  .lo-cls { clip-path: none; justify-content: center; }
  .lo-cls .t, .lo-cls.using::after { display: none; }
}
/* acessórios: espaços embaixo de cada arma e a lista de escolha */
.lo-accs { display: flex; gap: 6px; margin-top: -4px; }
.lo-acc { flex: 1; padding: 9px 10px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; text-align: left; background: #ffffff08; border: 1px dashed #ffffff26; color: #8b95a7; border-radius: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lo-acc.on { border-style: solid; border-color: #f2a51a66; color: #fff; background: #f2a51a1c; }
.lo-acc:hover { border-color: #f2a51a; color: #fff; }
.lo-item small { display: block; margin-top: 4px; font-size: 10.5px; font-weight: 500; letter-spacing: 0.4px; text-transform: none; color: #9aa4b5; }
.lo-item.on small { color: #3b3320; }
