/* 🎮 Gaming Continental — Mobile-First Style */

:root {
  --bg: #0f172a;
  --card: #111827;
  --accent: #2563eb;
  --muted: #94a3b8;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg);
  color: white;
  min-height: 100vh;
  line-height: 1.5;
}

/* ---------- NAVBAR ---------- */
.nav {
  background: #0b1220;
  padding: 16px 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-bottom: 1px solid #1e293b;
  flex-wrap: wrap;
  gap: 8px;
}

.nav a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  flex: 1;
  text-align: center;
  min-width: 60px;
}

.nav a:hover {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.1);
}

/* ---------- LAYOUT ---------- */
.center {
  padding: 20px 16px;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

/* ---------- CARDS ---------- */
.card,
.left-card,
.right-card {
  background: var(--card);
  padding: 24px 20px;
  border-radius: 16px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
  width: 100%;
  border: 1px solid #1e293b;
}

.left-card {
  background: linear-gradient(135deg, #1f2937, #0b1220);
  border-left: 4px solid var(--accent);
}

.right-card {
  text-align: center;
}

/* ---------- AUTH PAGES (Index/Register) ---------- */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  padding: 20px 16px;
}

.auth-card {
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 32px 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
  border: 1px solid #1e293b;
  width: 100%;
  max-width: 400px;
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.auth-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: white;
}

.auth-subtitle {
  color: var(--muted);
  font-size: 1rem;
}

/* ---------- FORMS ---------- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #e2e8f0;
  font-size: 0.95rem;
}

.form-input {
  width: 100%;
  padding: 16px 20px;
  background: #1e293b;
  color: white;
  border: 2px solid #334155;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.form-input::placeholder {
  color: #64748b;
}

/* ---------- BUTTONS ---------- */
.btn {
  width: 100%;
  padding: 18px 24px;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #1d4ed8);
  color: white;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: #374151;
  color: white;
}

.btn-secondary:active {
  background: #4b5563;
  transform: translateY(1px);
}

/* ---------- AUTH LINKS ---------- */
.auth-link {
  text-align: center;
  margin-top: 24px;
  font-size: 0.95rem;
  color: var(--muted);
}

.auth-link a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.3s ease;
}

.auth-link a:active {
  color: #1d4ed8;
}

/* ---------- MESSAGES ---------- */
.message {
  padding: 16px;
  border-radius: 12px;
  margin-top: 16px;
  font-weight: 600;
  text-align: center;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.message.success {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success);
  border: 2px solid rgba(34, 197, 94, 0.3);
}

.message.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 2px solid rgba(239, 68, 68, 0.3);
}

.message.info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent);
  border: 2px solid rgba(59, 130, 246, 0.3);
}

.message.warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border: 2px solid rgba(245, 158, 11, 0.3);
}

/* ---------- LOADING STATES ---------- */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ---------- TOURNAMENTS ---------- */
.center .grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.tournament-card {
  background: #0b1320;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
  border: 1px solid #1e293b;
}

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

.tournament-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.tournament-card .info {
  padding: 20px;
}

.tournament-card h4 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.tournament-card .meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.4;
}

.tournament-card button {
  margin-top: 8px;
}

/* ---------- BALANCE ---------- */
.balance-value {
  font-size: 2rem;
  margin-top: 8px;
  color: #fff;
  font-weight: 800;
}

/* ---------- FOOTER ---------- */
footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #0b1220;
  border-top: 1px solid #1e293b;
  display: flex;
  justify-content: space-around;
  padding: 12px 16px;
  z-index: 100;
}

footer .footer-item {
  text-align: center;
  cursor: pointer;
  flex: 1;
  transition: transform 0.2s ease;
}

footer .footer-item:active {
  transform: scale(0.9);
}

footer .footer-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e293b;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 6px;
  font-size: 1.3rem;
  color: var(--accent);
  transition: background 0.3s ease;
}

footer .footer-label {
  font-size: 0.75rem;
  color: #cbd5e1;
  font-weight: 500;
}

/* ---------- RESPONSIVE ENHANCEMENTS ---------- */
@media (max-width: 480px) {
  .nav {
    padding: 12px 8px;
    gap: 4px;
  }
  
  .nav a {
    font-size: 0.8rem;
    padding: 6px 8px;
  }
  
  .auth-card {
    padding: 24px 20px;
    margin: 0 8px;
  }
  
  .auth-title {
    font-size: 1.6rem;
  }
  
  .form-input {
    padding: 14px 16px;
  }
  
  .btn {
    padding: 16px 20px;
    font-size: 1rem;
  }
  
  footer {
    padding: 10px 12px;
  }
  
  footer .footer-circle {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }
}

@media (max-width: 320px) {
  .nav {
    flex-direction: column;
    gap: 8px;
  }
  
  .auth-icon {
    font-size: 2.5rem;
  }
  
  .auth-title {
    font-size: 1.4rem;
  }
  
  .center {
    padding: 16px 12px;
  }
}

@media (min-width: 768px) {
  .center {
    max-width: 500px;
  }
  
  .center .grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

/* ---------- PASSWORD TOGGLE (Optional Enhancement) ---------- */
.password-wrapper {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 8px;
}

/* ---------- INPUT VALIDATION STATES ---------- */
.form-input.valid {
  border-color: var(--success);
}

.form-input.invalid {
  border-color: var(--danger);
}

/* ---------- ACCESSIBILITY ---------- */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles for keyboard navigation */
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}