/* ===== Сброс стилей (как на minecraft.net) ===== */
@layer reset {
    html {
        line-height: 1.15rem;
        -webkit-text-size-adjust: 100%;
        -webkit-tap-highlight-color: transparent;
        scroll-behavior: smooth;
    }

    *, :after, :before {
        box-sizing: border-box;
    }

    article, aside, figcaption, figure, footer, header, hgroup, main, nav, section {
        display: block;
    }

    body {
        margin: 0;
        font-size: 1rem;
        font-weight: 400;
        line-height: 1.5;
        color: #313131;
    }

    p { margin: 0; }
    dl, ol, ul { margin: 0; }
    b, strong { font-weight: bolder; }
    small { font-size: 80%; }
    img { vertical-align: middle; border-style: none; }

    button {
        border-radius: 0;
        cursor: pointer;
        font-family: inherit;
        font-size: inherit;
        line-height: inherit;
    }

    a { text-decoration: none; color: inherit; }
}

/* ===== Полоса прокрутки Minecraft ===== */
::-webkit-scrollbar {
    width: 16px;
}

::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-left: 2px solid #1a1a1a;
    image-rendering: pixelated;
}

::-webkit-scrollbar-thumb {
    background: #8B8B8B;
    border: 2px solid #373737;
    box-shadow: inset -2px -2px 0 #555, inset 2px 2px 0 #fff;
    image-rendering: pixelated;
}

::-webkit-scrollbar-thumb:hover {
    background: #A0A0A0;
}

::-webkit-scrollbar-button {
    display: none;
}

/* ===== Шрифты ===== */
@font-face {
    font-family: 'Noto Sans';
    src: url('../fonts/NotoSans-Regular.woff2') format('woff2');
    font-style: normal;
    font-weight: normal;
}

@font-face {
    font-family: 'MinecraftSeven';
    src: url('../fonts/Minecraft-Seven_v2.woff2') format('woff2');
    font-style: normal;
    font-weight: normal;
}

@font-face {
    font-family: 'MinecraftTen';
    src: url('../fonts/Minecraft-Tenv2.woff2') format('woff2');
    font-style: normal;
    font-weight: normal;
}

@font-face {
    font-family: 'MinecraftSixteen';
    src: url('../fonts/MinecraftSixteen.woff2') format('woff2');
    font-style: normal;
    font-weight: normal;
}

/* ===== Переменные ===== */
:root {
    --green: #3B8526;
    --dark-green: #2A641C;
    --gold: #FFAA00;
    --light: #F5F5F5;
    --dark: #1A1A1A;
    --gray: #6B6B6B;
}

/* ===== Базовые стили ===== */
body {
    font-family: 'Noto Sans', sans-serif;
    background: var(--light);
    color: var(--dark);
    overflow-x: hidden;
}

