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

@font-face {
    font-family: 'CourierNewCustom';
    src: url('fonts/cour.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'CourierNewCustom';
    src: url('fonts/courbd.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'CourierNewCustom';
    src: url('fonts/couri.ttf') format('truetype');
    font-weight: normal;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'CourierNewCustom';
    src: url('fonts/courbi.ttf') format('truetype');
    font-weight: bold;
    font-style: italic;
    font-display: swap;
}

/* ==========================================================================
   1. DESIGN TOKENS & HUD VEIL VARIABLES (Dynamic Theme-Aware)
   ========================================================================== */
:root {
    --font-ui: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'CourierNewCustom', Courier, monospace;

    /* Derived HUD Veil tokens (automatically adapt to active theme variables) */
    --hairline: rgba(255, 255, 255, 0.08);
    --hairline-soft: rgba(255, 255, 255, 0.045);
    --hairline-active: rgba(var(--accent-rgb), 0.42);
    --accent-glow: rgba(var(--accent-rgb), 0.35);
    --accent-surface: rgba(var(--accent-rgb), 0.08);
    --veil-stage-bg: radial-gradient(
        130% 100% at 50% 0%,
        rgba(18, 21, 28, 0.86) 0%,
        rgba(13, 15, 22, 0.76) 75%,
        rgba(10, 12, 18, 0.64) 100%
    );
    --veil-card-bg: rgba(16, 18, 24, 0.68);
    --veil-card-hover: rgba(24, 28, 36, 0.84);
    --groove-bg: rgba(6, 8, 14, 0.62);
}

*, *::before, *::after {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--selector);
}

::selection {
    background-color: var(--accent);
    color: var(--selector);
}

::-moz-selection {
    background-color: var(--accent);
    color: var(--selector);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

html, body {
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    background-color: var(--selector, #0b0d13);
    color: var(--white);
    font-family: var(--font-ui);
    font-size: 15px;
    line-height: 1.55;
    word-spacing: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.background-image {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -1;
    pointer-events: none;
}

/* Semantic color utilities */
.hl { color: var(--accent); }
.bad { color: var(--danger); }
.good, #green_color { color: var(--success); }
.alt, #unic, .ability-passive { color: var(--text-alter); }
.text, #text, .text-dimmed { color: var(--text-dim); }
#yellow_color { color: var(--text-tech, #f1c40f); }

/* ==========================================================================
   2. HEADER & TELEMETRY TICKER (HUD Top Bar)
   ========================================================================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(180deg, rgba(16, 19, 26, 0.90) 0%, rgba(16, 19, 26, 0.76) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--hairline);
    padding: 10px 0 12px;
    z-index: 1000;
    text-align: center;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.38);
}

header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(var(--accent-rgb), 0.5) 30%,
        rgba(255, 255, 255, 0.55) 50%,
        rgba(var(--accent-rgb), 0.5) 70%,
        transparent
    );
    pointer-events: none;
}

.container {
    max-width: 94%;
    margin: 0 auto;
    padding: 0 16px;
}

.header-container {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    width: min(100%, 760px);
}

.logo {
    font-family: var(--font-mono);
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 0 0 22px var(--accent-glow), 0 2px 6px rgba(0, 0, 0, 0.8);
    text-align: center;
    margin-bottom: 6px;
    line-height: 1.15;
}

.header-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 30px;
    gap: 14px;
    background: var(--groove-bg);
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--hairline);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.news-ticker {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.ticker-content {
    position: absolute;
    white-space: nowrap;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1;
    top: 50%;
    transform: translateY(-50%);
    animation: scroll-text 18s linear infinite;
    transition: opacity 0.4s ease;
}

@keyframes scroll-text {
    0% { transform: translate(100%, -50%); }
    100% { transform: translate(-100%, -50%); }
}

.pda-time-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    height: 100%;
    padding-left: 12px;
    border-left: 1px solid var(--hairline);
}

.pda-time {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-shadow: 0 0 10px var(--accent-glow);
    line-height: 1;
}

.header-side-info {
    display: none;
}

@media (min-width: 1200px) {
    .header-side-info {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        font-family: var(--font-mono);
        line-height: 1.3;
        opacity: 0.55;
        transition: opacity 0.25s ease;
    }

    header:hover .header-side-info {
        opacity: 0.9;
    }

    .left-side {
        left: 28px;
        border-left: 2px solid var(--accent);
        padding-left: 10px;
        text-align: left;
    }

    .right-side {
        right: 28px;
        border-right: 2px solid var(--accent);
        padding-right: 10px;
        align-items: flex-end;
        text-align: right;
    }

    .side-label {
        font-size: 0.62rem;
        color: var(--accent);
        font-weight: 600;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .side-value {
        font-size: 0.75rem;
        color: var(--white);
    }
}

/* ==========================================================================
   3. MAIN WORKSPACE & HUD VEIL STAGES (Sidebar + Content Stage)
   ========================================================================== */
main {
    display: flex;
    gap: 16px;
    flex-wrap: nowrap;
    margin-top: 102px;
    height: calc(100vh - 148px);
    height: calc(100dvh - 148px);
    padding: 0 18px;
    align-items: stretch;
}

.sidebar {
    position: relative;
    height: 100%;
    width: 240px;
    min-width: 220px;
    flex-shrink: 0;
    background: var(--veil-stage-bg);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--hairline);
    padding: 16px 16px 14px;
    border-radius: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
}

/* Top Sheen on Sidebar & Content Wrapper */
.sidebar::before,
.content-wrapper::before,
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(var(--accent-rgb), 0.55) 30%,
        rgba(255, 255, 255, 0.65) 50%,
        rgba(var(--accent-rgb), 0.55) 70%,
        transparent
    );
    pointer-events: none;
}

.sidebar h2 {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--hairline);
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar li {
    margin-bottom: 4px;
}

.sidebar a,
.dropdown-btn {
    font-family: var(--font-ui);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    text-align: left;
    transition: all 0.18s ease;
    line-height: 1.3;
}

.sidebar a:hover,
.dropdown-btn:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--hairline-soft);
    transform: translateX(2px);
}

