/* css/main.css — PunkGem 2.0 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Rajdhani:wght@500;600;700&display=swap');

:root {
  /* Основная палитра - углубленная */
  --bg-base:    #0b0d12;
  --bg-gradient: radial-gradient(circle at 50% 0%, #1f2536 0%, #0b0d12 60%);
  
  /* Полупрозрачные слои для стекла */
  --glass-bg:   rgba(24, 28, 36, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  
  /* Текст */
  --text:       #eef1f6;
  --text-dim:   #8b9bb4;
  
  /* Акценты с неоновым оттенком */
  --accent:     #ff4f4f;
  --accent-glow: rgb(0 0 0 / 0%);
  --accent2:    #ff7e47;
  
  /* Статусы */
  --green:      #2ecc71;
  --green-glow: rgba(46, 204, 113, 0.4);
  --red:        #ff4757;
  --gold:       #ffc048;
  
  /* UI */
  --radius:     12px;
  --radius-sm:  6px;
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-base);
  background-image: var(--bg-gradient);
  background-attachment: fixed; /* Градиент стоит на месте при скролле */
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: scroll;
}

/* ── Nav (Glassmorphism) ── */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px); /* Эффект матового стекла */
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s ease;
}

.nav-logo {
  font-family: 'Rajdhani', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-shadow: 0 0 20px rgba(255,255,255,0.05);
}
.nav-logo span { 
  color: var(--accent); 
  text-shadow: 0 0 15px var(--accent-glow);
}

.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { 
  color: var(--text-dim); 
  text-decoration: none; 
  font-size: .9rem; 
  font-weight: 500;
  transition: color .2s, text-shadow .2s; 
}
.nav-links a:hover { 
  color: #fff; 
  text-shadow: 0 0 8px rgba(255,255,255,0.3);
}

.nav-icon-link { position: relative; font-size: 1.2rem; display: flex; align-items: center; }

.nav-user { display: flex; align-items: center; gap: .8rem; }
.nav-avatar { 
  display: flex; align-items: center; gap: .6rem; 
  color: var(--text) !important; font-weight: 600; 
  padding: 4px 10px; border-radius: 20px;
  transition: background 0.2s;
}
.nav-avatar:hover { background: rgba(255,255,255,0.05); }
.nav-avatar img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border-color, transparent); }

