/* ==========================================================================
   AZIZLAND Wiki & Portal — Minimalist Editorial Design System
   Inspired by Apple Human Interface Guidelines & the Server Crest
   (Shield + Bookshelf + Redstone Torch: Knowledge & Engineering)
   Zero AI glow blobs, zero drop-shadows, crisp 1px structural geometry.
   ========================================================================== */

:root {
    --bg-canvas: #0a0a0c;
    --bg-surface: #121215;
    --bg-elevated: #18181c;
    --bg-subtle: #1f1f24;

    --border-hairline: #242429;
    --border-strong: #32323a;

    --text-primary: #f5f5f7;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --accent-primary: #dc2626;
    --accent-primary-soft: rgba(220, 38, 38, 0.12);
    --accent-secondary: #d97706;
    --accent-secondary-soft: rgba(217, 119, 6, 0.12);
    --accent-green: #16a34a;
    --accent-green-soft: rgba(22, 163, 74, 0.12);

    --radius-xs: 6px;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;

    --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

/* Contextual Theme: Тыквенный Спас (Halloween) */
body.theme-halloween {
    --bg-canvas: #0c0805;
    --bg-surface: #150e09;
    --bg-elevated: #1e140d;
    --bg-subtle: #281b12;

    --border-hairline: #2e1f14;
    --border-strong: #462e1c;

    --accent-primary: #ea580c;
    --accent-primary-soft: rgba(234, 88, 12, 0.14);
    --accent-secondary: #f59e0b;
    --accent-secondary-soft: rgba(245, 158, 11, 0.14);
}

/* Contextual Theme: Магия и Сферы (Magic) */
body.theme-magic {
    --bg-canvas: #09090d;
    --bg-surface: #111118;
    --bg-elevated: #171722;
    --bg-subtle: #20202e;

    --border-hairline: #232332;
    --border-strong: #34344a;

    --accent-primary: #9333ea;
    --accent-primary-soft: rgba(147, 51, 234, 0.14);
    --accent-secondary: #dc2626;
    --accent-secondary-soft: rgba(220, 38, 38, 0.12);
}

/* Contextual Theme: Владыка Бездны и Ивенты (Void & Events) */
body.theme-void {
    --bg-canvas: #080a0d;
    --bg-surface: #0f1318;
    --bg-elevated: #151b22;
    --bg-subtle: #1c242e;

    --border-hairline: #1f2933;
    --border-strong: #2d3b4a;

    --accent-primary: #0891b2;
    --accent-primary-soft: rgba(8, 145, 178, 0.14);
    --accent-secondary: #7c3aed;
    --accent-secondary-soft: rgba(124, 58, 237, 0.14);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

a {
    color: inherit;
    text-decoration: none;
}

img.pixel-art {
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   Navigation Bar (Apple-style crisp sticky header)
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(10, 10, 12, 0.88);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-hairline);
}

body.theme-halloween .site-header {
    background-color: rgba(12, 8, 5, 0.9);
}

.nav-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.brand-crest {
    width: 34px;
    height: 34px;
    display: block;
    flex-shrink: 0;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.brand-name span {
    color: var(--accent-primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.nav-item {
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: var(--bg-elevated);
}

.nav-item.active {
    color: var(--text-primary);
    background-color: var(--bg-subtle);
    font-weight: 600;
}

.nav-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--accent-green);
}

/* ==========================================================================
   Hero & Page Headers
   ========================================================================== */
.hero-section {
    padding: 72px 0 56px;
    border-bottom: 1px solid var(--border-hairline);
    position: relative;
}

.page-hero {
    padding: 56px 0 44px;
    border-bottom: 1px solid var(--border-hairline);
    position: relative;
    overflow: hidden;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-primary);
    margin-bottom: 14px;
}

.hero-crest-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.hero-crest-large {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.hero-title {
    font-size: clamp(2.2rem, 4.5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.08;
    color: var(--text-primary);
    margin-bottom: 18px;
}

.hero-slogan {
    font-size: clamp(1.25rem, 2.2vw, 1.65rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.hero-slogan mark {
    background: transparent;
    color: var(--accent-primary);
}

.hero-lead {
    font-size: 1.08rem;
    color: var(--text-secondary);
    max-width: 680px;
    line-height: 1.65;
}

/* ==========================================================================
   Connection Endpoints Grid (msk.azizland.ru & azizland.ru)
   ========================================================================== */
.connect-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 36px;
}

.connect-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-md);
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.connect-card:hover {
    border-color: var(--border-strong);
    background-color: var(--bg-elevated);
}

.connect-region {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.region-tag {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.region-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: var(--radius-xs);
    background-color: var(--accent-primary-soft);
    color: var(--accent-primary);
}

.connect-address-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.connect-ip {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.copy-btn {
    padding: 8px 14px;
    border-radius: var(--radius-xs);
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.connect-card:hover .copy-btn {
    background-color: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #fff;
}

.connect-note {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* ==========================================================================
   Sections, Bento Cards & Editorial Typography
   ========================================================================== */
.section {
    padding: 64px 0;
    border-bottom: 1px solid var(--border-hairline);
    position: relative;
}

.section:last-of-type {
    border-bottom: none;
}

.section-head {
    margin-bottom: 36px;
    max-width: 720px;
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.18;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.section-desc {
    font-size: 1.02rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

/* Bento Grid & Cards */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 16px;
}

.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-7  { grid-column: span 7; }
.col-6  { grid-column: span 6; }
.col-5  { grid-column: span 5; }
.col-4  { grid-column: span 4; }

@media (max-width: 900px) {
    .col-8, .col-7, .col-6, .col-5, .col-4 {
        grid-column: span 12;
    }
}

.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-md);
    padding: 28px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.card-interactive {
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.card-interactive:hover {
    border-color: var(--border-strong);
    background-color: var(--bg-elevated);
}

.card-kicker {
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-primary);
}

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    line-height: 1.25;
}

.card-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.65;
}

.card-link-footer {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid var(--border-hairline);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-interactive:hover .card-link-footer {
    color: var(--accent-primary);
}

/* ==========================================================================
   Data Tables & Key-Value Specs
   ========================================================================== */
.spec-table-wrap {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.92rem;
}

.spec-table th {
    background-color: var(--bg-elevated);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border-strong);
    border-right: 1px solid var(--border-hairline);
    vertical-align: middle;
}

.spec-table th:last-child {
    border-right: none;
}

.spec-table td {
    padding: 13px 18px;
    border-bottom: 1px solid var(--border-hairline);
    border-right: 1px solid var(--border-hairline);
    color: var(--text-secondary);
    vertical-align: middle;
}

.spec-table td:last-child {
    border-right: none;
}

.spec-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.015);
}

.spec-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.spec-table tr:last-child td {
    border-bottom: none;
}

.spec-table td strong {
    color: var(--text-primary);
    font-weight: 600;
}

.chance-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    background-color: var(--accent-primary-soft);
    color: var(--accent-primary);
}

.chance-badge.guaranteed {
    background-color: var(--accent-green-soft);
    color: #4ade80;
}

.chance-badge.amber {
    background-color: var(--accent-secondary-soft);
    color: #fbbf24;
}

code.inline-cmd {
    font-family: var(--font-mono);
    font-size: 0.86em;
    padding: 2px 7px;
    border-radius: 5px;
    background-color: var(--bg-subtle);
    border: 1px solid var(--border-hairline);
    color: var(--text-primary);
}

/* Stat / Metric Pills inside cards */
.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.stat-chip {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-xs);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-chip-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.stat-chip-val {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ==========================================================================
   3x3 Minecraft Crafting Table Grids (for Magic & Items)
   ========================================================================== */
.recipe-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-hairline);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recipe-layout {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.craft-grid {
    display: grid;
    grid-template-columns: repeat(3, 58px);
    grid-template-rows: repeat(3, 58px);
    gap: 5px;
    padding: 8px;
    background-color: #0d0d12;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.craft-slot {
    width: 58px;
    height: 58px;
    background-color: #181822;
    border: 1px solid #2a2a3a;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.62rem;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
    padding: 4px 2px;
    line-height: 1.05;
    position: relative;
}

.craft-slot svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: block;
}

.craft-slot span {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.craft-slot.empty {
    background-color: #111118;
    border-color: #1d1d28;
}

.craft-slot.amethyst { background-color: rgba(147, 51, 234, 0.18); border-color: rgba(168, 85, 247, 0.45); color: #e9d5ff; }
.craft-slot.diamond  { background-color: rgba(6, 182, 212, 0.18); border-color: rgba(34, 211, 238, 0.45); color: #cffafe; }
.craft-slot.emerald  { background-color: rgba(22, 163, 74, 0.18); border-color: rgba(74, 222, 128, 0.45); color: #dcfce7; }
.craft-slot.wood     { background-color: rgba(180, 83, 9, 0.2); border-color: rgba(217, 119, 6, 0.45); color: #fef3c7; }
.craft-slot.gold     { background-color: rgba(234, 179, 8, 0.18); border-color: rgba(250, 204, 21, 0.45); color: #fef9c3; }
.craft-slot.quartz   { background-color: rgba(228, 228, 231, 0.14); border-color: rgba(244, 244, 245, 0.35); color: #f4f4f5; }
.craft-slot.fire     { background-color: rgba(234, 88, 12, 0.2); border-color: rgba(249, 115, 22, 0.45); color: #ffedd5; }

/* ==========================================================================
   Halloween Atmospheric Decorations (SVG Cobwebs & Pumpkin Accents)
   ========================================================================== */
.cobweb-corner {
    position: absolute;
    pointer-events: none;
    opacity: 0.22;
    z-index: 0;
}

.cobweb-top-right {
    top: 0;
    right: 0;
    width: 220px;
    height: 220px;
}

.cobweb-top-left {
    top: 0;
    left: 0;
    width: 180px;
    height: 180px;
    transform: scaleX(-1);
}

.card-cobweb {
    position: absolute;
    top: 0;
    right: 0;
    width: 96px;
    height: 96px;
    pointer-events: none;
    opacity: 0.18;
}

.pumpkin-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 28px 0;
    color: var(--accent-primary);
}

.pumpkin-divider::before,
.pumpkin-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: var(--border-hairline);
}

/* ==========================================================================
   Footer & Toast
   ========================================================================== */
.site-footer {
    border-top: 1px solid var(--border-hairline);
    padding: 28px 0;
    background-color: var(--bg-canvas);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.footer-links a:hover {
    color: var(--text-primary);
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
    z-index: 200;
}

.toast.visible {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 768px) {
    .nav-inner {
        height: auto;
        padding: 14px 20px;
        flex-direction: column;
        align-items: flex-start;
    }
    .hero-section, .page-hero {
        padding: 40px 0 36px;
    }
    .section {
        padding: 44px 0;
    }
}

/* ==========================================================================
   Symmetric Fixed-Grid Leaderboard & Stats Tables
   ========================================================================== */
.table-card-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    margin-bottom: 4px;
}

.table-card-head-titles {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.table-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    min-height: 2.7rem;
    display: flex;
    align-items: center;
}

.compact-table-wrap {
    width: 100%;
    background-color: var(--bg-canvas);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-top: 8px;
}

.compact-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.87rem;
    font-variant-numeric: tabular-nums;
}

.compact-table th {
    background-color: var(--bg-elevated);
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.71rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    height: 38px;
    padding: 0 12px;
    border-bottom: 1px solid var(--border-strong);
    border-right: 1px solid var(--border-hairline);
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-table th:last-child {
    border-right: none;
}

.compact-table td {
    height: 41px;
    padding: 0 12px;
    border-bottom: 1px solid var(--border-hairline);
    border-right: 1px solid var(--border-hairline);
    color: var(--text-secondary);
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compact-table td:last-child {
    border-right: none;
}

.compact-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.018);
}

.compact-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.04);
}

.compact-table tr:last-child td {
    border-bottom: none;
}

.compact-table td strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Strict 4-Column Symmetric Proportions (10% + 42% + 22% + 26% = 100%) */
.compact-table th.col-rank,
.compact-table td.col-rank {
    width: 10%;
    text-align: center;
    padding: 0 4px;
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-muted);
    background-color: rgba(255, 255, 255, 0.012);
}

.compact-table th.col-name,
.compact-table td.col-name {
    width: 42%;
    text-align: left;
    padding-left: 14px;
    padding-right: 10px;
}

.compact-table th.col-mid,
.compact-table td.col-mid {
    width: 22%;
    text-align: center;
    padding: 0 8px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.compact-table th.col-num,
.compact-table td.col-num {
    width: 26%;
    text-align: center;
    padding: 0 10px;
    font-family: var(--font-mono);
    font-weight: 600;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    background-color: transparent;
    color: var(--text-muted);
}

.rank-medal-1 .rank-badge,
td.rank-medal-1 {
    color: #fbbf24 !important;
    font-weight: 700 !important;
}

.rank-medal-2 .rank-badge,
td.rank-medal-2 {
    color: #e4e4e7 !important;
    font-weight: 700 !important;
}

.rank-medal-3 .rank-badge,
td.rank-medal-3 {
    color: #d97706 !important;
    font-weight: 700 !important;
}

tr.row-empty td {
    color: var(--text-muted);
    opacity: 0.45;
    font-style: normal;
}


