/* css/main.css - The Tomb of Amun-Ra Theme & Layout */
:root {
  --bg-dark: #0d0f12;
  --bg-panel: #161a22;
  --bg-card: #1f2430;
  --gold-primary: #e6b800;
  --gold-light: #ffd700;
  --gold-glow: rgba(230, 184, 0, 0.4);
  --sand-accent: #c2a649;
  --crimson-trap: #d32f2f;
  --crimson-glow: rgba(211, 47, 47, 0.5);
  --lapis-blue: #1976d2;
  --text-main: #f5f5f7;
  --text-muted: #9ba1b0;
  --border-gold: rgba(230, 184, 0, 0.3);
  --font-heading: 'Cinzel', 'Trajan Pro', 'Georgia', serif;
  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.6);
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(230, 184, 0, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 10% 90%, rgba(25, 118, 210, 0.05) 0%, transparent 40%),
    linear-gradient(180deg, #090a0d 0%, #12141a 100%);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, .cinzel {
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h1 {
  font-size: 2.2rem;
  color: var(--gold-light);
  text-shadow: 0 2px 10px var(--gold-glow);
}

/* App Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: rgba(18, 20, 26, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-gold);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Announcement Banner */
.announcement-banner {
  background: linear-gradient(90deg, #2b1f06 0%, #171306 50%, #2b1f06 100%);
  border-bottom: 1px solid var(--gold-primary);
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 95;
  transition: all 0.3s ease;
}

.announcement-banner.banner-gold {
  background: linear-gradient(90deg, #3d2b07 0%, #211704 50%, #3d2b07 100%);
  border-bottom-color: var(--gold-light);
  color: var(--gold-light);
}

.announcement-banner.banner-info {
  background: linear-gradient(90deg, #092644 0%, #061629 50%, #092644 100%);
  border-bottom-color: #2196f3;
  color: #90caf9;
}

.announcement-banner.banner-warning {
  background: linear-gradient(90deg, #421b07 0%, #260e02 50%, #421b07 100%);
  border-bottom-color: #ff9800;
  color: #ffcc80;
}

.announcement-banner.banner-event {
  background: linear-gradient(90deg, #330b3b 0%, #1a041f 50%, #330b3b 100%);
  border-bottom-color: #e040fb;
  color: #f48fb1;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 auto;
  font-weight: 600;
  text-align: center;
}

.banner-icon {
  font-size: 1.2rem;
}

.banner-close-btn {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 4px;
}

.banner-close-btn:hover {
  color: #fff;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  font-size: 1.8rem;
  color: var(--gold-primary);
}

.logo-text {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gold-light);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Buttons */
.btn {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gold-primary);
  background: linear-gradient(180deg, #2a2208 0%, #171203 100%);
  color: var(--gold-light);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #3d310a 0%, #261e05 100%);
  border-color: var(--gold-light);
  box-shadow: 0 0 14px var(--gold-glow);
  transform: translateY(-2px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: #444;
  color: #888;
  background: #1a1a1a;
}

.btn-primary {
  background: linear-gradient(180deg, #e6b800 0%, #9e7d00 100%);
  color: #121212;
  border-color: #ffe066;
  text-shadow: none;
  font-weight: 700;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffc700 0%, #b38e00 100%);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.btn-danger {
  background: linear-gradient(180deg, #9b111e 0%, #5a0a11 100%);
  border-color: #ff4d4d;
  color: #fff;
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(180deg, #bd1827 0%, #750d17 100%);
  box-shadow: 0 0 15px var(--crimson-glow);
}

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

/* Lobby Container */
.lobby-container {
  max-width: 900px;
  margin: 30px auto;
  padding: 24px;
  width: 95%;
}

.lobby-hero {
  text-align: center;
  margin-bottom: 30px;
}

.lobby-hero h1 {
  font-size: 2.8rem;
  margin-bottom: 8px;
}

.lobby-hero p {
  color: var(--sand-accent);
  font-size: 1.1rem;
}

.lobby-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.card-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-main);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card-panel:hover {
  border-color: var(--gold-light);
}

.card-panel h2 {
  font-size: 1.3rem;
  color: var(--gold-light);
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(230, 184, 0, 0.2);
  padding-bottom: 8px;
}

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

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

.form-input {
  width: 100%;
  padding: 12px;
  background: #0d0f14;
  border: 1px solid #2a3142;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 8px var(--gold-glow);
}

/* Avatar Color Selector */
.avatar-picker {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.avatar-color-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.avatar-color-btn:hover {
  transform: scale(1.15);
}

.avatar-color-btn.selected {
  border-color: #fff;
  transform: scale(1.2);
  box-shadow: 0 0 10px #fff;
}

.color-red { background: #e53935; }
.color-blue { background: #1e88e5; }
.color-green { background: #43a047; }
.color-yellow { background: #fdd835; }
.color-white { background: #eceff1; }
.color-black { background: #263238; border: 1px solid #546e7a; }

/* Waiting Room */
.waiting-room {
  text-align: center;
}

.room-code-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #0a0c10;
  border: 2px dashed var(--gold-primary);
  padding: 12px 28px;
  border-radius: var(--radius-md);
  margin: 16px 0 24px;
}

.room-code-badge .code {
  font-size: 2.2rem;
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 4px;
}

.players-lobby-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 20px 0 30px;
}

.player-lobby-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid #333d52;
  padding: 8px 16px;
  border-radius: 30px;
}

.player-token-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: 0 0 6px currentColor;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: var(--shadow-main);
  position: relative;
  transform: scale(0.95);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(22, 26, 34, 0.95);
  border-left: 4px solid var(--gold-primary);
  border-top: 1px solid #2d3345;
  border-right: 1px solid #2d3345;
  border-bottom: 1px solid #2d3345;
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-main);
  font-size: 0.95rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .app-header {
    padding: 10px 14px;
  }
  .logo-text {
    font-size: 1.1rem;
  }
  .lobby-hero h1 {
    font-size: 2rem;
  }
  .btn {
    padding: 8px 14px;
    font-size: 0.85rem;
  }
}

/* App Footer */
.app-footer {
  text-align: center;
  padding: 24px 16px 80px;
  font-size: 0.85rem;
  color: var(--sand-accent);
  letter-spacing: 0.5px;
  border-top: 1px solid rgba(230, 184, 0, 0.15);
  margin-top: auto;
  background: rgba(9, 10, 15, 0.95);
}

.footer-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.footer-copyright {
  opacity: 0.85;
  font-size: 0.8rem;
}

/* Leaderboard Modal & Tabs */
.leaderboard-modal-box {
  max-width: 800px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.leaderboard-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(230, 184, 0, 0.25);
  padding-bottom: 8px;
}

.btn-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-tab:hover {
  color: #fff;
  background: rgba(230, 184, 0, 0.1);
}

.btn-tab.active {
  background: rgba(230, 184, 0, 0.2);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.leaderboard-stats-ribbon {
  display: flex;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(230, 184, 0, 0.15);
  padding: 10px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--sand-accent);
}

.leaderboard-table-wrapper {
  max-height: 380px;
  overflow-y: auto;
  border: 1px solid #232a3b;
  border-radius: 6px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.leaderboard-table th {
  background: #11141c;
  padding: 10px 14px;
  color: var(--sand-accent);
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid #2d3345;
}

.leaderboard-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #1a202c;
}

.leaderboard-table tr:hover td {
  background: rgba(230, 184, 0, 0.05);
}

.rank-badge {
  font-weight: 700;
  font-size: 1rem;
}

.rank-1 { color: #ffd700; }
.rank-2 { color: #e0e0e0; }
.rank-3 { color: #cd7f32; }

.player-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
}