.sidebar a.active,
.dropdown-btn.active {
    color: var(--accent);
    background: var(--accent-surface);
    border-color: rgba(var(--accent-rgb), 0.25);
    text-shadow: 0 0 12px var(--accent-glow);
}

.caret {
    font-size: 0.72rem;
    color: var(--text-dim);
    transition: transform 0.25s ease, color 0.2s ease;
}

.dropdown-btn:hover .caret,
.dropdown-btn.active .caret {
    color: var(--accent);
}

.dropdown-btn {
    margin-top: 8px;
    margin-bottom: 6px;
}

.dropdown-btn:first-child,
.sidebar > ul > li:first-child .dropdown-btn {
    margin-top: 0;
}

.dropdown-btn.active {
    margin-bottom: 10px;
}

.dropdown-btn.active .caret {
    transform: rotate(180deg);
}

.dropdown-container {
    display: none;
    max-height: none;
    overflow: visible;
    margin: 8px 0 14px 6px;
    padding-left: 10px;
    border-left: 1px solid rgba(var(--accent-rgb), 0.28);
}

.dropdown-container li {
    margin-bottom: 3px;
}

.dropdown-container li:first-child {
    margin-top: 0;
}

.dropdown-container li a {
    padding: 5px 8px;
    font-size: 0.86rem;
    font-weight: 400;
    justify-content: flex-start;
    gap: 6px;
}

.dropdown-container li a::before {
    content: "-";
    font-family: var(--font-mono);
    font-size: 0.75rem;
    opacity: 0.55;
    color: var(--accent);
}

.current-v {
    display: block;
    margin-top: auto;
    padding-top: 12px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.45;
}

.current-v div:nth-child(2) {
    animation: blink 3s infinite;
}

.theme-btn {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), 0.38);
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    width: 100%;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.theme-btn:hover {
    background: var(--accent);
    color: var(--selector);
    box-shadow: 0 0 18px var(--accent-glow);
    transform: translateY(-1px);
}

.theme-btn:active {
    transform: translateY(0);
}

@keyframes blink {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 0.35; }
}

/* Main Backdrop Veil Stage */
.content-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 100%;
    margin-top: 0;
    background: var(--veil-stage-bg);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    padding: 12px 6px 12px 26px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.48);
}

.content-mask {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 3.5%,
        black 96.5%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        black 3.5%,
        black 96.5%,
        transparent 100%
    );
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border) rgba(0, 0, 0, 0.2);
    overscroll-behavior-y: contain;
}

.content {
    padding: 20px 24px 36px 0;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   4. TYPOGRAPHY, HEADINGS & HAIRLINE DIVIDERS
   ========================================================================== */
.content h1,
.page-title {
    font-family: var(--font-ui);
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--white);
    margin: 0 0 20px 0;
    text-align: center;
    line-height: 1.25;
    text-shadow: 0 0 24px rgba(var(--accent-rgb), 0.22);
}

.content h2.group-title,
.cmd-category {
    font-family: var(--font-mono);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 32px 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--hairline);
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.content h2.group-title::before,
.cmd-category::before {
    content: '//';
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    opacity: 0.65;
}

.content h3 {
    font-family: var(--font-ui);
    font-size: 1.18rem;
    font-weight: 600;
    color: var(--accent);
    margin: 24px 0 10px 0;
    letter-spacing: -0.01em;
}

.content h4 {
    color: var(--text-dim);
    text-align: center;
    font-weight: 500;
}

/* Hide legacy <hr/> immediately after .group-title since .group-title has its own hairline */
h2.group-title + hr {
    display: none;
}

.content hr {
    width: 100%;
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--hairline-active), transparent);
    margin: 22px 0;
}

/* ==========================================================================
   5. HUD VEIL METRIC STRIP & CONSOLE DOCK (Search + Category Filters)
   ========================================================================== */
.metric-strip {
    display: flex;
    align-items: baseline;
    gap: 24px;
    margin-bottom: 18px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.018);
    border: 1px solid var(--hairline-soft);
    border-radius: 10px;
    flex-wrap: wrap;
}

.metric-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.metric-val {
    font-family: var(--font-ui);
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--white);
}

