/* ===== Мини-игра TF2: Арена ===== */
[hidden] { display: none !important; }

body.game-page {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.8rem 0.8rem 1.4rem;
  color: #e9e0cd;
  font-family: 'Roboto Condensed', Arial, sans-serif;
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(216, 168, 75, 0.14), transparent 60%),
    radial-gradient(700px 500px at 10% 110%, rgba(184, 56, 59, 0.18), transparent 60%),
    radial-gradient(700px 500px at 90% 110%, rgba(88, 133, 162, 0.18), transparent 60%),
    #17130f;
}

.game-top {
  width: min(960px, 100%);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 0.8rem;
  margin-bottom: 0.7rem;
  background: #35302a;
  border: 3px solid #17130f;
  border-radius: 8px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
}

.game-back {
  color: #e9e0cd;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.game-back:hover { color: #ffd97a; }

.game-title {
  margin-left: auto;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.95rem;
}

.game-title span { color: #d8a84b; }

.game-hudscore {
  font-family: 'Oswald', sans-serif;
  font-size: 0.95rem;
  background: #17130f;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  white-space: nowrap;
}

.game-hudscore b { font-size: 1.15rem; }
#scoreRed { color: #ff8f8f; }
#scoreBlue { color: #9ecfff; }

/* ---------- сцена ---------- */
.stage {
  position: relative;
  width: min(960px, 100%);
  aspect-ratio: 16 / 10;
  border: 4px solid #17130f;
  border-radius: 10px;
  overflow: hidden;
  background: #4a4338;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.65), 0 0 0 3px rgba(216, 168, 75, 0.25);
}

body.is-playing .stage { cursor: none; }

.stage > canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- HUD ---------- */
.hud { position: absolute; inset: 0; pointer-events: none; }

.hud__hp {
  position: absolute;
  left: 14px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.7rem;
  background: rgba(15, 12, 10, 0.74);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  font-family: 'Oswald', sans-serif;
}

.hud__hp-num { font-size: 1.8rem; color: #fff; min-width: 2.6rem; text-align: right; }

.hud__hp-bar {
  width: 150px;
  height: 14px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  overflow: hidden;
}

.hud__hp-bar i {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(#9ae08a, #59b04b);
  transition: width 0.15s;
}

.hud__cls { font-size: 0.7rem; letter-spacing: 0.16em; color: #d8a84b; }

.hud__ammo {
  position: absolute;
  right: 14px;
  bottom: 12px;
  text-align: right;
  padding: 0.45rem 0.8rem;
  background: rgba(15, 12, 10, 0.74);
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  font-family: 'Oswald', sans-serif;
}

.hud__ammo b { font-size: 1.9rem; color: #ffe17a; }
.hud__ammo span { font-size: 0.9rem; color: #b7ac99; margin-left: 0.3rem; }

.hud__ammo em {
  display: block;
  font-style: normal;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: #8fd7ff;
  min-height: 1em;
}

.killfeed {
  position: absolute;
  right: 12px;
  top: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: flex-end;
}

.feed__item {
  font-weight: 700;
  font-size: 0.82rem;
  background: rgba(15, 12, 10, 0.72);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border-left: 4px solid #b8383b;
  transition: opacity 0.35s, transform 0.35s;
}

.feed__item.is-blu { border-left-color: #5885a2; }
.feed__item.is-out { opacity: 0; transform: translateX(24px); }

.hud__hint {
  position: absolute;
  left: 50%;
  bottom: 66px;
  transform: translateX(-50%);
  font-size: 0.8rem;
  background: rgba(15, 12, 10, 0.66);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
  transition: opacity 0.7s;
}

.hud__hint.is-gone { opacity: 0; }

/* ---------- меню ---------- */
.menu {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 1.2rem;
  text-align: center;
  overflow: auto;
  background: linear-gradient(rgba(15, 12, 10, 0.87), rgba(15, 12, 10, 0.95));
}

.menu__title {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-size: clamp(2rem, 6vw, 3.4rem);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 4px 4px 0 rgba(0, 0, 0, 0.6);
}

.menu__title span { color: #e05a4a; }
.menu__sub { margin: 0; max-width: 34rem; color: #cfc4ae; font-size: 0.95rem; }

.menu__classes {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 150px));
  gap: 0.6rem;
  margin-top: 0.3rem;
}

.mclass {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.7rem 0.4rem;
  background: #35302a;
  color: #e9e0cd;
  border: 3px solid #17130f;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Roboto Condensed', sans-serif;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}

.mclass:hover { transform: translateY(-4px); border-color: #d8a84b; }

.mclass.is-on {
  border-color: #d8a84b;
  background: #413a30;
  box-shadow: 0 0 0 3px rgba(216, 168, 75, 0.4);
}

.mclass__e { font-size: 1.9rem; }

.mclass b {
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.95rem;
}

.mclass i { font-style: normal; font-size: 0.72rem; color: #b7ac99; line-height: 1.25; }
.mclass em { font-style: normal; font-size: 0.7rem; color: #8fd7ff; letter-spacing: 0.1em; }

.menu__row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.85rem;
  color: #cfc4ae;
}

.chpicks { display: flex; gap: 0.5rem; }

.ch-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.35rem 0.5rem;
  background: #241f19;
  border: 2px solid #4a4238;
  border-radius: 8px;
  cursor: pointer;
  color: #cfc4ae;
  font-family: 'Oswald', sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ch-btn canvas { display: block; background: rgba(255, 255, 255, 0.05); border-radius: 4px; }
.ch-btn:hover { border-color: #d8a84b; }

.ch-btn.is-on {
  border-color: #d8a84b;
  color: #ffe17a;
  box-shadow: 0 0 0 2px rgba(216, 168, 75, 0.35);
}

.menu__start { margin-top: 0.3rem; font-size: 1.15rem; padding: 0.8rem 2.4rem; }
.menu__tip { margin: 0; font-size: 0.78rem; color: #9a8f7c; max-width: 36rem; }

/* ---------- оверлеи ---------- */
.respawn,
.over {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  background: rgba(15, 12, 10, 0.8);
}

.respawn b {
  font-family: 'Oswald', sans-serif;
  font-size: 2.4rem;
  text-transform: uppercase;
  color: #ff6a5a;
}

.respawn span { font-family: 'Oswald', sans-serif; font-size: 3.2rem; color: #fff; }
.respawn p { margin: 0; color: #cfc4ae; }

.over h2 {
  margin: 0;
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: #ffe17a;
  text-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
}

.over p { margin: 0; color: #cfc4ae; }
.over__row { display: flex; gap: 0.8rem; align-items: center; margin-top: 0.6rem; flex-wrap: wrap; justify-content: center; }

.over__menu {
  background: none;
  border: 2px solid rgba(233, 224, 205, 0.5);
  color: #e9e0cd;
  border-radius: 4px;
  padding: 0.65rem 1.3rem;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}

.over__menu:hover { background: rgba(233, 224, 205, 0.12); }

.game-foot { font-size: 0.75rem; color: #7d7360; margin: 0.9rem 0 0; text-align: center; }

@media (max-width: 720px) {
  .menu__classes { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
  .hud__hp-bar { width: 90px; }
  .hud__hint { display: none; }
}
