/* Base styles */
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background-color: #111827;
  color: #e5e7eb;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.display-1 {
  font-size: 4rem;
  font-weight: 700;
}

/* Stats Card */
.stats-card-col {
  min-width: 200px;
  flex: 1;
}

.stats-card-col .card-text {
  font-size: 1.2rem !important;
  line-height: 1.1;
}

.stats-card-col .card-title {
  font-size: 0.8rem !important;
  margin-bottom: 0.4rem;
}

/* Dashboard title */
.dashboard-title {
  font-size: 1.5rem !important;
  margin-bottom: 1rem;
}

/* Additional text within cards */
.stats-card-col .small-text {
  font-size: 0.75rem !important;
}

.stats-card-col .card-subtitle {
  font-size: 0.7rem !important;
  color: #9ca3af;
}

/* Game indicators - decreased size */
#game-stats .card-body {
  padding: 0.5rem !important;
}

#game-stats .h4 {
  font-size: 0.9rem !important;
  margin-bottom: 0 !important;
}

#game-stats .text-medium-grey {
  font-size: 0.7rem !important;
  margin-bottom: 0.25rem !important;
}

#game-stats .card {
  margin-bottom: 0.5rem !important;
}

#game-stats .row {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Game Container - Fixed height to prevent layout shift */
.game-container {
    min-height: 520px;
    padding: 15px 0;
}

/* Game HUD - Compact and readable with fixed widths */
.game-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    border-radius: 12px;
    margin-bottom: 15px;
    border: 1px solid #374151;
    min-height: 70px;
}

.hud-timer {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    padding: 8px 16px;
    border-radius: 10px;
    width: 80px;
    text-align: center;
    flex-shrink: 0;
}

.timer-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
}

.timer-unit {
    font-size: 1rem;
    color: rgba(255,255,255,0.8);
}

.hud-stats {
    display: flex;
    gap: 12px;
}

.hud-stat {
    text-align: center;
    width: 75px;
    flex-shrink: 0;
}

.stat-num {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    color: #e5e7eb;
    white-space: nowrap;
    overflow: hidden;
}

.stat-lbl {
    font-size: 0.6rem;
    color: #9ca3af;
    text-transform: uppercase;
}

.f1-compare {
    background: rgba(251, 191, 36, 0.1);
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid rgba(251, 191, 36, 0.3);
    width: 85px;
}

.f1-compare .stat-num {
    color: #fbbf24;
}

/* Live F1 comparison indicator during gameplay */
.f1-live-indicator {
    text-align: center;
    padding: 8px 15px;
    margin-bottom: 12px;
    background: rgba(31, 41, 55, 0.6);
    border-radius: 10px;
    border: 1px solid #374151;
    min-height: 36px;
}

#f1-live-text {
    font-size: 0.9rem;
    color: #9ca3af;
    transition: color 0.3s ease;
}

#f1-live-text.beating-f1 {
    color: #fbbf24;
    font-weight: 600;
}

#f1-live-text.close-to-f1 {
    color: #10b981;
}

/* Grid wrapper - Contains grid and countdown overlay */
.grid-wrapper {
    position: relative;
    min-height: 400px;
}

/* Countdown Overlay - Positioned over grid to prevent layout shift */
.countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(17, 24, 39, 0.9);
    border-radius: 12px;
    z-index: 10;
}

.countdown-number {
    font-size: 6rem;
    font-weight: 700;
    color: #10b981;
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

.countdown-pulse {
    animation: countdownPulse 0.8s ease-out;
}

@keyframes countdownPulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* ========================================
   START SCREEN - Rich content layout
   ======================================== */
.start-screen {
    padding: 25px 20px;
    min-height: 480px;
    max-width: 420px;
    margin: 0 auto;
}

.start-header {
    text-align: center;
    margin-bottom: 25px;
}

.game-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 8px;
}

.game-subtitle {
    font-size: 1.1rem;
    color: #9ca3af;
    margin: 0;
}

/* F1 Challenge Box */
.f1-challenge-box {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.1));
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center;
}

