:root {
  --bg: #0a0f13;
  --panel: rgba(10, 16, 21, 0.82);
  --border: rgba(255, 255, 255, 0.1);
  --text: #eef4f6;
  --muted: #93a7b1;
  --t: #ff7a45;
  --ct: #45b5ff;
  --gold: #ffd25e;
  --danger: #ff4b3a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Space Mono", ui-monospace, monospace;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

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

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 0.35em;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-bottom-width: 3px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.78em;
  text-align: center;
  line-height: 1.5;
}

#stage {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 10%, #1d2b33 0, transparent 45%),
    radial-gradient(circle at 90% 90%, #2a1f17 0, transparent 40%),
    var(--bg);
}

#game {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  touch-action: none;
}

.panel,
.hud-top .team,
.hud-top .clock,
#status,
.room-tag {
  background: var(--panel);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* HUD */

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#hud .panel,
#hud button,
#hud input,
#roomTag {
  pointer-events: auto;
}

.hud-top {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  align-items: stretch;
}

.hud-top .team {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 10px;
  min-width: 120px;
}

.hud-top .team.t {
  border-color: color-mix(in srgb, var(--t), transparent 40%);
  justify-content: flex-start;
}

.hud-top .team.ct {
  border-color: color-mix(in srgb, var(--ct), transparent 40%);
  justify-content: flex-end;
}

.hud-top .side {
  font-size: 0.75rem;
  color: var(--muted);
}

.hud-top strong {
  font-family: "Black Ops One", system-ui;
  font-size: 1.6rem;
  line-height: 1;
}

.team.t strong {
  color: var(--t);
}

.team.ct strong {
  color: var(--ct);
}

.dots {
  display: flex;
  gap: 3px;
}

.dots i {
  width: 9px;
  height: 14px;
  border-radius: 3px;
  background: currentColor;
}

.team.t .dots {
  color: var(--t);
}

.team.ct .dots {
  color: var(--ct);
}

.dots i.dead {
  opacity: 0.2;
}

.hud-top .clock {
  border-radius: 10px;
  padding: 3px 16px;
  text-align: center;
  min-width: 132px;
}

#timer {
  font-family: "Black Ops One", system-ui;
  font-size: 1.45rem;
  line-height: 1.1;
}

#timer.planted {
  color: var(--danger);
  animation: blink 0.5s steps(2) infinite;
}

#timer.low {
  color: var(--danger);
}

#phase {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
}

@keyframes blink {
  50% {
    opacity: 0.45;
  }
}

.room-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 0.72rem;
  display: flex;
  gap: 8px;
  align-items: center;
}

.room-tag:empty {
  display: none;
}

.room-tag b {
  font-family: "Black Ops One", system-ui;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.room-tag button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
}

#killfeed {
  position: absolute;
  top: 8px;
  right: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  max-width: 46vw;
}

#killfeed li {
  background: rgba(8, 12, 16, 0.78);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 0.74rem;
  white-space: nowrap;
  animation: slideIn 0.18s ease-out;
}

#killfeed li.mine {
  border-color: #e23b2a;
  box-shadow: inset 0 0 0 1px rgba(226, 59, 42, 0.5);
}

#killfeed .T {
  color: var(--t);
  font-weight: 700;
}

#killfeed .CT {
  color: var(--ct);
  font-weight: 700;
}

#killfeed .how {
  margin: 0 6px;
  opacity: 0.9;
}

@keyframes slideIn {
  from {
    transform: translateX(20px);
    opacity: 0;
  }
}

#announce {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-family: "Black Ops One", system-ui;
  pointer-events: none;
  width: 100%;
}

#announce .big {
  font-size: clamp(1.8rem, 5vw, 3.6rem);
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.45), 0 0 30px rgba(0, 0, 0, 0.6);
  animation: pop 0.35s cubic-bezier(0.2, 1.6, 0.4, 1);
}

#announce .small {
  font-family: "Space Mono", monospace;
  font-size: clamp(0.8rem, 1.8vw, 1.05rem);
  margin-top: 4px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

@keyframes pop {
  from {
    transform: scale(1.6);
    opacity: 0;
  }
}

