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

:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-sidebar: #0f1629;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0b0;
    --accent: #e2b714;
    --accent-hover: #f0c830;
    --border: #2a2a4a;
    --sidebar-width-expanded: 260px;
    --sidebar-width-collapsed: 72px;
    --sidebar-width: var(--sidebar-width-expanded);
    --mc-text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.75);
}

/* Cross-document View Transitions: smooth fade between pages on full reloads */
@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.18s;
    animation-timing-function: ease;
}

html.sidebar-collapsed {
    --sidebar-width: var(--sidebar-width-collapsed);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */

.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: width 0.2s ease, transform 0.25s ease;
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid var(--border);
    min-height: 72px;
}

.sidebar-toggle {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px 0;
    flex-shrink: 0;
}

.sidebar-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: background-color 0.2s ease;
}

.sidebar-toggle:hover span {
    background-color: var(--accent);
}

.sidebar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 0.5px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-brand:hover {
    color: var(--accent-hover);
}

html.sidebar-collapsed .sidebar-brand {
    display: none;
}

.sidebar-nav {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-nav a:hover {
    background-color: rgba(226, 183, 20, 0.08);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background-color: rgba(226, 183, 20, 0.12);
    color: var(--accent);
}

.sidebar-nav a .icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

html.sidebar-collapsed .sidebar-nav a {
    justify-content: center;
    padding: 12px 8px;
}

html.sidebar-collapsed .sidebar-label-text {
    display: none;
}

.sidebar-footer {
    padding: 16px;
    font-size: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-discord {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 10px 12px;
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-discord:hover {
    background-color: rgba(226, 183, 20, 0.08);
    border-color: var(--accent);
    color: var(--text-primary);
}

.sidebar-discord-full {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sidebar-external-arrow {
    font-size: 0.8rem;
    opacity: 0.75;
}

.sidebar-discord-short {
    display: none;
}

html.sidebar-collapsed .sidebar-discord-full {
    display: none;
}

html.sidebar-collapsed .sidebar-discord-short {
    display: inline;
}

html.sidebar-collapsed .sidebar-discord {
    padding: 10px 0;
}

.sidebar-ip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 12px;
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--accent);
    font-family: inherit;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar-ip:hover {
    background-color: rgba(226, 183, 20, 0.08);
    border-color: var(--accent);
}

.sidebar-ip-short {
    display: none;
}

html.sidebar-collapsed .sidebar-ip-full {
    display: none;
}

html.sidebar-collapsed .sidebar-ip-short {
    display: inline;
}

html.sidebar-collapsed .sidebar-ip {
    padding: 10px 0;
}

/* Mobile hamburger (only on small screens) */

.mobile-hamburger {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    width: 44px;
    height: 44px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    z-index: 110;
    padding: 0;
}

.mobile-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
}

.mobile-hamburger:hover {
    border-color: var(--accent);
}

.mobile-hamburger:hover span {
    background-color: var(--accent);
}

/* Mobile backdrop */

.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 95;
}

/* Slideshow */

.slideshow {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    z-index: 0;
    overflow: hidden;
    background-color: var(--bg-primary);
}

.slideshow img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease;
}

.slideshow img.active {
    opacity: 1;
}

.slideshow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(26, 26, 46, 0.6) 0%, rgba(26, 26, 46, 0.85) 100%);
    pointer-events: none;
}

/* Main Content */

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px 48px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

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

.page-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-shadow: var(--mc-text-shadow);
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    text-shadow: var(--mc-text-shadow);
}

/* Home Page */

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
}

.hero img {
    width: 180px;
    height: 180px;
    border-radius: 24px;
    margin-bottom: 32px;
    box-shadow: none;
}

.hero h2 {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.hero-description {
    background-color: rgba(15, 22, 41, 0.85);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px 32px;
    max-width: 540px;
    backdrop-filter: blur(8px);
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 500px;
    line-height: 1.7;
}

.hero-join-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    padding: 12px 24px;
    background-color: rgba(226, 183, 20, 0.12);
    border: 1px solid var(--accent);
    border-radius: 10px;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    text-shadow: var(--mc-text-shadow);
}

.hero-join-link:hover {
    background-color: var(--accent);
    color: var(--bg-primary);
}

/* Vote page */

.vote-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.vote-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.vote-card:hover {
    border-color: var(--accent);
    background-color: rgba(226, 183, 20, 0.08);
    transform: translateY(-2px);
}

.vote-card-name {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.05rem;
    text-shadow: var(--mc-text-shadow);
}

.vote-card-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 8px 18px;
    background-color: rgba(226, 183, 20, 0.12);
    border: 1px solid var(--accent);
    border-radius: 8px;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: var(--mc-text-shadow);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.vote-card:hover .vote-card-action {
    background-color: var(--accent);
    color: var(--bg-primary);
}

