@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

:root {
    --mc-green: #5aaa35;
    --mc-dark-green: #3d7a1e;
    --mc-dirt: #8b5e3c;
    --mc-sky: #5ba3e0;
    --mc-sky2: #87ceeb;
    --mc-zombie: #53a854;
    --mc-yellow: #f5c518;
    --mc-explosion: #ff6600;
    --mc-cave: #1a1008;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Press Start 2P', monospace;
    background: #1a1008;
    overflow-x: hidden;
}

/* ─── HERO ─── */
.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 520px;
    overflow: hidden;
    background: var(--mc-sky);
}

#minecraftCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.hero-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 1.2rem;
    padding: 1rem;
    text-align: center;
    pointer-events: none;
}

/* Minecraft logo style */
.mc-logo-wrap {
    position: relative;
    display: inline-block;
    font-size: clamp(1.6rem, 5vw, 3.2rem);
    line-height: 1;
    margin-bottom: 0.3rem;
}
.mc-logo {
    color: var(--mc-yellow);
    position: relative;
    z-index: 2;
    text-shadow:
        3px 3px 0 #7a5e00,
        -1px -1px 0 #7a5e00,
        1px -1px 0 #7a5e00,
        -1px 1px 0 #7a5e00;
    filter: drop-shadow(0 4px 0 rgba(0,0,0,0.5));
}
.mc-logo-shadow {
    position: absolute;
    inset: 0;
    color: #8f6e00;
    transform: translate(4px, 6px);
    z-index: 1;
}

.hero-content h1 {
    font-size: clamp(0.9rem, 2.8vw, 1.8rem);
    color: #fff;
    text-shadow:
        2px 2px 0 #000,
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000;
    letter-spacing: 0.04em;
}

/* Server IP/Port copy boxes */
.server-info {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.8rem;
    pointer-events: all;
}

.copy-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.copy-label {
    font-size: 0.5rem;
    color: #c8ffc8;
    text-shadow: 1px 1px 0 #000;
    letter-spacing: 0.1em;
}

.copy-box {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.75);
    border: 3px solid #5aaa35;
    border-bottom-color: #2d5a1a;
    border-right-color: #2d5a1a;
    cursor: pointer;
    transition: background 0.15s;
    image-rendering: pixelated;
    position: relative;
}
.copy-box:hover { background: rgba(0,0,0,0.9); }
.copy-box.copied { border-color: var(--mc-yellow); }

.copy-value {
    font-size: clamp(0.45rem, 1.8vw, 0.75rem);
    color: #fff;
    padding: 0.55rem 0.7rem;
    letter-spacing: 0.05em;
}

.copy-btn {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(0.38rem, 1.2vw, 0.55rem);
    background: var(--mc-green);
    color: #fff;
    border: none;
    border-left: 3px solid #2d5a1a;
    padding: 0.55rem 0.6rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-shadow: 1px 1px 0 #000;
    white-space: nowrap;
}
.copy-btn:hover { background: #4cad2a; transform: scale(1.03); }
.copy-btn:active { transform: scale(0.97); }
.copy-box.copied .copy-btn {
    background: var(--mc-yellow);
    color: #000;
}

/* ─── ZOMBIE SECTION ─── */
.zombie-section {
    position: relative;
    width: 100%;
    height: 200px;
    background: linear-gradient(to bottom, #1c1005 0%, #2a1a08 60%, #3d2510 100%);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.ground-strip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 38px;
    background: repeating-linear-gradient(
        90deg,
        #4a3010 0px, #4a3010 28px,
        #3d2808 28px, #3d2808 56px
    );
    border-top: 4px solid #6b4520;
    z-index: 2;
}

/* Cave entrance on the left */
.cave-entrance {
    position: absolute;
    left: 0;
    bottom: 34px;
    width: 130px;
    z-index: 5;
}

.cave-mouth {
    width: 130px;
    height: 120px;
    background: #0a0604;
    border-radius: 0 50% 0 0;
    border-right: 6px solid #2a1a08;
    border-top: 6px solid #2a1a08;
    box-shadow: inset -10px -10px 30px rgba(0,0,0,0.8);
}

.cave-dark {
    position: absolute;
    left: 0;
    top: 0;
    width: 130px;
    height: 120px;
    background: linear-gradient(to right, #000 40%, transparent 100%);
    border-radius: 0 50% 0 0;
}

/* Zombie track */
.zombie-track {
    position: absolute;
    bottom: 38px;
    left: 0;
    right: 0;
    height: 90px;
    z-index: 3;
}

/* ─── ZOMBIE CSS PIXEL ART ─── */
.zombie {
    position: absolute;
    bottom: 0;
    right: -80px;
    width: 32px;
    height: 64px;
    image-rendering: pixelated;
    animation: zombieWalk linear infinite;
}

/* Each zombie gets different delays & speeds via JS inline styles */

.zombie-body {
    position: absolute;
    bottom: 24px;
    left: 6px;
    width: 20px;
    height: 22px;
    background: #3a8c3a;
    border: 2px solid #1e5a1e;
}
.zombie-head {
    position: absolute;
    bottom: 48px;
    left: 4px;
    width: 24px;
    height: 22px;
    background: #53a854;
    border: 2px solid #1e5a1e;
}
.zombie-head::before { /* eye */
    content: '';
    position: absolute;
    top: 5px;
    left: 4px;
    width: 5px;
    height: 4px;
    background: #ff0000;
    box-shadow: 9px 0 0 #ff0000;
}
.zombie-arm-l, .zombie-arm-r {
    position: absolute;
    bottom: 30px;
    width: 8px;
    height: 20px;
    background: #3a8c3a;
    border: 2px solid #1e5a1e;
    transform-origin: top center;
    animation: zombieArm 0.5s ease-in-out infinite alternate;
}
.zombie-arm-l { left: -2px; animation-delay: 0s; }
.zombie-arm-r { right: -2px; animation-delay: 0.25s; }

.zombie-leg-l, .zombie-leg-r {
    position: absolute;
    bottom: 0;
    width: 9px;
    height: 24px;
    background: #2a5a2a;
    border: 2px solid #143014;
    transform-origin: top center;
    animation: zombieLeg 0.5s ease-in-out infinite alternate;
}
.zombie-leg-l { left: 6px; animation-delay: 0s; }
.zombie-leg-r { right: 6px; animation-delay: 0.25s; }

@keyframes zombieWalk {
    from { right: -80px; opacity: 1; }
    90% { opacity: 1; }
    to   { right: calc(100% - 50px); opacity: 0; }
}

@keyframes zombieArm {
    from { transform: rotate(-45deg); }
    to   { transform: rotate(10deg); }
}

@keyframes zombieLeg {
    from { transform: rotate(20deg); }
    to   { transform: rotate(-20deg); }
}

/* Copied toast */
.copy-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #000;
    color: var(--mc-yellow);
    font-family: 'Press Start 2P', monospace;
    font-size: 0.6rem;
    padding: 0.7rem 1.2rem;
    border: 3px solid var(--mc-yellow);
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    pointer-events: none;
}
.copy-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 520px) {
    .server-info { flex-direction: column; }
}