/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    width: 100%;
}

.screen.active {
    display: block;
}

/* Authentication Screen */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
}

.login-card h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.login-card p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.clerk-toggle {
    margin-top: 20px;
}

.clerk-toggle a {
    color: #22c55e;
    text-decoration: none;
    font-weight: 600;
}

.clerk-toggle a:hover {
    text-decoration: underline;
}

/* Demo Mode Styling */
.demo-mode {
    text-align: center;
    padding: 20px;
}

.demo-mode p {
    margin-bottom: 15px;
    color: #666;
}

.demo-mode ul {
    background: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    margin: 20px 0;
}

.demo-mode li {
    margin-bottom: 8px;
    color: #64748b;
}

.demo-mode .btn-primary {
    margin-top: 20px;
    padding: 15px 30px;
    font-size: 1.1rem;
}

/* Game Screen */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left h2 {
    color: #333;
    font-size: 1.5rem;
}

.nav-center .user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.nav-center .user-info span:first-child {
    font-weight: 600;
    color: #333;
}

.nav-center .points {
    color: #22c55e;
    font-weight: 600;
}

.nav-right {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.btn-primary {
    background: #22c55e;
    color: white;
}

.btn-primary:hover {
    background: #16a34a;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-secondary:hover {
    background: #e5e7eb;
    transform: translateY(-2px);
}

/* Game Container */
.game-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

@media (max-width: 768px) {
    .game-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* Wheel Section */
.wheel-section {
    text-align: center;
}

.wheel-container {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}

#wheelCanvas {
    border-radius: 50%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease;
}

.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 30px solid #e74c3c;
    z-index: 10;
}

.spin-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #22c55e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 20;
}

.spin-button:hover {
    background: #16a34a;
    transform: translate(-50%, -50%) scale(1.1);
}

.spin-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: translate(-50%, -50%) scale(1);
}

.wheel-spinning {
    animation: wheelGlow 0.5s ease-in-out infinite alternate;
}

@keyframes wheelGlow {
    from { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
    to { box-shadow: 0 10px 30px rgba(34, 197, 94, 0.6); }
}

.wheel-info h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.dare-display {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.dare-display p {
    color: #333;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Dare Section */
.dare-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.dare-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-align: center;
}

.dare-text {
    background: #f8fafc;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    font-size: 1.1rem;
    color: #333;
    text-align: center;
    border: 2px solid #e2e8f0;
}

.upload-section {
    text-align: center;
}

.upload-label {
    display: inline-block;
    background: #f1f5f9;
    border: 2px dashed #cbd5e1;
    border-radius: 15px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
}

.upload-label:hover {
    border-color: #22c55e;
    background: #f0fdf4;
}

.upload-label i {
    font-size: 2rem;
    color: #64748b;
    margin-bottom: 15px;
    display: block;
}

.upload-label span {
    color: #64748b;
    font-weight: 500;
}

.image-preview {
    margin-top: 20px;
    text-align: center;
}

#previewImg {
    max-width: 100%;
    max-height: 300px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* Points Animation */
.points-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    display: none;
}

.points-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #22c55e;
    color: white;
    padding: 20px 30px;
    border-radius: 15px;
    font-size: 1.5rem;
    font-weight: 600;
    animation: pointsFloat 1s ease-out forwards;
}

@keyframes pointsFloat {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1) translateY(-50px);
    }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: #22c55e;
    color: white;
    padding: 20px 30px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 30px;
}

/* Leaderboard */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.rank-number {
    background: #22c55e;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.rank-1 .rank-number {
    background: #fbbf24;
}

.rank-2 .rank-number {
    background: #9ca3af;
}

.rank-3 .rank-number {
    background: #f59e0b;
}

.user-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.user-name, .user-points {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: color 0.3s ease;
}

.user-name {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.user-points {
    color: #22c55e;
    font-weight: 500;
}

.user-name:hover, .user-points:hover {
    color: #16a34a;
}

/* Achievement Cards */
.achievement-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.achievement-title {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.achievement-emoji {
    font-size: 1.5rem;
}

.achievement-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #64748b;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.points-badge {
    background: #22c55e;
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.achievement-image img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
}

.achievement-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.achievement-share {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 8px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-size: 0.9rem;
}

.achievement-share:hover {
    background: #e2e8f0;
    color: #374151;
}

.empty-history {
    text-align: center;
    padding: 40px;
    color: #64748b;
}

.empty-history i {
    font-size: 3rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.loading-spinner {
    background: white;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.loading-spinner i {
    font-size: 3rem;
    color: #22c55e;
    margin-bottom: 20px;
}

.loading-spinner p {
    color: #64748b;
    font-weight: 500;
}

/* Toast Notifications */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #22c55e;
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 4000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-content i {
    font-size: 1.2rem;
}

/* Share Modal */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

.share-modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.share-modal-content h3 {
    margin-bottom: 20px;
    color: #333;
}

.share-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.share-option {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.share-option:hover {
    background: #e2e8f0;
    color: #374151;
}

.share-close {
    background: #ef4444;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.share-close:hover {
    background: #dc2626;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-center {
        order: 3;
    }
    
    .game-container {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .wheel-container {
        transform: scale(0.8);
        margin-bottom: 20px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .achievement-card {
        padding: 15px;
    }
    
    .leaderboard-item {
        padding: 15px;
        gap: 15px;
    }
    
    .rank-number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
        margin: 0 15px;
    }
    
    .login-card h1 {
        font-size: 2rem;
    }
    
    .wheel-container {
        transform: scale(0.7);
    }
    
    .btn-primary, .btn-secondary {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
} 