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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #1a1a1a;
    color: #eee;
    line-height: 1.6;
}

a { color: inherit; }

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background: #7ac143;
    color: #fff;
    padding: 8px 16px;
    z-index: 2000;
    text-decoration: none;
}

.skip-link:focus { top: 16px; }

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0d0d0d;
    padding: 10px 20px;
    border-bottom: 3px solid #7ac143;
    position: relative;
    z-index: 1000;
}

.navbar .logo {
    flex-shrink: 1;
    min-width: 0;
}

.navbar .logo img {
    vertical-align: middle;
    height: 50px;
    width: auto;
}

.hero {
    text-align: center;
    padding: 100px 20px;
    background-size: cover;
    background-position: center;
    border-bottom: 5px solid #7ac143;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.hero h1,
.hero .server-ip,
.hero .player-count,
.hero .btn {
    position: relative;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.nav-links a {
    color: #ccc;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active { color: #7ac143; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #7ac143;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 1001;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    text-shadow: 2px 2px #000;
}

.highlight { color: #7ac143; }

.server-ip {
    font-size: 1.5rem;
    margin: 20px 0;
    background: rgba(0, 0, 0, 0.7);
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
}

.server-ip strong {
    cursor: pointer;
    color: #7ac143;
}

.player-count {
    font-size: 1rem;
    color: #ccc;
    margin: 12px 0 0;
}

.player-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #7ac143;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 6px #7ac143;
}

.player-dot.offline {
    background: #e74c3c;
    box-shadow: 0 0 6px #e74c3c;
}

.btn {
    background: #7ac143;
    color: #fff;
    padding: 12px 30px;
    text-decoration: none;
    font-size: 1.2rem;
    font-family: inherit;
    border: none;
    border-radius: 5px;
    display: inline-block;
    margin-top: 15px;
    cursor: pointer;
}

.btn:hover { background: #5e9e2f; }

main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.about, .quick-nav, .gallery { margin-bottom: 40px; }

.quick-nav h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.5rem;
    color: #7ac143;
}

.quick-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.quick-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 140px;
    padding: 24px 16px;
    background: #2a2a2a;
    border: 2px solid #444;
    border-radius: 10px;
    color: #eee;
    text-decoration: none;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
}

.quick-nav-btn:hover,
.quick-nav-btn:focus-visible {
    border-color: #7ac143;
    background: #333;
    transform: translateY(-2px);
}

.quick-nav-icon {
    font-size: 2.5rem;
    line-height: 1;
}

.quick-nav-label {
    font-size: 1.35rem;
    font-weight: 700;
    color: #7ac143;
}

.quick-nav-desc {
    font-size: 0.85rem;
    color: #aaa;
    text-align: center;
}

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

.card {
    background: #2a2a2a;
    padding: 20px;
    border-left: 4px solid #7ac143;
}

.gallery h2 {
    margin-bottom: 8px;
    border-bottom: 2px solid #7ac143;
    padding-bottom: 10px;
}

.gallery-intro {
    color: #aaa;
    margin-bottom: 24px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.gallery-item {
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
}

.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.gallery-item figcaption {
    padding: 10px 14px;
    font-size: 0.95rem;
    color: #ccc;
    text-align: center;
}

.content h1 {
    margin-bottom: 20px;
    border-bottom: 2px solid #7ac143;
    padding-bottom: 10px;
}

.content ol {
    padding-left: 24px;
    margin-bottom: 20px;
}

.content ol li { margin-bottom: 8px; }

.rules-page .rules-list li {
    margin-bottom: 24px;
}

.rules-page .rules-list li p {
    margin-bottom: 8px;
}

.rules-page .rules-list li p:last-child {
    margin-bottom: 0;
}

.rules-section,
.rules-note {
    margin: 32px 0;
    padding: 20px;
    background: #2a2a2a;
    border-left: 4px solid #7ac143;
    border-radius: 4px;
}

.rules-section h2,
.rules-note h2 {
    margin-bottom: 12px;
    color: #7ac143;
    font-size: 1.2rem;
}

.rules-section p,
.rules-note p {
    margin-bottom: 10px;
}

.rules-section p:last-child,
.rules-note p:last-child {
    margin-bottom: 0;
}

.rules-links {
    list-style: none;
    padding-left: 0;
}

.rules-links li {
    margin-bottom: 12px;
}

.rules-links a {
    color: #7ac143;
    text-decoration: underline;
}

.rules-links a:hover {
    color: #8ed44a;
}

.rules-video {
    margin-top: 40px;
    text-align: center;
}

.rules-test-callout {
    font-size: 1.2rem;
    line-height: 1.5;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: #2a2a2a;
    border: 2px solid #7ac143;
    border-radius: 8px;
}

.video-wrap {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    background: #0d0d0d;
    border-radius: 8px;
    overflow: hidden;
}

.video-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.staff-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin: 30px 0;
}

.staff-card {
    background: #2a2a2a;
    padding: 15px;
    text-align: center;
    width: 200px;
    border-radius: 8px;
    border: 1px solid #333;
}

.staff-card img.avatar {
    width: 100%;
    height: 160px;
    object-fit: contain;
    object-position: center bottom;
    display: block;
    margin: 0 auto 12px;
}

.vote-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px 0;
}