.metric-val.accent {
    color: var(--accent);
    text-shadow: 0 0 16px var(--accent-glow);
}

.metric-val.emerald {
    color: var(--success);
    text-shadow: 0 0 16px rgba(4, 211, 97, 0.35);
}

.metric-val.ruby {
    color: var(--danger);
}

.metric-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.metric-divider {
    font-family: var(--font-mono);
    color: var(--hairline);
    user-select: none;
}

.console-dock {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(8, 10, 16, 0.42);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-stream {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.filter-link {
    background: none;
    border: none;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    color: var(--text-dim);
    cursor: pointer;
    padding: 5px 2px;
    position: relative;
    transition: color 0.18s ease;
    white-space: nowrap;
}

.filter-link:hover {
    color: var(--white);
}

.filter-link.active {
    color: var(--white);
    font-weight: 600;
}

.filter-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
    border-radius: 2px;
}

.search-pocket {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--groove-bg);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 6px 12px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-width: 210px;
}

.search-pocket:focus-within {
    border-color: rgba(var(--accent-rgb), 0.6);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45), 0 0 14px var(--accent-glow);
}

.search-pocket input {
    background: transparent;
    border: none;
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    width: 100%;
    outline: none;
}

.search-pocket input::placeholder {
    color: var(--text-dim);
}

/* Frosted Groove inputs across site (Modals, Support, Web Auth) */
.frosted-input,
#update-search,
#support-user-id,
#ticket-category,
#ticket-message,
#ticket-reply-input,
#auth-login,
#auth-pass {
    width: 100%;
    padding: 11px 14px;
    background: var(--groove-bg);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 0.88rem;
    outline: none;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.frosted-input:focus,
#update-search:focus,
#support-user-id:focus,
#ticket-category:focus,
#ticket-message:focus,
#ticket-reply-input:focus,
#auth-login:focus,
#auth-pass:focus {
    border-color: rgba(var(--accent-rgb), 0.65);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5), 0 0 14px var(--accent-glow);
    background: rgba(8, 11, 18, 0.85);
}

#ticket-category option {
    background: #14171f;
    color: var(--white);
}

/* ==========================================================================
   6. CATALOG CARDS & 3D FLIP MODULES (.items-grid, .item-card)
   ========================================================================== */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding: 10px 0 20px;
}

.item-card {
    background: var(--veil-card-bg);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
    min-height: 210px;
    height: auto;
    perspective: 1000px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
    pointer-events: none;
    z-index: 2;
}

.item-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--accent-rgb), 0.5);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.48), 0 0 20px rgba(var(--accent-rgb), 0.12);
    background: var(--veil-card-hover);
}

.item-card:has(.long),
.item-card[onclick] {
    cursor: pointer;
}

/* CSS Grid 3D Flip Architecture (Zero clipping, auto-sizing height) */
.item-card-inner {
    position: relative;
    width: 100%;
    flex: 1;
    display: grid;
    grid-template-areas: "flip";
    transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    transform-style: preserve-3d;
}

.item-card-front,
.item-card-back {
    grid-area: flip;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
}

.item-card-back {
    transform: rotateY(180deg);
    background: rgba(14, 17, 24, 0.96);
}

.item-card.flipped .item-card-inner {
    transform: rotateY(180deg);
}

.item-header {
    padding: 16px 16px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: radial-gradient(circle at 50% 60%, rgba(var(--accent-rgb), 0.08), rgba(255, 255, 255, 0.015) 70%);
    border-bottom: 1px solid var(--hairline-soft);
}

.item-header img {
    max-height: 76px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
    transition: transform 0.25s ease;
}

.item-card:hover .item-header img:not(.rotated) {
    transform: scale(1.05);
}

.item-header img.rotated {
    max-height: none;
    max-width: none;
    height: 185px;
    width: auto;
    transform: rotate(-90deg);
    margin: -54px 0;
    flex-shrink: 0;
}

.item-title,
.item-name {
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--white);
    text-align: center;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.item-info {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 5px;
    font-size: 0.86rem;
    line-height: 1.45;
    color: var(--text);
}

.item-info br {
    display: none;
}

.item-info > span,
.info-block {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.45;
}

.info-block {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--hairline-soft);
}

.info-block:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.info-label {
    display: block;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    margin-bottom: 3px;
    font-weight: 600;
}

.info-text {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--text);
}

.more-info-text,
.icons-info-btn {
    margin-top: auto;
    padding-top: 10px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-dim);
    text-align: center;
    cursor: pointer;
    transition: color 0.2s ease;
}

.item-card:hover .more-info-text,
.icons-info-btn:hover {
    color: var(--accent);
}

/* ==========================================================================
   7. PETS, GUIDES, WEATHER, SHELTER & MAFIA MODULES
   ========================================================================== */
.pets-grid {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 20px;
}

.pet-card {
    background: var(--veil-card-bg);
    border: 1px solid var(--hairline);
    border-radius: 14px;
    display: flex;
    overflow: hidden;
    transition: all 0.25s ease;
}