#hint {
  position: absolute;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.82rem;
  background: rgba(8, 12, 16, 0.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px;
  white-space: nowrap;
}

#hint:empty {
  display: none;
}

#hint.alert {
  border-color: var(--danger);
  color: #ffd6d0;
}

#deathCard {
  position: absolute;
  top: 34%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  background: rgba(30, 6, 6, 0.75);
  border: 1px solid rgba(255, 75, 58, 0.5);
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.85rem;
}

#deathCard b {
  display: block;
  font-family: "Black Ops One", system-ui;
  font-size: 1.4rem;
  color: var(--danger);
}

#chat {
  position: absolute;
  left: 8px;
  bottom: 74px;
  width: min(380px, 60vw);
}

#chatLog {
  list-style: none;
  margin: 0 0 4px;
  padding: 0;
  font-size: 0.74rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#chatLog li {
  text-shadow: 0 1px 3px #000, 0 0 2px #000;
  transition: opacity 0.6s;
}

#chatLog li.old {
  opacity: 0;
}

#chatLog .T {
  color: var(--t);
}

#chatLog .CT {
  color: var(--ct);
}

#chatLog .sys {
  color: var(--gold);
}

#chatInput {
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--gold);
  background: rgba(8, 12, 16, 0.9);
  outline: none;
}

#status {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  border-radius: 12px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
}








.stat.ammo b {
  font-family: "Black Ops One", system-ui;
  font-size: 1.1rem;
  min-width: 3.4ch;
}


.stat.ammo.reloading b {
  animation: blink 0.5s steps(2) infinite;
}




.items {
  display: flex;
  gap: 4px;
}

.items span {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  opacity: 0.3;
}

.items span.on {
  opacity: 1;
  border-color: rgba(255, 210, 94, 0.55);
}

.panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 14px;
  padding: 14px 16px;
  width: min(460px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
}

.panel h2 {
  margin: 0 0 10px;
  font-family: "Black Ops One", system-ui;
  font-weight: 400;
  letter-spacing: 0.04em;
}









#scoreboard,
#matchOver {
  width: min(720px, calc(100% - 24px));
}

.sb-team {
  margin-bottom: 10px;
}

.sb-team h3 {
  margin: 0 0 4px;
  font-family: "Black Ops One", system-ui;
  font-weight: 400;
  font-size: 1rem;
}

.sb-team.T h3 {
  color: var(--t);
}

.sb-team.CT h3 {
  color: var(--ct);
}

.sb-team table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.sb-team th {
  text-align: right;
  color: var(--muted);
  font-weight: 400;
  padding: 2px 6px;
}

.sb-team td {
  text-align: right;
  padding: 3px 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sb-team th:first-child,
.sb-team td:first-child {
  text-align: left;
}

.sb-team tr.me td {
  background: rgba(255, 228, 107, 0.1);
}

.sb-team tr.dead td {
  opacity: 0.5;
}

.final-score {
  font-family: "Black Ops One", system-ui;
  font-size: 2.6rem;
  text-align: center;
  margin: 4px 0 10px;
}

.final-score .T {
  color: var(--t);
}

.final-score .CT {
  color: var(--ct);
}

#flash,
#hurt {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

/* Menu (le thème est dans vgui.css) */

.logo {
  margin: 0;
  font-family: "Black Ops One", system-ui;
  font-weight: 400;
  font-size: clamp(2.8rem, 11vw, 4.4rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: #f4e4c4;
  text-shadow: 3px 3px 0 #8a4b1c, 6px 6px 0 rgba(0, 0, 0, 0.4);
}

.logo span {
  display: inline-block;
  margin-right: 0.05em;
  color: var(--t);
  transform: rotate(-4deg);
}

h3 {
  font-size: 0.85rem;
  margin: 14px 0 6px;
  color: var(--muted);
  font-weight: 400;
}

.small {
  font-size: 0.72rem;
}

#xpFeed {
  position: absolute;
  left: 50%;
  bottom: 108px;
  transform: translateX(-50%);
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
}

#xpFeed li {
  font-size: 0.74rem;
  font-weight: 700;
  color: #ffd25e;
  text-shadow: 0 1px 3px #000;
  animation: xpRise 1.8s ease-out forwards;
}