.f1-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.f1-challenge-text {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
}

.f1-label {
    font-size: 1rem;
    color: #d1d5db;
}

.f1-time {
    font-size: 2rem;
    font-weight: 700;
    color: #fbbf24;
}

.f1-description {
    font-size: 0.9rem;
    color: #9ca3af;
    margin: 0;
}

/* How to Play */
.how-to-play {
    margin-bottom: 25px;
}

.how-to-play h3 {
    font-size: 1rem;
    color: #9ca3af;
    text-align: center;
    margin-bottom: 15px;
    font-weight: 500;
}

.instructions-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.instruction-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.instruction-icon {
    font-size: 1.5rem;
}

.instruction-item span:last-child {
    font-size: 0.85rem;
    color: #d1d5db;
}

/* Start Button */
.start-button {
    display: block;
    width: 100%;
    padding: 18px 30px;
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    margin-bottom: 20px;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.start-button:active {
    transform: translateY(0);
}

/* Start Footer */
.start-footer {
    text-align: center;
}

.weekly-players {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0;
}

/* ========================================
   GAME OVER SCREEN - Rich results layout
   ======================================== */
.game-over-container {
    padding: 20px;
    max-width: 420px;
    margin: 0 auto;
}

.performance-message {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.1));
    border-radius: 16px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    margin-bottom: 20px;
}

.performance-emoji {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 8px;
}

.performance-text {
    font-size: 1.4rem;
    font-weight: 600;
    color: #10b981;
    display: block;
}

.f1-comparison-text {
    font-size: 0.95rem;
    color: #9ca3af;
    display: block;
    margin-top: 8px;
}

/* Results Section */
.results-section {
    margin-bottom: 20px;
}

.results-title {
    font-size: 1rem;
    color: #9ca3af;
    text-align: center;
    margin-bottom: 15px;
    font-weight: 500;
}

