/* ================= MODERN GAMING AESTHETIC ================= */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Space+Mono:wght@400;700&family=Orbitron:wght@400;700&display=swap');

:root {
  --bg-primary: #0a0e27;
  --bg-secondary: #1a1f3a;
  --bg-card: #252b4a;
  --accent-primary: #ff6b35;
  --accent-secondary: #f7931e;
  --accent-gold: #ffd700;
  --text-primary: #e0e6ed;
  --text-secondary: #a0a8b8;
  --success: #4ecdc4;
  --danger: #ff6b6b;
  --warning: #ffe66d;
  --info: #4d96ff;
  --border: #3a4466;
  --shadow: rgba(0, 0, 0, 0.5);
  --gradient-primary: linear-gradient(135deg, #ff6b35, #f7931e);
  --gradient-success: linear-gradient(135deg, #4ecdc4, #44a08d);
  --gradient-danger: linear-gradient(135deg, #ff6b6b, #ff4757);
  --gradient-gold: linear-gradient(135deg, #ffd700, #ffa500);
}

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

body {
  background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1535 100%);
  color: var(--text-primary);
  font-family: 'Space Mono', monospace;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 50%, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(78, 205, 196, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 20%, rgba(77, 150, 255, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ================= LOADER ================= */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loader-logo {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1.3em, 7vw, 2.5em);
  color: var(--accent-primary);
  margin-bottom: 24px;
  text-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
  animation: glow 2s ease-in-out infinite alternate;
  text-align: center;
  max-width: 92vw;
  line-height: 1.25;
  padding: 0 12px;
  word-break: break-word;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
  opacity: 0;
  animation: fadeIn 0.5s ease 0.3s forwards;
}

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

/* ================= HEADER ================= */
.app-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
  position: relative;
}

.app-header h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(1.5em, 5vw, 2.5em);
  color: var(--accent-primary);
  text-shadow: 0 0 20px rgba(255, 107, 53, 0.5), 0 4px 0 rgba(0, 0, 0, 0.3);
  margin-bottom: 10px;
  animation: glow 2s ease-in-out infinite alternate;
}

.current-user {
  background: var(--bg-secondary);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 15px;
  border-radius: 25px;
  border: 1px solid var(--border);
  font-size: 0.9em;
}

.current-user .badge-admin {
  background: var(--gradient-gold);
  color: var(--bg-primary);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.8em;
  font-weight: bold;
}

/* ================= CARD SYSTEM ================= */
.card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 10px 30px var(--shadow);
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.card:hover::before {
  transform: scaleX(1);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6);
  border-color: var(--accent-primary);
}

.card-title {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(0.9em, 2.5vw, 1.2em);
  color: var(--accent-secondary);
  margin-bottom: 20px;
  text-shadow: 0 2px 4px var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ================= TABS ================= */
.tabs-container {
  position: relative;
  margin-bottom: 30px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 25px;
  flex-wrap: wrap;
  overflow-x: auto;
  padding-bottom: 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-primary) var(--bg-primary);
}

.tab {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 12px 20px;
  cursor: pointer;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-size: clamp(0.75em, 1.8vw, 0.9em);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
}

.tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.2), transparent);
  transition: left 0.5s ease;
}

.tab:hover::before {
  left: 100%;
}

.tab:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.tab.active {
  background: var(--gradient-primary);
  color: white;
  border-color: var(--accent-primary);
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
  transform: translateY(-2px);
}

.tab-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.8em;
  min-width: 20px;
  text-align: center;
}

.tab-content {
  display: none;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-content.active {
  display: block;
}

/* ================= RESPONSIVE GRIDS ================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ================= STAT CARDS ================= */
.stat-card {
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-primary);
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

.stat-card.trend-up::after {
  content: '📈';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2em;
}

.stat-card.trend-down::after {
  content: '📉';
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2em;
}

.stat-value {
  font-size: clamp(1.8em, 6vw, 2.8em);
  font-weight: 700;
  color: var(--accent-primary);
  margin: 10px 0;
  text-shadow: 0 2px 4px var(--shadow);
  font-family: 'Orbitron', sans-serif;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-change {
  font-size: 0.8em;
  margin-top: 5px;
}

.stat-change.positive {
  color: var(--success);
}

.stat-change.negative {
  color: var(--danger);
}

/* ================= TABLES ================= */
.table-responsive {
  overflow-x: auto;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 600px;
}

thead {
  background: var(--gradient-primary);
}

th {
  padding: 16px;
  text-align: center;
  font-weight: 700;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-size: clamp(0.8em, 2vw, 1em);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
}

th:last-child {
  border-right: none;
}

tbody tr {
  background: var(--bg-secondary);
  transition: all 0.3s ease;
}

tbody tr:nth-child(even) {
  background: var(--bg-card);
}

tbody tr:hover {
  background: rgba(255, 107, 53, 0.1);
  transform: scale(1.01);
}

td {
  padding: 14px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: clamp(0.8em, 2vw, 0.95em);
}

.rank-1 { 
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05)) !important;
  border-left: 4px solid var(--accent-gold);
}
.rank-2 { 
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(192, 192, 192, 0.05)) !important;
  border-left: 4px solid #c0c0c0;
}
.rank-3 { 
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(205, 127, 50, 0.05)) !important;
  border-left: 4px solid #cd7f32;
}

