* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg: #000000;
    --surface: #111111;
    --elevated: #161616;
    --border: #2A2A2A;
    --text-primary: #FFFFFF;
    --text-secondary: #A6A6A6;
    --muted: #6F6F6F;
    --accent: #FFFFFF;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 4px 16px rgba(0,0,0,0.35);
    --shadow-md: 0 10px 30px rgba(0,0,0,0.45);
}

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Segoe UI Symbol', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.header {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
}

.title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.challenges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.challenge-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    cursor: default;
}

.challenge-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: #3A3A3A;
}

.challenge-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: #0D0D0D;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.challenge-card:hover .preview-image {
    transform: scale(1.04);
}

.difficulty-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    backdrop-filter: saturate(120%) blur(4px);
}

.difficulty-badge.easy { background: #4CAF50; color: #FFFFFF; border-color: #4CAF50; }
.difficulty-badge.medium { background: #FF9800; color: #FFFFFF; border-color: #FF9800; }
.difficulty-badge.hard { background: #F44336; color: #FFFFFF; border-color: #F44336; }
.difficulty-badge.beginner { background: #8BC34A; color: #FFFFFF; border-color: #8BC34A; }
.difficulty-badge.expert { background: #9C27B0; color: #FFFFFF; border-color: #9C27B0; }
.difficulty-badge.extreme { background: #E91E63; color: #FFFFFF; border-color: #E91E63; }
.difficulty-badge.insane { background: #000000; color: #FFFFFF; border-color: #000000; }

.challenge-info {
    padding: 1.25rem 1.5rem 1.5rem;
}

.challenge-info h3 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.challenge-info p {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
    line-height: 1.7;
}

.start-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.start-btn:hover {
    background: var(--accent);
    color: #000000;
    border-color: #FFFFFF;
    box-shadow: 0 6px 20px rgba(255,255,255,0.08);
}

.start-btn:active {
    transform: translateY(1px);
}

.start-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.25);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(6px);
}

.modal-content {
    background-color: var(--elevated);
    margin: 2% auto;
    padding: 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: transparent;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

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

.close {
    font-size: 1.75rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease, opacity 0.2s ease;
}

.close:hover {
    color: var(--text-primary);
    opacity: 0.9;
}

.modal-body {
    padding: 1.25rem 1.5rem;
    height: calc(90vh - 64px);
    display: flex;
    flex-direction: column;
}

.panorama-container {
    flex: 1;
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
    margin-bottom: 1rem;
}

#panoramaContainer {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-md);
}

.pnlm-container {
    border-radius: var(--radius-md) !important;
}

#panorama {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .challenges-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .modal-content {
        width: 98%;
        height: 95vh;
        margin: 1% auto;
    }
    
    .modal-body {
        padding: 1rem;
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top: 3px solid #FFFFFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.footer {
    text-align: center;
    margin-top: 3rem;
    padding: 2rem 0;
    color: var(--text-secondary);
}

.footer-note {
    font-size: 1rem;
    font-weight: 500;
    font-style: normal;
}
.badge-stack {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.badge-stack .difficulty-badge {
    position: static;
    top: auto;
    right: auto;
}

.author-badge {
    position: relative;
    overflow: hidden;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #FFFFFF;
    background: #000000;
    border: none;
    box-shadow: 0 4px 18px rgba(255, 255, 255, 0.10);
}

.author-badge::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 220%;
    height: 220%;
    background: linear-gradient(120deg,
        rgba(255, 255, 255, 0.00) 30%,
        rgba(220, 225, 232, 0.40) 50%,
        rgba(255, 255, 255, 0.00) 70%
    );
    filter: blur(4px);
    opacity: 0;
    animation: shimmerSweep 4s ease-in-out infinite;
    will-change: transform, opacity;
    pointer-events: none;
}

@keyframes shimmerSweep {
    0% { transform: translateX(-80%); opacity: 0; }
    10% { opacity: 0.2; }
    50% { opacity: 0.5; }
    90% { opacity: 0.2; }
    100% { transform: translateX(80%); opacity: 0; }
}