/* ================= FONTS ================= */
@font-face {
    font-family: 'Minecraft';
    src: url('fonts/minecraftfive-regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Minecraft';
    src: url('fonts/minecraftfive-bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'MinecraftSeven';
    src: url('fonts/minecraftseven.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'NotoSans';
    src: url('fonts/notosans-regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'NotoSansCJK';
    src: url('fonts/notosanscjk-regular.ttc') format('truetype');
    font-weight: 400;
    font-style: normal;
}

/* ================= CSS VARIABLES ================= */
:root {
    --bg-dark: #1a1a1a;
    --bg-panel: #2a2a2a;
    --border-color: #3a3a3a;
    --text-main: #e0e0e0;
    --text-muted: #b0b0b0;
    --accent-primary: #ff9800;
    --accent-hover: #f57c00;
    --accent-light: #ffb74d;
    --accent-dark: #ef6c00;
    --accent-border: #e65100;
    --success: #55ff55;
    --danger: #ff5555;
    --discord: #5865F2;
    --discord-hover: #4752c4;
    --discord-border: #3d47a0;
}

/* ================= GLOBAL & RESET ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-left: 2px solid var(--border-color);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--accent-primary) 0%, var(--accent-dark) 100%);
    border: 2px solid var(--accent-border);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-light) 0%, var(--accent-primary) 100%);
}

body {
    font-family: 'Minecraft', 'NotoSans', 'NotoSansCJK', monospace;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 4rem 1rem;
    background: url('backgrounds/background.png') center center / cover no-repeat fixed var(--bg-dark);
    color: var(--text-main);
    font-feature-settings: "kern" 0, "liga" 0, "calt" 0;
    text-rendering: optimize-contrast;
    -webkit-font-smoothing: none;
    font-smooth: never;
    letter-spacing: 0.005em;
    touch-action: manipulation;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
    z-index: 0;
}

.pixelated {
    image-rendering: pixelated;
}

.container, .tab-content, .section, h1, h2, h3, h4, h5, h6, .nav-tab, img {
    image-rendering: pixelated;
}

/* ================= LAYOUT & CONTAINERS ================= */
.container {
    background: var(--bg-panel);
    border: 4px solid var(--bg-dark);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), inset 0 0 0 4px var(--border-color);
    border-radius: 6px;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 2.5rem;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ================= HEADER ================= */
.header-banner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.header-banner img {
    max-width: 100%;
    width: 450px;
    height: auto;
}

.header-title-hidden {
    display: none;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ================= NAVIGATION TABS ================= */
.nav-tabs-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto 1rem auto;
}

.nav-tabs {
    display: flex;
    width: 100%;
    border-bottom: 4px solid var(--border-color);
}

.nav-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    background: var(--bg-dark);
    color: var(--text-main);
    border: 3px solid var(--border-color);
    border-bottom: none;
    border-right: none;
    cursor: pointer;
    font-family: 'MinecraftSeven', sans-serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

.nav-tab:first-child {
    border-radius: 4px 0 0 0;
    border-left: 3px solid var(--border-color);
}

.nav-tab:last-child {
    border-radius: 0 4px 0 0;
    border-right: 3px solid var(--border-color);
}

.nav-tab:hover {
    background: var(--bg-panel);
    transform: translateY(-2px);
}

.nav-tab.active {
    background: linear-gradient(180deg, var(--accent-primary) 0%, var(--accent-dark) 100%);
    color: white;
    border-color: var(--accent-border);
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.2), 0 5px 10px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.nav-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4));
    transition: transform 0.2s;
}

.nav-tab.active .nav-icon img {
    filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.5)) brightness(1.1);
}

.nav-tab:hover .nav-icon img {
    transform: scale(1.1);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================= LOADING BAR ================= */
.page-load-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-border), var(--accent-primary), var(--accent-light));
    z-index: 99999;
    box-shadow: 0 0 8px var(--accent-primary);
    transition: width 0.3s ease;
}

/* ================= SERVER INFO BOX ================= */
.server-ip-box {
    background: var(--bg-dark);
    border: 3px solid var(--border-color);
    border-radius: 6px;
    padding: 1.5rem;
    margin: 0 auto 2rem auto;
    max-width: 650px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 6px 0 var(--bg-dark), 0 8px 20px rgba(0, 0, 0, 0.3);
}

.server-status-banner {
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.status-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-count-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-dark);
    padding: 6px 16px;
    border-radius: 20px;
    border: 2px solid var(--border-color);
}

.ip-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-panel);
    padding: 12px 20px;
    border-radius: 4px;
    border: 2px solid var(--border-color);
    gap: 15px;
}