.pet-card:hover {
    border-color: rgba(var(--accent-rgb), 0.5);
    transform: translateX(6px);
    background: var(--veil-card-hover);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

.pet-main {
    flex: 0 0 280px;
    padding: 22px;
    background: radial-gradient(circle at 50% 40%, rgba(var(--accent-rgb), 0.08), rgba(255, 255, 255, 0.015) 75%);
    border-right: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.pet-header img {
    max-width: 150px;
    height: auto;
    margin: 12px 0;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55));
}

.pet-name {
    font-family: var(--font-ui);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
}

.pet-source {
    margin-top: 10px;
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text);
}

.pet-source strong {
    font-family: var(--font-mono);
    color: var(--text-tech, #ffcc00);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 4px;
}

.pet-details {
    flex: 1;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.details-label {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--white);
    border-left: 3px solid var(--accent);
    padding-left: 10px;
}

.abilities {
    list-style: none;
    padding: 0;
    margin: 0;
}

.abilities li {
    margin-bottom: 8px;
    line-height: 1.5;
    font-size: 0.88rem;
    color: var(--text);
}

.legend {
    margin-top: 24px;
    padding: 16px 20px;
    background: rgba(8, 10, 16, 0.5);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    font-size: 0.88rem;
}

/* Guides & Callout Blocks */
.guide-content {
    line-height: 1.65;
    color: var(--text);
    font-size: 0.95rem;
}

.guide-list {
    list-style: none;
    padding-left: 0;
    margin: 14px 0;
}

.guide-list li {
    position: relative;
    padding: 4px 0 4px 22px;
    margin-bottom: 8px;
    border-left: 1px solid var(--hairline);
}

.guide-list li::before {
    content: "•";
    position: absolute;
    left: 8px;
    color: var(--accent);
    font-weight: bold;
}

.guide-list.two-col {
    columns: 2;
    -webkit-columns: 2;
    -moz-columns: 2;
    column-gap: 28px;
}

.pda-notification,
.cmd-page-intro,
.pre-info-block,
.weather-info-block {
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.08) 0%, rgba(255, 255, 255, 0.015) 100%);
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--accent);
    padding: 16px 20px;
    margin: 0 0 24px 0;
    border-radius: 4px 12px 12px 4px;
    color: var(--text);
    line-height: 1.55;
}

.pda-notification h4 {
    margin: 0 0 8px 0;
    color: var(--accent);
    text-transform: uppercase;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.86rem;
    letter-spacing: 0.05em;
}

/* Hints Grid (guides.html) */
.hints-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.hint-card {
    background: var(--veil-card-bg);
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--text-dim);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.hint-card:hover {
    border-color: rgba(var(--accent-rgb), 0.45);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
}

.cat-survival { border-left-color: var(--accent); }
.cat-danger   { border-left-color: var(--danger); }
.cat-economy  { border-left-color: var(--success); }
.cat-misc     { border-left-color: var(--text-dim); }
.cat-other    { border-left-color: var(--text-alter); }
.cat-tech     { border-left-color: var(--text-tech, #f1c40f); }

.hint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid var(--hairline-soft);
}

.hint-number {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
}

.hint-category {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hint-content {
    padding: 14px;
    color: var(--text);
    line-height: 1.55;
    font-size: 0.9rem;
}

/* Weather Cards (weather.html) */
.weather-section {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.weather-card {
    background: var(--veil-card-bg);
    border: 1px solid var(--hairline);
    padding: 16px;
    border-radius: 12px;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.weather-card:hover {
    border-color: rgba(var(--accent-rgb), 0.5);
    background: var(--veil-card-hover);
    transform: translateY(-3px);
}

.weather-card.danger-weather {
    border-left: 3px solid var(--danger);
}

.weather-card h4 {
    margin: 0 0 10px 0;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    font-size: 0.98rem;
}

.weather-card span.chance {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    display: block;
    margin-bottom: 6px;
}

.weather-effects {
    list-style: none;
    padding: 0;
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.weather-effects li {
    padding: 3px 0 3px 18px;
    position: relative;
    line-height: 1.4;
}

.weather-effects li::before {
    position: absolute;
    left: 0;
    font-weight: bold;
}

.weather-effects li.up { color: var(--success); }
.weather-effects li.up::before { content: "▲"; filter: drop-shadow(0 0 4px var(--success)); }

.weather-effects li.down { color: var(--danger); }
.weather-effects li.down::before { content: "▼"; filter: drop-shadow(0 0 4px var(--danger)); }

.weather-effects li.n { color: var(--text-dim); }
.weather-effects li.n::before { content: "•"; }

.weather-card.holiday {
    border-color: rgba(241, 196, 15, 0.35);
    background: linear-gradient(145deg, rgba(241, 196, 15, 0.06), rgba(16, 18, 24, 0.7));
}

.weather-card.holiday:hover {
    border-color: #f1c40f;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.18);
}

.holiday-bonus {
    grid-column: 1 / -1;
    background: rgba(241, 196, 15, 0.08);
    color: #f1c40f;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px dashed rgba(241, 196, 15, 0.5);
    margin-bottom: 6px;
    text-align: center;
    font-family: var(--font-mono);
    font-size: 0.84rem;
}

/* Shelter Zones (shelter.html) */
.zone-block {
    background: var(--veil-card-bg);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
}

.zone-header {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(var(--accent-rgb), 0.12);
    padding: 12px 18px;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.35);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--white);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.zone-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed var(--hairline-soft);
    font-size: 0.9rem;
}

.stat-row:last-child {
    border-bottom: none;
}

.unic-item {
    margin-top: 4px;
    font-size: 0.88rem;
}

.requirement-tag {
    display: inline-block;
    align-self: flex-start;
    padding: 5px 12px;
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    border-radius: 6px;
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent);
}

/* Mafia & Auction Blocks */
.role-icon { font-size: 1.35rem; margin-right: 6px; vertical-align: middle; }
.phase-block {
    background: var(--veil-card-bg);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}
.phase-block h3 {
    margin-top: 0;
    border-bottom: 1px solid var(--hairline);
    padding-bottom: 8px;
    color: var(--accent);
}
.role-card-content { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.role-desc { color: var(--text-dim); font-size: 0.86rem; line-height: 1.45; }

.market-info-block {
    background: var(--veil-card-bg);
    padding: 22px;
    border: 1px solid var(--hairline);
    border-radius: 14px;
    margin-bottom: 32px;
}

.market-two-col {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}

/* Icons Gallery (donat.html modal) */
.icon-gallery-section {
    margin-top: 20px;
}

.icon-gallery-section h3 {
    color: var(--accent);
    border-bottom: 1px dashed var(--hairline);
    padding-bottom: 8px;
    margin-bottom: 14px;
    font-size: 1rem;
    font-family: var(--font-mono);
}

.icons-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.icon-item {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--hairline);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.2s ease;
}

.icon-item:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    background: rgba(var(--accent-rgb), 0.08);
}

.icon-item img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.icon-item span {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--white);
    line-height: 1.25;
}

