@import url('https://fonts.googleapis.com/css2?family=Righteous&display=swap');

/* Base styles */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    overflow: hidden;
}

/* Particles */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    background: #3498db;
    border-radius: 50%;
    opacity: 0.3;
    animation: float 3s infinite ease-in-out;
}

.particle.black {
    background: #000000;
    pointer-events: auto !important;
    cursor: pointer;
    z-index: 100;
    position: fixed;
    opacity: 0.6 !important;
}

.holiday-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Righteous', cursive;
    font-size: 2.5rem;
    color: #2c3e50;
    text-shadow: 
        3px 3px 0px #3498db,
        6px 6px 0px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
}

.holiday-message.show {
    opacity: 1;
}

.gift-notification {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Righteous', cursive;
    font-size: 2rem;
    color: #2c3e50;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-shadow: 
        2px 2px 0px #3498db,
        4px 4px 0px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    pointer-events: none;
    transform: translateX(-50%) translateY(-20px);
}

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

/* Title styling with enhanced decoration */
.game-title {
    font-family: 'Righteous', cursive;
    font-size: 4.5rem;
    color: #2c3e50;
    text-shadow: 
        3px 3px 0px #3498db,
        6px 6px 0px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: absolute;
    width: 100%;
    top: 5%;
    left: 0;
    z-index: 10;
    letter-spacing: 2px;
    transition: all 0.5s ease-out;
    transform: translateY(0);
}

.game-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 4px;
    background: linear-gradient(90deg, transparent, #3498db, transparent);
}

/* Add class for hiding title */
.game-title.hide {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transform: translateY(-50px);
}

/* Menu container with glass effect */
.menu-container {
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    transition: all 0.5s ease-out;
}

.menu-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    animation: shimmer 8s infinite linear;
}

/* Menu items with enhanced styling */
.menu-item {
    margin: 1.2rem 0;
    animation: fadeInRight 0.5s ease-out forwards;
    position: relative;
}

/* Enhanced decorative button styling */
.menu-button {
    background: linear-gradient(135deg, #00c6ff, #0072ff);
    color: white;
    padding: 15px 24px;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 15px rgba(0, 198, 255, 0.3),
        inset 0 0 0 1px rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.menu-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    transition: 0.5s;
}

.menu-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 60%);
    animation: shimmerButton 8s infinite linear;
}

