@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@700&display=swap');

:root {
    --bg: #0b0f14;
    --card: #12161c;
    --card-2: #0f1318;
    --border: rgba(255,255,255,0.06);
    --text: #e6e9ee;
    --muted: #8b949e;
    --accent: #f59e0b;
    --accent-2: #fbbf24;
    --danger: #ef4444;
    --success: #10b981;
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

.navbar {
    background: var(--card);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}

#navbar-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    grid-column: 2 / 3;
}

@media (min-width: 769px) {
    #navbar-links {
        flex-wrap: wrap;
        overflow-x: visible;
    }
}

@media (max-width: 768px) {
    .navbar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }
    #navbar-links {
        order: 1;
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }
    #navbar-links::-webkit-scrollbar {
        height: 4px;
    }
    #navbar-links::-webkit-scrollbar-track {
        background: var(--bg);
        border-radius: 4px;
    }
    #navbar-links::-webkit-scrollbar-thumb {
        background: var(--accent);
        border-radius: 4px;
    }
    .tarkov-time {
        order: 2;
        justify-content: center;
        width: 100%;
    }
}

.map-btn {
    background: #1a1f26;
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 40px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
    touch-action: manipulation;
}

.map-btn:hover {
    background: #222832;
    color: var(--accent);
    border-color: var(--accent);
}

.map-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

.tarkov-time {
    display: flex;
    gap: 16px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 12px;
    border-radius: 40px;
    border: 1px solid var(--border);
    flex-shrink: 0;
    grid-column: 3 / 4;
    justify-self: end;
}

.time-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffffff;
    white-space: nowrap;
}

.time-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.time-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    vector-effect: non-scaling-stroke;
}

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

.page-header {
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 20px;
}

.tier-row {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    transition: 0.2s;
    margin-bottom: 20px;
}

.tier-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    border-radius: 16px 0 0 16px;
}

.tier-s::before { background: linear-gradient(135deg, #ffd700, #ff8c00); }
.tier-a::before { background: linear-gradient(135deg, #ff7e5e, #feb47b); }
.tier-b::before { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.tier-c::before { background: linear-gradient(135deg, #3498db, #2980b9); }
.tier-d::before { background: linear-gradient(135deg, #95a5a6, #7f8c8d); }
.tier-f::before { background: linear-gradient(135deg, #7f8c8d, #2c3e50); }

.tier-header {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 6px 18px;
    border-radius: 40px;
    display: inline-block;
    width: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.tier-s.tier-header { background: linear-gradient(135deg, #ffd700, #ff8c00); text-shadow: 0 1px 2px rgba(255,215,0,0.5); }
.tier-a.tier-header { background: linear-gradient(135deg, #ff7e5e, #feb47b); }
.tier-b.tier-header { background: linear-gradient(135deg, #2ecc71, #27ae60); }
.tier-c.tier-header { background: linear-gradient(135deg, #3498db, #2980b9); }
.tier-d.tier-header { background: linear-gradient(135deg, #95a5a6, #7f8c8d); }
.tier-f.tier-header { background: linear-gradient(135deg, #7f8c8d, #2c3e50); }

.tier-s { background: rgba(255, 215, 0, 0.05); }
.tier-a { background: rgba(255, 126, 94, 0.05); }
.tier-b { background: rgba(46, 204, 113, 0.05); }
.tier-c { background: rgba(52, 152, 219, 0.05); }
.tier-d { background: rgba(149, 165, 166, 0.05); }
.tier-f { background: rgba(127, 140, 141, 0.05); }

.tier-keys,
.all-keys-grid {
    display: grid !important;
    gap: 16px !important;
}

@media (min-width: 1024px) {
    .tier-keys,
    .all-keys-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .tier-keys,
    .all-keys-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 639px) {
    .tier-keys,
    .all-keys-grid {
        grid-template-columns: 1fr !important;
    }
}

.location-section {
    margin-bottom: 32px;
    background: var(--card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
}

.location-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
    color: var(--accent);
}

.key-card {
    background: var(--card-2);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: 0.2s;
    touch-action: manipulation;
}

.key-card:hover {
    border-color: var(--accent);
    background: #1a1f26;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.key-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(0,0,0,0.4);
    flex-shrink: 0;
}

.key-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    flex: 1;
    word-break: break-word;
}

.copy-btn {
    margin-left: auto;
    background: #1a1f26;
    border: none;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    flex-shrink: 0;
    touch-action: manipulation;
}

.copy-btn:hover {
    background: var(--accent);
    color: #000;
}

.copy-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--card);
    border-radius: 24px;
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow: auto;
    position: relative;
    margin: 16px;
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 20px;
    font-size: 32px;
    cursor: pointer;
    color: var(--muted);
    transition: 0.2s;
    line-height: 1;
    touch-action: manipulation;
}

.close-modal:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.loot-list {
    list-style: none;
    padding-left: 0;
}

.loot-list li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    color: var(--text);
}

.loot-list li:last-child {
    border-bottom: none;
}

.loot-list li::before {
    content: "→";
    color: var(--accent);
    margin-right: 12px;
    font-weight: 600;
}

.version-footer {
    text-align: right;
    padding: 32px 20px 20px;
    font-size: 0.75rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--card);
    border-radius: 10px;
    border: 1px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

@media (max-width: 640px) {
    .section-title {
        font-size: 1.5rem;
        text-align: center;
    }
    .tier-header {
        font-size: 22px;
        padding: 4px 14px;
    }
    .key-name {
        font-size: 0.85rem;
    }
}

@media (max-width: 400px) {
    .tarkov-time {
        gap: 12px;
    }
    .time-item span {
        font-size: 0.75rem;
    }
}