/* ==========================================================================
   8. SEAMLESS DATA GRIDS (Commands, Policy Rules, Roles Table)
   ========================================================================== */
.cmd-list,
.rule-list {
    background: rgba(10, 12, 18, 0.55);
    border: 1px solid var(--hairline);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.cmd-item,
.rule-item {
    display: grid;
    grid-template-columns: 310px 1fr;
    border-bottom: 1px solid var(--hairline-soft);
    transition: background 0.16s ease;
    position: relative;
}

.rule-item {
    grid-template-columns: 110px 1fr;
}

.cmd-item:last-child,
.rule-item:last-child {
    border-bottom: none;
}

.cmd-item:hover,
.rule-item:hover {
    background: rgba(var(--accent-rgb), 0.045);
}

/* HUD Veil Left Neon Marker on Row Hover */
.cmd-item:hover::before,
.rule-item:hover::before {
    content: '';
    position: absolute;
    left: 0;
    top: 16%;
    bottom: 16%;
    width: 2px;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    border-radius: 2px;
}

.cmd-syntax,
.rule-title {
    padding: 13px 16px;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    color: var(--white);
    border-right: 1px solid var(--hairline-soft);
    background: rgba(255, 255, 255, 0.015);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    font-weight: 600;
}

.rule-title {
    align-items: flex-start;
    color: var(--accent);
}

.cmd-desc,
.rule-desc {
    padding: 13px 18px;
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cmd-arg {
    color: var(--accent);
    font-weight: 500;
    margin: 0 2px;
}

.cmd-arg-opt {
    color: var(--text-dim);
    font-weight: 400;
    margin: 0 2px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
    border: 1px solid var(--hairline);
    border-radius: 12px;
    background: rgba(10, 12, 18, 0.55);
}

.roles-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 580px;
    font-family: var(--font-mono);
    font-size: 0.84rem;
    text-align: center;
}

.roles-table th {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    border-bottom: 1px solid var(--hairline);
    padding: 12px 8px;
    font-weight: 600;
}

.roles-table td {
    border-bottom: 1px solid var(--hairline-soft);
    padding: 10px 8px;
    color: var(--text);
}

.roles-table tbody tr:hover td {
    background: rgba(var(--accent-rgb), 0.05);
}

/* ==========================================================================
   9. INTERACTIVE STRATEGIC MAP (pages/map.html)
   ========================================================================== */
#map-root {
    position: relative;
    width: 100%;
    height: 75vh;
    background: var(--selector);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--hairline);
    user-select: none;
    -webkit-user-select: none;
}

#map-viewport {
    width: 100%;
    height: 100%;
    cursor: grab;
    position: relative;
    background-image: radial-gradient(var(--border) 1px, transparent 0);
    background-size: 60px 60px;
}

#connections-svg {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 100;
}

#map-container {
    transform-origin: 0 0;
    position: absolute;
    width: fit-content;
    height: fit-content;
    transition: none !important;
    will-change: transform;
}

#loc-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(7, 800px);
    grid-template-rows: repeat(7, 800px);
    padding: 1000px;
    z-index: 2;
    margin: 0;
}

.mi {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: middle;
    display: inline-block;
    flex-shrink: 0;
}

.loc-card {
    width: 500px;
    height: fit-content;
    background: rgba(20, 23, 30, 0.92);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
    align-self: start;
}

