/* ThrottleIQ.app - LAMP Stack CSS */
/* Note: Google Fonts are loaded via <link> tags in the HTML head for better reliability */

/* CSS Variables */
:root {
    --background: #09090b;
    --foreground: #fafafa;
    --paper: #18181b;
    --primary: #f97316;
    --secondary: #06b6d4;
    --muted: #71717a;
    --muted-foreground: #a1a1aa;
    --border: #27272a;
    --destructive: #ef4444;
    --success: #22c55e;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base */
html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    min-height: 100vh;
    line-height: 1.5;
}

/* Font Classes */
.font-teko {
    font-family: 'Teko', sans-serif;
}

.font-rajdhani {
    font-family: 'Rajdhani', sans-serif;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Container */
.app-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Typography */
h1 {
    font-family: 'Teko', sans-serif;
    font-size: 4rem;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1;
}

h1 .highlight {
    color: var(--primary);
}

h2 {
    font-family: 'Teko', sans-serif;
    font-size: 1.5rem;
    text-transform: uppercase;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-family: 'Teko', sans-serif;
    font-size: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    min-width: 200px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: white;
    transform: skewX(-5deg);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.4), 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: skewX(-5deg) scale(1.02);
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.6), 0 6px 20px rgba(0, 0, 0, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: skewX(-5deg) scale(0.98);
}

.btn-secondary {
    background: rgba(6, 182, 212, 0.2);
    color: var(--secondary);
    border: 1px solid rgba(6, 182, 212, 0.5);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(6, 182, 212, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--foreground);
    border: 1px solid var(--border);
}

.btn-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--muted-foreground);
}

.btn-ghost:hover:not(:disabled) {
    color: var(--foreground);
}