/* ===== Навигация ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 3px solid var(--green);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'MinecraftTen', sans-serif;
    font-size: 1.5rem;
    color: #fff;
    text-transform: uppercase;
}

.logo-img {
    height: 30px;
    width: auto;
}

.logo-text {
    letter-spacing: 2px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 24px;
    padding: 0;
}

.nav-link {
    font-family: 'MinecraftSeven', sans-serif;
    color: #ccc;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 8px 0;
    position: relative;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--green);
    transition: width 0.2s;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-cta {
    background: var(--green);
    padding: 8px 16px !important;
    border-radius: 4px;
    color: #fff !important;
}

.nav-cta:hover {
    background: var(--dark-green);
}

.nav-cta::after {
    display: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background: #fff;
    transition: 0.3s;
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #1a1a1a;
    padding-top: 64px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        url('../img/hero-bg.webp') center/cover no-repeat,
        linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.8) 100%);
    background-blend-mode: overlay;
    image-rendering: pixelated;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px 16px;
    max-width: 90vw;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-title {
    font-family: 'MinecraftTen', sans-serif;
    font-size: clamp(2rem, 8vw, 5rem);
    color: #fff;
    text-shadow: 4px 4px 0 rgba(0,0,0,0.5);
    margin: 0 auto 16px;
    letter-spacing: 0.04em;
    line-height: 1.1;
    text-align: center;
    word-break: break-word;
    width: 100%;
}

.highlight {
    color: var(--gold);
}

.hero-subtitle {
    font-family: 'MinecraftSeven', sans-serif;
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    color: #ccc;
    margin-bottom: 32px;
    letter-spacing: 1px;
    text-align: center;
    width: 100%;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
    width: 100%;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: 'MinecraftSeven', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--green);
    color: #fff;
    box-shadow: 0 4px 0 var(--dark-green);
}

.btn-primary:hover {
    background: var(--dark-green);
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--dark-green);
}

.btn-primary:active {
    transform: translateY(4px);
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 2px solid rgba(255,255,255,0.3);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.2);
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-arrow {
    font-size: 0.8rem;
}

/* Статус сервера */
.server-status {
    font-family: 'MinecraftSeven', sans-serif;
    font-size: 0.85rem;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online {
    background: #55FF55;
    box-shadow: 0 0 8px #55FF55;
}

.status-dot.offline {
    background: #FF5555;
    box-shadow: 0 0 8px #FF5555;
}

/* ===== Секции ===== */
.section {
    padding: 80px 20px;
}

.section-dark {
    background: #1a1a1a;
    color: #fff;
}

.section-container {
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    font-family: 'MinecraftTen', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    text-align: center;
    margin-bottom: 48px;
    letter-spacing: 2px;
    color: inherit;
}

/* ===== Карточки ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.card {
    background: #fff;
    padding: 32px 24px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    border: 2px solid #e0e0e0;
}

.card:hover {
    transform: translateY(-4px);
    border-color: var(--green);
}

.card-img {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    image-rendering: pixelated;
}

.card-title {
    font-family: 'MinecraftTen', sans-serif;
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.card-text {
    font-size: 0.95rem;
    color: #6B6B6B;
    line-height: 1.6;
}

/* ===== Правила ===== */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 600px;
    margin: 0 auto;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255,255,255,0.05);
    padding: 16px 24px;
    border-left: 4px solid var(--green);
    font-family: 'MinecraftSeven', sans-serif;
    font-size: 1rem;
}

.rule-number {
    font-family: 'MinecraftTen', sans-serif;
    font-size: 1.5rem;
    color: var(--green);
    min-width: 40px;
}

/* ===== Footer ===== */
.footer {
    background: #1a1a1a;
    color: #aaa;
    padding: 32px 24px;
    border-top: 4px solid var(--green);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.flag-counter img {
    display: block;
    image-rendering: auto;
    height: auto;
    max-width: 100%;
}

.footer-center {
    display: flex;
    align-items: center;
}

.footer-text {
    text-align: right;
}

.footer-text p {
    margin: 4px 0;
    font-size: 0.85rem;
}

/* Переключатель языков */
.lang-switcher {
    display: flex;
    gap: 8px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #ccc;
    padding: 8px 14px;
    font-family: 'MinecraftSeven', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.lang-btn.active {
    border-color: var(--green);
    background: rgba(59, 133, 38, 0.3);
    color: #fff;
}

/* ===== Toast ===== */
.toast {
    visibility: hidden;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark);
    color: #fff;
    padding: 12px 24px;
    font-family: 'MinecraftSeven', sans-serif;
    font-size: 0.9rem;
    z-index: 2000;
    border: 2px solid var(--green);
}

.toast.show {
    visibility: visible;
    animation: toastAnim 2.5s ease forwards;
}

@keyframes toastAnim {
    0% { opacity: 0; bottom: 0; }
    20% { opacity: 1; bottom: 30px; }
    80% { opacity: 1; bottom: 30px; }
    100% { opacity: 0; bottom: 0; }
}

/* ===== Экран загрузки ===== */
#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #1a1a1a;
    background-image:
        url('../img/dirt-block.png'),
        linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.9) 100%);
    background-size: 64px, auto;
    background-blend-mode: overlay;
    image-rendering: pixelated;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s, visibility 0.5s;
    overflow: hidden;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#particles-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.loading-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.loading-logo {
    width: 256px;
    height: auto;
    image-rendering: pixelated;
    animation: logoBounce 1s ease-in-out infinite;
}