.vote-card-arrow {
    font-size: 0.95rem;
}

.hero-platforms-info {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    opacity: 0.85;
    text-shadow: var(--mc-text-shadow);
}

.hero-platforms-info-icon {
    color: var(--accent);
    font-size: 0.9rem;
}

.server-ip {
    padding: 14px 32px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent);
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    text-shadow: var(--mc-text-shadow);
}

.server-ip:hover {
    border-color: var(--accent);
    background-color: rgba(226, 183, 20, 0.08);
}

.hero .server-ip {
    margin-top: 32px;
}

.server-ip-inline {
    padding: 10px 22px;
    font-size: 0.95rem;
}

/* Content Cards */

.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 20px;
}

.card h3 {
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 12px;
}

.card p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.email-link {
    color: var(--accent);
    text-decoration: none;
}

.email-link:hover {
    text-decoration: underline;
}

/* Placeholder */

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.placeholder-content .icon-large {
    font-size: 3rem;
    margin-bottom: 20px;
}

.placeholder-content h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.placeholder-content p {
    color: var(--text-secondary);
}

/* Join List */

.join-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.join-list li {
    color: var(--text-secondary);
    line-height: 1.7;
    padding-left: 16px;
    position: relative;
}

.join-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 11px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent);
}

.join-list code {
    background-color: rgba(226, 183, 20, 0.1);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Store */

.store-username-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding: 16px 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.store-username-bar.hidden {
    display: none;
}

.store-player-head {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    image-rendering: pixelated;
}

.store-player-head.hidden {
    display: none;
}

.store-auth-label {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.store-auth-label strong {
    color: var(--accent);
}

.store-sign-in-button {
    padding: 10px 24px;
    background-color: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.store-sign-in-button:hover {
    background-color: var(--accent-hover);
}

.store-sign-out-button {
    padding: 10px 24px;
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.store-sign-out-button:hover {
    border-color: #e74c3c;
    color: #e74c3c;
}

/* Sign-in Modal */

.store-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    backdrop-filter: blur(4px);
}

.store-modal-overlay.hidden {
    display: none;
}

.store-modal {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.store-modal h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.store-platform-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.store-platform-button {
    flex: 1;
    padding: 10px 16px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.store-platform-button:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.store-platform-button.active {
    background-color: rgba(226, 183, 20, 0.12);
    border-color: var(--accent);
    color: var(--accent);
}

.store-modal p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.store-modal p.hidden {
    display: none;
}

.store-input-wrapper {
    position: relative;
}

.store-input-wrapper.hidden {
    display: none;
}

.store-bedrock-prefix {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
    user-select: none;
    pointer-events: none;
}

.store-input-wrapper .store-bedrock-prefix + input {
    padding-left: 26px;
}

.store-modal input {
    width: 100%;
    padding: 12px 14px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.store-modal input.hidden {
    display: none;
}

.store-modal input:focus {
    border-color: var(--accent);
}

.store-modal input.store-input-error {
    border-color: #e74c3c;
    animation: shake 0.3s ease;
}

.store-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.store-modal-cancel {
    padding: 10px 20px;
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.store-modal-cancel:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.store-category {
    margin-bottom: 40px;
}

.store-category-title {
    font-size: 1.4rem;
    color: var(--accent);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.store-item {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease;
}

.store-item:hover {
    border-color: var(--accent);
}

.store-item-image-wrapper {
    width: 100%;
    height: 180px;
    background-color: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.store-item-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    box-sizing: border-box;
}

.store-item-image-placeholder {
    font-size: 3rem;
    opacity: 0.3;
}

.store-item-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.store-item-name {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.store-item-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    flex: 1;
}

.store-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 20px;
}

.store-item-price {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
}

.store-item-currency {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 4px;
}

.store-buy-button {
    padding: 10px 20px;
    background-color: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.store-buy-button:hover {
    background-color: var(--accent-hover);
}

.store-buy-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Store Cart Bar */

.store-cart-bar {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    background-color: var(--bg-sidebar);
    border-top: 1px solid var(--border);
    padding: 16px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
}

.store-cart-bar.hidden {
    display: none;
}

.store-cart-items {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
    margin-right: 24px;
}

.store-cart-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.store-cart-quantity {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    margin-right: 2px;
}

.store-cart-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}

.store-cart-remove:hover {
    color: #e74c3c;
}

.store-cart-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.store-cart-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.store-checkout-button {
    padding: 12px 28px;
    background-color: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.store-checkout-button:hover {
    background-color: var(--accent-hover);
}

/* Toast Notifications */

.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    background-color: var(--bg-sidebar);
    border: 1px solid #e74c3c;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    min-width: 280px;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: toast-in 0.3s ease;
}

.toast.toast-out {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

/* Rules Page */

.rules-section {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px 32px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.main-content:has(.rules-section) .page-header,
.main-content-narrow .page-header,
.main-content-narrow .card,
.main-content-narrow .store-username-bar,
.main-content-narrow .vote-grid {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.rules-section-title {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.rules-list {
    padding-left: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rules-list > li {
    color: var(--text-primary);
    font-size: 1.05rem;
    line-height: 1.7;
    font-weight: 500;
}

.rules-list > li::marker {
    color: var(--accent);
    font-weight: 700;
}

.rules-sublist {
    list-style: none;
    padding-left: 20px;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rules-sublist li {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.6;
    position: relative;
    padding-left: 16px;
}

.rules-sublist li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent);
}

.rules-sublist li.rules-note {
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.85;
}

.rules-sublist li.rules-note::before {
    background-color: var(--text-secondary);
}

.rules-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.rules-link:hover {
    text-decoration: underline;
    color: var(--accent-hover);
}

.rules-staff-note {
    margin-top: 20px;
    padding: 14px 18px;
    background-color: rgba(226, 183, 20, 0.08);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-style: italic;
}

/* Error Page */

.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 20px;
    text-align: center;
}

.error-page .error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 16px;
    text-shadow: var(--mc-text-shadow);
}

.error-page h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-shadow: var(--mc-text-shadow);
}

.error-page p {
    color: var(--text-secondary);
    margin-bottom: 32px;
    text-shadow: var(--mc-text-shadow);
}

.error-page a {
    padding: 12px 28px;
    background-color: var(--accent);
    color: var(--bg-primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}

.error-page a:hover {
    background-color: var(--accent-hover);
}

/* Join Page */

.join-steps {
    padding-left: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.join-steps li {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.98rem;
}

.join-steps li::marker {
    color: var(--accent);
    font-weight: 700;
}

.join-steps code {
    background-color: rgba(226, 183, 20, 0.12);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.join-steps strong {
    color: var(--text-primary);
}

/* Mobile */

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }

    html.sidebar-collapsed {
        --sidebar-width: 0px;
    }

    .sidebar {
        width: 280px;
        transform: translateX(-100%);
    }

    html.sidebar-collapsed .sidebar-brand,
    html.sidebar-collapsed .sidebar-label-text,
    html.sidebar-collapsed .sidebar-discord-full,
    html.sidebar-collapsed .sidebar-ip-full {
        display: inline;
    }

    html.sidebar-collapsed .sidebar-discord-full {
        display: inline-flex;
    }

    html.sidebar-collapsed .sidebar-discord-short,
    html.sidebar-collapsed .sidebar-ip-short {
        display: none;
    }

    html.sidebar-collapsed .sidebar-nav a {
        justify-content: flex-start;
        padding: 12px 16px;
    }

    html.sidebar-collapsed .sidebar-discord,
    html.sidebar-collapsed .sidebar-ip {
        padding: 10px 12px;
    }

    body.sidebar-mobile-open .sidebar {
        transform: translateX(0);
    }

    body.sidebar-mobile-open .sidebar-backdrop {
        display: block;
    }

    .mobile-hamburger {
        display: flex;
    }

    body.sidebar-mobile-open .mobile-hamburger {
        display: none;
    }

    .main-content {
        margin-left: 0;
        padding: 72px 20px 32px;
    }

    .slideshow {
        left: 0;
    }

    .page-header h2 {
        font-size: 1.6rem;
    }

    .page-header p {
        font-size: 0.95rem;
    }

    .hero {
        padding: 32px 8px 48px;
    }

    .hero img {
        width: 128px;
        height: 128px;
        margin-bottom: 24px;
    }

    .hero-description {
        padding: 18px 20px;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-platforms-info {
        font-size: 0.75rem;
    }

    .hero .server-ip {
        margin-top: 24px;
        padding: 12px 24px;
        font-size: 0.95rem;
    }

    .card {
        padding: 20px;
    }

    .store-grid {
        grid-template-columns: 1fr;
    }

    .store-cart-bar {
        left: 0;
        padding: 12px 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .store-cart-items {
        margin-right: 0;
    }

    .store-cart-actions {
        justify-content: space-between;
        width: 100%;
    }

    .store-username-bar {
        flex-wrap: wrap;
        gap: 12px;
    }

    .store-auth-label {
        flex-basis: 100%;
        order: -1;
    }

    .rules-section {
        padding: 20px;
    }

    .rules-list {
        padding-left: 20px;
    }

    .rules-section-title {
        font-size: 1.2rem;
    }

    .error-page {
        padding: 80px 20px;
    }

    .error-page .error-code {
        font-size: 4.5rem;
    }

    .toast-container {
        top: 70px;
        right: 12px;
        left: 12px;
    }

    .toast {
        min-width: 0;
        max-width: none;
    }

}

@media (max-width: 420px) {
    .main-content {
        padding: 72px 14px 32px;
    }

    .hero-description {
        padding: 16px;
    }

    .hero-join-link {
        width: 100%;
        justify-content: center;
    }
}

/* IP Picker Modal */

.ip-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.ip-modal-overlay.hidden {
    display: none;
}

.ip-modal {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 28px;
    width: 420px;
    max-width: 100%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.ip-modal h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ip-modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 18px;
}

.ip-modal-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ip-modal-option {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 16px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    text-align: left;
}

.ip-modal-option:hover {
    border-color: var(--accent);
    background-color: rgba(226, 183, 20, 0.06);
}

.ip-modal-option-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ip-modal-option-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
}

.ip-modal-option-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 999px;
    background-color: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.ip-modal-option-ip {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.ip-modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}

.ip-modal-cancel {
    padding: 10px 20px;
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.ip-modal-cancel:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* IP Copy Toast */

.ip-toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    pointer-events: none;
}

.ip-toast {
    padding: 12px 22px;
    background-color: var(--bg-sidebar);
    border: 1px solid #4ade80;
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    animation: ip-toast-in 0.25s ease;
}

.ip-toast.ip-toast-out {
    animation: ip-toast-out 0.25s ease forwards;
}

@keyframes ip-toast-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ip-toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(12px);
    }
}

@media (max-width: 480px) {
    .ip-modal {
        padding: 22px;
    }

    .ip-modal h3 {
        font-size: 1.15rem;
    }
}

/* ============================================================
   WIKI
   ============================================================ */

:root {
    --rarity-common: #9aa0ad;
    --rarity-uncommon: #4ade80;
    --rarity-rare: #4aa3ff;
    --rarity-epic: #b06bff;
    --rarity-legendary: #f5b301;
    --rarity-mythical: #ff5ecb;

    --cur-ticks: #b0a5a5;
    --cur-moments: #e2b714;
    --cur-seconds: #b880ff;
    --cur-chrono: #29d3d3;
    --cur-coal: #8892a3;
    --cur-bronze: #cf873f;
    --cur-iron: #cfd6e0;
    --cur-diamond: #4fd6ff;
    --cur-pure: #8bf1ff;
    --cur-gems: #34d399;
    --cur-strength: #ff6b5c;
    --cur-intel: #d17bff;
    --cur-temporal: #e0466b;
    --cur-timeleap: #34c6c0;
    --cur-era: #a26bff;
    --cur-flesh: #e0776b;
    --cur-aeon: #c9a6ff;

    /* Combat / mining stat colors - tuned from the in-game StatDisplay palette so a stat reads the
       same hue on the wiki as on the scoreboard (health red, defense green, mining speed teal…). */
    --stat-health: #ff5f5f;
    --stat-damage: #e0554e;
    --stat-defense: #4fb56a;
    --stat-crit-chance: #d17f36;
    --stat-crit-power: #e08a34;
    --stat-mining-speed: #1dd27a;
    --stat-move-speed: #5be3e3;
    --stat-attack-speed: #cdd6e0;
    --stat-loot-luck: #c3d64a;
    --stat-kills: #ff5f5f;
    --stat-deaths: #c0392b;

    --wiki-radius: 14px;
    --wiki-bg-image: url('/images/wiki-bg.png');
}

/* Wiki pages use a single, heavily-tinted still image so long-form text stays readable
   (instead of the rotating, lightly-tinted slideshow used on the marketing pages). */
body:has(.wiki-hub) .slideshow img,
body:has(.wiki-shell) .slideshow img {
    display: none;
}

body:has(.wiki-hub) .slideshow,
body:has(.wiki-shell) .slideshow {
    background-image:
        linear-gradient(rgba(8, 10, 18, 0.9), rgba(8, 10, 18, 0.94)),
        var(--wiki-bg-image);
    background-size: cover;
    background-position: center;
}

body:has(.wiki-hub) .slideshow::after,
body:has(.wiki-shell) .slideshow::after {
    display: none;
}

/* --- Wiki home / hub --- */

.wiki-hub {
    max-width: 1080px;
    margin: 0 auto;
}

.wiki-hero {
    text-align: center;
    padding: 24px 16px 40px;
    position: relative;
}

.wiki-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    background-color: rgba(226, 183, 20, 0.1);
    border: 1px solid rgba(226, 183, 20, 0.28);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 20px;
}

.wiki-hero h1 {
    font-size: 2.9rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #f2f2f6;
    margin-bottom: 14px;
    text-shadow: var(--mc-text-shadow);
}

.wiki-hero h1 .accent {
    color: var(--accent);
}

.wiki-hero p {
    color: var(--text-secondary);
    font-size: 1.12rem;
    line-height: 1.7;
    max-width: 620px;
    margin: 0 auto;
}

/* Search trigger (button that looks like a search field) */

.wiki-search-trigger {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 560px;
    margin: 28px auto 0;
    padding: 15px 18px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.wiki-search-trigger:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(226, 183, 20, 0.08);
}

.wiki-search-trigger .search-icon {
    color: var(--accent);
    font-size: 1.05rem;
}

.wiki-search-trigger .search-label {
    flex: 1;
    text-align: left;
}

.wiki-search-trigger .search-kbd {
    display: inline-flex;
    gap: 4px;
}

.kbd {
    display: inline-block;
    min-width: 18px;
    padding: 2px 7px;
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    line-height: 1.2;
    text-align: center;
}

/* Category grid on the hub */

.wiki-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
    margin-top: 12px;
}

.wiki-cat-card {
    --cat-accent: var(--accent);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px 22px 20px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--wiki-radius);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.wiki-cat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--cat-accent);
    opacity: 0.85;
}

.wiki-cat-card:hover {
    transform: translateY(-3px);
    border-color: var(--cat-accent);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.wiki-cat-card-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 12px;
    background-color: color-mix(in srgb, var(--cat-accent) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--cat-accent) 35%, transparent);
}

/* The diamond and book emoji carry extra built-in bottom padding, so the glyph sits
   low inside its tile. Nudge only the glyph up (not the tile) so it reads as centered
   like the other category icons. */
.wiki-cat-card[data-cat="store"] .wiki-cat-card-glyph {
    display: inline-block;
    transform: translateY(-4px);
}

.wiki-cat-card[data-cat="reference"] .wiki-cat-card-glyph {
    display: inline-block;
    transform: translateY(-3px);
}

.wiki-cat-card h3 {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--text-primary);
}

.wiki-cat-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.6;
    flex: 1;
}

.wiki-cat-card-meta {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cat-accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.wiki-hub-section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 44px 0 18px;
    text-shadow: var(--mc-text-shadow);
}

.wiki-quicklinks {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.wiki-quicklink {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: border-color 0.16s ease, color 0.16s ease;
}

.wiki-quicklink:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.wiki-quicklink .ql-icon {
    opacity: 0.9;
}

/* --- Wiki category shell (nav | content | toc) --- */

.wiki-shell {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr) 216px;
    gap: 36px;
    align-items: start;
}

.wiki-sidenav {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
}

.wiki-sidenav-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.86rem;
    cursor: pointer;
    transition: border-color 0.16s ease;
}