.ip-line {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ip-line .label {
    color: var(--text-muted);
    text-transform: uppercase;
}

.ip-line .value {
    color: var(--accent-light);
    font-weight: bold;
    letter-spacing: 1px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: var(--success);
    animation: pulse-green 2s infinite;
}

.status-dot.offline {
    background-color: var(--danger);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(85, 255, 85, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(85, 255, 85, 0); }
    100% { box-shadow: 0 0 0 0 rgba(85, 255, 85, 0); }
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(255, 85, 85, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 85, 85, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 85, 85, 0); }
}

/* ================= STATUS TEXT ================= */
.status-text-offline {
    color: var(--danger);
    text-transform: uppercase;
    font-weight: bold;
}

.status-text-online {
    color: var(--success);
    text-transform: uppercase;
    font-weight: bold;
}

.player-count-value {
    color: var(--accent-light);
    font-size: 1.2rem;
    font-weight: bold;
}

.icon-muted {
    color: var(--text-muted);
}

/* ================= BUTTONS ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-family: 'Minecraft', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    text-transform: uppercase;
    border-radius: 4px;
    transition: all 0.15s;
    text-decoration: none;
    border: 3px solid transparent;
    font-weight: bold;
}

.btn-copy {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-border);
    box-shadow: 0 4px 0 #bf360c;
    flex-shrink: 0;
}

.btn-copy:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 0 #bf360c;
}

.btn-copy:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #bf360c;
}

.discord-banner {
    text-align: center;
    margin: 2rem 0;
}

.discord-banner-compact {
    margin-top: 20px;
}

.btn-discord {
    background: var(--discord);
    color: white;
    border-color: var(--discord-border);
    padding: 15px 30px;
    font-size: 1.1rem;
    box-shadow: 0 5px 0 #2e3799, 0 0 18px rgba(88, 101, 242, 0.35);
    letter-spacing: 2px;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

.btn-discord:hover {
    background: var(--discord-hover);
    transform: translateY(-2px);
    box-shadow: 0 7px 0 #3d47a0;
}

.btn-discord:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #3d47a0;
}

/* ================= SECTIONS & CONTENT ================= */
.section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.4rem;
    color: var(--accent-light);
    font-weight: 800;
    margin-bottom: 1rem;
    padding-bottom: 10px;
    border-bottom: 4px solid var(--accent-hover);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-card {
    background: var(--bg-dark);
    padding: 1.5rem;
    border-radius: 4px;
    border: 3px solid var(--border-color);
    box-shadow: 0 6px 0 var(--bg-dark), 0 8px 20px rgba(0, 0, 0, 0.2);
    line-height: 1.8;
    font-size: 0.9rem;
}

.info-card-compact {
    padding: 0;
}

.info-card-widget {
    padding: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    background: var(--bg-dark);
    border: none;
    box-shadow: none;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border: 3px solid var(--border-color);
    border-radius: 4px;
    box-shadow: 0 6px 0 var(--bg-dark), 0 8px 20px rgba(0, 0, 0, 0.2);
    background: var(--bg-dark);
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.info-note {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: var(--bg-dark);
    border-left: 5px solid var(--accent-light);
    border-top: 3px solid var(--border-color);
    border-right: 3px solid var(--border-color);
    border-bottom: 3px solid var(--border-color);
    border-radius: 4px;
    margin-top: 1rem;
}

.info-note-no-margin {
    margin-bottom: 0;
}

.info-note i {
    color: var(--accent-light);
    font-size: 1.5rem;
}

.info-note span {
    font-weight: 700;
    color: var(--text-muted);
}

/* ================= GRIDS (Authors, Gallery, FAQ) ================= */
.authors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.author-card {
    background: var(--bg-dark);
    padding: 1.5rem;
    border-radius: 4px;
    text-align: center;
    border: 3px solid var(--border-color);
    box-shadow: 0 6px 0 var(--bg-dark);
    transition: transform 0.2s;
}

.author-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 0 var(--bg-dark);
}

.author-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
    word-break: break-word;
}

.author-role {
    font-size: 0.9rem;
    color: var(--accent-light);
    font-weight: 600;
    text-transform: uppercase;
}

.faq-item {
    background: var(--bg-dark);
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 12px;
    border: 3px solid var(--border-color);
}

.faq-question {
    font-weight: 700;
    color: var(--accent-light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
}

.faq-answer {
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 0.9rem;
}

/* ================= FEATURE LISTS ================= */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border-color);
    line-height: 1.6;
}

.feature-list li:last-child {
    border-bottom: none;
}

.feature-list i {
    color: var(--accent-light);
    font-size: 1.1rem;
    margin-top: 3px;
    flex-shrink: 0;
}

.feature-list strong {
    color: var(--accent-light);
}

.feature-highlight {
    background: rgba(255, 152, 0, 0.15);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
}

.server-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.server-detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    border-radius: 4px;
}

.server-detail-item i {
    color: var(--accent-light);
    font-size: 1.2rem;
}

.server-detail-item .detail-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
}

.server-detail-item .detail-value {
    color: var(--text-main);
    font-weight: 700;
}

