:root {
  /* Цветовая палитра: глубокий темный с оранжевым акцентом */
  --bg-color: #0f111a;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;

  --accent-primary: #f97316;
  --accent-secondary: #ea580c;
  --accent-gradient: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);

  --glass-bg: rgba(30, 41, 59, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);

  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;

  --nav-height: 70px;
  --header-height: 70px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  /* Устанавливаем градиентный фон для премиального вида */
  background-image:
    radial-gradient(circle at 10% 20%, rgba(249, 115, 22, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(234, 88, 12, 0.15) 0%, transparent 40%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* Glassmorphism элементы */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--glass-shadow);
}

/* Header */
.glass-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  background: rgba(15, 17, 26, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-primary);
  padding: 2px;
}

.user-details h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.level-badge {
  font-size: 12px;
  color: var(--accent-secondary);
  font-weight: 500;
  margin: 0;
}

.bonus-pill {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fbbf24;
}

/* Page Container */
.page-container {
  padding: calc(var(--header-height) + 20px) 20px calc(var(--nav-height) + 20px);
  min-height: 100vh;
  animation: fadeIn 0.3s ease;
}

/* Typography */
h1 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 24px;
  background: var(--accent-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

p {
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* Button variants */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
  border: none;
  outline: none;
  width: 100%;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(15, 17, 26, 0.9);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  width: 60px;
  height: 100%;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-item svg {
  transition: transform 0.2s;
}

.nav-item.active {
  color: var(--accent-primary);
}

.nav-item.active svg {
  transform: translateY(-2px);
  stroke: var(--accent-primary);
  fill: rgba(139, 92, 246, 0.2);
}

/* Loaders */
.loader-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-color);
  z-index: 9999;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent-primary);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: 16px;
}

/* Utility Animations */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Common Card style (Games/Slots/History) */
.card {
  padding: 20px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #fff;
}

.card-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
}

.badge.green {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.badge.purple {
  background: rgba(139, 92, 246, 0.2);
  color: #c4b5fd;
}

/* Date Slider */
.date-slider {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 24px;
  scroll-snap-type: x mandatory;
}

.date-slider::-webkit-scrollbar {
  display: none;
}

.date-item {
  min-width: 64px;
  padding: 12px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.2s ease;
  scroll-snap-align: start;
  flex-shrink: 0;
}

.date-item.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.date-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.date-item .weekday {
  font-size: 11px;
  opacity: 0.8;
  margin-bottom: 4px;
  display: block;
}

.date-item .day {
  font-size: 18px;
  font-weight: bold;
}

.date-item .month {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 2px;
  display: block;
}

/* Slot Card */
.slot-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  transition: transform 0.2s, background 0.2s;
  user-select: none;
}

.slot-card.free {
  border-left: 4px solid var(--success);
  cursor: pointer;
}

.slot-card.free:active {
  transform: scale(0.98);
  background: rgba(255, 255, 255, 0.1);
}

.slot-card.party_game {
  border-left: 4px solid var(--warning);
  cursor: pointer;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(249, 115, 22, 0) 100%);
}

.slot-card.party_game:active {
  transform: scale(0.98);
}

.slot-card.occupied {
  border-left: 4px solid #555;
  opacity: 0.6;
  background: rgba(0, 0, 0, 0.2);
}

.slot-time {
  font-size: 18px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slot-title {
  font-size: 14px;
  margin-top: 4px;
}

.slot-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Bottom Sheet Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  align-items: flex-end;
}

.modal-overlay.open {
  display: flex;
  opacity: 1;
}

.bottom-sheet {
  background: var(--bg-color);
  width: 100%;
  max-height: 90vh;
  border-radius: 24px 24px 0 0;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow-y: auto;
  border-top: 1px solid var(--glass-border);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

.modal-overlay.open .bottom-sheet {
  transform: translateY(0);
}

.sheet-drag-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  margin: 0 auto 20px;
}

.modal-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 8px;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* Form Elements */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  padding: 12px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--accent-primary);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

/* Ссылки на документы (экран регистрации) */
.doc-link {
  display: block;
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.2);
  transition: background 0.2s, border-color 0.2s;
}

.doc-link:hover,
.doc-link:active {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.4);
}