:root {
    --bg-color: #f8fafc;
    --text-color: #334155;
    --accent-color: #0284c7;
    --card-bg: #ffffff;
    --nav-bg: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* --- Navigation --- */
.navbar {
    background-color: var(--nav-bg);
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.nav-links a:hover {
    background-color: #f1f5f9;
    border-color: var(--accent-color);
}

.nav-links a.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

.menu-toggle {
    display: none;
    cursor: pointer;
    text-align: center;
    font-weight: bold;
    color: var(--text-color);
    padding: 10px;
    background-color: #f1f5f9;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    user-select: none;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        margin-top: 15px;
    }

    .nav-links.active {
        display: flex;
    }
}

/* --- Layout & typography --- */
.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

h1 {
    color: #0f172a;
    margin-bottom: 10px;
    text-align: center;
}

.subtitle {
    text-align: center;
    color: #64748b;
    margin-bottom: 40px;
}

.section-title {
    color: var(--accent-color);
    margin-top: 40px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.event-header {
    color: #0f172a;
    text-align: center;
    padding-top: 90px;
    margin-top: -50px;
    margin-bottom: 30px;
    font-size: 2.2rem;
    font-weight: 800;
    position: relative;
}

.event-header::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    margin: 8px auto 0 auto;
    border-radius: 2px;
}

/* --- Table of contents --- */
.toc {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--accent-color);
    text-align: center;
}

.toc h3 {
    margin-top: 0;
    color: #0f172a;
}

.toc-part-title {
    color: var(--accent-color);
    font-weight: 800;
    margin-top: 15px;
    margin-bottom: 10px;
    text-align: center;
    font-size: 1.1rem;
}

.toc-part-title + .toc-links,
.toc-part-title[style] {
    margin-top: 0;
}

.toc-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 15px;
    margin-bottom: 15px;
}

.toc-links a {
    text-decoration: none;
    background: #f1f5f9;
    color: var(--text-color);
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.toc-links a:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
}

/* Heroes page: compact TOC links */
.toc--detailed .toc-links {
    gap: 10px;
}

.toc--detailed .toc-links a {
    padding: 6px 16px;
    font-size: 0.9rem;
}

.toc--detailed {
    text-align: left;
}

/* --- Guide cards --- */
.guide-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.guide-card h3 {
    margin-top: 0;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
}

.guide-card h4 {
    color: #334155;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 5px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.guide-card p {
    margin-bottom: 10px;
}

.guide-card ul {
    padding-left: 20px;
    margin-bottom: 0;
}

.guide-card li {
    margin-bottom: 8px;
}

.guide-card li:last-child {
    margin-bottom: 0;
}

.highlight {
    font-weight: bold;
    color: var(--accent-color);
}

.danger-text {
    font-weight: bold;
    color: #e11d48;
}

.ratio-box {
    background: #f1f5f9;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 15px 0;
    color: #0f172a;
    border: 1px dashed var(--accent-color);
}

/* --- Rules alert --- */
.rules-card {
    background: #fff1f2;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(225, 29, 72, 0.1);
    border: 2px solid #fecdd3;
    border-left: 6px solid #e11d48;
}

.rules-card h3 {
    margin-top: 0;
    color: #be123c;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
}

.rules-card p {
    margin-bottom: 10px;
    color: #4c0519;
}

.rules-card ul {
    padding-left: 20px;
    margin-bottom: 15px;
    color: #881337;
}

.rules-card li {
    margin-bottom: 8px;
    font-weight: 500;
}

.rules-card .highlight {
    font-weight: bold;
    color: #e11d48;
}

.rules-alert-footer {
    font-weight: bold;
    color: #be123c;
    margin-top: 15px;
    border-top: 1px solid #fda4af;
    padding-top: 15px;
    line-height: 1.8;
}

/* --- Matrix tables --- */
.matrix-table-container {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    min-width: 600px;
    background-color: #ffffff;
}

.matrix-table th,
.matrix-table td {
    border: 1px solid #e2e8f0;
    padding: 12px 10px;
    text-align: center;
}

.matrix-table th {
    background-color: var(--accent-color);
    color: white;
    font-weight: 600;
}

.matrix-table td:first-child {
    text-align: left;
    font-weight: 600;
    background-color: #f8fafc;
    color: #0f172a;
}

.icon-best {
    color: #16a34a;
    font-weight: bold;
    font-size: 1.2rem;
}

.icon-ok {
    color: #0284c7;
    font-weight: bold;
    font-size: 1.1rem;
}

.icon-none {
    color: #cbd5e1;
    font-weight: bold;
}

/* Widget priority table (heroes page) */
.matrix-table--widgets th,
.matrix-table--widgets td {
    text-align: left;
}

.matrix-table--widgets th {
    text-align: center;
}

.matrix-table--widgets td:first-child {
    text-align: center;
    white-space: nowrap;
}

.matrix-table--widgets td:nth-child(2) {
    text-align: center;
    font-weight: bold;
    color: var(--accent-color);
}

/* --- Gallery (index page) --- */
.gallery {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.thumb-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    border: 1px solid #e2e8f0;
    transition: transform 0.3s ease;
}

.thumb-container:hover {
    transform: translateY(-5px);
}

.thumb-container img {
    width: 100%;
    border-radius: 8px;
    display: block;
}

.thumb-title {
    margin-top: 15px;
    font-weight: bold;
    font-size: 1.2rem;
    text-align: center;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal img {
    max-width: 95%;
    max-height: 80vh;
    border-radius: 5px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.modal-caption {
    color: white;
    margin-top: 20px;
    font-size: 1.5rem;
    font-weight: bold;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
}

/* --- Scroll to top --- */
.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--accent-color);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-top:hover {
    background-color: #0369a1;
    transform: translateY(-3px);
}
