/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

.screen.active {
    display: block;
}

/* Loading Screen */
#loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    overflow: hidden;
}



.loading-content {
    text-align: center;
    color: white;
    z-index: 10000;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 30px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.loading-content h2 {
    font-size: 1.5rem;
    font-weight: 300;
    letter-spacing: 2px;
    animation: fadeInOut 2s ease-in-out infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



@keyframes fadeInOut {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Forms */
.login-form, .register-form {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    margin: 50px auto;
    text-align: center;
}

.register-form {
    max-width: 500px;
}

.login-form h1, .register-form h1 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2.5rem;
    font-weight: 700;
}

.login-form p {
    color: #666;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-back {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e1e5e9;
}

.btn-secondary:hover {
    background: #e9ecef;
}

.btn-back {
    background: transparent;
    color: #667eea;
    padding: 10px 15px;
    font-size: 14px;
}

.btn-back:hover {
    background: rgba(102, 126, 234, 0.1);
}

.btn-skip {
    background: #6c757d;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-skip:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.form-footer {
    margin-top: 20px;
    color: #666;
}

.form-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

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

.info-links {
    margin-top: 15px;
    font-size: 14px;
}

.info-links a {
    color: #667eea;
    text-decoration: none;
    margin: 0 5px;
}

.info-links a:hover {
    text-decoration: underline;
}

.project-info {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e1e5e9;
    font-size: 12px;
    color: #999;
    text-align: center;
}

.project-info p {
    margin: 3px 0;
    line-height: 1.3;
}

.home-footer {
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.home-footer .info-links {
    margin: 0;
}

.home-footer .info-links a {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 500;
}

.home-footer .info-links a:hover {
    color: white;
    text-decoration: underline;
}

/* Information Screens */
.info-content {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.info-content h1 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2rem;
}

.info-content p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.instructions-list h3 {
    color: #333;
    margin: 25px 0 15px 0;
    font-size: 1.2rem;
}

.instructions-list ol, .instructions-list ul {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    padding-left: 20px;
}

.instructions-list li {
    margin-bottom: 8px;
}

.privacy-content h3 {
    color: #333;
    margin: 25px 0 15px 0;
    font-size: 1.2rem;
}

.privacy-content ul {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    padding-left: 20px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    background: white;
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.header h1 {
    color: #667eea;
    font-size: 2rem;
    font-weight: 700;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info span {
    color: #666;
    font-weight: 500;
}

/* Search Container */
.search-container {
    margin-bottom: 30px;
    text-align: center;
}

.search-input {
    width: 100%;
    max-width: 500px;
    padding: 15px 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    color: #333;
    outline: none;
    transition: all 0.3s;
}

.search-input:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.search-input::placeholder {
    color: #999;
}

/* Adventures Grid */
.adventures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.adventure-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.adventure-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.adventure-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
}

.adventure-card-content {
    padding: 25px;
}

.adventure-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3rem;
    font-weight: 600;
}

.adventure-card p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.adventure-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #667eea;
    font-weight: 500;
    font-size: 14px;
}

/* Adventure Details */
.adventure-details {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.adventure-header {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    align-items: center;
}

.adventure-header img, #adventure-image, .adventure-details img, .adventure-image img {
    object-fit: contain !important;
    border-radius: 10px !important;
    width: 300px !important;
    height: 200px !important;
}


.adventure-info h1 {
    color: #333;
    margin-bottom: 15px;
    font-size: 2rem;
}

.adventure-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Challenge Screen */
.challenge-container {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

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

.challenge-progress {
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 25px;
    color: #667eea;
    font-weight: 600;
}

.challenge-header-content {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    align-items: center;
}

.challenge-header-content .challenge-media {
    flex-shrink: 0;
}

.challenge-header-content .challenge-media img {
    width: 300px !important;
    height: 200px !important;
    object-fit: contain !important;
    border-radius: 10px !important;
    margin: 0 !important;
    display: block !important;
}

.challenge-info h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 2rem;
}

.challenge-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

.challenge-content h2 {
    color: #333;
    margin-bottom: 15px;
    font-size: 2.2rem;
}

.challenge-content p {
    color: #666;
    line-height: 1.8;
    margin-bottom: 30px;
    font-size: 1.1rem;
}

.challenge-type {
    display: none;
    margin-bottom: 30px;
}

.challenge-type.active {
    display: block;
}

/* Question Challenge */
.answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.answer-option {
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    font-weight: 500;
}

.answer-option:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.answer-option.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.answer-option.correct {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.answer-option.incorrect {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Geolocation Challenge */
.geolocation-content {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 10px;
}

.location-info {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 10px;
    display: none;
}

.location-info.active {
    display: block;
}

/* Hints Container */
.hints-container {
    margin-bottom: 20px;
}

.hint-item {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    font-style: italic;
}

.hint-item.new {
    background: #e3f2fd;
    border-left-color: #2196f3;
    animation: highlightHint 2s ease-in-out;
}

@keyframes highlightHint {
    0% { background: #bbdefb; }
    100% { background: #e3f2fd; }
}

/* Challenge Media */
.challenge-media {
    text-align: center;
}

.challenge-media img {
    width: 300px;
    height: 200px;
    object-fit: contain;
    border-radius: 10px;
}

.challenge-media iframe {
    width: 300px !important;
    height: 200px !important;
    border-radius: 10px !important;
    margin: 0 auto !important;
    display: block !important;
}

.challenge-media audio {
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    width: 100% !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    display: block !important;
}

@media (max-width: 768px) {
    .challenge-media img,
    .challenge-media iframe {
        width: 100% !important;
        max-width: 300px !important;
    }
}

/* Sponsor Image */
.sponsor-image {
    text-align: center;
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
    color: #6c757d;
    font-style: italic;
}

/* Custom Result Text */
.custom-result-text {
    background: #e3f2fd;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2196f3;
}

/* Publish Results */
.publish-results {
    margin: 30px 0;
    text-align: center;
}

.publish-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 15px 0;
}

.publish-preview {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-style: italic;
    border-left: 4px solid #28a745;
}

/* Challenge Actions */
.challenge-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.challenge-actions button {
    min-width: 200px;
}

/* Result Screen */
.result-content {
    background: white;
    border-radius: 15px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.result-content h1 {
    color: #28a745;
    margin-bottom: 40px;
    font-size: 2.5rem;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 40px;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 3rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.stat-label {
    color: #666;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-content h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.modal-content p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Ranking Section */
.ranking-section {
    margin-top: 30px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    border: 1px solid #dee2e6;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.ranking-section h3 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8rem;
    text-align: center;
    font-weight: 700;
    position: relative;
}

.ranking-section h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ranking-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.ranking-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: #667eea;
    transition: all 0.3s ease;
}

.ranking-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.ranking-item:first-child {
    background: linear-gradient(135deg, #fff9c4 0%, #fff3a0 100%);
    border: 2px solid #ffd700;
}

.ranking-item:first-child::before {
    background: linear-gradient(180deg, #ffd700 0%, #ffed4e 100%);
    width: 8px;
}

.ranking-item:first-child .ranking-position {
    color: #b8860b;
    font-size: 1.5rem;
}

.ranking-item:nth-child(2) {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    border: 2px solid #c0c0c0;
}

.ranking-item:nth-child(2)::before {
    background: linear-gradient(180deg, #c0c0c0 0%, #d3d3d3 100%);
    width: 6px;
}

.ranking-item:nth-child(2) .ranking-position {
    color: #808080;
    font-size: 1.4rem;
}

.ranking-item:nth-child(3) {
    background: linear-gradient(135deg, #f4e4bc 0%, #e6d3a3 100%);
    border: 2px solid #cd7f32;
}

.ranking-item:nth-child(3)::before {
    background: linear-gradient(180deg, #cd7f32 0%, #daa520 100%);
    width: 6px;
}

.ranking-item:nth-child(3) .ranking-position {
    color: #8b4513;
    font-size: 1.4rem;
}

.ranking-position {
    font-weight: 800;
    font-size: 1.3rem;
    color: #333;
    min-width: 40px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ranking-position::after {
    content: '°';
    font-size: 0.8em;
    opacity: 0.7;
}

.ranking-player {
    flex: 1;
    margin-left: 20px;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.ranking-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.ranking-points {
    font-weight: 800;
    font-size: 1.2rem;
    color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ranking-date {
    font-size: 12px;
    color: #999;
    font-weight: 500;
}

/* Adventure Actions */
.adventure-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-play, .btn-ranking {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-play {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-play:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-ranking {
    background: #f8f9fa;
    color: #667eea;
    border: 2px solid #e1e5e9;
}

.btn-ranking:hover {
    background: #e9ecef;
    border-color: #667eea;
}

/* Ranking Modal */
.ranking-modal-content {
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
}

.ranking-modal-content h3 {
    margin-bottom: 30px;
    color: #333;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
    position: relative;
}

.ranking-modal-content h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.ranking-modal-content .ranking-list {
    margin-top: 20px;
}

/* Result Actions */
.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.result-actions button {
    min-width: 180px;
}

/* Footer */
.game-footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content p {
    color: rgba(255, 255, 255, 0.9);
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.4;
}

.footer-content p:first-child {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .adventure-header {
        flex-direction: column;
        text-align: center;
    }
    
    .adventure-header img {
        width: 100%;
        max-width: 300px;
    }
    
    .challenge-header-content {
        flex-direction: column !important;
        text-align: center !important;
        align-items: center !important;
    }
    
    .challenge-header-content .challenge-media {
        text-align: center !important;
        margin-bottom: 20px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        flex-shrink: 1 !important;
        width: 100% !important;
    }
    
    .challenge-header-content .challenge-info {
        text-align: center !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .result-stats {
        flex-direction: column;
        gap: 30px;
    }
    
    .challenge-actions {
        flex-direction: column;
    }
    
    .challenge-actions button {
        width: 100%;
    }
    
    .answers-grid {
        grid-template-columns: 1fr;
    }
    
    .header {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .footer-content p {
        font-size: 12px;
    }
    
    .footer-content p:first-child {
        font-size: 14px;
    }
}