* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #1c1c1e 0%, #2c2c2e 100%);
    min-height: 100vh;
    color: #ffffff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

header {
    text-align: center;
    margin-bottom: 30px;
    background: rgba(44, 44, 46, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.start-hunt-btn {
    background: #007AFF;
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    letter-spacing: -0.01em;
    margin-top: 24px;
}

.start-hunt-btn:hover {
    background: #0056CC;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.35);
}

.start-hunt-btn:active {
    transform: translateY(0);
    background: #004999;
}

main {
    background: rgba(44, 44, 46, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 32px;
    border-radius: 24px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 60vh;
}

.welcome-section {
    text-align: center;
    padding: 40px 20px;
}

.welcome-section h2 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.welcome-section p {
    font-size: 1.2rem;
    color: #aeaeb2;
    line-height: 1.6;
    font-weight: 400;
}

.treasure-selection-section h2, .individual-clue-section h2, .map-section h2 {
    color: #ffffff;
    margin-bottom: 24px;
    text-align: center;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.treasure-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.clue-item {
    background: rgba(58, 58, 60, 0.9);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.clue-content {
    cursor: pointer;
}

.clue-content:hover {
    opacity: 0.8;
}

.clue-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    background: rgba(72, 72, 74, 0.95);
}

.clue-item h3 {
    color: #ffffff;
    margin-bottom: 12px;
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.clue-item p {
    color: #aeaeb2;
    font-size: 1.1rem;
    line-height: 1.5;
    font-weight: 400;
}

.clue-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 8px;
}

.back-btn-clue, .map-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    letter-spacing: -0.01em;
}

.back-btn-clue {
    background: #636366;
    color: white;
    box-shadow: 0 2px 6px rgba(99, 99, 102, 0.25);
}

.back-btn-clue:hover {
    background: #48484a;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(99, 99, 102, 0.35);
}

.map-btn {
    background: #34C759;
    color: white;
    box-shadow: 0 2px 6px rgba(52, 199, 89, 0.25);
}

.map-btn:hover {
    background: #2FB653;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(52, 199, 89, 0.35);
}

.clue-info {
    font-size: 0.85rem;
    color: #aeaeb2;
    margin-top: 8px;
    font-style: italic;
}

.clue-navigation {
    margin-top: 24px;
    padding: 20px;
    background: rgba(58, 58, 60, 0.7);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-btn {
    background: #007AFF;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-btn:hover:not(:disabled) {
    background: #0056CC;
    transform: translateY(-1px);
}

.nav-btn:disabled {
    background: #48484a;
    cursor: not-allowed;
    opacity: 0.6;
}

.clue-counter {
    font-weight: 600;
    color: #ffffff;
    font-size: 1rem;
}

/* Treasure Selection Styles */
.treasure-card {
    background: rgba(58, 58, 60, 0.9);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.treasure-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    background: rgba(72, 72, 74, 0.95);
}

.treasure-content h3 {
    color: #ffffff;
    margin-bottom: 12px;
    font-size: 1.4rem;
    font-weight: 600;
}

.treasure-description {
    color: #aeaeb2;
    font-size: 1rem;
    margin-bottom: 20px;
}

.treasure-select-btn {
    background: #007AFF;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 100%;
}

.treasure-select-btn:hover {
    background: #0056CC;
    transform: translateY(-1px);
}

.treasure-back-section {
    margin-top: 24px;
    text-align: center;
}

/* Individual Clue Styles */
.individual-clue-card {
    background: rgba(58, 58, 60, 0.95);
    padding: 32px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    max-width: 600px;
    margin: 0 auto;
}

.clue-header {
    text-align: center;
    margin-bottom: 24px;
}

.clue-header h2 {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.clue-progress {
    color: #aeaeb2;
    font-size: 1rem;
    font-weight: 500;
}

.clue-body {
    margin: 32px 0;
    text-align: center;
}

.clue-text {
    color: #ffffff;
    font-size: 1.3rem;
    line-height: 1.6;
    font-weight: 500;
    padding: 24px;
    background: rgba(44, 44, 46, 0.6);
    border-radius: 12px;
    border-left: 4px solid #007AFF;
}

.clue-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}

.next-clue-btn {
    background: #34C759;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.next-clue-btn:hover {
    background: #2FB653;
    transform: translateY(-1px);
}


.map-container {
    width: 100%;
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.back-btn {
    background: #636366;
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
    margin: 0 auto;
    letter-spacing: -0.01em;
}

.back-btn:hover {
    background: #48484a;
    transform: translateY(-1px);
}

.hidden {
    display: none !important;
}

.user-marker {
    background: rgba(0, 122, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 2px solid #007AFF;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 122, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 122, 255, 0);
    }
}

.compass-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 100px;
    height: 100px;
    z-index: 1000;
    pointer-events: none;
}

.compass-ring {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(44, 44, 46, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.compass-direction {
    position: absolute;
    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
    text-align: center;
    width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.2);
}

.compass-direction.north {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 59, 48, 0.2);
    color: #FF3B30;
    font-weight: 800;
}

.compass-direction.east {
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.compass-direction.south {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.compass-direction.west {
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.compass-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 35px;
    background: linear-gradient(to bottom, #FF3B30 0%, #FF3B30 50%, #8E8E93 50%, #8E8E93 100%);
    transform: translateX(-50%) translateY(-50%);
    transform-origin: center center;
    border-radius: 1px;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.compass-needle::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 8px solid #FF3B30;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .help-btn {
        padding: 12px 24px;
        font-size: 1.1rem;
    }
    
    main {
        padding: 20px;
    }
    
    .map-container {
        height: 350px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .help-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .welcome-section h2 {
        font-size: 1.6rem;
    }
    
    .welcome-section p {
        font-size: 1.1rem;
    }
    
    .map-container {
        height: 300px;
    }
    
    .compass-overlay {
        width: 80px;
        height: 80px;
        top: 15px;
        right: 15px;
    }
    
    .compass-direction {
        font-size: 12px;
        width: 18px;
        height: 18px;
        line-height: 18px;
    }
    
    .compass-needle {
        height: 28px;
    }
}