/* =============================================
   Leitstellenspiel - Main Stylesheet
   ============================================= */

:root {
  --bg-dark: #0a0e17;
  --bg-panel: #111827;
  --bg-card: #1a2235;
  --bg-input: #1e293b;
  --bg-hover: #243044;
  --border-color: #2a3a52;
  --border-light: #374357;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #3b82f6;
  --accent-blue-hover: #2563eb;
  --accent-red: #ef4444;
  --accent-red-glow: rgba(239, 68, 68, 0.3);
  --accent-orange: #f59e0b;
  --accent-green: #22c55e;
  --accent-purple: #a855f7;
  --accent-cyan: #06b6d4;
  --fire-color: #ef4444;
  --ems-color: #f59e0b;
  --police-color: #3b82f6;
  --thw-color: #8b5cf6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html, body {
  height: 100%;
  font-family: var(--font-main);
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden;
}

/* =============================================
   Utility Classes
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--accent-blue);
  color: white;
}
.btn-primary:hover { background: var(--accent-blue-hover); }

.btn-danger {
  background: var(--accent-red);
  color: white;
}
.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 0 20px var(--accent-red-glow);
}

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

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 600;
}

.form-group {
  margin-bottom: 16px;
}

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

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.error-msg {
  color: var(--accent-red);
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}

/* =============================================
   Landing Page
   ============================================= */

.landing-page {
  overflow-y: auto;
}

.landing-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  position: relative;
}

.landing-bg-animation {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  pointer-events: none;
}

.pulse-ring {
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  border: 1px solid rgba(59, 130, 246, 0.1);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: pulse-expand 4s ease-out infinite;
}

.pulse-ring.delay-1 { animation-delay: 1.3s; }
.pulse-ring.delay-2 { animation-delay: 2.6s; }

@keyframes pulse-expand {
  0% { width: 100px; height: 100px; opacity: 0.6; }
  100% { width: 600px; height: 600px; opacity: 0; }
}

.landing-header {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  z-index: 1;
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 80px;
  height: 80px;
  color: var(--accent-blue);
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.blink {
  animation: blink-anim 2s ease-in-out infinite;
}

.blink.delay-blink {
  animation-delay: 1s;
}

@keyframes blink-anim {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.logo h1 {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 16px;
}

.landing-main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 900px;
}

/* Auth Card */
.auth-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin-bottom: 60px;
  box-shadow: var(--shadow-lg);
}

.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
}

.auth-form h2 {
  font-size: 22px;
  margin-bottom: 24px;
  text-align: center;
}

.auth-switch {
  text-align: center;
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 14px;
}

.auth-switch a {
  color: var(--accent-blue);
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Features */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.feature {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  transition: border-color 0.3s;
}

.feature:hover {
  border-color: var(--accent-blue);
}

.feature-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.feature h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.feature p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* =============================================
   Lobby
   ============================================= */

.lobby-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lobby-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
}

.lobby-logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lobby-logo h1 {
  font-size: 20px;
}

.user-info {
  color: var(--text-secondary);
  font-size: 14px;
}

.lobby-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.lobby-section {
  margin-bottom: 32px;
}

.lobby-section h2 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.create-room-form {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
}

/* Room List */
.room-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.room-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  transition: border-color 0.2s;
  cursor: pointer;
}

.room-card:hover {
  border-color: var(--accent-blue);
}

.room-card-info h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.room-card-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

.room-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.room-card-meta .member-count {
  font-size: 13px;
  color: var(--text-secondary);
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

/* =============================================
   Scrollbar
   ============================================= */

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}