/* ================= FORMS ================= */
.form-group {
  margin-bottom: 25px;
  position: relative;
}

.form-group label {
  display: block;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.9em;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-control {
  background: var(--bg-primary);
  color: var(--text-primary);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  font-family: 'Space Mono', monospace;
  font-size: 15px;
  width: 100%;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.2);
  transform: translateY(-2px);
}

.form-control::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

/* ================= BUTTONS ================= */
.btn {
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
  min-height: 48px;
  min-width: 100px;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
}

.btn:active {
  transform: translateY(-1px);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 14px;
  min-height: 42px;
  min-width: 80px;
}

.btn-lg {
  padding: 18px 36px;
  font-size: 16px;
  min-height: 56px;
  min-width: 120px;
}

.btn-secondary {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  box-shadow: none;
}

.btn-success {
  background: var(--gradient-success);
}

.btn-danger {
  background: var(--gradient-danger);
}

.btn-warning {
  background: var(--gradient-gold);
  color: var(--bg-primary);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--accent-primary);
  color: var(--accent-primary);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

/* ================= PLAYER CARDS ================= */
.player-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.player-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-primary);
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

.player-card.premium {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.1), var(--bg-secondary));
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border);
}

.player-name {
  font-weight: 700;
  font-size: 1.3em;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-score {
  font-size: 1.8em;
  font-weight: 700;
  color: var(--accent-primary);
  font-family: 'Orbitron', sans-serif;
}

.player-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 15px;
}

.player-stat {
  text-align: center;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.player-stat:hover {
  transform: translateY(-2px);
  background: var(--bg-card);
}

.player-stat-value {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--success);
  font-family: 'Orbitron', sans-serif;
}

.player-stat-label {
  font-size: 0.8em;
  color: var(--text-secondary);
  margin-top: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ================= ACHIEVEMENTS ================= */
.achievements-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.achievement-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--gradient-gold);
  color: var(--bg-primary);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(255, 215, 0, 0.3);
  animation: pulse 2s ease-in-out infinite;
  transition: all 0.3s ease;
}

.achievement-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(255, 215, 0, 0.5);
}

/* ================= GAME CATALOG ================= */
.catalog-item {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.catalog-item:hover {
  transform: translateY(-5px);
  border-color: var(--accent-primary);
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.3);
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 15px;
}

.catalog-name {
  font-weight: 700;
  font-size: 1.2em;
  color: var(--accent-gold);
  flex: 1;
}

.catalog-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-gold);
  font-weight: bold;
}

.catalog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.catalog-tag {
  background: var(--bg-primary);
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.8em;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 5px;
}

.catalog-details {
  color: var(--text-secondary);
  font-size: 0.9em;
  margin-top: 15px;
}

