/* Hexidecimate Wiki Styles */
:root {
    --bg-dark: #11100f;
    --bg-card: #1b1a18;
    --bg-panel: #24221f;
    --accent: #e15d4f;
    --accent-strong: #ffcc66;
    --accent-cool: #69c5b8;
    --accent-dim: #4a2d29;
    --text: #f4f1ea;
    --text-dim: #b7afa2;
    --border: #393530;
    --border-strong: #5b5147;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(225, 93, 79, 0.12), transparent 34rem),
        linear-gradient(180deg, #171514 0%, var(--bg-dark) 38rem);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Navigation */
.wiki-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 2rem;
    background: rgba(27, 26, 24, 0.92);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(14px);
}

.wiki-nav .brand {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0;
}

.wiki-nav .nav-links {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.wiki-nav .nav-links a {
    color: var(--text-dim);
    padding: 0.45rem 0.7rem;
    border-radius: 6px;
}

.wiki-nav .nav-links a:hover {
    color: var(--text);
    background: rgba(255,255,255,0.06);
    text-decoration: none;
}

/* Main Content */
.wiki-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.wiki-home {
    max-width: 1240px;
}

.wiki-main h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text);
    letter-spacing: 0;
}

.subtitle {
    color: var(--text-dim);
    font-size: 1.1rem;
    margin-bottom: 0;
}

.wiki-hero {
    min-height: 360px;
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
    gap: 1.5rem;
    align-items: stretch;
    margin: 1rem 0 1.5rem;
}

.hero-copy {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 3rem;
    background:
        linear-gradient(135deg, rgba(225, 93, 79, 0.22), rgba(105, 197, 184, 0.08)),
        var(--bg-card);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    overflow: hidden;
}

.hero-copy::before {
    content: "";
    position: absolute;
    inset: 1rem;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 6px;
    pointer-events: none;
}

.hero-kicker,
.category-kicker,
.home-section-heading span {
    color: var(--accent-strong);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero-copy h1 {
    font-size: 4rem;
    line-height: 1;
    margin: 0.55rem 0 1rem;
}

.hero-copy .subtitle {
    max-width: 680px;
    font-size: 1.2rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.hero-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.65rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--border-strong);
    color: var(--text);
    background: rgba(255,255,255,0.06);
    font-weight: 700;
}

.hero-button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #160d0b;
}

.hero-button:hover {
    text-decoration: none;
    border-color: var(--accent-strong);
}

.hero-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.hero-stat {
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    padding: 1rem;
    background: rgba(255,255,255,0.035);
}

.primary-stat strong {
    display: block;
    color: var(--accent-strong);
    font-size: 3rem;
    line-height: 1;
}

