/* === Landing Page: Leaderboard, Timeline, Create Card, Rooms, Streak === */

/* --- Leaderboard --- */

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  transition: background 0.15s ease;
}

.lb-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* Highlight current user in leaderboard */
.lb-row--me {
  background: rgba(var(--color-primary-rgb), 0.12);
  border: 1px solid rgba(var(--color-primary-rgb), 0.3);
}

.lb-row--me .lb-name {
  color: var(--color-primary);
  font-weight: 700;
}

.lb-rank {
  font-size: 13px;
  font-weight: 700;
  color: #555;
  width: 24px;
  text-align: center;
}

.lb-rank.top1 {
  color: var(--color-gold);
}

.lb-rank.top2 {
  color: var(--color-silver);
}

.lb-rank.top3 {
  color: var(--color-bronze);
}

.lb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.lb-name-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.lb-name {
  font-size: 13px;
  font-weight: 500;
  color: #ccc;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-rank-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid;
  flex-shrink: 0;
}

.lb-winrate-container {
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.lb-winrate {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
}

.lb-elo {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
}

/* --- Leaderboard Skeleton --- */
.lb-skeleton {
  pointer-events: none;
}

.skeleton-pulse {
  background: rgba(255, 255, 255, 0.05);
  animation: skeletonPulse 1.5s infinite ease-in-out;
}

@keyframes skeletonPulse {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* --- Create Card --- */

.create-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.rooms-divider {
  height: 1px;
  background: var(--color-border);
  margin: 4px 0;
}

.create-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.create-avatar {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--color-primary), #a8cc00);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  border-radius: 14px;
  flex-shrink: 0;
}

.create-user-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.create-username {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  display: flex;
  align-items: center;
}

.create-elo {
  font-size: 12px;
  color: var(--color-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
}

.create-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.create-label {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Mode Toggle --- */

.mode-toggle {
  display: flex;
  background: var(--color-surface);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  padding: 3px;
  position: relative;
}

.mode-indicator {
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(25% - 2px);
  height: calc(100% - 6px);
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: transform var(--transition-smooth), opacity 0.2s ease;
  z-index: 0;
}

.mode-btn {
  flex: 1;
  padding: 8px 0;
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: color var(--transition-base);
  border-radius: var(--radius-full);
}

.mode-btn.active {
  color: #000;
}

/* --- Mobile Grid Warning --- */

.mobile-grid-warning {
  display: none;
  font-size: 11px;
  color: var(--color-warning, #f0a500);
  margin: 4px 0 0 0;
  padding: 0;
  opacity: 0.85;
  font-weight: 500;
}

.mobile-grid-warning.visible {
  display: block;
}

/* --- Rooms --- */

.rooms-count {
  font-size: 12px;
  font-weight: 700;
  color: #000;
  background: var(--color-primary);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.rooms-list::-webkit-scrollbar,
.timeline-list::-webkit-scrollbar,
.leaderboard-list::-webkit-scrollbar {
  width: 4px;
}

.rooms-list::-webkit-scrollbar-track,
.timeline-list::-webkit-scrollbar-track,
.leaderboard-list::-webkit-scrollbar-track {
  background: transparent;
}

.rooms-list::-webkit-scrollbar-thumb,
.timeline-list::-webkit-scrollbar-thumb,
.leaderboard-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.rooms-list::-webkit-scrollbar-thumb:hover,
.timeline-list::-webkit-scrollbar-thumb:hover,
.leaderboard-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.room-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  transition: all 0.15s ease;
}

.room-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
}

.room-id {
  font-size: 11px;
  color: #555;
  font-weight: 600;
  width: 32px;
}

.room-host {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: #ccc;
}

.room-mode {
  font-size: 11px;
  color: var(--color-text-muted);
  padding: 3px 10px;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  font-weight: 500;
}

.btn-join {
  background: transparent;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-radius: var(--radius-full);
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-join:hover {
  background: var(--color-primary);
  color: #000;
}

/* --- Right Column --- */

.landing-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 300px;
  width: 100%;
  margin-left: auto;
}

/* --- Streak Card --- */

.streak-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.streak-icon {
  font-size: 32px;
  line-height: 1;
}

.streak-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.streak-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.streak-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* --- Challenges Card --- */

.challenges-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.challenges-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.challenge-row {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 110px;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.challenge-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.challenge-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.challenge-progress-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-primary);
}

.challenge-desc {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  line-height: 1.4;
}

.challenge-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.challenge-progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.challenge-row.done .challenge-title {
  color: var(--color-text-muted);
  text-decoration: line-through;
}

.challenge-row.done .challenge-progress-text {
  color: #28a745;
}

.challenge-row.done .challenge-progress-fill {
  background: #28a745;
}

/* --- Timeline --- */

.timeline-card {
  display: flex;
  flex-direction: column;
}

.timeline-list {
  display: flex;
  flex-direction: column;
  position: relative;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.timeline-list:has(.timeline-item)::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: repeating-linear-gradient(to bottom,
      rgba(168, 85, 247, 0.4) 0px,
      rgba(168, 85, 247, 0.4) 4px,
      transparent 4px,
      transparent 8px);
  border-radius: 1px;
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  position: relative;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid #1e1e2e;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.4);
}

.timeline-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.timeline-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.timeline-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 400;
}

.timeline-result {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.timeline-result.win {
  background: rgba(52, 199, 89, 0.15);
  color: var(--color-success);
}

.timeline-result.lose {
  background: rgba(255, 69, 58, 0.15);
  color: var(--color-danger);
}

/* --- Footer --- */

.landing-footer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px 20px;
  margin-top: 10px;
  gap: 10px;
  border-top: 1px solid var(--color-border);
  width: 100%;
}

.footer-contact-top {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  margin: 0;
}

.footer-contact-top p {
  margin: 0;
}

.footer-contact-top a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-contact-top a:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.footer-link-btn,
.footer-contact-link,
.social-btn {
  color: rgba(255, 255, 255, 0.4);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
}

.footer-dot {
  color: rgba(255, 255, 255, 0.2);
  font-size: 10px;
  cursor: default;
  display: flex;
  align-items: center;
}

.footer-link-btn:hover,
.footer-contact-link:hover,
.social-btn:hover {
  color: rgba(255, 255, 255, 0.8);
}

.social-btn svg {
  width: 16px;
  height: 16px;
}

/* --- Fight Computer Card --- */

.fight-computer-card {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.fight-computer-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.06), transparent);
  transition: left 0.5s ease;
}