/* Cards */
.card {
    background: rgba(24, 24, 27, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

.card-challenge {
    border-color: rgba(249, 115, 22, 0.3);
}

/* Home Screen */
.home-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
}

.home-bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.home-bg-blob-1 {
    top: 5rem;
    left: 2.5rem;
    width: 8rem;
    height: 8rem;
    background: rgba(249, 115, 22, 0.1);
}

.home-bg-blob-2 {
    bottom: 5rem;
    right: 2.5rem;
    width: 10rem;
    height: 10rem;
    background: rgba(6, 182, 212, 0.1);
}

.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(249, 115, 22, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    margin-bottom: 2rem;
}

.streak-badge svg {
    color: var(--primary);
}

.info-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.info-item svg {
    width: 1.5rem;
    height: 1.5rem;
    margin-bottom: 0.5rem;
}

.info-item span {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    white-space: nowrap;
}

/* Ad Placeholder */
.ad-placeholder {
    background: rgba(24, 24, 27, 0.3);
    border: 2px dashed rgba(249, 115, 22, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
    width: 100%;
    max-width: 28rem;
    margin: 1.5rem 0;
}

.ad-placeholder-label {
    font-family: 'Teko', sans-serif;
    font-size: 1.125rem;
    color: rgba(249, 115, 22, 0.6);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.ad-placeholder-info {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Trivia Section */
.trivia-section {
    width: 100%;
    max-width: 28rem;
    background: rgba(24, 24, 27, 0.3);
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 1.5rem;
}

.trivia-section h3 {
    font-family: 'Teko', sans-serif;
    font-size: 1.125rem;
    color: var(--primary);
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.trivia-item {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.trivia-item:last-child {
    margin-bottom: 0;
}

.trivia-category {
    color: var(--primary);
    font-family: 'Teko', sans-serif;
    font-size: 0.875rem;
    flex-shrink: 0;
    min-width: 50px;
}

.trivia-content {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    line-height: 1.4;
}

/* Game Screen */
.game-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.round-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.round-current {
    font-family: 'Teko', sans-serif;
    font-size: 1.875rem;
    color: var(--primary);
}

.round-total {
    color: var(--muted-foreground);
}

.score-display {
    font-family: 'Teko', sans-serif;
    font-size: 1.5rem;
}

.score-display .pts {
    color: var(--primary);
}

.lives-display {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.life {
    width: 1.25rem;
    height: 1.25rem;
}

.life-active {
    color: #ef4444;
    fill: #ef4444;
}

.life-empty {
    color: var(--muted-foreground);
}

/* Progress Bar */
.progress-container {
    margin-bottom: 1rem;
}

.progress-bar {
    height: 0.5rem;
    background: var(--paper);
    border-radius: 0.25rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.1s linear;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 0.25rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* Image Container */
.image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.image-wrapper {
    position: relative;
    width: 100%;
    max-width: 32rem;
    aspect-ratio: 4 / 3;
    border-radius: 0.75rem;
    overflow: hidden;
    background: var(--paper);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bike-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.3s ease-out;
}

.image-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-overlay.show {
    opacity: 1;
}

.image-overlay-correct {
    background: rgba(34, 197, 94, 0.2);
}

.image-overlay-wrong {
    background: rgba(239, 68, 68, 0.2);
}

.overlay-text {
    font-family: 'Teko', sans-serif;
    font-size: 2rem;
    text-transform: uppercase;
}

.overlay-text-correct {
    color: #4ade80;
}

.overlay-text-wrong {
    color: #f87171;
}

.overlay-bike-name {
    font-size: 1.125rem;
    color: var(--foreground);
    margin-top: 0.5rem;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.option-btn {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.75rem 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(24, 24, 27, 0.5);
    color: var(--foreground);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: rgba(249, 115, 22, 0.1);
}

.option-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.option-btn:disabled {
    cursor: not-allowed;
}

.option-btn-correct {
    background: rgba(34, 197, 94, 0.2);
    border-color: #22c55e;
    color: #4ade80;
}

.option-btn-wrong {
    background: rgba(24, 24, 27, 0.5);
    border-color: rgba(255, 255, 255, 0.05);
    color: var(--muted-foreground);
}

/* Challenge Badge */
.challenge-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(6, 182, 212, 0.2);
    color: var(--secondary);
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    margin-bottom: 0.5rem;
}

/* Result Screen */
.result-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

.result-header {
    text-align: center;
    padding: 1rem 0;
}

.rank-title {
    font-family: 'Teko', sans-serif;
    font-size: 2.5rem;
    text-transform: uppercase;
}

.final-score {
    font-family: 'Teko', sans-serif;
    font-size: 4rem;
    color: var(--primary);
    margin-top: 0.5rem;
}

.final-score-label {
    font-size: 1.25rem;
    color: var(--muted-foreground);
}

/* Challenge Result Banner */
.challenge-result-banner {
    text-align: center;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.challenge-result-win {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.5);
}

.challenge-result-lose {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.challenge-result-title {
    font-family: 'Teko', sans-serif;
    font-size: 1.5rem;
}

.challenge-result-comparison {
    color: var(--muted-foreground);
}

/* Round Breakdown */
.breakdown-section {
    margin-bottom: 1rem;
}

.breakdown-title {
    font-family: 'Teko', sans-serif;
    font-size: 1.25rem;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.breakdown-label {
    color: var(--muted-foreground);
}

.breakdown-score {
    font-family: 'Teko', sans-serif;
    font-size: 1.125rem;
}

.breakdown-score-zero {
    color: var(--muted-foreground);
}

.breakdown-score-positive {
    color: var(--primary);
}

/* Leaderboard */
.leaderboard-section {
    flex: 1;
    margin-bottom: 1rem;
}

.leaderboard-title {
    font-family: 'Teko', sans-serif;
    font-size: 1.25rem;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.leaderboard-title svg {
    color: #eab308;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
}

.leaderboard-item-top {
    background: rgba(249, 115, 22, 0.1);
}

.leaderboard-item-challenger {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.leaderboard-rank {
    font-family: 'Teko', sans-serif;
    font-size: 1.125rem;
    width: 1.5rem;
    text-align: center;
}

.leaderboard-rank-1 { color: #facc15; }
.leaderboard-rank-2 { color: #d1d5db; }
.leaderboard-rank-3 { color: #d97706; }
.leaderboard-rank-other { color: var(--muted-foreground); }

.leaderboard-name {
    flex: 1;
    margin-left: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-crown {
    display: inline;
    width: 0.75rem;
    height: 0.75rem;
    margin-left: 0.25rem;
    color: var(--primary);
}

.leaderboard-score {
    font-family: 'Teko', sans-serif;
    font-size: 1.125rem;
    color: var(--primary);
}

.leaderboard-empty {
    text-align: center;
    padding: 1rem;
    color: var(--muted-foreground);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--paper);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1.5rem;
    width: 100%;
    max-width: 24rem;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

.modal-title {
    font-family: 'Teko', sans-serif;
    font-size: 1.5rem;
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 1rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.form-input {
    width: 100%;
    background: var(--background);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    color: var(--foreground);
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
}

.form-input::placeholder {
    color: var(--muted-foreground);
}

.form-input-error {
    border-color: var(--destructive);
}

.form-textarea {
    resize: none;
    min-height: 8rem;
}

.form-error {
    color: var(--destructive);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-hint {
    color: var(--muted-foreground);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-counter {
    text-align: right;
    font-size: 0.75rem;
    color: var(--muted-foreground);
    margin-top: 0.25rem;
}

/* Footer */
.footer {
    width: 100%;
    padding: 1rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.footer-link {
    color: rgba(161, 161, 170, 0.6);
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-divider {
    color: rgba(161, 161, 170, 0.3);
}

.footer-copyright {
    color: rgba(161, 161, 170, 0.4);
    font-size: 0.75rem;
}

/* Static Pages */
.static-page {
    max-width: 48rem;
    margin: 0 auto;
    padding: 1.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted-foreground);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--primary);
}

.page-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.page-header svg {
    width: 2rem;
    height: 2rem;
    color: var(--primary);
}

.page-title {
    font-family: 'Teko', sans-serif;
    font-size: 2.5rem;
    text-transform: uppercase;
}

.page-content {
    background: rgba(24, 24, 27, 0.3);
    border-radius: 0.75rem;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.page-content section {
    margin-bottom: 1.5rem;
}

.page-content section:last-child {
    margin-bottom: 0;
}

.page-content h2 {
    font-family: 'Teko', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.page-content p {
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
}

.page-content ul {
    color: var(--muted-foreground);
    margin-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.page-content li {
    margin-bottom: 0.25rem;
}

.page-date {
    color: var(--muted-foreground);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Challenge Landing */
.challenge-landing {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.challenge-card {
    text-align: center;
    max-width: 28rem;
    width: 100%;
}

.challenge-icon {
    width: 4rem;
    height: 4rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.challenge-challenger {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1.5rem 0;
}

.challenger-label {
    color: var(--muted-foreground);
    margin-bottom: 0.5rem;
}

.challenger-name {
    font-family: 'Teko', sans-serif;
    font-size: 1.5rem;
}

.challenger-score {
    font-family: 'Teko', sans-serif;
    font-size: 2.5rem;
    color: var(--primary);
    margin-top: 0.5rem;
}

.challenge-attempts {
    color: var(--secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toast-success {
    border-color: var(--success);
    color: var(--success);
}

.toast-error {
    border-color: var(--destructive);
    color: var(--destructive);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 150;
}

.loading-text {
    font-family: 'Teko', sans-serif;
    font-size: 1.5rem;
    color: var(--primary);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Screen visibility */
.screen {
    display: none;
}

.screen.active {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Loading overlay visibility */
.loading-overlay {
    display: none;
}

.loading-overlay.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(1rem);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (min-width: 768px) {
    h1 {
        font-size: 5rem;
    }
    
    .options-grid {
        gap: 0.75rem;
    }
    
    .option-btn {
        font-size: 1rem;
    }
    
    .game-screen,
    .result-screen {
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    .btn-primary {
        transform: skewX(-3deg);
    }
    
    .btn-primary:hover:not(:disabled) {
        transform: skewX(-3deg) scale(1.02);
    }
    
    .btn-primary:active:not(:disabled) {
        transform: skewX(-3deg) scale(0.98);
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3f3f46;
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}

/* Focus */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
#copy-challenge-link{
    min-width: 40px;
}