.loc-card-title {
    font-family: var(--font-ui);
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    font-size: 32px;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--hairline);
    padding-bottom: 8px;
}

.sub-map-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: var(--selector);
    padding: 8px;
    border-radius: 10px;
}

.sub-point {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-dim);
    padding: 6px;
    flex-wrap: wrap;
    word-break: break-word;
    line-height: 1.15;
}

.sub-point.exists {
    position: relative;
    background: #23272a;
    color: var(--white);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-color: rgba(255, 255, 255, 0.14);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (any-hover: hover) {
    .sub-point.exists:hover {
        background: var(--accent);
        color: var(--selector);
        border-color: var(--accent);
        font-weight: 700;
        transform: scale(1.04);
    }
}

.sub-point.exists:active {
    background: var(--accent) !important;
    color: var(--selector) !important;
    transform: scale(0.94) !important;
    border-color: var(--accent) !important;
}

#map-details-panel {
    user-select: text !important;
    -webkit-user-select: text !important;
    touch-action: pan-y !important;
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    background: rgba(16, 19, 26, 0.92);
    border: 1px solid rgba(var(--accent-rgb), 0.4);
    border-radius: 14px;
    padding: 20px;
    transform: translateX(360px);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 110;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

#map-details-panel.active {
    transform: translateX(0);
}

#md-title {
    color: var(--accent);
    margin: 0 0 6px 0;
    text-transform: uppercase;
    padding-right: 28px;
}

#md-info {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 14px;
}

#md-body {
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.45;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.close-map-p {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 28px;
    line-height: 1;
    color: var(--text-dim);
    cursor: pointer;
    user-select: none;
    padding: 8px;
    z-index: 10;
    transition: color 0.2s ease, transform 0.2s ease;
}

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

.status-tag.danger { color: var(--danger); }
.status-tag.safe { color: var(--success); }
.info-item strong { color: var(--accent); }

.port-node {
    position: absolute;
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
    top: 6px;
    right: 6px;
    box-shadow: 0 0 8px var(--accent);
    pointer-events: none;
    animation: port-pulse 1.5s infinite;
}

@keyframes port-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.6; }
}

/* ==========================================================================
   10. MAIN PAGE NEWS, BUTTONS & MODALS
   ========================================================================== */
.main-text {
    margin: 0 0 12px 0;
    color: var(--text);
    line-height: 1.65;
}

.main-text p {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--accent);
    border-radius: 4px 12px 12px 4px;
    padding: 16px 20px;
    margin: 0 0 24px 0;
}

.main-text h2 {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin: 0 0 14px 0;
}

.news-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin: 6px 0;
}

.news-item {
    background: var(--veil-card-bg);
    border-radius: 14px;
    padding: 20px 22px;
    border: 1px solid var(--hairline);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.3s ease, background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.news-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.news-item:hover {
    background: var(--veil-card-hover);
    border-color: rgba(var(--accent-rgb), 0.5);
    transform: translateY(-4px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45), 0 0 18px rgba(var(--accent-rgb), 0.12);
}

.news-item h2 {
    font-family: var(--font-mono);
    margin: 0 0 10px 0;
    font-size: 1.15rem;
    color: var(--accent);
}

.news-item p {
    margin: 0 0 16px 0;
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.5;
    flex-grow: 1;
}

.open-modal-btn,
#auth-btn {
    background: rgba(var(--accent-rgb), 0.14);
    color: var(--white);
    border: 1px solid rgba(var(--accent-rgb), 0.45);
    padding: 9px 18px;
    border-radius: 8px;
    font-family: var(--font-ui);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.open-modal-btn:hover,
#auth-btn:hover {
    background: var(--accent);
    color: var(--selector);
    box-shadow: 0 0 18px var(--accent-glow);
    transform: translateY(-1px);
}

.all-updates-btn {
    margin: 16px auto 0 !important;
    grid-column: 1 / -1;
    width: fit-content;
}

/* Modal Backdrop Veil */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: rgba(4, 6, 12, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    background: var(--veil-stage-bg);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    color: var(--white);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 32px 28px;
    border-radius: 16px;
    width: 90%;
    max-width: 780px;
    max-height: 88vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
    font-size: 0.96rem;
    line-height: 1.6;
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 16px;
    font-size: 1.8rem;
    line-height: 1;
    color: var(--text-dim);
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.close-btn:hover {
    color: var(--accent);
    transform: scale(1.08);
}

/* ==========================================================================
   11. FOOTER, DEV MODE, AD BLOCKS, TOASTS & AMBIENT FIREFLIES
   ========================================================================== */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 8px 0;
    background: rgba(14, 17, 24, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-dim);
    text-align: center;
    font-size: 0.85rem;
    border-top: 1px solid var(--hairline);
    z-index: 900;
}

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

footer a:hover {
    text-decoration: underline;
}

#main-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 0 15px;
}

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

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--hairline);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    line-height: 1;
    color: var(--text);
    transition: all 0.2s ease;
}

.social-link svg {
    display: block;
    flex-shrink: 0;
}

.social-link span {
    display: inline-block;
    line-height: 16px;
}

.social-link:hover {
    background: rgba(var(--accent-rgb), 0.14);
    border-color: rgba(var(--accent-rgb), 0.45);
    color: var(--white);
    text-decoration: none;
}