.fight-computer-card:hover {
  border-color: rgba(168, 85, 247, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.15);
}

.fight-computer-card:hover::before {
  left: 100%;
}

.fight-computer-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

.fight-computer-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}

.fight-computer-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.fight-computer-sub {
  font-size: 13px;
  color: var(--color-text-muted);
}

.fight-computer-arrow {
  color: var(--color-text-muted);
  flex-shrink: 0;
  transition: transform 0.2s ease, color 0.2s ease;
}

.fight-computer-card:hover .fight-computer-arrow {
  transform: translateX(4px);
  color: var(--color-accent);
}

/* --- SVG Micro Animations & Styling --- */

.streak-icon svg {
  color: var(--color-primary);
  filter: drop-shadow(0 0 8px rgba(var(--color-primary-rgb), 0.6));
  transition: all 0.3s ease;
}

@keyframes pulseFire {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(var(--color-primary-rgb), 0.6)); }
  50% { transform: scale(1.15); filter: drop-shadow(0 0 16px rgba(var(--color-primary-rgb), 0.9)); }
}

@keyframes hoverFlame {
  0% { transform: translate(0px, 0px) rotate(0deg); }
  25% { transform: translate(1px, -2px) rotate(4deg); }
  50% { transform: translate(-1px, -1px) rotate(-3deg); }
  75% { transform: translate(0.5px, -2px) rotate(2deg); }
  100% { transform: translate(0px, 0px) rotate(0deg); }
}

.streak-card:hover .streak-icon svg {
  animation: pulseFire 1.5s ease-in-out infinite;
}

.streak-card:hover .streak-icon .flame-group {
  animation: hoverFlame 0.6s ease-out forwards;
}

.fight-computer-icon svg {
  color: var(--color-primary);
  filter: drop-shadow(0 0 8px rgba(var(--color-primary-rgb), 0.6));
  transition: all 0.3s ease;
}

@keyframes floatBot {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25% { transform: translateY(-4px) rotate(-5deg); filter: drop-shadow(0 0 12px rgba(var(--color-primary-rgb), 0.8)); }
  75% { transform: translateY(-4px) rotate(5deg); filter: drop-shadow(0 0 12px rgba(var(--color-primary-rgb), 0.8)); }
}

@keyframes blinkEye {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.1); }
}

.fight-computer-card:hover .fight-computer-icon svg {
  animation: floatBot 2s ease-in-out infinite;
}

.fight-computer-card:hover .fight-computer-icon .eye-left {
  animation: blinkEye 0.3s ease-in-out;
}

.fight-computer-card:hover .fight-computer-icon .eye-right {
  animation: blinkEye 0.3s ease-in-out 0.1s;
}