@keyframes logoBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.loading-title {
    font-family: 'MinecraftTen', sans-serif;
    font-size: 2rem;
    color: #fff;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.5);
    letter-spacing: 2px;
}

.loading-bar-wrapper {
    width: 300px;
    max-width: 80vw;
}

.loading-bar {
    width: 100%;
    height: 20px;
    background: #2a2a2a;
    border: 3px solid #555;
    box-shadow: inset 2px 2px 0 rgba(0,0,0,0.5), inset -2px -2px 0 rgba(0,0,0,0.3);
    image-rendering: pixelated;
    overflow: hidden;
}

.loading-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--green) 0%, #55FF55 50%, var(--green) 100%);
    background-size: 30px 100%;
    transition: width 0.3s;
    animation: fillShimmer 1s linear infinite;
}

@keyframes fillShimmer {
    0% { background-position: 0 0; }
    100% { background-position: 30px 0; }
}

.loading-text {
    font-family: 'MinecraftSeven', sans-serif;
    font-size: 0.85rem;
    color: #aaa;
    display: block;
    margin-top: 8px;
}

.loading-tips {
    font-family: 'MinecraftSeven', sans-serif;
    font-size: 0.8rem;
    color: #888;
    max-width: 400px;
    line-height: 1.6;
    min-height: 40px;
    animation: fadeInOut 3s ease-in-out infinite;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ===== Адаптив ===== */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: fixed;
        top: 64px;
        left: 0;
        width: 100%;
        background: rgba(26, 26, 26, 0.98);
        flex-direction: column;
        padding: 20px;
        gap: 12px;
        z-index: 999;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: block;
    }

    .hero-title {
        font-size: clamp(1.8rem, 6vw, 3rem);
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .btn {
        padding: 10px 18px;
        font-size: 0.8rem;
    }

    .section {
        padding: 60px 16px;
    }

    .section-title {
        font-size: 1.8rem;
        margin-bottom: 32px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card {
        padding: 24px 16px;
    }

    .rules-list {
        max-width: 100%;
    }

    .rule-item {
        padding: 12px 16px;
        gap: 12px;
    }

    .rule-number {
        font-size: 1.2rem;
        min-width: 30px;
    }

    .footer-container {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }

    .footer-text {
        text-align: center;
    }

    .lang-switcher {
        flex-wrap: wrap;
        justify-content: center;
    }

    .lang-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .loading-logo {
        width: 512px;
    }

    .loading-title {
        font-size: 1.5rem;
    }

    .loading-bar-wrapper {
        width: 250px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 12px;
        height: 56px;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .hero {
        padding-top: 56px;
    }

    .hero-content {
        padding: 24px 12px;
    }

    .hero-title {
        font-size: 1.5rem;
        letter-spacing: 0.02em;
    }

    .hero-actions {
        gap: 8px;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
        font-size: 0.75rem;
    }

    .server-status {
        font-size: 0.75rem;
        flex-direction: column;
        gap: 4px;
    }

    .section {
        padding: 40px 12px;
    }

    .section-title {
        font-size: 1.4rem;
        margin-bottom: 24px;
    }

    .card {
        padding: 20px 12px;
    }

    .card-title {
        font-size: 1rem;
    }

    .card-text {
        font-size: 0.85rem;
    }

    .rule-item {
        font-size: 0.85rem;
        padding: 10px 12px;
    }

    .footer {
        padding: 24px 12px;
    }

    .footer-text p {
        font-size: 0.75rem;
    }

    .lang-btn {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    .toast {
        width: 90%;
        font-size: 0.8rem;
        padding: 10px 16px;
    }

    .loading-logo {
        width: 512px;
    }

    .loading-title {
        font-size: 1.2rem;
    }

    .loading-bar-wrapper {
        width: 200px;
    }

    .loading-tips {
        font-size: 0.7rem;
    }
}