@keyframes xpRise {
  0% {
    opacity: 0;
    transform: translateY(8px) scale(0.9);
  }

  12% {
    opacity: 1;
    transform: translateY(0) scale(1.08);
  }

  75% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translateY(-14px);
  }
}

.xp-summary {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 210, 94, 0.35);
  background: rgba(255, 210, 94, 0.06);
  display: grid;
  gap: 8px;
}

.xp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.xp-head .gain {
  margin-left: auto;
  color: #ffd25e;
  font-family: "Black Ops One", system-ui;
  font-size: 1.2rem;
}

.xp-lines {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 2px 12px;
  font-size: 0.72rem;
  color: var(--muted);
}

.xp-lines b {
  color: #ffd25e;
  float: right;
}

.end-buttons {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
}

@media (pointer: coarse) {
  .stat.hp .bar {
    width: 52px;
  }

  .stat.hp b,
  .stat.squad b,
  .stat.ammo b {
    font-size: 0.95rem;
  }

  #xpFeed {
    bottom: 30px;
  }
}

.stat.hp .bar {
  width: 110px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.stat.hp .bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #4ade80, #a7ff6a);
  transition: width 0.15s linear;
}

.stat.hp.low .bar i {
  background: linear-gradient(90deg, #ff4b3a, #ff8a3d);
}

.stat.hp b,
.stat.squad b,
.stat.ammo b {
  font-family: "Black Ops One", system-ui;
  font-size: 1.15rem;
  min-width: 2.2ch;
}

.stat.ammo span {
  font-family: "Black Ops One", system-ui;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.stat.ammo.low b,
.stat.ammo.reloading b {
  color: var(--danger);
}

.stat.ammo.reloading b {
  animation: blink 0.5s steps(2) infinite;
}

.stick-pad {
  position: absolute;
  bottom: 12px;
  aspect-ratio: 1;
  width: calc(var(--side, 150px) - 14px);
  border-radius: 50%;
  pointer-events: auto;
  touch-action: none;
  display: grid;
  place-items: center;
}

.stick-pad.move {
  left: 8px;
  border: 2px solid rgba(160, 220, 255, 0.45);
  background: radial-gradient(circle, rgba(69, 181, 255, 0.18), rgba(10, 16, 21, 0.65) 70%);
}

.stick-pad.aim {
  position: relative;
  bottom: auto;
  grid-column: 1 / -1;
  width: 100%;
  border: 2px solid rgba(255, 90, 60, 0.6);
  background: radial-gradient(circle, rgba(200, 50, 30, 0.35), rgba(10, 16, 21, 0.65) 70%);
}

.stick-pad span {
  font-family: "Black Ops One", system-ui;
  font-size: 0.62rem;
  line-height: 1.2;
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.stick-pad i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38%;
  height: 38%;
  margin: -19% 0 0 -19%;
  border-radius: 50%;
  pointer-events: none;
}

.stick-pad.move i {
  background: rgba(120, 200, 255, 0.7);
  box-shadow: 0 0 12px rgba(69, 181, 255, 0.6);
}

.stick-pad.aim i {
  background: rgba(255, 110, 80, 0.75);
  box-shadow: 0 0 12px rgba(255, 90, 60, 0.6);
}

.stick-pad.active {
  border-color: #ffb547;
}

#actionBar {
  position: absolute;
  left: 50%;
  top: 62%;
  transform: translateX(-50%);
  width: min(320px, 70vw);
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 75, 58, 0.6);
  background: rgba(10, 16, 21, 0.85);
  text-align: center;
  font-family: "Black Ops One", system-ui;
  font-size: 0.9rem;
}

#actionBar .bar {
  margin-top: 6px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

#actionBar .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ff4b2b, #ffb547);
}

#actionBar.defuse {
  border-color: rgba(69, 181, 255, 0.6);
}

#actionBar.defuse .bar i {
  background: linear-gradient(90deg, #2b9bff, #9be3ff);
}

.elo-line {
  text-align: center;
  margin: 0 0 8px;
}