.menu-toggle {
    display: none;
}

/* Dev Notification & Ad Cards */
.dev-notification {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 21, 28, 0.94);
    backdrop-filter: blur(16px);
    border: 1px solid var(--accent);
    padding: 12px 22px;
    border-radius: 10px;
    z-index: 10001;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7);
    pointer-events: none;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { bottom: 40px; opacity: 0; }
    to { bottom: 80px; opacity: 1; }
}

.dev-content {
    font-family: var(--font-mono);
    font-size: 0.84rem;
    color: var(--white);
    text-align: center;
}

#ad-test-block {
    display: none;
    border-color: var(--accent);
    transform: none;
}

#ad-test-block.visible {
    display: block;
}

.ad-card {
    position: sticky;
    top: 104px;
    height: fit-content;
    width: 220px;
    padding: 20px;
    border-radius: 14px;
    background: var(--veil-stage-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--hairline);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.ad-card-mobile {
    display: none;
    width: 100%;
    height: 60px;
}

.ad-hr {
    position: relative;
    width: 200%;
    left: -30%;
    margin: 24px 0;
}

.ad-sub-block {
    height: 170px;
    padding: 5px 0;
}

.ad-sub-block h2 {
    margin-top: 0;
    color: var(--text-dim);
}

.ad-sub-block p {
    margin-bottom: 12px;
}

.ad-badge {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--accent);
    opacity: 0.7;
    margin-bottom: 8px;
    letter-spacing: 0.08em;
}

/* System Toast */
.pda-sys-toast {
    position: fixed;
    background: rgba(16, 19, 26, 0.96);
    border: 1px solid var(--danger);
    border-radius: 14px;
    padding: 18px 20px;
    z-index: 10005;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.75), inset 0 0 18px rgba(247, 90, 104, 0.12);
    font-family: var(--font-ui);
    backdrop-filter: blur(16px);
    right: 50%;
    bottom: 90px;
    transform: translateX(50%);
    width: min(92%, 520px);
    animation: slideUpPda 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pda-sys-toast .toast-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--hairline);
    padding-bottom: 10px;
    margin-bottom: 10px;
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1rem;
}

.pda-sys-toast .toast-body {
    font-size: 0.92rem;
    color: var(--white);
    line-height: 1.5;
}

