/* ═══════════════════════════════════════════════════════════════
   БОЙЦОВСКИЙ КЛУБ — Combats.ru Clone
   Dark, gritty 2000s Russian browser RPG aesthetic
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

:root {
  --bg-dark: #1a1a1a;
  --bg-panel: #222;
  --bg-panel-alt: #2a2a2a;
  --border: #444;
  --border-light: #555;
  --text: #ccc;
  --text-dim: #888;
  --text-bright: #eee;
  --red: #c33;
  --red-bright: #e44;
  --gold: #d4a017;
  --gold-dim: #a07810;
  --green: #3a3;
  --blue: #48f;
  --hp-bar: #c33;
  --hp-bg: #411;
  --xp-bar: #38a;
  --xp-bg: #134;
  --stamina-bar: #3a3;
  --stamina-bg: #141;
}

body {
  background: var(--bg-dark);
  color: var(--text);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ─── Header ──────────────────────────────────────────────── */

.header {
  background: linear-gradient(180deg, #2a1a1a 0%, #1a1010 100%);
  border-bottom: 2px solid var(--red);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  color: var(--red-bright);
  text-shadow: 0 0 10px rgba(200,50,50,0.5);
  letter-spacing: 2px;
}
.header .server-time {
  color: var(--text-dim);
  font-size: 12px;
}

/* ─── Layout ──────────────────────────────────────────────── */

.main-layout {
  display: flex;
  max-width: 1200px;
  margin: 0 auto;
  gap: 0;
  min-height: calc(100vh - 50px);
}
.sidebar-left {
  width: 240px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 10px;
  flex-shrink: 0;
}
.content-area {
  flex: 1;
  padding: 15px;
  min-width: 0;
}
.sidebar-right {
  width: 220px;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  padding: 10px;
  flex-shrink: 0;
}

/* ─── Panels ──────────────────────────────────────────────── */

.panel {
  background: var(--bg-panel-alt);
  border: 1px solid var(--border);
  border-radius: 3px;
  margin-bottom: 10px;
}
.panel-header {
  background: linear-gradient(180deg, #333 0%, #282828 100%);
  padding: 6px 10px;
  font-weight: bold;
  font-size: 12px;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.panel-body {
  padding: 8px 10px;
}

/* ─── Character Info ──────────────────────────────────────── */

.char-avatar {
  width: 80px;
  height: 80px;
  margin: 5px auto 10px;
  border: 2px solid var(--border-light);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: #1a1a2a;
}
.char-name {
  text-align: center;
  font-weight: bold;
  color: var(--gold);
  font-size: 15px;
  margin-bottom: 2px;
}
.char-level {
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 8px;
}

/* ─── Bars ────────────────────────────────────────────────── */

.bar-container { margin-bottom: 6px; }
.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 2px;
}
.bar-label span:first-child { color: var(--text-dim); }
.bar-label span:last-child { color: var(--text); }
.bar {
  height: 14px;
  border-radius: 2px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}
.bar-hp { background: var(--hp-bg); }
.bar-hp .bar-fill { background: linear-gradient(90deg, #a22, var(--hp-bar)); }
.bar-xp { background: var(--xp-bg); }
.bar-xp .bar-fill { background: linear-gradient(90deg, #268, var(--xp-bar)); }
.bar-stamina { background: var(--stamina-bg); }
.bar-stamina .bar-fill { background: linear-gradient(90deg, #282, var(--stamina-bar)); }

/* ─── Stats ───────────────────────────────────────────────── */

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
  font-size: 12px;
  border-bottom: 1px dotted #333;
}
.stat-row:last-child { border-bottom: none; }
.stat-name { color: var(--text-dim); }
.stat-val { color: var(--text-bright); font-weight: bold; }
.stat-val.str { color: #e55; }
.stat-val.agi { color: #5e5; }
.stat-val.end { color: #ee5; }
.stat-val.int { color: #5be; }

/* ─── Navigation ──────────────────────────────────────────── */

.nav-menu { list-style: none; }
.nav-menu li {
  padding: 6px 10px;
  cursor: pointer;
  border-bottom: 1px solid #2a2a2a;
  font-size: 13px;
  color: var(--text);
  transition: all 0.15s;
}
.nav-menu li:hover {
  background: #333;
  color: var(--gold);
  padding-left: 14px;
}
.nav-menu li.active {
  color: var(--gold);
  background: #2a2518;
  border-left: 3px solid var(--gold);
}
.nav-menu li .nav-icon { margin-right: 6px; font-size: 14px; }

/* ─── Buttons ─────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.15s;
  text-align: center;
}
.btn-primary {
  background: linear-gradient(180deg, #c33 0%, #922 100%);
  color: #fff;
  border-color: #a22;
}
.btn-primary:hover { background: linear-gradient(180deg, #d44 0%, #a33 100%); }
.btn-secondary {
  background: linear-gradient(180deg, #444 0%, #333 100%);
  color: var(--text);
  border-color: #555;
}
.btn-secondary:hover { background: linear-gradient(180deg, #555 0%, #444 100%); }
.btn-gold {
  background: linear-gradient(180deg, #b8860b 0%, #8b6914 100%);
  color: #fff;
  border-color: var(--gold-dim);
}
.btn-gold:hover { background: linear-gradient(180deg, #d4a017 0%, #a07810 100%); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ─── Tables ──────────────────────────────────────────────── */

.game-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.game-table th {
  background: #2a2a2a;
  padding: 6px 8px;
  text-align: left;
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.game-table td {
  padding: 5px 8px;
  border-bottom: 1px solid #2a2a2a;
}
.game-table tr:hover td { background: #2a2a2a; }

/* ─── Combat ──────────────────────────────────────────────── */

.combat-arena {
  border: 2px solid var(--red);
  border-radius: 5px;
  padding: 15px;
  background: linear-gradient(180deg, #1a1010 0%, #1a1a1a 100%);
  margin-bottom: 15px;
}
.combat-header {
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: var(--red-bright);
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
}
.combat-fighters {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 15px;
}
.combat-fighter { flex: 1; text-align: center; }
.combat-fighter-name { font-weight: bold; color: var(--gold); margin-bottom: 5px; }
.combat-fighter-level { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; }
.combat-vs {
  font-size: 24px;
  font-weight: bold;
  color: var(--red);
  align-self: center;
  font-family: 'Press Start 2P', monospace;
}
.combat-zones {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 15px;
}
.zone-select { text-align: center; }
.zone-select h4 {
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.body-map { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.body-zone {
  width: 100px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
  text-align: center;
  transition: all 0.15s;
  background: #2a2a2a;
  color: var(--text);
}
.body-zone:hover { border-color: var(--gold); background: #333; }
.body-zone.selected-attack {
  border-color: var(--red-bright);
  background: #3a1a1a;
  color: var(--red-bright);
  box-shadow: 0 0 5px rgba(200,50,50,0.3);
}
.body-zone.selected-defend {
  border-color: var(--blue);
  background: #1a1a3a;
  color: var(--blue);
  box-shadow: 0 0 5px rgba(68,136,255,0.3);
}

/* ─── Combat Log ──────────────────────────────────────────── */

.combat-log {
  max-height: 250px;
  overflow-y: auto;
  padding: 8px;
  background: #111;
  border: 1px solid #333;
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.6;
  margin-bottom: 10px;
  scroll-behavior: smooth;
}
.combat-log::-webkit-scrollbar { width: 6px; }
.combat-log::-webkit-scrollbar-track { background: #111; }
.combat-log::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.log-hit { color: var(--red-bright); }
.log-miss { color: var(--text-dim); }
.log-crit { color: var(--gold); font-weight: bold; }
.log-block { color: var(--blue); }
.log-system { color: var(--green); }
.log-round {
  color: var(--gold-dim);
  font-weight: bold;
  border-top: 1px solid #333;
  margin-top: 4px;
  padding-top: 4px;
}

/* ─── Character Creation ──────────────────────────────────── */

.create-screen {
  max-width: 500px;
  margin: 40px auto;
  text-align: center;
}
.create-screen h2 {
  font-family: 'Press Start 2P', monospace;
  color: var(--red-bright);
  font-size: 16px;
  margin-bottom: 20px;
  text-shadow: 0 0 10px rgba(200,50,50,0.5);
}
.create-form { text-align: left; }
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  color: var(--gold);
  font-size: 12px;
  margin-bottom: 4px;
  text-transform: uppercase;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 10px;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-bright);
  font-size: 14px;
  font-family: inherit;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--gold);
}
.stat-alloc {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.stat-alloc label { width: 140px; color: var(--text); font-size: 13px; }
.stat-alloc .stat-btns { display: flex; gap: 4px; align-items: center; }
.stat-alloc .stat-val-display { width: 30px; text-align: center; font-weight: bold; font-size: 16px; }
.points-remaining { text-align: center; font-size: 14px; color: var(--gold); margin: 10px 0; }

/* ─── Shop Items ──────────────────────────────────────────── */

.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-bottom: 1px solid #2a2a2a;
  transition: background 0.15s;
}
.shop-item:hover { background: #2a2a2a; }
.shop-item-icon { font-size: 24px; width: 36px; text-align: center; }
.shop-item-info { flex: 1; }
.shop-item-name { font-weight: bold; color: var(--text-bright); font-size: 13px; }
.shop-item-desc { font-size: 11px; color: var(--text-dim); }
.shop-item-price { color: var(--gold); font-weight: bold; font-size: 13px; white-space: nowrap; }
.equipped-badge { color: var(--green); font-size: 11px; font-weight: bold; }

/* ─── Chat ────────────────────────────────────────────────── */

.chat-box {
  height: 200px;
  overflow-y: auto;
  background: #111;
  border: 1px solid #333;
  border-radius: 3px;
  padding: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  scroll-behavior: smooth;
}
.chat-box::-webkit-scrollbar { width: 6px; }
.chat-box::-webkit-scrollbar-track { background: #111; }
.chat-box::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }
.chat-msg-user { color: var(--gold); }
.chat-msg-system { color: var(--green); font-style: italic; }
.chat-msg-npc { color: var(--blue); }
.chat-input-row { display: flex; gap: 4px; }
.chat-input-row input {
  flex: 1;
  padding: 6px 8px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 3px;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
}
.chat-input-row input:focus { outline: none; border-color: var(--gold-dim); }

/* ─── Quests ──────────────────────────────────────────────── */

.quest-item {
  padding: 8px;
  border-bottom: 1px solid #2a2a2a;
}
.quest-name { font-weight: bold; color: var(--text-bright); }
.quest-desc { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.quest-reward { font-size: 11px; color: var(--gold); margin-top: 2px; }
.quest-progress {
  height: 6px;
  background: #333;
  border-radius: 3px;
  margin-top: 4px;
  overflow: hidden;
}
.quest-progress-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.3s;
}

/* ─── Online Players ──────────────────────────────────────── */

.online-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px dotted #2a2a2a;
}
.online-player-name { color: var(--text-bright); cursor: pointer; }
.online-player-name:hover { color: var(--gold); }
.online-player-lvl { color: var(--text-dim); font-size: 11px; }

/* ─── Location Banner ─────────────────────────────────────── */

.location-banner {
  background: linear-gradient(180deg, #2a2a1a 0%, #1a1a10 100%);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 12px 15px;
  margin-bottom: 15px;
}
.location-name { font-size: 16px; font-weight: bold; color: var(--gold); margin-bottom: 4px; }
.location-desc { font-size: 12px; color: var(--text-dim); }

/* ─── Notifications ───────────────────────────────────────── */

.notification {
  position: fixed;
  top: 60px;
  right: 20px;
  background: #2a2a1a;
  border: 1px solid var(--gold);
  border-radius: 4px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--gold);
  z-index: 999;
  animation: fadeInOut 3s ease forwards;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* ─── Animations ──────────────────────────────────────────── */

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}
.shake { animation: shake 0.3s ease; }

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(-10px); }
  15% { opacity: 1; transform: translateY(0); }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

/* ─── Scrollbar ───────────────────────────────────────────── */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ─── Responsive ──────────────────────────────────────────── */

@media (max-width: 900px) {
  .main-layout { flex-direction: column; }
  .sidebar-left, .sidebar-right { width: 100%; }
  .combat-fighters { flex-direction: column; align-items: center; }
}

/* ─── Rarity Colors ───────────────────────────────────────── */

.rarity-common { color: #ccc; }
.rarity-uncommon { color: #3a3; }
.rarity-rare { color: #48f; }
.rarity-epic { color: #a3e; }
.rarity-legendary { color: #fc3; text-shadow: 0 0 6px rgba(255,204,50,0.4); }

/* ─── Class Selection ─────────────────────────────────────── */

.class-option { transition: all 0.15s; }
.class-option:hover { background: #333 !important; }
.selected-class { border-color: var(--gold) !important; background: #2a2518 !important; }

/* ─── Badge / Pill ────────────────────────────────────────── */

.badge {
  background: var(--red);
  color: #fff;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 4px;
}

/* ─── Loot Drop Highlight ─────────────────────────────────── */

@keyframes lootGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(50,200,50,0.3); }
  50% { box-shadow: 0 0 15px rgba(50,200,50,0.6); }
}
.loot-drop {
  animation: lootGlow 1.5s ease infinite;
  border-color: var(--green) !important;
}

/* ─── Nav Badge ───────────────────────────────────────────── */

.nav-menu li { position: relative; }

/* ─── Better Shop Item Hover ──────────────────────────────── */

.shop-item { transition: background 0.15s, transform 0.1s; }
.shop-item:hover { background: #2a2a2a; }

/* ─── Notification Stack ──────────────────────────────────── */

.notification + .notification { top: 110px; }
.notification + .notification + .notification { top: 160px; }

/* ─── Admin Panel ─────────────────────────────────────────── */

.game-table input[type="number"] {
  width: 80px;
  padding: 4px 6px;
  background: #1a1a1a;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-bright);
  font-family: inherit;
  font-size: 13px;
}

/* ─── Smooth panel transitions ────────────────────────────── */

.content-area { min-height: 400px; }
.panel { transition: border-color 0.2s; }