.stats-container-large {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.stat-card-large {
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    flex: 1;
    max-width: 110px;
}

.stat-value-large {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 4px;
}

.stat-value-large small {
    font-size: 0.85rem;
    font-weight: 400;
    opacity: 0.7;
}

.stat-label {
    font-size: 0.75rem;
    color: #9ca3af;
    text-transform: uppercase;
}

.f1-card {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
}

.f1-card .stat-value-large {
    color: #fbbf24;
}

/* Chart Section */
.chart-section {
    margin-bottom: 20px;
}

.chart-title {
    font-size: 0.9rem;
    color: #9ca3af;
    text-align: center;
    margin-bottom: 10px;
    font-weight: 500;
}

.chart-container {
    height: 120px;
    background: rgba(31, 41, 55, 0.4);
    border-radius: 12px;
    padding: 10px;
}

/* Share CTA */
.share-cta {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(22, 163, 74, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    margin-bottom: 20px;
}

.share-prompt {
    font-size: 0.95rem;
    color: #d1d5db;
    margin-bottom: 12px;
}

.share-button-large {
    width: 100%;
    padding: 14px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.share-button-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

/* Score Submission Form */
.score-submission-form {
    background: rgba(31, 41, 55, 0.4);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 15px;
}

.save-title {
    font-size: 0.9rem;
    color: #9ca3af;
    text-align: center;
    margin-bottom: 12px;
    font-weight: 500;
}

/* Play Again Button */
.play-again-button {
    display: block;
    width: 100%;
    padding: 16px 20px;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.play-again-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Grid and Square styles - Optimized for mobile touch */
.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-gap: 10px;
    padding: 10px;
    max-width: 400px;
    box-sizing: border-box;
    margin: 0 auto;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.square {
    width: 100%;
    padding-bottom: 100%;
    background-color: #1f2937;
    border: 3px solid #374151;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: transform 0.05s ease-out, background-color 0.1s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.square:active {
    transform: scale(0.95);
}

.highlight {
    background-color: #059669;
    border-color: #10b981;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
    animation: pulse-highlight 0.5s ease-in-out infinite alternate;
}

@keyframes pulse-highlight {
    0% { box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }
    100% { box-shadow: 0 0 25px rgba(16, 185, 129, 0.7); }
}

/* Hit feedback animation */
.hit-feedback {
    animation: hitPop 0.2s ease-out;
    background-color: #22c55e !important;
}

@keyframes hitPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); background-color: #4ade80; }
    100% { transform: scale(1); }
}

/* Mobile grid optimization */
@media (max-width: 420px) {
    .grid {
        max-width: 320px;
        grid-gap: 8px;
        padding: 8px;
    }
    
    .grid-wrapper {
        min-height: 350px;
    }
    
    .game-container {
        min-height: 480px;
    }
    
    .game-hud {
        padding: 10px;
        gap: 8px;
        min-height: 60px;
    }
    
    .hud-timer {
        width: 65px;
        padding: 6px 10px;
    }
    
    .timer-value {
        font-size: 1.5rem;
    }
    
    .hud-stat {
        width: 60px;
    }
    
    .f1-compare {
        width: 70px;
    }
    
    .stat-num {
        font-size: 0.95rem;
    }
    
    .stat-lbl {
        font-size: 0.55rem;
    }
    
    #start-screen {
        padding: 20px 10px;
        min-height: 350px;
    }
    
    .game-over-container {
        padding: 15px 10px;
        min-height: 420px;
    }
    
    .countdown-number {
        font-size: 5rem;
    }
}

/* Cards and UI Elements */
.card {
  background-color: #1f2937 !important;
  border: 1px solid #374151 !important;
  border-radius: 8px !important;
  margin-bottom: 0.5rem;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

.btn {
  border-radius: 8px;
  padding: 0.5rem 1.5rem;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background-color: #2563eb !important;
  border-color: #3b82f6 !important;
}

.btn-primary:hover {
  background-color: #1d4ed8 !important;
  border-color: #2563eb !important;
  transform: translateY(-1px);
}

/* Custom Colors */
.text-light-grey {
  color: #d1d5db !important;
}

.text-medium-grey {
  color: #9ca3af !important;
}

.text-secondary {
  color: #e5e7eb !important;
}

/* Table Styles */
.table {
  background-color: #1f2937;
  border-radius: 12px;
  overflow: hidden;
}

.table th {
  background-color: #111827;
  border-bottom: 2px solid #374151;
  color: #e5e7eb;
  font-weight: 600;
}

.table td {
  border-color: #374151;
  padding: 1rem;
}

/* Form Elements */
input.form-control {
  background-color: #1f2937;
  border: 1px solid #374151;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

input.form-control:focus {
  background-color: #1f2937;
  border-color: #3b82f6;
  color: #e5e7eb;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Custom font size between fs-5 and fs-6 */
.fs-5-6 {
  font-size: 1.05rem !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: repeat(5, 1fr);
    grid-gap: 8px;
    padding: 10px;
  }

  .container {
    padding: 1rem;
  }

  .table {
    font-size: 0.875rem;
  }

  h1 {
    font-size: 1.75rem;
  }
}

/* Chart Customization */
canvas {
  background-color: #1f2937;
  border-radius: 12px;
  padding: 1rem;
}
/* Add this after the existing styles */

/* Custom divider */
.divider-line {
  border: 0;
  height: 1px;
  background: rgba(156, 163, 175, 0.2);
  margin: 1rem auto;
  width: 80%;
}

/* Add after existing styles */

/* Game Over Screen */
.game-over-container {
  max-width: 90%;
  margin: 1rem auto 4rem;
  padding: 1.5rem;
  background: linear-gradient(145deg, #1a1f2e, #111827);
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.game-over-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #e5e7eb;
  margin-bottom: 2rem;
  letter-spacing: -0.5px;
}

/* Stats Cards */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 0.3rem;
  margin: 0.4rem 0;
}

.stat-card {
  padding: 0.3rem;
  background: rgba(31, 41, 55, 0.5);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 0.15rem;
  display: block;
}

.stat-label {
  font-size: 0.7rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Chart Container */
.chart-container {
  margin: 1rem 0;
  padding: 0.75rem;
  background: rgba(31, 41, 55, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  height: 200px;
  width: 100%;
  position: relative;
}

/* Form Elements */
.score-submission-form {
  width: 100%;
  max-width: 320px;
  margin: 1rem auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.minimal-input {
  width: 100%;
  padding: 0.75rem;
  background: rgba(31, 41, 55, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #e5e7eb;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.minimal-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(31, 41, 55, 0.5);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.minimal-input::placeholder {
  color: #6b7280;
}

.submit-button {
  width: 100%;
  padding: 0.75rem;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.submit-button:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.submit-button:active {
  transform: translateY(0);
}

/* Add these styles after the existing .chart-container styles */

/* Info Text Section */
.info-text {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(31, 41, 55, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-text p {
    margin: 0.5rem 0;
}

.text-medium {
    color: #9ca3af;
    font-size: 0.95rem;
}

.text-warning {
    color: #fbbf24;
    font-size: 0.9rem;
}

.text-highlight {
    color: #60a5fa;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Update responsive design for info text */
@media (max-width: 640px) {
    .game-over-container {
        margin: 1rem;
        padding: 1.5rem;
    }

    .game-over-title {
        font-size: 2rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stats-container {
        flex-direction: column;
    }

    .stat-card {
        text-align: center;
    }

    .info-text {
        margin: 1rem 0;
        padding: 0.75rem;
    }

    .info-text p {
        font-size: 0.85rem;
    }
}

/* Game Stats */
#game-stats {
  padding: 0.25rem;
  margin-bottom: 0.25rem;
}

#game-stats .row {
  margin: 0 -0.15rem;
}

#game-stats .col-6,
#game-stats .col-sm-3 {
  padding: 0 0.15rem;
}

#game-stats .card {
  padding: 0.25rem !important;
  margin-bottom: 0.25rem;
}

#game-stats .text-medium-grey {
  font-size: 0.7rem !important;
  margin-bottom: 0.15rem !important;
}

#game-stats .h4 {
  font-size: 0.85rem !important;
  margin-bottom: 0 !important;
}

/* Media Queries */
@media (max-width: 576px) {
  .grid {
    grid-template-columns: repeat(5, minmax(40px, 55px));
    grid-gap: 6px;
    padding: 10px;
  }

  #game-stats h2 {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
  }

  #game-stats .card {
    padding: 0.25rem !important;
  }

  #game-stats .text-medium-grey {
    font-size: 0.65rem !important;
  }

  #game-stats .h4 {
    font-size: 0.8rem !important;
  }

  .game-over-container {
    padding: 1rem;
  }

  .stat-value {
    font-size: 0.95rem;
  }

  .stat-label {
    font-size: 0.65rem;
  }
  .chart-container {
    height: 180px;
  }
}

@media (max-width: 360px) {
  .grid {
    grid-template-columns: repeat(5, minmax(35px, 45px));
    grid-gap: 4px;
    padding: 8px;
  }
}

/* Score and Stats Animations */
@keyframes scoreUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes statUpdate {
    0% { background-color: rgba(37, 99, 235, 0.2); }
    100% { background-color: transparent; }
}

.score-update {
    animation: scoreUpdate 0.3s ease-out;
}

.stat-update {
    animation: statUpdate 0.5s ease-out;
}

/* Game stats card animations */
#game-stats .card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#game-stats .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Enhanced button interactions */
.btn:active {
    transform: scale(0.95);
}

/* Mini App Optimizations */
.mini-app-context {
    padding: var(--mini-app-padding, 15px);
}

.mini-app-context .container {
    padding: 0;
    max-width: 100%;
}

.mini-app-context #start-screen {
    margin-bottom: 20px;
}

.mini-app-context .grid {
    margin: 10px auto;
}

/* Safe area support for mobile mini apps */
@supports (padding: max(0px)) {
    .mini-app-context {
        padding-top: max(var(--mini-app-padding, 15px), env(safe-area-inset-top));
        padding-bottom: max(var(--mini-app-padding, 15px), env(safe-area-inset-bottom));
        padding-left: max(var(--mini-app-padding, 15px), env(safe-area-inset-left));
        padding-right: max(var(--mini-app-padding, 15px), env(safe-area-inset-right));
    }
}

/* Share button styling */
.share-section {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.share-section .btn {
    transition: all 0.2s ease;
}

.share-section .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Compact mode for mini apps */
@media (max-height: 600px) {
    .mini-app-context #start-screen h1 {
        font-size: 1.5rem;
        margin-bottom: 15px;
    }
    
    .mini-app-context .grid {
        grid-gap: 4px;
        padding: 8px;
    }
    
    .mini-app-context .chart-container {
        height: 120px;
    }
    
    .mini-app-context .stats-container {
        gap: 8px;
    }
}

/* Embedded iframe optimizations */
@media (max-width: 400px) {
    .mini-app-context .stat-card {
        padding: 8px;
    }
    
    .mini-app-context .stat-value {
        font-size: 0.9rem;
    }
    
    .mini-app-context .stat-label {
        font-size: 0.7rem;
    }
}

/* Custom connect wallet button */
#connect-wallet-btn.btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    line-height: 1.2;
}