.badge {
  position: absolute;
  top: -5px; right: -6px;
  background: var(--accent2);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.badge-admin {
  background: linear-gradient(135deg, var(--gold), #ffdb73);
  color: #111;
  font-size: .65rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  text-decoration: none;
  box-shadow: 0 0 10px rgba(212, 168, 75, 0.3);
}

/* ── Buttons (Modern & Glow) ── */
.btn-primary, .btn-outline, .btn-sm, .btn-danger, .btn-green {
  padding: .55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.02em;
}

.btn-primary { 
  background: var(--accent); 
  color: #fff; 
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover { 
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
  filter: brightness(1.1);
}

.btn-outline { 
  background: rgba(255,255,255,0.03); 
  border: 1px solid var(--glass-border); 
  color: var(--text); 
}
.btn-outline:hover { 
  background: rgba(255,255,255,0.08); 
  border-color: var(--text-dim);
  color: #fff;
}

.btn-sm { padding: .35rem .8rem; font-size: .75rem; background: rgba(255,255,255,0.05); color: var(--text-dim); }
.btn-sm:hover { background: rgba(255,255,255,0.1); color: #fff; }

.btn-danger { background: var(--red); color: #fff; box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3); }
.btn-danger:hover { filter: brightness(1.1); transform: translateY(-1px); }

.btn-green { background: var(--green); color: #000; box-shadow: 0 4px 15px var(--green-glow); }
.btn-green:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ── Container ── */
.container { max-width: 1240px; margin: 0 auto; padding: 2.5rem 1.5rem; flex: 1; width: 100%; }

/* ── Cards (Floating Style) ── */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.6rem;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
  backdrop-filter: blur(5px);
}
.card:hover { 
  border-color: rgba(255,255,255,0.15); 
  box-shadow: var(--shadow-card);
}

.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(480px, 1fr)); gap: 1.5rem; }

/* ── Flash messages ── */
.flash {
  padding: 1rem 1.5rem;
  font-weight: 600;
  font-size: .9rem;
  text-align: center;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  animation: fadeIn 0.4s ease-out;
  border: 1px solid transparent;
}
.flash-success { background: rgba(46, 204, 113, 0.1); color: var(--green); border-color: rgba(46, 204, 113, 0.2); }
.flash-error   { background: rgba(255, 71, 87, 0.1); color: var(--red); border-color: rgba(255, 71, 87, 0.2); }
.flash-info    { background: rgba(79, 142, 255, 0.1); color: var(--accent); border-color: rgba(79, 142, 255, 0.2); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* ── Forms (Clean Inputs) ── */
.form-group { margin-bottom: 1.2rem; position: relative; }
label { display: block; font-size: .8rem; color: var(--text-dim); margin-bottom: .4rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

input[type=text], input[type=email], input[type=password], input[type=number],
textarea, select {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: .75rem 1rem;
  font-family: inherit;
  font-size: .95rem;
  transition: all .2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.4);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 142, 255, 0.15);
}
textarea { resize: vertical; min-height: 100px; }
select option { background: #1a1d26; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }

/* ── Page titles ── */
.page-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.8rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.page-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 32px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--accent-glow);
}
.page-title span { color: var(--accent); }

/* ── Server card ── */
.server-card {
  background: linear-gradient(145deg, rgba(30,35,48,0.6) 0%, rgba(20,23,30,0.8) 100%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: .8rem;
  transition: all .3s ease;
  position: relative;
  overflow: hidden;
}
.server-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity .3s;
}
.server-card:hover { 
  border-color: var(--accent); 
  transform: translateY(-5px); 
  box-shadow: 0 10px 30px -5px rgba(0,0,0,0.5);
}
.server-card:hover::before { opacity: 1; }

.server-header { display: flex; align-items: center; justify-content: space-between; }
.server-name { font-family: 'Rajdhani', sans-serif; font-size: 1.25rem; font-weight: 700; color: #fff; text-decoration: none; transition: color .2s; }
.server-name:hover { color: var(--accent); }

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: .5rem;
  position: relative;
}
.status-online  { background: var(--green); box-shadow: 0 0 8px var(--green); }
.status-offline { background: var(--red); }

.server-meta { display: flex; gap: 1.2rem; font-size: .85rem; color: var(--text-dim); flex-wrap: wrap; align-items: center; }
.player-bar { 
  background: rgba(0,0,0,0.3); 
  border-radius: 10px; 
  height: 6px; 
  flex: 1; 
  overflow: hidden; 
  min-width: 80px;
}
.player-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #8abaff); border-radius: 10px; transition: width .6s cubic-bezier(0.4, 0, 0.2, 1); }

.game-tag {
  font-size: .7rem;
  padding: 3px 9px;
  border-radius: 4px;
  font-weight: 700;
  color: #fff;
  background: rgba(79, 142, 255, 0.15);
  border: 1px solid rgba(79, 142, 255, 0.3);
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* ── Stars ── */
.stars { color: var(--gold); letter-spacing: .1em; font-size: .9rem; text-shadow: 0 0 5px rgba(255, 192, 72, 0.4); }
.stars-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: .2rem; }
.stars-input input { display: none; }
.stars-input label { font-size: 1.5rem; color: #333b4d; cursor: pointer; transition: all .2s; }
.stars-input input:checked ~ label,
.stars-input label:hover,
.stars-input label:hover ~ label { color: var(--gold); transform: scale(1.1); }

/* ── Avatar placeholder ── */
.avatar-placeholder {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), #3a6bd6);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .85rem;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.avatar-lg {
  width: 90px; height: 90px;
  font-size: 2.2rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg3), var(--bg2));
  border: 3px solid var(--glass-border);
  color: #fff;
  font-weight: 700;
  position: relative;
}
.avatar-lg img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ── Profile ── */
.profile-header {
  display: flex;
  align-items: center;
  gap: 2rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.profile-header::after {
  content: '';
  position: absolute;
  top: 0; right: 0; width: 300px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(79, 142, 255, 0.05));
  pointer-events: none;
}
.profile-info h1 { font-family: 'Rajdhani', sans-serif; font-size: 2.2rem; font-weight: 700; color: #fff; margin-bottom: 0.2rem; }
.profile-info p  { color: var(--text-dim); font-size: .95rem; }

/* ── Tabs ── */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--glass-border); margin-bottom: 2rem; }
.tab {
  padding: .8rem 1.5rem;
  font-size: .9rem;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .2s;
  text-decoration: none;
  font-weight: 600;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); text-shadow: 0 0 10px var(--accent-glow); }