.wiki-sidenav-search:hover {
    border-color: var(--accent);
}

.wiki-sidenav-search .search-icon {
    color: var(--accent);
}

.wiki-sidenav-search .search-kbd {
    margin-left: auto;
}

.wiki-nav-group {
    margin-bottom: 4px;
}

.wiki-nav-cat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: background-color 0.16s ease, color 0.16s ease;
}

.wiki-nav-cat:hover {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.wiki-nav-cat.active {
    color: var(--text-primary);
    background-color: color-mix(in srgb, var(--accent) 12%, transparent);
}

.wiki-nav-cat .nav-cat-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.wiki-nav-sections {
    list-style: none;
    margin: 4px 0 10px;
    padding-left: 15px;
    border-left: 1px solid var(--border);
    margin-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.wiki-nav-sections a {
    display: block;
    padding: 6px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.86rem;
    border-radius: 6px;
    border-left: 2px solid transparent;
    margin-left: -16px;
    padding-left: 16px;
    transition: color 0.16s ease, border-color 0.16s ease;
}

.wiki-nav-sections a:hover {
    color: var(--text-primary);
}

.wiki-nav-sections a.active {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

/* Content column */

.wiki-content {
    min-width: 0;
    max-width: 860px;
}

.wiki-crumbs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.wiki-crumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.wiki-crumbs a:hover {
    color: var(--accent);
}

.wiki-crumbs .sep {
    opacity: 0.5;
}

.wiki-crumbs .current {
    color: var(--text-primary);
    font-weight: 600;
}

.wiki-page-head {
    padding-bottom: 22px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.wiki-page-head .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.wiki-page-head h1 {
    font-size: 2.3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.15;
    text-shadow: var(--mc-text-shadow);
}

.wiki-page-head .page-lead {
    color: var(--text-secondary);
    font-size: 1.08rem;
    line-height: 1.7;
    margin-top: 12px;
}

/* Article prose */

.wiki-article {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-primary);
}

.wiki-section {
    scroll-margin-top: 24px;
    padding-top: 34px;
}

.wiki-section > h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 14px;
    scroll-margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wiki-section h3 {
    font-size: 1.18rem;
    font-weight: 700;
    color: var(--accent);
    margin: 26px 0 10px;
    scroll-margin-top: 24px;
}

.wiki-section h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 20px 0 8px;
}

.wiki-article p {
    color: var(--text-secondary);
    margin-bottom: 14px;
}

.wiki-article a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px dotted rgba(226, 183, 20, 0.5);
}

.wiki-article a:hover {
    color: var(--accent-hover);
    border-bottom-style: solid;
}

.wiki-article strong {
    color: var(--text-primary);
    font-weight: 700;
}

.wiki-article ul,
.wiki-article ol {
    margin: 0 0 16px 4px;
    padding-left: 22px;
    color: var(--text-secondary);
}

.wiki-article li {
    margin-bottom: 7px;
    line-height: 1.7;
}

.wiki-article li::marker {
    color: var(--accent);
}

.wiki-article code {
    background-color: rgba(226, 183, 20, 0.1);
    color: #f0d27a;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 0.86em;
    font-family: 'Courier New', monospace;
}

/* Click-to-copy slash commands (used in the wiki and on the vote page) */

code.cmd-copy {
    cursor: pointer;
    position: relative;
    padding: 2px 26px 2px 7px;
    background-color: rgba(226, 183, 20, 0.1);
    color: #f0d27a;
    border: 1px solid rgba(226, 183, 20, 0.28);
    border-radius: 5px;
    font-size: 0.86em;
    font-family: 'Courier New', monospace;
    user-select: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

code.cmd-copy::after {
    content: '';
    position: absolute;
    right: 6px;
    top: 50%;
    width: 12px;
    height: 12px;
    transform: translateY(-50%);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2b714' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

code.cmd-copy:hover {
    background-color: rgba(226, 183, 20, 0.2);
    border-color: var(--accent);
    color: #ffe487;
}

code.cmd-copy:hover::after {
    opacity: 0.95;
}

code.cmd-copy:active {
    transform: translateY(1px);
}

code.cmd-copy.copied {
    background-color: rgba(74, 222, 128, 0.16);
    border-color: #4ade80;
    color: #bff3cd;
}

code.cmd-copy.copied::after {
    opacity: 1;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234ade80' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.wiki-article hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 32px 0;
}

.heading-anchor {
    color: var(--text-secondary);
    opacity: 0;
    font-size: 0.85em;
    text-decoration: none;
    border: none;
    transition: opacity 0.15s ease;
}

.wiki-section > h2:hover .heading-anchor {
    opacity: 0.6;
}

/* Callouts */

.callout {
    display: flex;
    gap: 14px;
    padding: 16px 18px;
    margin: 18px 0;
    border-radius: 12px;
    border: 1px solid var(--border);
    border-left-width: 3px;
    background-color: var(--bg-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

.callout .callout-icon {
    font-size: 1.15rem;
    line-height: 1.5;
    flex-shrink: 0;
}

.callout .callout-body {
    color: var(--text-secondary);
    min-width: 0;
}

.callout .callout-body strong {
    color: var(--text-primary);
}

.callout.is-info { border-left-color: #4aa3ff; background-color: rgba(74, 163, 255, 0.06); }
.callout.is-tip { border-left-color: #4ade80; background-color: rgba(74, 222, 128, 0.06); }
.callout.is-warn { border-left-color: #f5b301; background-color: rgba(245, 179, 1, 0.06); }
.callout.is-lore { border-left-color: #b06bff; background-color: rgba(176, 107, 255, 0.06); }
.callout.is-lore .callout-body { font-style: italic; }
.callout.is-danger { border-left-color: #ff5c5c; background-color: rgba(255, 92, 92, 0.06); }

/* Tables */

.table-wrap {
    overflow-x: auto;
    margin: 18px 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    scrollbar-width: thin;
}

.wiki-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 460px;
}

.wiki-table th,
.wiki-table td {
    padding: 11px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.wiki-table thead th {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

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

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

.wiki-table td {
    color: var(--text-secondary);
}

.wiki-table td strong,
.wiki-table th strong {
    color: var(--text-primary);
}

.wiki-table .num {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Feature / stat cards */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.feature {
    padding: 16px 18px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.feature .feature-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 1rem;
}

.feature p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.feature .feature-icon {
    font-size: 1.1rem;
}

/* Stat line (aligned key/value tiles, e.g. mob stats) */

.statline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0;
}

.statline .stat {
    flex: 1 1 0;
    min-width: 88px;
    padding: 10px 14px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: center;
}

.statline .stat-k {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.statline .stat-v {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

/* Badges, chips, currencies */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    border: 1px solid var(--border);
    white-space: nowrap;
}

.badge.soon {
    color: #f5b301;
    border-color: rgba(245, 179, 1, 0.4);
    background-color: rgba(245, 179, 1, 0.1);
}

.badge.new {
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.4);
    background-color: rgba(74, 222, 128, 0.1);
}

.rarity {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    border: 1px solid currentColor;
    background-color: color-mix(in srgb, currentColor 12%, transparent);
}

.rarity.common { color: var(--rarity-common); }
.rarity.uncommon { color: var(--rarity-uncommon); }
.rarity.rare { color: var(--rarity-rare); }
.rarity.epic { color: var(--rarity-epic); }
.rarity.legendary { color: var(--rarity-legendary); }
.rarity.mythical {
    color: var(--rarity-mythical);
    background: linear-gradient(90deg, rgba(255,94,203,0.16), rgba(176,107,255,0.16));
}

.cur {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: var(--cur-color, var(--text-primary));
    white-space: nowrap;
}

.cur::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--cur-color, var(--accent));
    box-shadow: 0 0 6px color-mix(in srgb, var(--cur-color, var(--accent)) 60%, transparent);
    flex-shrink: 0;
}

.cur.ticks { --cur-color: var(--cur-ticks); }
.cur.moments { --cur-color: var(--cur-moments); }
.cur.seconds { --cur-color: var(--cur-seconds); }
.cur.chrono { --cur-color: var(--cur-chrono); }
.cur.coal { --cur-color: var(--cur-coal); }
.cur.bronze { --cur-color: var(--cur-bronze); }
.cur.iron { --cur-color: var(--cur-iron); }
.cur.diamond { --cur-color: var(--cur-diamond); }
.cur.pure { --cur-color: var(--cur-pure); }
.cur.gems { --cur-color: var(--cur-gems); }
.cur.strength { --cur-color: var(--cur-strength); }
.cur.intel { --cur-color: var(--cur-intel); }
.cur.temporal { --cur-color: var(--cur-temporal); }
.cur.timeleap { --cur-color: var(--cur-timeleap); }
.cur.era { --cur-color: var(--cur-era); }
.cur.flesh { --cur-color: var(--cur-flesh); }
.cur.aeon { --cur-color: var(--cur-aeon); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Inline colored stat token - like .cur but with no leading dot, for combat/mining stats and the
   boosts that target them. Author writes the emoji themselves, e.g. <span class="st health">100 ❤</span>
   or <span class="st damage">+15% 🗡</span>, so the number and stat read in the in-game color. */
.st {
    font-weight: 600;
    color: var(--st-color, var(--text-primary));
    white-space: nowrap;
}

.st.health { --st-color: var(--stat-health); }
.st.damage { --st-color: var(--stat-damage); }
.st.defense { --st-color: var(--stat-defense); }
.st.crit-chance { --st-color: var(--stat-crit-chance); }
.st.crit-power { --st-color: var(--stat-crit-power); }
.st.mining-speed { --st-color: var(--stat-mining-speed); }
.st.move-speed { --st-color: var(--stat-move-speed); }
.st.attack-speed { --st-color: var(--stat-attack-speed); }
.st.loot-luck { --st-color: var(--stat-loot-luck); }
.st.kills { --st-color: var(--stat-kills); }
.st.deaths { --st-color: var(--stat-deaths); }

/* Item name rendered as a link, tinted by its rarity (like a real wiki's colored item links).
   e.g. <a class="item-link legendary" href="/wiki/items/deep-breaker">Deep Breaker</a>. The
   non-link variant .item-name paints the same colors when no dedicated page exists yet. */
.item-link,
.item-name {
    color: var(--item-color, var(--text-primary));
    font-weight: 600;
    white-space: nowrap;
}

.item-link {
    text-decoration: none;
    border-bottom: 1px dashed color-mix(in srgb, var(--item-color, var(--accent)) 55%, transparent);
    transition: border-color 0.15s ease, color 0.15s ease;
}

.item-link:hover {
    border-bottom-color: var(--item-color, var(--accent));
    border-bottom-style: solid;
}

.item-link.common,
.item-name.common { --item-color: var(--rarity-common); }
.item-link.uncommon,
.item-name.uncommon { --item-color: var(--rarity-uncommon); }
.item-link.rare,
.item-name.rare { --item-color: var(--rarity-rare); }
.item-link.epic,
.item-name.epic { --item-color: var(--rarity-epic); }
.item-link.legendary,
.item-name.legendary { --item-color: var(--rarity-legendary); }
.item-link.mythical,
.item-name.mythical {
    --item-color: var(--rarity-mythical);
    background: linear-gradient(90deg, var(--rarity-epic), var(--rarity-mythical));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Overview "entry" cards - a category overview links out to each of its standalone sub-pages
   through this grid (mirrors the hub's .wiki-cat-card, sized for the denser in-page context). */
.wiki-entry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 14px;
    margin: 18px 0;
}

.wiki-entry-card {
    --entry-accent: var(--accent);
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 16px 18px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.wiki-entry-card:hover {
    transform: translateY(-3px);
    border-color: var(--entry-accent);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
}

.wiki-entry-card .entry-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--text-primary);
}

.wiki-entry-card .entry-icon { font-size: 1.15rem; }

.wiki-entry-card p {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.55;
    color: var(--text-secondary);
    flex: 1;
}

.wiki-entry-card .entry-go {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--entry-accent);
}

/* A row link inside an overview table (item name → its page) keeps the table tidy while still
   reading as a link. */
.wiki-table a.item-link { font-weight: 700; }

/* Definition list style */

.wiki-dl {
    display: grid;
    grid-template-columns: minmax(120px, 200px) 1fr;
    gap: 0;
    margin: 18px 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.wiki-dl dt {
    padding: 11px 16px;
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.wiki-dl dd {
    padding: 11px 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}

.wiki-dl dt:last-of-type,
.wiki-dl dd:last-of-type {
    border-bottom: none;
}

/* On this page (TOC) */

.wiki-onthispage {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    font-size: 0.85rem;
    scrollbar-width: thin;
}

.wiki-onthispage .toc-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding-left: 12px;
}

.wiki-toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1px;
    border-left: 1px solid var(--border);
}

.wiki-toc-list a {
    display: block;
    padding: 5px 12px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--text-secondary);
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.wiki-toc-list a:hover {
    color: var(--text-primary);
}

.wiki-toc-list a.active {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 600;
}

/* Pager (prev / next) */

.wiki-pager {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.wiki-pager a {
    flex: 1;
    max-width: 48%;
    padding: 14px 18px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    text-decoration: none;
    transition: border-color 0.16s ease, transform 0.16s ease;
}

.wiki-pager a:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.wiki-pager a.next {
    text-align: right;
    margin-left: auto;
}

.wiki-pager .pager-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.wiki-pager .pager-title {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.98rem;
}

/* --- Search overlay (command palette) --- */

.wiki-search-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 500;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 12vh 20px 20px;
}

.wiki-search-overlay.hidden {
    display: none;
}

.wiki-search-box {
    width: 100%;
    max-width: 620px;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
}

.wiki-search-field {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.wiki-search-field .search-icon {
    color: var(--accent);
    font-size: 1.1rem;
}

.wiki-search-field input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.05rem;
}

.wiki-search-field input::placeholder {
    color: var(--text-secondary);
}

.wiki-search-field .esc-hint {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.wiki-search-results {
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
}

.wiki-search-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 14px;
    border-radius: 10px;
    text-decoration: none;
    cursor: pointer;
}

.wiki-search-item:hover,
.wiki-search-item.active {
    background-color: color-mix(in srgb, var(--accent) 12%, transparent);
}

.wiki-search-item .result-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    border-radius: 9px;
    background-color: color-mix(in srgb, var(--result-accent, var(--accent)) 16%, transparent);
    border: 1px solid color-mix(in srgb, var(--result-accent, var(--accent)) 32%, transparent);
    flex-shrink: 0;
}

.wiki-search-item .result-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.3;
}

.wiki-search-item .result-title {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wiki-search-item .result-cat {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.wiki-search-item .result-go {
    margin-left: auto;
    color: var(--text-secondary);
    opacity: 0;
}

.wiki-search-item.active .result-go {
    opacity: 1;
}

.wiki-search-empty {
    padding: 34px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.wiki-search-footer {
    display: flex;
    gap: 16px;
    padding: 10px 18px;
    border-top: 1px solid var(--border);
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.wiki-search-footer span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Mobile nav toggle for the wiki side nav */

.wiki-nav-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

/* --- Wiki responsive --- */

@media (max-width: 1180px) {
    .wiki-shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .wiki-onthispage {
        display: none;
    }
}

@media (max-width: 900px) {
    .wiki-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .wiki-sidenav {
        position: static;
        max-height: none;
        margin-bottom: 8px;
    }

    .wiki-nav-toggle {
        display: flex;
    }

    .wiki-nav-collapsible {
        display: none;
    }

    .wiki-sidenav.open .wiki-nav-collapsible {
        display: block;
    }

    .wiki-content {
        max-width: none;
    }
}

@media (max-width: 640px) {
    .wiki-hero h1 {
        font-size: 2.1rem;
    }

    .wiki-hero p {
        font-size: 1rem;
    }

    .wiki-page-head h1 {
        font-size: 1.7rem;
    }

    .wiki-cat-grid {
        grid-template-columns: 1fr;
    }

    .wiki-pager {
        flex-direction: column;
    }

    .wiki-pager a,
    .wiki-pager a.next {
        max-width: none;
        text-align: left;
    }

    .wiki-search-overlay {
        padding: 8vh 12px 12px;
    }
}