.hero-stat span,
.hero-panel p {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.hero-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.hero-stat-grid a {
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem;
    background: rgba(255,255,255,0.045);
    border: 1px solid rgba(255,255,255,0.075);
    border-radius: 6px;
}

.hero-stat-grid a:hover {
    text-decoration: none;
    border-color: var(--accent-cool);
}

.hero-stat-grid strong {
    color: var(--text);
    font-size: 1.45rem;
    line-height: 1;
}

.hero-stat-grid span {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.global-search {
    margin: 1.5rem 0 2rem;
}

.home-search {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0;
}

.global-search label {
    display: block;
    color: var(--text-dim);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.global-search input,
.list-search {
    width: 100%;
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    padding: 0.9rem 1rem;
    font-size: 1rem;
}

.global-search input:focus,
.list-search:focus {
    outline: none;
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px rgba(255, 204, 102, 0.12);
}

.global-search-results {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.search-result {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.25rem 0.75rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem 1rem;
}

.search-result:hover {
    border-color: var(--accent-cool);
    text-decoration: none;
}

.search-result-title {
    color: var(--text);
    font-weight: 650;
}

.search-result-meta {
    color: var(--text-dim);
    font-size: 0.85rem;
    text-transform: capitalize;
}

.search-result-desc {
    grid-column: 1 / -1;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.search-muted {
    color: var(--text-dim);
    padding: 0.5rem 0;
}

.breadcrumb {
    margin-bottom: 1rem;
    color: var(--text-dim);
}

.breadcrumb a {
    color: var(--text-dim);
}

.category-page {
    max-width: 1240px;
}

.category-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    align-items: stretch;
    margin: 1rem 0 1.25rem;
    padding: 2.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(225, 93, 79, 0.18), rgba(105, 197, 184, 0.07)),
        var(--bg-card);
    position: relative;
    overflow: hidden;
}

.category-page-classes .category-hero {
    background:
        linear-gradient(135deg, rgba(255, 204, 102, 0.16), rgba(225, 93, 79, 0.12)),
        var(--bg-card);
}

.category-page-equipment .category-hero {
    background:
        linear-gradient(135deg, rgba(105, 197, 184, 0.16), rgba(255, 204, 102, 0.08)),
        var(--bg-card);
}

.category-page-conditions .category-hero {
    background:
        linear-gradient(135deg, rgba(225, 93, 79, 0.2), rgba(120, 92, 62, 0.12)),
        var(--bg-card);
}

.category-page-lore .category-hero {
    background:
        linear-gradient(135deg, rgba(105, 197, 184, 0.14), rgba(225, 93, 79, 0.08)),
        var(--bg-card);
}

.category-page-kicker,
.article-kicker {
    display: inline-block;
    color: var(--accent-strong);
    font-size: 0.75rem;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
    margin-bottom: 0.55rem;
}

.category-hero h1 {
    font-size: 3.15rem;
    line-height: 1;
    margin-bottom: 0.85rem;
}

.category-hero p {
    max-width: 760px;
    color: var(--text-dim);
    font-size: 1.05rem;
    line-height: 1.55;
}

.category-page-stat {
    min-width: 145px;
    display: grid;
    place-items: center;
    align-content: center;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 8px;
    background: rgba(255,255,255,0.045);
    padding: 1rem;
}

.category-page-stat strong {
    color: var(--accent-strong);
    font-size: 3rem;
    line-height: 1;
}

.category-page-stat span {
    color: var(--text-dim);
    font-size: 0.9rem;
    text-transform: lowercase;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.25rem 0 2.25rem;
}

.quick-link {
    display: grid;
    gap: 0.35rem;
    min-height: 110px;
    padding: 1rem;
    background: rgba(255,255,255,0.045);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
}

.quick-link:hover {
    border-color: var(--accent-cool);
    text-decoration: none;
    background: rgba(105, 197, 184, 0.08);
}

.quick-link span {
    font-weight: 800;
}

.quick-link small {
    color: var(--text-dim);
    line-height: 1.45;
}

.home-section-heading {
    margin-top: 1rem;
}

.home-section-heading h2 {
    font-size: 1.7rem;
    margin-top: 0.2rem;
}

/* Category Grid */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.category-card {
    background: rgba(27, 26, 24, 0.9);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.2rem;
    min-height: 255px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.category-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-panel);
    transform: translateY(-2px);
}

.category-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.6rem;
}

.category-card h3 {
    margin-bottom: 0.4rem;
    font-size: 1.35rem;
}

.category-card h3 a {
    color: var(--text);
}

.category-card h3 a:hover {
    color: var(--accent-strong);
    text-decoration: none;
}

.category-card p {
    color: var(--text-dim);
    font-size: 0.92rem;
    line-height: 1.45;
}

.category-count {
    min-width: 2.65rem;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    text-align: center;
    color: var(--text);
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.05);
    font-weight: 800;
    font-size: 0.85rem;
}

.category-card ul {
    list-style: none;
    margin-top: auto;
    padding-top: 1rem;
}

.category-card li {
    padding: 0.18rem 0;
    font-size: 0.92rem;
}

.category-card li a {
    color: var(--text-dim);
}

.category-card li:last-child a {
    color: var(--accent-cool);
    font-weight: 700;
}

/* Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.item-card {
    background: rgba(27, 26, 24, 0.92);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.1rem 1.2rem;
    min-height: 165px;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
}

.item-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-panel);
    transform: translateY(-2px);
}

.item-card-top {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
}

.item-card-top span {
    color: var(--accent-strong);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.item-card h3 {
    margin-bottom: 0.45rem;
    font-size: 1.22rem;
}

.item-card h3 a {
    color: var(--text);
}

.item-card h3 a:hover {
    color: var(--accent-strong);
    text-decoration: none;
}

.item-card p {
    color: var(--text-dim);
    font-size: 0.9rem;
    line-height: 1.48;
}

.item-card-tags,
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: auto;
    padding-top: 1rem;
}

.item-card-tags:empty,
.article-tags:empty {
    display: none;
}

.item-card-tags span,
.article-tags span {
    color: var(--text-dim);
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.045);
    border-radius: 999px;
    padding: 0.22rem 0.55rem;
    font-size: 0.78rem;
}

.list-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}

.list-count {
    color: var(--text-dim);
    white-space: nowrap;
}

.hidden {
    display: none !important;
}

/* Article Content */
.wiki-article {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 2rem;
    margin-top: 1rem;
}