.tab:hover:not(.active) { color: #fff; }

/* ── Messages ── */
.msg-list { display: flex; flex-direction: column; gap: 1rem; }
.msg-bubble {
  max-width: 75%;
  padding: .8rem 1.2rem;
  border-radius: 12px;
  font-size: .95rem;
  line-height: 1.5;
  position: relative;
}
.msg-me    { 
  background: linear-gradient(135deg, var(--accent), #3b7dd8); 
  color: #fff; 
  align-self: flex-end; 
  border-bottom-right-radius: 2px; 
  box-shadow: 0 4px 15px rgba(79, 142, 255, 0.2);
}
.msg-them  { 
  background: rgba(255,255,255,0.05); 
  color: var(--text); 
  align-self: flex-start; 
  border-bottom-left-radius: 2px; 
  border: 1px solid var(--glass-border);
}
.msg-meta  { font-size: .7rem; opacity: .7; margin-top: .4rem; display: block; text-align: right; }

.chat-window {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  height: 500px;
  background: rgba(11, 13, 18, 0.6);
  backdrop-filter: blur(10px);
}
.chat-body { flex: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.chat-footer { padding: 1.2rem; border-top: 1px solid var(--glass-border); display: flex; gap: .8rem; background: rgba(255,255,255,0.02); border-radius: 0 0 var(--radius) var(--radius); }
.chat-footer input { flex: 1; background: rgba(0,0,0,0.3); border-color: transparent; }
.chat-footer input:focus { border-color: var(--accent); }

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 6rem 1rem 4rem;
  position: relative;
}
.hero h1 {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  color: #fff;
  line-height: 1;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.hero h1 span { 
  color: transparent;
  background: linear-gradient(90deg, var(--accent), #a4c2ff);
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 0 0 30px var(--accent-glow);
}
.hero p { font-size: 1.15rem; color: var(--text-dim); max-width: 600px; margin: 0 auto 2.5rem; line-height: 1.7; }
.hero-btns { display: flex; gap: 1.2rem; justify-content: center; flex-wrap: wrap; }
.hero-btns .btn-primary { padding: .9rem 2.5rem; font-size: 1.1rem; }
.hero-btns .btn-outline  { padding: .9rem 2.5rem; font-size: 1.1rem; }

/* ── Stats bar ── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 4rem;
  padding: 2rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin-bottom: 3rem;
  flex-wrap: wrap;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.stat { text-align: center; position: relative; }
.stat:not(:last-child)::after {
  content: ''; position: absolute; right: -2rem; top: 10%; height: 80%; width: 1px; background: var(--glass-border);
}
.stat-num { font-family: 'Rajdhani', sans-serif; font-size: 2.5rem; font-weight: 700; color: #fff; line-height: 1; margin-bottom: .3rem; }
.stat-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--text-dim); font-weight: 600; }

/* ── Search bar ── */
.search-bar {
  display: flex;
  gap: .8rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  background: var(--glass-bg);
  padding: 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
}
.search-bar input { flex: 1; min-width: 200px; background: rgba(0,0,0,0.2); border: none; }
.search-bar select { min-width: 140px; background: rgba(0,0,0,0.2); border: none; }

/* ── Auth pages ── */
.auth-box {
  max-width: 440px;
  margin: 4rem auto;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2.5rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.auth-box h2 { font-family: 'Rajdhani', sans-serif; font-size: 2rem; font-weight: 700; margin-bottom: 2rem; text-align: center; color: #fff; }

/* ── Review ── */
.review {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1rem;
}
.review-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.review-author { font-weight: 600; font-size: .95rem; color: #fff; }
.review-date   { font-size: .75rem; color: var(--text-dim); }

/* ── Game grid ── */
.game-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.game-card:hover { 
  border-color: var(--accent); 
  transform: translateY(-5px); 
  background: rgba(255,255,255,0.05);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.game-icon { font-size: 3rem; margin-bottom: 1rem; display: block; filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3)); }
.game-name { font-family: 'Rajdhani', sans-serif; font-size: 1.3rem; font-weight: 700; color: #fff; margin-bottom: 0.2rem; }
.game-count { font-size: .85rem; color: var(--text-dim); }

/* ── Admin ── */
.admin-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.admin-table th { 
  background: rgba(0,0,0,0.3); 
  color: var(--text-dim); 
  font-weight: 600; 
  letter-spacing: .05em; 
  text-transform: uppercase; 
  font-size: .75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--glass-border);
}
.admin-table td { 
  padding: 1rem; 
  text-align: left; 
  border-bottom: 1px solid var(--glass-border); 
  font-size: .9rem; 
  color: var(--text);
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }
.admin-nav { display: flex; gap: .8rem; margin-bottom: 2rem; flex-wrap: wrap; }

/* ── Friends ── */
.friend-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 1rem 1.4rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  margin-bottom: .8rem;
  transition: transform .2s;
}
.friend-row:hover { transform: translateX(5px); border-color: rgba(255,255,255,0.15); }
.friend-row img, .friend-row .avatar-placeholder { width: 42px; height: 42px; font-size: 1rem; border: 2px solid rgba(255,255,255,0.1); }
.friend-info { flex: 1; }
.friend-name { font-weight: 600; text-decoration: none; color: #fff; font-size: 1rem; }
.friend-name:hover { color: var(--accent); }

/* ── Misc ── */
hr { border: none; border-top: 1px solid var(--glass-border); margin: 2rem 0; }
.mt1 { margin-top: .5rem; }
.mt2 { margin-top: 1rem; }
.mt3 { margin-top: 1.5rem; }
.text-dim { color: var(--text-dim); }
.text-sm  { font-size: .85rem; }
.text-green { color: var(--green); text-shadow: 0 0 10px var(--green-glow); }
.text-red   { color: var(--red); }
.d-flex { display: flex; gap: .8rem; align-items: center; }
.ml-auto { margin-left: auto; }

/* ── Footer ── */
.footer {
  background: rgba(11, 13, 18, 0.8);
  border-top: 1px solid var(--glass-border);
  padding: 2.5rem 0;
  margin-top: auto;
  backdrop-filter: blur(10px);
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: .9rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.footer-logo { font-family: 'Rajdhani', sans-serif; font-size: 1.4rem; font-weight: 700; color: #fff; }
.footer-logo span { color: var(--accent); }
.footer-links { display: flex; gap: 1.5rem; margin-left: auto; }
.footer-links a { color: var(--text-dim); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: #fff; }

/* ── Scrollbar (Custom) ── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: #2d3648; border-radius: 4px; border: 2px solid var(--bg-base); }
::-webkit-scrollbar-thumb:hover { background: #414e66; }

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .stats-bar { gap: 2rem; padding: 1.5rem; }
  .stat:not(:last-child)::after { display: none; }
  .nav { padding: 0 1rem; }
  .nav-links { gap: .8rem; }
  .hero { padding: 3rem 1rem 2rem; }
  .profile-header { flex-direction: column; text-align: center; gap: 1rem; }
}