.pda-sys-toast .close-toast {
    cursor: pointer;
    color: var(--text-dim);
    font-size: 1.3rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.pda-sys-toast .close-toast:hover {
    color: var(--danger);
}

@keyframes slideUpPda {
    from { transform: translate(50%, 150%); opacity: 0; }
    to { transform: translate(50%, 0); opacity: 1; }
}


/* ==========================================================================
   12. HARMONIOUS MOBILE & TABLET RESPONSIVE LAYOUT
   ========================================================================== */
@media (max-width: 1024px) {
    .news-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14.5px;
    }

    header {
        position: sticky;
        top: 0;
        padding: 8px 0 10px;
    }

    .container {
        max-width: 100%;
        padding: 0 12px;
    }

    .logo {
        font-size: 1.35rem;
        letter-spacing: 2px;
        margin-bottom: 5px;
    }

    .header-bottom {
        height: 26px;
        padding: 0 10px;
        gap: 8px;
    }

    .ticker-content,
    .pda-time {
        font-size: 0.74rem;
    }

    main {
        display: block;
        padding: 0 10px;
        margin-top: 8px !important;
        height: calc(100vh - 120px) !important;
        height: calc(100dvh - 120px) !important;
    }

    .content-wrapper {
        width: 100% !important;
        margin: 0 !important;
        padding: 12px 14px !important;
        height: 100% !important;
        min-height: 55vh;
        border-radius: 12px;
        overflow: hidden;
    }

    body.dev-mode-active main {
        height: calc(100vh - 170px) !important;
        height: calc(100dvh - 170px) !important;
    }

    .content-mask {
        width: 100%;
        height: 100% !important;
        -webkit-mask-image: linear-gradient(
            to bottom,
            transparent 0%,
            black 2.5%,
            black 97.5%,
            transparent 100%
        );
        mask-image: linear-gradient(
            to bottom,
            transparent 0%,
            black 2.5%,
            black 97.5%,
            transparent 100%
        );
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .content {
        width: 100% !important;
        padding: 10px 2px 68px 2px !important;
    }

    .content h1,
    .page-title {
        font-size: 1.3rem;
        margin-bottom: 14px;
    }

    .content h2.group-title,
    .cmd-category {
        font-size: 0.84rem;
        margin-top: 22px;
        margin-bottom: 10px;
    }

    /* HUD Veil Mobile Rules (Section 9 of Spec) */
    .metric-strip {
        gap: 14px;
        padding: 8px 12px;
        margin-bottom: 12px;
    }

    .metric-val {
        font-size: 1.2rem;
    }

    .console-dock {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px 14px;
        margin-bottom: 16px;
    }

    .filter-stream {
        flex-wrap: wrap;
        white-space: normal;
        overflow: visible;
        width: 100%;
        gap: 8px 12px;
        padding-bottom: 2px;
    }

    .filter-link {
        font-size: 0.75rem;
        padding: 4px 6px;
        line-height: 1.3;
    }

    .search-pocket {
        width: 100%;
        min-width: 0;
    }

    /* Slide-out Mobile Sidebar Drawer */
    .sidebar {
        position: fixed;
        left: -105%;
        top: 0;
        width: min(290px, 84vw);
        height: 100vh;
        height: 100dvh;
        z-index: 10002;
        margin-top: 0;
        padding: 20px 18px 28px;
        border-radius: 0 16px 16px 0;
        transition: left 0.3s cubic-bezier(0.22, 1, 0.36, 1);
        box-shadow: 16px 0 48px rgba(0, 0, 0, 0.85);
        overflow-y: auto;
    }

    .sidebar.active {
        left: 0;
    }

    /* Harmonious Mobile Catalog Grids */
    .items-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        padding: 6px 0 14px;
    }

    /* Detailed text-heavy grids stack cleanly in 1 column on mobile */
    #ranks-container.items-grid,
    #platform-selection.items-grid,
    #tickets-list.items-grid,
    .items-grid.single-col-mobile {
        grid-template-columns: 1fr;
    }

    .item-card {
        border-radius: 12px;
        min-height: 160px;
    }

    .item-header {
        padding: 12px 10px 10px;
        gap: 8px;
    }

    .item-header img {
        max-height: 60px;
        max-width: 100%;
        width: auto;
        height: auto;
        object-fit: contain;
        margin: 0 auto;
    }

    .item-header img.rotated {
        max-height: none;
        height: 118px;
        width: auto;
        transform: rotate(-90deg);
        margin: -26px 0;
    }

    .item-title,
    .item-name {
        font-size: 0.85rem;
        line-height: 1.25;
    }

    .item-info {
        padding: 10px 12px 12px;
        font-size: 0.78rem;
        gap: 4px;
    }

    .item-info > span,
    .info-block {
        font-size: 0.75rem;
    }

    /* Pets, Commands, Policy, Weather, Guides on Mobile */
    .pet-card {
        flex-direction: column;
    }

    .pet-main {
        flex: none;
        border-right: none;
        border-bottom: 1px solid var(--hairline);
        padding: 16px;
    }

    .pet-details {
        padding: 16px;
    }

    .cmd-item,
    .rule-item {
        grid-template-columns: 1fr;
    }

    .cmd-syntax,
    .rule-title {
        border-right: none;
        border-bottom: 1px dashed var(--hairline);
        padding: 10px 14px 8px;
        background: rgba(255, 255, 255, 0.025);
    }

    .cmd-desc,
    .rule-desc {
        padding: 10px 14px 12px;
        font-size: 0.85rem;
    }

    .hints-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .weather-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .weather-card {
        padding: 12px;
    }

    .weather-card h4 {
        font-size: 0.86rem;
        gap: 5px;
    }

    .weather-effects li {
        font-size: 0.74rem;
        padding-left: 14px;
    }

    .guide-list.two-col,
    .market-two-col {
        columns: 1;
        -webkit-columns: 1;
        -moz-columns: 1;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .news-container {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }

    .news-item {
        padding: 16px;
    }

    #map-root {
        height: 64vh;
    }

    #map-details-panel {
        top: auto;
        bottom: 10px;
        left: 10px;
        right: 10px;
        width: auto;
        max-height: 55%;
        overflow-y: auto;
        transform: translateY(120%);
    }

    #map-details-panel.active {
        transform: translateY(0);
    }

    /* Floating Mobile Menu Pill Button */
    .menu-toggle {
        white-space: nowrap !important;
        line-height: 1 !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        position: fixed !important;
        bottom: 46px !important;
        left: calc(100% - 122px) !important;
        z-index: 10003 !important;
        background: var(--accent) !important;
        color: var(--selector) !important;
        padding: 11px 20px !important;
        font-family: var(--font-mono) !important;
        font-size: 0.82rem !important;
        letter-spacing: 0.05em;
        border-radius: 50px;
        font-weight: 700;
        border: 1px solid rgba(255, 255, 255, 0.25);
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.65), 0 0 18px var(--accent-glow);
        transition: transform 0.2s ease, left 0.45s cubic-bezier(0.22, 1, 0.36, 1) !important;
    }

    .menu-toggle.left-side {
        left: 12px !important;
    }

    .menu-toggle:active {
        transform: scale(0.94);
    }

    .modal-content {
        width: 92% !important;
        padding: 22px 16px !important;
        font-size: 0.9rem !important;
        line-height: 1.45 !important;
        border-radius: 14px !important;
        max-height: 88vh !important;
    }

    .modal-content h2 {
        font-size: 1.2rem !important;
        margin-bottom: 12px !important;
        padding-right: 28px;
    }

    .close-btn {
        top: 12px !important;
        right: 14px !important;
        font-size: 1.6rem !important;
    }

    .footer-label {
        display: none;
    }
}

@media (max-width: 380px) {
    .weather-section {
        grid-template-columns: 1fr;
    }

    .item-title,
    .item-name {
        font-size: 0.8rem;
    }
}
