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

body {
  background: #000;
  background-image: repeating-linear-gradient(45deg, #0f0 0px, #0f0 2px, #000 2px, #000 12px);
  font-family: 'Courier New', 'Comic Sans MS', 'Impact', 'Space Mono', monospace;
  color: #f0f;
  text-shadow: 0 0 2px #0f0, 0 0 4px #f0f;
  min-height: 100vh;
  padding: 8px;
  position: relative;
}

/* Неоновая рамка (теперь не мешает) */
body::before {
  content: "";
  position: fixed;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  pointer-events: none;
  border: 2px solid #f0c;
  box-shadow: 0 0 10px #0f0, 0 0 5px #f0c inset;
  animation: blinkBorder 1s infinite alternate;
  z-index: 9999;
  border-radius: 16px;
}

@keyframes blinkBorder {
  0% { border-color: #f0c; box-shadow: 0 0 5px #0f0, 0 0 10px #f0c inset; }
  100% { border-color: #0f0; box-shadow: 0 0 20px #f0c, 0 0 30px #0f0 inset; }
}

.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}
.screen.active {
  display: flex;
}

/* ===== Анимированный фон с сеткой ===== */
@keyframes moveGrid {
  0% { background-position: 0 0; }
  100% { background-position: 40px 40px; }
}
.screen.active {
  background-image: 
    linear-gradient(rgba(0,255,0,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,0,0.1) 1px, transparent 1px);
  background-size: 30px 30px;
  animation: moveGrid 20s linear infinite;
}

/* ===== Нижняя навигация ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(12px);
  border-top: 2px solid #f0f;
  padding: 8px 12px;
  gap: 8px;
  z-index: 100;
  justify-content: space-around;
}
.nav-item {
  flex: 1;
  background: #111;
  border: 2px solid #0f0;
  color: #0f0;
  padding: 10px 0;
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.1s ease;
  text-align: center;
  box-shadow: 0 2px 0 #f0f;
}
.nav-item.active {
  background: #f0c;
  color: #000;
  border-color: #ff0;
  box-shadow: 0 0 12px #f0c;
}
.nav-item:active {
  transform: translateY(2px);
  box-shadow: none;
}

/* Хедер */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid #f0f;
  position: sticky;
  top: 0;
  z-index: 99;
}
.header-brand {
  font-size: 18px;
  font-weight: bold;
  background: linear-gradient(45deg, #f0c, #0f0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.points-badge, .admin-badge {
  background: #000;
  border: 2px solid #0f0;
  border-radius: 40px;
  padding: 6px 14px;
  font-weight: bold;
  font-size: 14px;
}
.player-name {
  font-size: 14px;
  color: #fa0;
}

/* Основной контент с отступом под навигацию */
.main-content {
  flex: 1;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 12px 80px 12px;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* Карточки событий */
.event-card, .admin-event-card, .player-row, .lb-row {
  background: rgba(0,0,0,0.85);
  border: 2px solid #f0f;
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 4px 4px 0px #0f0;
  transition: transform 0.1s ease, box-shadow 0.1s;
}
.event-card:hover, .admin-event-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px #fa0;
  border-color: #fa0;
}
.event-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.status-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: bold;
}
.status-open { background: #0f0; color: #000; }
.status-closed { background: #fa0; color: #000; }
.status-resolved { background: #f0f; color: #000; }

/* Прогресс-бар времени */
.time-progress {
  margin: 12px 0;
  height: 8px;
  background: #222;
  border-radius: 4px;
  overflow: hidden;
}
.time-fill {
  height: 100%;
  background: linear-gradient(90deg, #0f0, #f0c);
  width: 100%;
  border-radius: 4px;
  transition: width 0.5s linear;
}
.deadline-timer {
  font-family: monospace;
  font-size: 13px;
  color: #fa0;
  margin-top: 6px;
}

/* Кнопки */
.btn, button {
  font-family: 'Impact', 'Courier New', monospace;
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  border: 2px solid #0f0;
  background: #111;
  color: #0f0;
  box-shadow: 2px 2px 0px #f0f;
  cursor: pointer;
  padding: 8px 16px;
  border-radius: 40px;
  transition: 0.05s linear;
}
.btn:active, button:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}
.btn-primary {
  background: #f0c;
  border-color: #ff0;
  color: #000;
}
.btn-ghost {
  background: transparent;
  border-color: #fa0;
  color: #fa0;
}
.btn-danger {
  border-color: #f30;
  color: #f30;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Поля ввода */
input, select {
  background: #000;
  border: 2px solid #0f0;
  color: #0f0;
  padding: 10px 12px;
  border-radius: 16px;
  width: 100%;
  font-family: monospace;
}
input:focus, select:focus {
  outline: none;
  border-color: #f0f;
  box-shadow: 0 0 10px #f0f;
}

/* Модалки — bottom sheet на мобилках */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(12px);
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.open {
  display: flex;
}
.modal-box {
  background: #0a0a0a;
  border: 2px solid #f0f;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
  animation: slideUp 0.2s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
  }
  .modal-box {
    border-radius: 24px;
    max-height: 80vh;
  }
}
.modal-footer {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Таблица ответов с поиском */
.search-box {
  margin: 16px 0;
}
.search-input {
  width: 100%;
  padding: 10px;
}
.answers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.answers-table th, .answers-table td {
  border: 1px solid #0f0;
  padding: 6px;
  text-align: left;
}
.answers-table th {
  background: #f0c;
  color: #000;
}

/* Анимация пульсации для кнопки ответа */
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 #0f0; }
  70% { box-shadow: 0 0 0 6px rgba(0,255,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,255,0,0); }
}
.btn-primary:active {
  animation: pulse 0.3s;
}

/* Адаптив */
@media (max-width: 640px) {
  body {
    padding: 4px;
  }
  body::before {
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border-width: 2px;
  }
  .brand-name {
    font-size: 32px;
  }
  .event-title {
    font-size: 16px;
  }
  .nav-item {
    font-size: 12px;
    padding: 6px 0;
  }
}