/* ================= GALLERY ================= */
#gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-card {
    background: var(--bg-dark);
    border: 3px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gallery-img-wrapper {
    height: 200px;
    overflow: hidden;
    cursor: zoom-in;
    border-bottom: 3px solid var(--border-color);
}

.gallery-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-img-wrapper:hover img {
    transform: scale(1.05);
}

.gallery-info {
    padding: 15px;
}

.gallery-info h3 {
    color: var(--accent-light);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.gallery-info p {
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.4;
}

/* ================= CHAT ================= */
.chat-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    align-items: start;
}

.chat-box-container {
    height: 400px;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-message {
    font-size: 0.95rem;
    line-height: 1.5;
    word-break: break-word;
    padding: 6px 0;
    border-bottom: 1px dashed var(--border-color);
}

.chat-message:last-child {
    border-bottom: none;
}

.chat-message-timestamp {
    color: var(--accent-light);
    margin-right: 5px;
}

.chat-message-username {
    color: var(--success);
    font-weight: bold;
}

.chat-placeholder {
    color: var(--accent-light);
    text-align: center;
    margin-top: 150px;
}

.chat-placeholder-muted {
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    margin-top: 150px;
}

.chat-placeholder-error {
    color: var(--danger);
    text-align: center;
    margin-top: 150px;
}

.discord-widget-container iframe {
    border-radius: 4px;
    background-color: var(--bg-dark);
}

/* ================= FOOTER ================= */
footer {
    text-align: center;
    margin-top: 2rem;
}

footer span {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--bg-panel);
    text-shadow: 1px 1px 1px var(--border-color), -1px -1px 1px var(--bg-dark), 0 0 1px rgba(0, 0, 0, 0.5);
}

/* ================= LIGHTBOX ================= */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 99999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    user-select: none;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-content-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 40px 60px;
}

.lightbox-image {
    max-width: 100%;
    max-height: 75vh;
    border: 4px solid var(--border-color);
    box-shadow: 0 0 30px rgba(255, 183, 77, 0.3);
    object-fit: contain;
    background: var(--bg-dark);
    border-radius: 4px;
}

.lightbox-caption-container {
    margin-top: 15px;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    padding: 15px 20px;
    max-width: 800px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.lightbox-caption-container h3 {
    color: var(--accent-light);
    margin-bottom: 5px;
    font-size: 1.2rem;
}

.lightbox-caption-container p {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.4;
}

.lightbox-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: var(--text-muted);
    font-weight: bold;
    font-size: 1.1rem;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 12px;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    z-index: 100000;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 25px;
    color: var(--text-muted);
    font-size: 45px;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
    z-index: 100000;
    transition: color 0.2s, transform 0.2s;
}

.close-btn:hover {
    color: var(--danger);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    padding: 20px;
    z-index: 100001;
    transition: color 0.2s, transform 0.2s;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.lightbox-nav:hover {
    color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.6);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
    left: 15px;
}

.lightbox-nav.next {
    right: 15px;
}

/* ================= MCE ICONS ================= */
.mce-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* ================= UTILITY CLASSES ================= */
.text-center {
    text-align: center;
}

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

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

.text-accent {
    color: var(--accent-light);
}

.text-danger {
    color: var(--danger);
}

.text-muted {
    color: var(--text-muted);
}

.full-width {
    width: 100%;
}

/* ================= RESPONSIVE DESIGN ================= */
@media (max-width: 850px) {
    .chat-layout {
        grid-template-columns: 1fr;
    }

    .discord-widget-container iframe {
        width: 100%;
        max-width: 350px;
        display: block;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
        align-items: flex-start;
    }

    .container {
        padding: 1.5rem;
        border-width: 3px;
        border-radius: 0;
        box-shadow: none;
    }

    .server-status-banner {
        flex-direction: column;
        gap: 12px;
    }

    .ip-info-row {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .btn-copy {
        width: 100%;
    }

    .nav-tabs {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .nav-tab {
        padding: 10px 4px;
        font-size: 10px;
    }

    .nav-tab:first-child {
        border-radius: 0;
    }

    .nav-tab:last-child {
        border-radius: 0;
    }

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

    .btn-discord {
        width: 100%;
        font-size: 1rem;
        padding: 12px 20px;
    }

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

    #gallery-grid {
        grid-template-columns: 1fr;
    }

    .lightbox-content-wrapper {
        padding: 60px 10px 20px 10px;
    }

    .lightbox-nav {
        font-size: 35px;
        padding: 15px 10px;
        background: transparent;
    }

    .lightbox-nav.prev {
        left: 0;
    }

    .lightbox-nav.next {
        right: 0;
    }

    .lightbox-caption-container {
        padding: 10px;
        font-size: 0.85rem;
    }

    .lightbox-counter {
        font-size: 0.9rem;
        top: 10px;
        left: 10px;
    }

    .close-btn {
        top: 5px;
        right: 15px;
        font-size: 40px;
    }
}