.elo-line .up {
  color: #7dff7a;
  font-weight: 700;
}

.elo-line .down {
  color: #ff6b5a;
  font-weight: 700;
}

.act-btn {
  display: none;
}

#stage.mode-classic .act-btn {
  display: block;
  grid-column: 1 / -1;
  height: 40px;
  border-radius: 999px !important;
  font-family: "Black Ops One", system-ui;
}

/* Tactile */

#touch {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
}

#touch button {
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(10, 16, 21, 0.65);
  border-radius: 12px;
  font-weight: 700;
}

#touch button.active {
  background: rgba(255, 210, 94, 0.4);
}






.actions {
  position: absolute;
  right: 8px;
  bottom: 10px;
  width: calc(var(--side, 150px) - 14px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.actions .nades {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.actions .nades button {
  height: 30px;
  font-size: 0.66rem;
}






#stage.ingame #game {
  cursor: none;
}

#rotate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  background: var(--bg);
  text-align: center;
}

#rotate .phone {
  width: 54px;
  height: 92px;
  border: 4px solid var(--gold);
  border-radius: 12px;
  animation: rotatePhone 2.2s ease-in-out infinite;
}

#rotate b {
  font-family: "Black Ops One", system-ui;
  font-size: 1.4rem;
}

@keyframes rotatePhone {
  0%,
  20% {
    transform: rotate(0);
  }

  55%,
  85% {
    transform: rotate(-90deg);
  }

  100% {
    transform: rotate(0);
  }
}

@media (pointer: coarse) {
  #touch {
    display: block;
  }

  #game {
    top: calc(50% + 18px);
  }

  .hud-top {
    top: 4px;
    gap: 4px;
  }

  .hud-top .team {
    min-width: 0;
    padding: 2px 8px;
  }

  .hud-top strong {
    font-size: 1.2rem;
  }

  .hud-top .clock {
    min-width: 100px;
    padding: 2px 10px;
  }

  #timer {
    font-size: 1.1rem;
  }

  #phase {
    font-size: 0.56rem;
  }

  .dots,
  .items {
    display: none;
  }

  .room-tag {
    top: 4px;
    left: 6px;
    max-width: calc(var(--side, 150px) - 10px);
    flex-wrap: wrap;
    gap: 4px;
    padding: 3px 6px;
    font-size: 0.6rem;
  }

  .room-tag b {
    font-size: 0.85rem;
  }

  #status {
    left: 6px;
    top: 50px;
    bottom: auto;
    transform: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: calc(var(--side, 150px) - 12px);
    padding: 6px 8px;
  }


  #killfeed {
    top: 4px;
    right: 6px;
    max-width: calc(var(--side, 150px) - 8px);
  }

  #killfeed li {
    font-size: 0.56rem;
    padding: 2px 5px;
    white-space: normal;
  }

  #killfeed li:nth-child(n + 4) {
    display: none;
  }

  #chat {
    left: 6px;
    top: 150px;
    bottom: auto;
    width: calc(var(--side, 150px) - 8px);
  }

  #chatLog {
    font-size: 0.6rem;
  }

  #chatLog li:nth-last-child(n + 5) {
    display: none;
  }

  #hint {
    bottom: 6px;
    padding: 3px 10px;
    font-size: 0.66rem;
  }

  #announce {
    top: 16%;
  }

  #deathCard {
    top: 30%;
    padding: 6px 12px;
    font-size: 0.7rem;
  }

  .panel {
    padding: 10px 12px;
  }


}

@media (pointer: coarse) and (orientation: portrait) {
  #rotate {
    display: flex;
  }
}

@media (max-height: 520px) {
  #menu {
    padding: 8px;
  }

  .logo {
    font-size: 2rem;
  }

  .tagline {
    display: none;
  }

  .tabs {
    margin: 10px 0 6px;
  }

  .opt {
    margin: 4px 0;
  }

  .btn.big {
    padding: 8px;
    font-size: 1.05rem;
  }
}

@media (max-width: 720px) and (pointer: fine) {
  .hud-top .team {
    min-width: 0;
    padding: 3px 6px;
  }

  .dots {
    display: none;
  }
}
