/* Lingo2 - Timer Styles */

/* Timer Bar (horizontal progress bar) */
.timer-bar-container {
  display: flex;
  justify-content: center;
  margin: 1em auto;
  max-width: 600px;
  padding: 0 1em;
}

.timer-bar-wrapper {
  position: relative;
  width: 100%;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.timer-bar-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--lingo_yellow), #ffd400);
  border-radius: 20px;
  transition: width 0.5s linear, background 0.3s;
  box-shadow: 0 0 15px rgba(255, 232, 78, 0.5);
}

/* Timer color based on time remaining */
.timer-bar-progress.warning {
  background: linear-gradient(90deg, #ff9500, #ff6b00);
  box-shadow: 0 0 15px rgba(255, 149, 0, 0.5);
}

.timer-bar-progress.danger {
  background: linear-gradient(90deg, #ff3b30, #d32f2f);
  box-shadow: 0 0 15px rgba(255, 59, 48, 0.5);
}

.timer-bar-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2em;
  font-weight: bold;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  z-index: 1;
}

#timer-seconds {
  font-family: 'Gotham', monospace;
}

/* Timer animation when running out */
@keyframes timer-pulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
  }
}

.timer-bar-text.danger {
  animation: timer-pulse 0.5s infinite;
  color: #ff3b30;
  font-size: 1.3em;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .timer-bar-wrapper {
    height: 35px;
  }

  .timer-bar-text {
    font-size: 1em;
  }
}

/* Menu Styles */
.menu-container {
  max-width: 900px;
  margin: 0 auto;
}

.menu-title {
  text-align: center;
  margin-bottom: 1.5em;
  font-size: 2.5em;
}

.user-card {
  background-color: #ffffff10;
  padding: 1.5em;
  border-radius: 12px;
  margin-bottom: 2em;
  text-align: center;
}

.user-level {
  font-size: 1.3em;
  margin: 0.5em 0;
}

.lives-status {
  margin-top: 1em;
  padding-top: 1em;
  border-top: 1px solid #ffffff20;
}

.lives-count {
  font-size: 1.2em;
  margin: 0;
}

.cooldown-warning {
  color: #ff9500;
  font-size: 1.2em;
  font-weight: bold;
  margin: 0;
}

.cooldown-time {
  font-size: 1.1em;
  margin-top: 0.5em;
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 1em;
  align-items: center;
  margin: 2em 0;
}

.btn-play {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-play:hover {
  background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
}

/* Level Selection Grid */
.level-selection {
  margin-top: 3em;
}

.level-selection h3 {
  text-align: center;
  margin-bottom: 1em;
}

.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 1em;
  margin-top: 1.5em;
}

.level-card {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff10;
  border-radius: 8px;
  position: relative;
  transition: var(--transition);
}

.level-card:not(.locked):hover {
  background-color: #ffffff20;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.level-card.locked {
  opacity: 0.4;
  cursor: not-allowed;
}

.level-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: white;
}

.level-number {
  font-size: 1.8em;
  font-weight: bold;
}

.level-badge {
  position: absolute;
  bottom: 5px;
  font-size: 0.7em;
  background-color: var(--lingo_yellow);
  color: #2d2d2d;
  padding: 0.2em 0.5em;
  border-radius: 4px;
  font-weight: bold;
}

.level-badge.locked {
  background-color: transparent;
  color: white;
  font-size: 1.2em;
}