.vote-btn {
    background: #7ac143;
    color: white;
    padding: 15px;
    text-align: center;
    text-decoration: none;
    font-size: 1.2rem;
    border-radius: 5px;
}

.vote-btn:hover { background: #5e9e2f; }

.vote-modal {
    border: none;
    border-radius: 8px;
    padding: 0;
    max-width: 420px;
    width: min(420px, calc(100% - 32px));
    margin: auto;
    background: #2a2a2a;
    color: #eee;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.vote-modal[open] {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

.vote-modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
}

.vote-modal-inner {
    padding: 28px 24px 24px;
    position: relative;
    text-align: center;
}

.vote-modal-inner h2 {
    margin-bottom: 8px;
    color: #7ac143;
    font-size: 1.4rem;
}

.vote-modal-inner > p {
    margin-bottom: 20px;
    color: #aaa;
    font-size: 0.95rem;
}

.vote-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: #888;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 4px 8px;
}

.vote-modal-close:hover {
    color: #eee;
}

.vote-modal .vote-links {
    margin: 0;
}

.map-preview {
    width: 100%;
    border-radius: 8px;
    border: 2px solid #7ac143;
    margin-bottom: 16px;
}

.map-intro {
    color: #aaa;
    margin-bottom: 24px;
}

.map-container {
    overflow-x: hidden;
}

.map-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
    align-items: start;
    width: 100%;
}

.map-view {
    min-width: 0;
    width: 100%;
}

.map-worlds {
    background: #2a2a2a;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 16px;
}

.map-worlds-title {
    font-size: 1rem;
    color: #7ac143;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #444;
}

.map-world-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-world-btn {
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #eee;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.map-world-btn:hover {
    border-color: #7ac143;
}

.map-world-btn.active {
    background: #2d3a22;
    border-color: #7ac143;
}

.map-world-name {
    display: block;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 4px;
}

.map-world-desc {
    display: block;
    font-size: 0.8rem;
    color: #aaa;
    line-height: 1.4;
}

.map-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.map-view-header a {
    color: #7ac143;
    text-decoration: underline;
    font-size: 0.95rem;
}

.map-view-header a:hover {
    color: #8ed44a;
}

.map-embed {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 500px;
    background: #0d0d0d;
    border: 2px solid #7ac143;
    border-radius: 8px;
    overflow: hidden;
}

.map-embed iframe {
    width: 100%;
    height: 70vh;
    min-height: 500px;
    border: 0;
    display: block;
}

.map-note {
    margin-top: 16px;
    text-align: center;
    color: #888;
}

.map-mobile-tip {
    display: none;
    margin-top: 8px;
    color: #aaa;
}

.map-mobile-tip a {
    color: #7ac143;
    text-decoration: underline;
}

footer {
    text-align: center;
    padding: 20px;
    background: #0d0d0d;
    margin-top: 40px;
    font-size: 0.9rem;
    color: #888;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #7ac143;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    opacity: 0;
    transition: transform 0.2s, opacity 0.2s;
    pointer-events: none;
    z-index: 3000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

@media (max-width: 640px) {
    .nav-toggle { display: block; }

    .navbar .logo img {
        max-width: calc(100vw - 80px);
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background: #0d0d0d;
        padding: 12px 20px 16px;
        border-bottom: 3px solid #7ac143;
        gap: 12px;
        z-index: 1000;
    }

    .nav-links.open { display: flex; }

    .hero { padding: 60px 20px; }

    .map-layout {
        grid-template-columns: 1fr;
    }

    .map-embed {
        min-height: 280px;
    }

    .map-embed iframe {
        height: 55vh;
        min-height: 280px;
    }

    .map-world-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .map-world-item {
        flex: 1 1 calc(50% - 8px);
    }

    .map-world-desc {
        display: none;
    }

    .map-mobile-tip {
        display: inline;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