.catalog-detail {
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================= MODALS ================= */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  max-width: 90%;
  width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

@keyframes slideUp {
  from { transform: translateY(60px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.8em;
  cursor: pointer;
  padding: 5px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  z-index: 1001;
}

.modal-close:hover {
  background: var(--bg-primary);
  color: var(--danger);
  transform: rotate(90deg);
}

/* ================= CHAT ================= */
.chat-container {
  background: var(--bg-primary);
  border-radius: 16px;
  height: 500px;
  display: flex;
  flex-direction: column;
  border: 2px solid var(--border);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.chat-message {
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 8px 12px;
  max-width: 78%;
  position: relative;
  animation: messageIn 0.3s ease;
  word-break: break-word;
  border-bottom-left-radius: 4px;
}

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

.chat-message.own {
  background: var(--gradient-primary);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 14px;
}

.chat-message.own .chat-sender { display: none; }

.chat-message.admin {
  border-left: 4px solid var(--accent-gold);
}

.chat-message-system {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  max-width: 100%;
  text-align: center;
  font-style: italic;
  color: var(--text-secondary);
  border-radius: 10px;
  align-self: center;
}

.chat-sender {
  font-weight: 700;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82em;
}

.chat-badge-admin {
  background: var(--gradient-gold);
  color: var(--bg-primary);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.78em;
  font-weight: bold;
}

.chat-time {
  font-size: 0.7em;
  opacity: 0.7;
  margin-top: 4px;
  text-align: right;
}

.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-top: 2px solid var(--border);
  background: var(--bg-secondary);
  align-items: center;
  flex-wrap: nowrap;
}

.chat-input {
  flex: 1 1 auto;
  min-width: 0;
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: 22px;
  padding: 12px 18px;
  color: var(--text-primary);
  font-family: 'Space Mono', monospace;
  font-size: 15px;
  transition: border-color 0.2s ease;
}

.chat-input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.chat-send-btn, .chat-icon-btn {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.chat-send-btn { background: var(--gradient-primary); color: #fff; }
.chat-icon-btn { background: var(--bg-primary); color: var(--text-secondary); border: 1px solid var(--border); }
.chat-send-btn:active, .chat-icon-btn:active { transform: scale(0.92); }
.chat-send-btn:hover { filter: brightness(1.05); }

.chat-search-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 16px;
  margin: 4px 0 12px;
  color: var(--text-primary);
  font-family: 'Space Mono', monospace;
  font-size: 13px;
  opacity: 0.85;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.chat-search-input:focus { outline: none; opacity: 1; border-color: var(--accent-primary); }

.chat-seen {
  font-size: 0.62em;
  margin-top: 3px;
  text-align: right;
  opacity: 0.85;
}
.chat-message.own .chat-seen { color: rgba(255,255,255,0.85); }
.chat-seen.seen { font-weight: 700; }
.chat-message.own .chat-seen.seen { color: #cdeffd; }

.btn-x-small {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  min-height: 30px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  padding: 0;
  background: var(--danger, #e74c3c);
  color: #fff;
  transition: transform 0.15s ease;
}
.btn-x-small:active { transform: scale(0.9); }

.online-presence-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 8px 14px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  font-size: 0.82em;
  color: var(--text-secondary);
}
.online-presence-strip .op-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2ecc71; display: inline-block; margin-right: 6px;
  box-shadow: 0 0 0 3px rgba(46,204,113,0.18);
}
.online-presence-strip .op-user {
  display: inline-flex; align-items: center;
  color: var(--text-primary); font-weight: 600;
}

/* ================= POLLS ================= */
.poll-card {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  transition: all 0.3s ease;
}

.poll-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
}

.poll-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

.poll-meta {
  color: var(--text-secondary);
  font-size: 0.9em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.poll-status {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: bold;
}

.poll-status.active {
  background: rgba(78, 205, 196, 0.2);
  color: var(--success);
}

.poll-status.closed {
  background: rgba(255, 107, 107, 0.2);
  color: var(--danger);
}

.poll-option {
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 15px;
  margin: 12px 0;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.poll-option:hover {
  border-color: var(--accent-primary);
  transform: translateX(5px);
}

.poll-option.voted {
  border-color: var(--success);
  background: rgba(78, 205, 196, 0.1);
}

.poll-bar-container {
  height: 24px;
  background: var(--bg-secondary);
  border-radius: 12px;
  margin-top: 10px;
  overflow: hidden;
  position: relative;
}

.poll-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 12px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.poll-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.poll-percentage {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: white;
  font-weight: bold;
  font-size: 0.9em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.poll-voters {
  margin-top: 10px;
  font-size: 0.85em;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.poll-voter {
  background: var(--bg-secondary);
  padding: 4px 10px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* ================= NOTIFICATIONS ================= */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 350px;
}

.notification {
  background: var(--bg-card);
  border-left: 5px solid var(--success);
  border-radius: 12px;
  padding: 18px 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  animation: slideInRight 0.3s ease, slideOutRight 0.3s ease 2.7s forwards;
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--border);
}

.notification.error {
  border-left-color: var(--danger);
}

.notification.warning {
  border-left-color: var(--warning);
}

.notification.info {
  border-left-color: var(--info);
}

.notification-icon {
  font-size: 1.5em;
}

.notification-content {
  flex: 1;
}

.notification-title {
  font-weight: bold;
  margin-bottom: 5px;
}

.notification-message {
  color: var(--text-secondary);
  font-size: 0.95em;
}

@keyframes slideInRight {
  from { transform: translateX(400px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(400px); opacity: 0; }
}

/* ================= CALENDAR ================= */
.calendar {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 20px;
  border: 2px solid var(--border);
  max-width: 800px;
  margin: 0 auto;
  overflow-x: auto;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: nowrap;
  gap: 10px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  min-width: 300px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg-primary);
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 35px;
  min-height: 35px;
}

.calendar-day:hover {
  background: var(--accent-primary);
  color: white;
  transform: scale(1.1);
}

.calendar-day.event {
  background: rgba(78, 205, 196, 0.2);
  border: 2px solid var(--success);
}

.calendar-day.today {
  background: var(--gradient-primary);
  color: white;
  font-weight: bold;
}

/* ================= BADGES ================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: bold;
}

.badge-primary {
  background: rgba(255, 107, 53, 0.2);
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
}

.badge-success {
  background: rgba(78, 205, 196, 0.2);
  color: var(--success);
  border: 1px solid var(--success);
}

.badge-warning {
  background: rgba(255, 230, 109, 0.2);
  color: var(--warning);
  border: 1px solid var(--warning);
}

.badge-danger {
  background: rgba(255, 107, 107, 0.2);
  color: var(--danger);
  border: 1px solid var(--danger);
}

.badge-info {
  background: rgba(77, 150, 255, 0.2);
  color: var(--info);
  border: 1px solid var(--info);
}

/* ================= GAME LIST ================= */
.game-list-container {
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}

.game-list-item {
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 15px;
  margin: 10px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.game-list-item:hover {
  border-color: var(--accent-primary);
  transform: translateX(5px);
}

.game-list-info {
  flex: 1;
}

.game-list-game {
  font-weight: bold;
  color: var(--accent-gold);
  font-size: 1.1em;
}

.game-list-user {
  color: var(--text-secondary);
  font-size: 0.9em;
  margin-top: 5px;
}

.game-list-date {
  color: var(--text-secondary);
  font-size: 0.8em;
}

.game-list-actions {
  display: flex;
  gap: 10px;
}

/* ================= SCROLLBAR ================= */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: var(--gradient-primary);
  border-radius: 6px;
  border: 2px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-secondary);
}

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 1200px) {
  .container {
    padding: 15px;
  }
  
  .player-grid,
  .catalog-grid,
  .history-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .app-header h1 {
    font-size: 1.8em;
  }
  
  .tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 10px;
    margin-bottom: 15px;
    flex-direction: row !important;
    width: 100%;
  }
  
  .tabs::-webkit-scrollbar {
    display: none;
  }
  
  .tab {
    width: auto !important;
    min-width: 120px;
    font-size: 0.85em;
    padding: 10px 15px;
    justify-content: center;
    flex: 0 0 auto;
  }
  
  .tab-badge {
    min-width: 18px;
    font-size: 0.7em;
    padding: 1px 6px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .player-grid,
  .catalog-grid,
  .history-grid {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .modal-content {
    width: 95%;
    padding: 20px;
  }
  
  .btn-group {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .chat-container {
    height: 400px;
  }
  
  .form-control, 
  .chat-input,
  .session-player-score {
      padding: 16px 14px !important;
      font-size: 16px !important;
      min-height: 48px;
  }
  
  .btn {
      min-height: 48px;
      padding: 14px 20px !important;
  }
  
  .btn-sm {
      min-height: 42px;
      padding: 10px 16px !important;
  }
  
  .modal-content {
      width: 95% !important;
      max-width: 95% !important;
      padding: 15px !important;
      margin: 10px !important;
  }
  
  .modal-header {
      flex-direction: column;
      align-items: flex-start;
      gap: 10px;
  }
  
  .modal-header h2 {
      font-size: 1.2em !important;
  }
  
  .table-responsive {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      margin: 0 -15px;
      padding: 0 15px;
  }
  
  table {
      min-width: 800px;
  }
  
  th, td {
      padding: 12px 8px !important;
      font-size: 0.85em !important;
  }
  
  .calendar-grid {
      gap: 4px !important;
      min-width: 0 !important;
  }
  
  .calendar-day {
      min-width: 0 !important;
      min-height: 34px !important;
      font-size: 0.8em !important;
      border-radius: 8px !important;
  }
  
  .chat-container {
      height: 350px !important;
  }
  
  .chat-input-area {
      padding: 10px 12px !important;
      flex-wrap: nowrap;
      gap: 8px;
  }
  
  .chat-input {
      min-height: 44px;
      font-size: 16px !important;
  }
  
  .chat-send-btn, .chat-icon-btn {
      width: 44px !important;
      height: 44px !important;
      min-height: 44px;
  }
  
  .chat-message {
      max-width: 90% !important;
      padding: 12px !important;
  }
}

@media (max-width: 480px) {
  .app-header h1 {
    font-size: 1.5em;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .card {
    padding: 20px;
  }
  
  .modal-content {
    padding: 15px;
  }
  
  .player-stats {
    grid-template-columns: 1fr;
  }
  
  .chat-message {
    max-width: 95%;
  }
  
  .app-header h1 {
    font-size: 1.3em !important;
    line-height: 1.2;
    margin-bottom: 8px;
  }
  
  .current-user {
    padding: 6px 12px;
    font-size: 0.8em;
  }
  
  .player-grid,
  .catalog-grid,
  .session-players-grid {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
  }
  
  .player-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  
  .chat-container {
    height: 350px !important;
  }
  
  body {
    font-size: 14px;
  }
  
  .card-title {
    font-size: 1em !important;
    margin-bottom: 15px !important;
  }
  
  .stat-value {
    font-size: 1.8em !important;
  }
  
  h2, h3, h4 {
    font-size: 1.1em !important;
  }
}

/* ================= WELCOME SCREEN ================= */
.welcome-screen {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
}

.welcome-logo {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(2em, 8vw, 4em);
  color: var(--accent-primary);
  text-shadow: 0 0 30px rgba(255, 107, 53, 0.5);
  margin-bottom: 30px;
  animation: glow 2s ease-in-out infinite alternate;
}

.auth-buttons {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ================= SESSION FORM ================= */
.session-players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.session-player-card {
  background: var(--bg-primary);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 15px;
  transition: all 0.3s ease;
  position: relative;
}

.session-player-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
}

.session-player-card.absent {
  opacity: 0.6;
  background: var(--bg-card);
}

.session-player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.session-player-name {
  font-weight: bold;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-player-guest {
  color: var(--warning);
}

.session-player-score {
  width: 100%;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  text-align: center;
  transition: all 0.3s ease;
}

.session-player-score:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

/* ================= UTILITY CLASSES ================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }
.hidden { display: none !important; }
.fade-in { animation: fadeIn 0.5s ease; }
.slide-in { animation: slideIn 0.3s ease; }
.float { animation: float 3s ease-in-out infinite; }
.glow { animation: glow 2s ease-in-out infinite alternate; }

/* ================= AUDIT LOG ================= */
.audit-log {
  max-height: 400px;
  overflow-y: auto;
  padding: 15px;
  background: var(--bg-primary);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.audit-entry {
  padding: 12px;
  margin-bottom: 10px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 4px solid var(--accent-primary);
}

.audit-time {
  color: var(--text-secondary);
  font-size: 0.8em;
  margin-bottom: 5px;
}

.audit-action {
  font-size: 0.9em;
}

/* ================= ANIMATIONS ================= */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes glow {
  from { text-shadow: 0 0 20px rgba(255, 107, 53, 0.5), 0 4px 0 rgba(0, 0, 0, 0.3); }
  to { text-shadow: 0 0 30px rgba(255, 107, 53, 0.8), 0 4px 0 rgba(0, 0, 0, 0.3), 0 0 40px rgba(255, 107, 53, 0.3); }
}

/* ================= TOUCH OPTIMIZATIONS ================= */
@media (hover: none) and (pointer: coarse) {
  .btn:active, 
  .tab:active,
  .card:active {
    opacity: 0.7;
    transform: scale(0.98);
    transition: all 0.1s ease;
  }
  
  input:focus, 
  select:focus, 
  textarea:focus {
    font-size: 16px !important;
  }
}

/* Safe areas pentru iPhone cu notch */
@supports (padding: max(0px)) {
  .container {
    padding-top: max(24px, env(safe-area-inset-top));
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
  
  .btn, .tab {
    padding-left: max(15px, env(safe-area-inset-left));
    padding-right: max(15px, env(safe-area-inset-right));
  }
}
/* === i18n / tab tweaks === */
/* Ascunde numerele (badge) de lângă tab-uri */
.tab-badge { display: none !important; }
/* Pe ecrane mici: tab-ul neselectat = doar iconiță, îngust (încap mai multe);
   tab-ul selectat = iconiță + text, lățime normală */
@media (max-width: 768px) {
  .tab:not(.active) > span[data-i18n] { display: none; }
  .tab:not(.active) { min-width: 0 !important; padding: 10px 14px !important; }
  .tab { gap: 6px; }
}