.menu-button:hover {
    background: linear-gradient(135deg, #0072ff, #00c6ff);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(0, 198, 255, 0.4),
        inset 0 0 0 1px rgba(255, 255, 255, 0.3);
    letter-spacing: 3px;
}

.menu-button:hover::before {
    left: 100%;
}

/* Decorative corner accents */
.menu-container::after {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    width: 20px;
    height: 20px;
    border-top: 3px solid #3498db;
    border-right: 3px solid #3498db;
    opacity: 0.5;
}

.menu-container::before {
    content: '';
    position: absolute;
    bottom: 15px;
    left: 15px;
    width: 20px;
    height: 20px;
    border-bottom: 3px solid #3498db;
    border-left: 3px solid #3498db;
    opacity: 0.5;
}

/* Animation keyframes */
@keyframes titleDrop {
    0% {
        opacity: 0;
        transform: translateY(-50px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateX(-100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes shimmer {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Menu item animation delays */
.menu-item:nth-child(1) { animation-delay: 0.2s; }
.menu-item:nth-child(2) { animation-delay: 0.4s; }
.menu-item:nth-child(3) { animation-delay: 0.6s; }
.menu-item:nth-child(4) { animation-delay: 0.8s; }

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Add new animation for button shimmer */
@keyframes shimmerButton {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Add staggered hover effects for menu items */
.menu-item:nth-child(1) .menu-button { transition-delay: 0.05s; }
.menu-item:nth-child(2) .menu-button { transition-delay: 0.1s; }
.menu-item:nth-child(3) .menu-button { transition-delay: 0.15s; }
.menu-item:nth-child(4) .menu-button { transition-delay: 0.2s; }

/* Menu Container Transitions */
.menu-container {
    position: absolute;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease-out;
}

#main-menu.slide-left {
    transform: translate(-150%, -50%);
    opacity: 0;
}

#join-game-menu {
    transform: translate(50%, -50%);
    opacity: 0;
}

#join-game-menu.slide-in {
    transform: translate(-50%, -50%);
    opacity: 1;
}

#create-game-menu {
    transform: translate(50%, -50%);
    opacity: 0;
}

#create-game-menu.slide-in {
    transform: translate(-50%, -50%);
    opacity: 1;
}

/* Back button specific styling */
.back-button {
    background: linear-gradient(135deg, #ff7676, #f54242) !important;
}

.back-button:hover {
    background: linear-gradient(135deg, #f54242, #ff7676) !important;
}

/* Add these new styles */

/* Private Lobby Screen */
#private-lobby-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.lobby-code {
    font-family: 'Righteous', cursive;
    font-size: 5rem;
    letter-spacing: 10px;
    margin-bottom: 2rem;
}

.waiting-text {
    font-size: 1.5rem;
    opacity: 0.7;
}

/* Join Game Input */
.lobby-input {
    width: 100%;
    padding: 15px;
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 5px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #3498db;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
}

.lobby-input:focus {
    border-color: #2980b9;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.3);
}

/* Game World Styles */
#game-world {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #87CEEB;  /* Sky blue background */
}

.lobby-code-overlay {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-family: 'Righteous', cursive;
    font-size: 24px;
    z-index: 1000;
}

/* Add these styles for the inventory */
.inventory {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    z-index: 1000;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 4px;
    padding: 10px;
    background: #8B8B8B;
    border: 2px solid #373737;
    border-radius: 5px;
}

.inventory-slot {
    width: 50px;
    height: 50px;
    background: #C6C6C6;
    border: 2px solid #373737;
    border-radius: 3px;
    position: relative;
}

.inventory-item {
    width: 40px;
    height: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(0, 0, 0, 0.3);
    cursor: move;
}

/* Block colors */
.block-red { background-color: #FF0000; }
.block-blue { background-color: #0000FF; }
.block-green { background-color: #00FF00; }
.block-yellow { background-color: #FFFF00; }
.block-purple { background-color: #800080; }

.inventory-slot.dragging {
    opacity: 0.5;
}

.inventory-slot.can-drop {
    background: #D4D4D4;
}

/* Keep existing hotbar styles */
.hotbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 4px;
    border-radius: 5px;
    z-index: 1000;
}

.hotbar-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 4px;
    background: #8B8B8B;
    border: 2px solid #373737;
    border-radius: 5px;
}

.hotbar-slot {
    width: 50px;
    height: 50px;
    background: #C6C6C6;
    border: 2px solid #373737;
    border-radius: 3px;
    position: relative;
}

/* Add chat styles */
.chat-container {
    position: fixed;
    left: 20px;
    bottom: 120px; /* Above hotbar */
    width: 400px;
    z-index: 1000;
}

.chat-messages {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 5px;
    padding: 10px;
}

.chat-message {
    color: white;
    text-shadow: 1px 1px 0px #000;
    margin: 2px 0;
    font-family: 'Minecraft', Arial, sans-serif;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.chat-message.fade {
    opacity: 0;
}

.chat-input {
    width: 100%;
    padding: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #555;
    color: white;
    display: none;
    font-family: 'Minecraft', Arial, sans-serif;
}

.chat-input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.7);
}

/* Update hammer tool styles with a better hammer shape */
.hammer-tool {
    width: 32px;
    height: 32px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg); /* Rotate to proper hammer angle */
    background-color: #555;
    clip-path: polygon(
        35% 0%,    /* Handle top */
        45% 0%,    /* Handle top */
        45% 35%,   /* Handle to head */
        100% 35%,  /* Head right */
        100% 45%, /* Head right bottom */
        45% 45%,  /* Back to handle */
        45% 100%, /* Handle bottom */
        35% 100%, /* Handle bottom */
        35% 45%,  /* Handle side */
        0% 45%,   /* Head left bottom */
        0% 35%,   /* Head left */
        35% 35%   /* Back to handle */
    );
}

/* Add a wooden handle color */
.hammer-tool::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #8B4513; /* Wooden brown color */
    clip-path: polygon(
        35% 35%,   /* Top of handle */
        45% 35%,   /* Top of handle */
        45% 100%,  /* Bottom of handle */
        35% 100%   /* Bottom of handle */
    );
}

/* Keep existing tool name styles */
.tool-name {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 12px;
    white-space: nowrap;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
    opacity: 0;
    transition: opacity 0.2s;
}

.hotbar-slot.selected .tool-name {
    opacity: 1;
}

/* Add styles for inventory blocks */
.inventory-item {
    width: 80%;
    height: 80%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(0, 0, 0, 0.3);
}

.inventory-slot.dragging {
    opacity: 0.5;
}

.inventory-slot.can-drop {
    background: #D4D4D4;
}

/* Add hover effects for inventory items */
.inventory-slot .inventory-item:hover {
    filter: brightness(1.2);
    cursor: pointer;
}

.inventory-slot:not(:first-child):hover {
    background: #D4D4D4;
    cursor: pointer;
}

/* Update dragging states */
.inventory-slot.dragging .inventory-item {
    opacity: 0.5;
}

.hotbar-slot:not(:first-child).can-drop {
    background: #D4D4D4;
    border-color: #666;
}

.inventory-slot .inventory-item {
    width: 40px;
    height: 40px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s ease;
}

.inventory-slot .inventory-item:hover {
    transform: translate(-50%, -50%) scale(1.1);
    filter: brightness(1.2);
}

.hotbar-slot.selected {
    border-color: #fff;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.hotbar-slot.can-drop {
    background: #D4D4D4;
    border-color: #fff;
}

/* Crosshair styles */
.crosshair {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 1000;
}

.crosshair-line {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 1px;
}

.crosshair-vertical {
    width: 2px;
    height: 20px;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.crosshair-horizontal {
    width: 20px;
    height: 2px;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

/* Hide crosshair when inventory or chat is open */
.inventory-open .crosshair,
.chat-open .crosshair {
    display: none;
}