/* Performance Message - Game Over */
.performance-message {
    padding: 15px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(5, 150, 105, 0.1));
    border-radius: 12px;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.performance-emoji {
    font-size: 2rem;
    display: block;
    margin-bottom: 5px;
}

.performance-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: #10b981;
}

/* Large Stats Container - Game Over */
.stats-container-large {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.stat-card-large {
    background: rgba(31, 41, 55, 0.6);
    border: 1px solid #374151;
    border-radius: 12px;
    padding: 15px 20px;
    text-align: center;
    min-width: 90px;
    flex: 1;
    max-width: 120px;
}

.stat-value-large {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #e5e7eb;
    margin-bottom: 5px;
}

.stat-value-large small {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.7;
}

.f1-card {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
}

.f1-card .stat-value-large {
    color: #fbbf24;
}

/* Button Row */
.button-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.button-row .submit-button {
    flex: 1;
}

.share-button {
    background: linear-gradient(135deg, #4caf50, #2e7d32) !important;
}

.share-button:hover {
    background: linear-gradient(135deg, #66bb6a, #388e3c) !important;
}

/* ========================================
   LEADERBOARD - Always visible
   ======================================== */
.leaderboard-section {
    margin: 25px auto;
    max-width: 420px;
    padding: 0 20px;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.leaderboard-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e5e7eb;
    margin: 0;
}

.leaderboard-count {
    font-size: 0.85rem;
    color: #6b7280;
}

.leaderboard-table-wrapper {
    background: rgba(31, 41, 55, 0.5);
    border-radius: 12px;
    border: 1px solid #374151;
    overflow: hidden;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th {
    padding: 12px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    text-transform: uppercase;
    text-align: left;
    background: rgba(31, 41, 55, 0.8);
}

.leaderboard-table th:first-child {
    text-align: center;
    width: 40px;
}

.leaderboard-table th:nth-child(3),
.leaderboard-table th:nth-child(4) {
    text-align: center;
    width: 60px;
}

.leaderboard-table td {
    padding: 10px;
    font-size: 0.9rem;
    color: #d1d5db;
    border-top: 1px solid #374151;
}

.leaderboard-table .rank {
    text-align: center;
    font-weight: 600;
}

.leaderboard-table .score-val,
.leaderboard-table .avg-val {
    text-align: center;
}

.leaderboard-table tr.gold .rank { color: #fbbf24; }
.leaderboard-table tr.silver .rank { color: #94a3b8; }
.leaderboard-table tr.bronze .rank { color: #d97706; }

/* ========================================
   FOOTER
   ======================================== */
.footer-section {
    text-align: center;
    padding: 20px;
    margin-top: 10px;
}

.footer-text {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0;
}

.footer-text a {
    color: #60a5fa;
    text-decoration: none;
}

.footer-text a:hover {
    text-decoration: underline;
}