/* Cooldown Page */
.cooldown-container {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.cooldown-header {
  margin-bottom: 2em;
}

.cooldown-header h1 {
  font-size: 3em;
  margin-bottom: 0.3em;
}

.cooldown-info {
  background-color: #ffffff10;
  padding: 2em;
  border-radius: 12px;
  margin: 2em 0;
}

.cooldown-message {
  font-size: 1.3em;
  margin-bottom: 1em;
}

.cooldown-timer-big {
  font-size: 3em;
  font-weight: bold;
  color: var(--lingo_yellow);
  margin: 1em 0;
  font-family: 'Gotham', monospace;
  text-shadow: 0 0 20px rgba(255, 228, 78, 0.5);
}

.cooldown-hint {
  font-size: 1em;
  opacity: 0.8;
  margin-top: 1em;
}

.cooldown-actions {
  display: flex;
  flex-direction: column;
  gap: 1em;
  align-items: center;
  margin-top: 2em;
}

/* Leaderboard Styles */
.leaderboard-container {
  max-width: 900px;
  margin: 0 auto;
}

.leaderboard-subtitle {
  text-align: center;
  font-size: 1.1em;
  opacity: 0.8;
  margin-bottom: 2em;
}

.level-selector {
  text-align: center;
  margin-bottom: 2em;
}

.level-selector label {
  margin-right: 1em;
}

.level-selector select {
  min-width: 200px;
}

.leaderboard-table-container {
  overflow-x: auto;
  margin: 2em 0;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff10;
  border-radius: 8px;
  overflow: hidden;
}

.leaderboard-table thead {
  background-color: #00000030;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 1em;
  text-align: left;
}

.leaderboard-table th {
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9em;
}

.leaderboard-table tbody tr {
  border-bottom: 1px solid #ffffff10;
  transition: var(--transition);
}

.leaderboard-table tbody tr:hover {
  background-color: #ffffff10;
}

.leaderboard-table tbody tr:last-child {
  border-bottom: none;
}

.highlight-row {
  background-color: var(--lingo_yellow);
  color: #2d2d2d;
  font-weight: bold;
}

.highlight-row:hover {
  background-color: var(--lingo_yellow) !important;
}

.rank-cell {
  font-size: 1.2em;
  font-weight: bold;
  width: 80px;
}

.username-cell {
  font-size: 1.1em;
}

.score-cell {
  font-size: 1.2em;
  font-weight: bold;
  text-align: right;
}

.details-cell {
  font-size: 0.9em;
  opacity: 0.8;
  text-align: right;
}

.no-data {
  text-align: center;
  padding: 2em;
  opacity: 0.6;
  font-style: italic;
}

.leaderboard-actions {
  text-align: center;
  margin-top: 2em;
}

/* Scores Page */
.scores-container {
  max-width: 1000px;
  margin: 0 auto;
}

.scores-subtitle {
  text-align: center;
  font-size: 1.5em;
  margin-bottom: 1em;
}

.total-score-box {
  background-color: #ffffff10;
  padding: 2em;
  border-radius: 12px;
  text-align: center;
  margin: 2em 0;
}

.high-scores-section,
.recent-scores-section {
  margin: 3em 0;
}

.high-scores-section h2,
.recent-scores-section h2 {
  margin-bottom: 1.5em;
}

.high-scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1em;
}

.score-card {
  background-color: #ffffff10;
  padding: 1em;
  border-radius: 8px;
  text-align: center;
  transition: var(--transition);
}

.score-card:not(.no-score):hover {
  background-color: #ffffff20;
  transform: translateY(-2px);
}

.score-card.no-score {
  opacity: 0.4;
}

.score-card .level-number {
  font-size: 1.2em;
  font-weight: bold;
  margin-bottom: 0.5em;
}

.score-value {
  font-size: 1.8em;
  color: var(--lingo_yellow);
  font-weight: bold;
  margin: 0.5em 0;
}

.score-details {
  font-size: 0.75em;
  opacity: 0.7;
}

.no-score-text {
  opacity: 0.5;
  font-style: italic;
}

.scores-table {
  width: 100%;
  margin-top: 1.5em;
}

.highscore-row {
  background-color: #ffffff15;
}

.scores-actions {
  text-align: center;
  margin-top: 2em;
  display: flex;
  gap: 1em;
  justify-content: center;
  flex-wrap: wrap;
}

/* Responsive */
@media (min-width: 768px) {
  .menu-actions {
    flex-direction: row;
    justify-content: center;
  }

  .cooldown-actions {
    flex-direction: row;
    justify-content: center;
  }

  .levels-grid {
    grid-template-columns: repeat(11, 1fr);
  }
}
