:root {
  --bg-color: #050505;
  --bg-gradient: radial-gradient(circle at 15% 50%, rgba(88, 166, 255, 0.1), transparent 40%),
    radial-gradient(circle at 85% 30%, rgba(163, 113, 247, 0.1), transparent 40%);
  --panel-bg: rgba(255, 255, 255, 0.03);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --accent-color: #58a6ff;
  --success-color: #3fb950;
  --bronze: #cd7f32;
  --silver: #c0c0c0;
  --gold: #ffd700;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--bg-color);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.dashboard-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  width: 100%;
  padding: 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
  width: 100%;
  max-width: 1000px;
}

@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* Glassmorphism Classes */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.glass-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.glass-panel.centered-single {
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
}

.title {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(90deg, #58a6ff, #A371F7, #58a6ff);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: shine 3s linear infinite;
}

@keyframes shine {
  to {
    background-position: 200% center;
  }
}

.button {
  background-color: var(--accent-color);
  color: #161b22;
  border: none;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  font-family: 'Outfit', sans-serif;
  position: relative;
  overflow: hidden;
}

.button::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: all 0.4s ease;
  transform: skewX(-20deg);
}

.button:hover::after {
  left: 150%;
}

.button:hover {
  transform: translateY(-3px);
  background-color: #79c0ff;
  box-shadow: 0 6px 20px rgba(88, 166, 255, 0.4);
}

.level-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 15px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 10px;
}

.level-card:hover:not(.disabled) {
  transform: translateX(5px);
  border-color: rgba(88, 166, 255, 0.5);
  background: rgba(88, 166, 255, 0.05);
}

.level-card.selected {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.15), rgba(163, 113, 247, 0.15));
  border-color: #58a6ff;
  box-shadow: inset 0 0 10px rgba(88, 166, 255, 0.2);
}

.level-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(0, 0, 0, 0.5);
}

.level-icon {
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.selected .level-icon {
  background: rgba(88, 166, 255, 0.3);
  box-shadow: 0 0 10px rgba(88, 166, 255, 0.5);
}

.play-board {
  background: #111418;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
  border-radius: 16px;
  padding: 40px 20px;
  font-family: 'Chalkboard SE', 'Comic Sans MS', sans-serif;
  font-size: 1.4rem;
  color: #fff;
  text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.8);
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  word-break: keep-all;
  line-height: 1.6;
  position: relative;
}

/* Marathon Track Progress */
.marathon-track-container {
  width: 100%;
  height: 100px;
  background-color: #161b22;
  border-radius: 12px;
  position: relative;
  box-shadow: inset 0 6px 15px rgba(0, 0, 0, 0.8), 0 0 25px rgba(63, 185, 80, 0.3);
  border: 4px solid #3fb950;
  margin-top: 80px;
  margin-bottom: 20px;
}

.marathon-progress-fill {
  height: 100%;
  background: rgba(88, 166, 255, 0.3);
  border-right: 4px dashed #fff;
  border-radius: 8px 0 0 8px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.runner-avatar-wrapper {
  position: absolute;
  top: -45px;
  right: -55px;
  /* Offset to center the runner head somewhat on the progress edge */
  width: 110px;
  height: 110px;
  z-index: 10;
  filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.9));
  transition: transform 0.3s ease-out;
}

.runner-avatar-wrapper:hover {
  transform: scale(1.1) translateY(-5px);
}

.runner-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #58a6ff;
  background: var(--bg-color);
}

.medal-necklace {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2.2rem;
  z-index: 11;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.8));
}

.speech-bubble {
  position: absolute;
  top: -35px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #000;
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: bold;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0;
  border-style: solid;
  border-color: #fff transparent transparent transparent;
}

.input-field {
  flex: 1;
  padding: 15px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: rgba(0, 0, 0, 0.4);
  color: white;
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.input-field:focus {
  outline: none;
  border-color: #58a6ff;
  box-shadow: 0 0 10px rgba(88, 166, 255, 0.3);
  background: rgba(0, 0, 0, 0.6);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}