.wiki-reference-article {
    padding: 0;
    overflow: visible;
}

.wiki-article h1 {
    font-size: 2rem;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.wiki-article h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.wiki-article h3 {
    font-size: 1.2rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.wiki-article p {
    margin-bottom: 1rem;
}

.wiki-article ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.wiki-article li {
    margin-bottom: 0.25rem;
}

.wiki-article code {
    background: rgba(255,255,255,0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-family: monospace;
}

.article-hero {
    padding: 2rem 2rem 1.75rem;
    border-bottom: 1px solid var(--border);
    background:
        linear-gradient(135deg, rgba(225, 93, 79, 0.16), rgba(105, 197, 184, 0.06)),
        rgba(255,255,255,0.025);
}

.article-hero-classes {
    background:
        linear-gradient(135deg, rgba(255, 204, 102, 0.14), rgba(225, 93, 79, 0.1)),
        rgba(255,255,255,0.025);
}

.article-hero-equipment {
    background:
        linear-gradient(135deg, rgba(105, 197, 184, 0.14), rgba(255, 204, 102, 0.07)),
        rgba(255,255,255,0.025);
}

.article-hero-conditions {
    background:
        linear-gradient(135deg, rgba(225, 93, 79, 0.18), rgba(120, 92, 62, 0.11)),
        rgba(255,255,255,0.025);
}

.article-hero-lore {
    background:
        linear-gradient(135deg, rgba(105, 197, 184, 0.12), rgba(225, 93, 79, 0.08)),
        rgba(255,255,255,0.025);
}

.article-hero h1 {
    border-bottom: 0;
    padding-bottom: 0;
    margin-bottom: 0.75rem;
    font-size: 2.65rem;
    line-height: 1.05;
}

.article-hero p {
    max-width: 850px;
    color: var(--text-dim);
    font-size: 1.02rem;
    line-height: 1.55;
    margin-bottom: 0;
}

.article-body {
    padding: 2rem;
    overflow: visible;
}

.article-body > :first-child {
    margin-top: 0;
}

/* Tables */
.wiki-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    display: block;
    overflow-x: auto;
    overflow-y: visible;
}

.wiki-table td, .wiki-table th {
    border: 1px solid var(--border);
    padding: 0.5rem 0.75rem;
    text-align: left;
}

.wiki-table tr:nth-child(odd) {
    background: rgba(255,255,255,0.03);
}

.wiki-table tr:first-child td,
.wiki-table th {
    color: var(--accent-strong);
    background: rgba(255, 204, 102, 0.08);
    font-weight: 800;
}

/* Tooltip Terms - Conditions and other game terms */
.tooltip-term {
    color: #7dd3fc;  /* Light cyan - distinct from regular links */
    text-decoration: none;
    border-bottom: 1px dotted #7dd3fc;
    cursor: help;
    position: relative;
}

.tooltip-term:hover {
    color: #38bdf8;
    text-decoration: none;
}

/* Tooltip popup */
.tooltip-term::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 0;
    transform: none;
    background: #0f172a;
    color: #e2e8f0;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: 1px solid #334155;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-line;
    width: max-content;
    max-width: min(300px, calc(100vw - 2rem));
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    margin-bottom: 8px;
}

/* Arrow pointing down */
.tooltip-term::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 0.85rem;
    transform: none;
    border: 6px solid transparent;
    border-top-color: #334155;
    margin-bottom: 2px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    pointer-events: none;
}

.tooltip-term:hover::after,
.tooltip-term:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Footer */
footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
    .wiki-nav {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .wiki-nav .nav-links {
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .wiki-main {
        padding: 1rem;
    }

    .wiki-hero {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .hero-copy {
        padding: 2rem;
    }

    .hero-copy h1 {
        font-size: 2.7rem;
    }

    .quick-links {
        grid-template-columns: 1fr 1fr;
    }

    .category-hero {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .category-hero h1 {
        font-size: 2.35rem;
    }

    .category-page-stat {
        min-width: 0;
        grid-template-columns: auto auto;
        justify-content: start;
        gap: 0.5rem;
    }

    .article-hero,
    .article-body {
        padding: 1.4rem;
    }

    .article-hero h1 {
        font-size: 2rem;
    }

    .list-tools {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .hero-actions,
    .quick-links,
    .hero-stat-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions {
        display: grid;
    }

    .hero-copy {
        padding: 1.5rem;
    }

    .hero-copy h1 {
        font-size: 2.25rem;
    }
}
