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

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

body {
    overflow: hidden;
    font-family: 'Press Start 2P', cursive;
    background: #1a1a2e;
    image-rendering: pixelated;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px;
    pointer-events: none;
}

#resources-panel {
    display: flex;
    gap: 15px;
    background: rgba(0, 0, 0, 0.85);
    padding: 12px 18px;
    border: 3px solid #555;
    border-radius: 0;
    width: fit-content;
    box-shadow: inset 0 0 0 2px #333;
}

.resource {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 14px;
    text-shadow: 2px 2px 0 #000;
}

.resource-icon {
    font-size: 36px;
    filter: drop-shadow(3px 3px 0 #000);
    image-rendering: pixelated;
}

/* Left sidebar for utility buttons */
#left-sidebar {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
}

#left-sidebar button {
    width: 60px;
    height: 60px;
    background: rgba(0, 0, 0, 0.85);
    border: 4px solid #555;
    border-radius: 0;
    color: white;
    cursor: pointer;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 3px #333, 4px 4px 0 #000;
    transition: all 0.2s;
    image-rendering: pixelated;
}

#left-sidebar button:hover {
    background: rgba(78, 205, 196, 0.3);
    border-color: #4ecdc4;
}

#left-sidebar button:active {
    transform: scale(0.95);
}

/* Highlight feedback button */
#btn-feedback {
    border-color: #FFD700 !important;
    box-shadow:
        inset 0 0 0 3px #333,
        0 0 15px rgba(255, 215, 0, 0.6),
        4px 4px 0 #000 !important;
    animation: pulseGlow 2s ease-in-out infinite;
}

#btn-feedback:hover {
    background: rgba(255, 215, 0, 0.2) !important;
    border-color: #FFA500 !important;
    box-shadow:
        inset 0 0 0 3px #333,
        0 0 20px rgba(255, 215, 0, 0.8),
        4px 4px 0 #000 !important;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow:
            inset 0 0 0 3px #333,
            0 0 15px rgba(255, 215, 0, 0.6),
            4px 4px 0 #000;
    }
    50% {
        box-shadow:
            inset 0 0 0 3px #333,
            0 0 25px rgba(255, 215, 0, 0.9),
            4px 4px 0 #000;
    }
}

#health-panel {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#health-bar {
    width: 180px;
    height: 24px;
    background: rgba(0, 0, 0, 0.85);
    border: 3px solid #555;
    border-radius: 0;
    overflow: hidden;
    box-shadow: inset 0 0 0 2px #333;
}

#health-fill {
    width: 100%;
    height: 100%;
    background: #cc3333;
    transition: width 0.3s ease;
}

#health-text {
    color: white;
    font-size: 10px;
    background: rgba(0, 0, 0, 0.85);
    padding: 6px 10px;
    border: 3px solid #555;
    border-radius: 0;
    text-shadow: 2px 2px 0 #000;
}

#island-panel {
    position: absolute;
    top: 70px;
    left: 15px;
    background: rgba(0, 0, 0, 0.85);
    padding: 8px 12px;
    border: 3px solid #555;
    border-radius: 0;
    color: #4ecdc4;
    font-size: 10px;
    text-shadow: 2px 2px 0 #000;
}

.panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(20, 20, 40, 0.95);
    padding: 20px;
    border: 4px solid #555;
    border-radius: 0;
    color: white;
    min-width: 320px;
    max-width: 500px;
    max-height: 70vh;
    overflow-y: auto;
    pointer-events: auto;
    box-shadow: inset 0 0 0 2px #333, 0 0 20px rgba(0,0,0,0.5);
}

.panel h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #4ecdc4;
    font-size: 16px;
    text-shadow: 2px 2px 0 #000;
}

.panel button {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    background: #4ecdc4;
    border: 3px solid #3aa89d;
    border-radius: 0;
    color: #1a1a2e;
    font-family: 'Press Start 2P', cursive;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: none;
}

.panel button:hover {
    background: #5fe8d8;
    transform: scale(1.02);
}

.panel button:active {
    transform: scale(0.98);
}

.hidden {
    display: none !important;
}

#inventory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.inventory-slot {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.inventory-slot .item-icon {
    font-size: 24px;
}

.inventory-slot .item-count {
    font-size: 12px;
    color: #aaa;
}

.recipe-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.recipe-item .recipe-name {
    font-weight: bold;
}

.recipe-item .recipe-cost {
    font-size: 12px;
    color: #aaa;
}

.recipe-item button {
    width: auto;
    margin: 0;
    padding: 5px 15px;
    font-size: 12px;
}

.recipe-item button:disabled {
    background: #666;
    cursor: not-allowed;
}

#action-buttons {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

#action-buttons button {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.85);
    border: 3px solid #555;
    border-radius: 0;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    text-shadow: 1px 1px 0 #000;
    box-shadow: inset 0 0 0 2px #333;
}

#action-buttons button:hover {
    background: rgba(78, 205, 196, 0.3);
    border-color: #4ecdc4;
}

#action-buttons button.active {
    background: rgba(255, 107, 107, 0.5);
    border-color: #ff6b6b;
}

#message-display {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 10px 16px;
    border: 3px solid #555;
    border-radius: 0;
    color: #4ecdc4;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    text-shadow: 2px 2px 0 #000;
}

#message-display.show {
    opacity: 1;
}

#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
    z-index: 100;
}

#start-screen h1 {
    font-size: 32px;
    color: #4ecdc4;
    text-shadow: 4px 4px 0 #000, 0 0 20px rgba(78, 205, 196, 0.5);
    letter-spacing: 2px;
}

#start-screen p {
    color: #aaa;
    max-width: 500px;
    text-align: center;
    font-size: 10px;
    line-height: 1.8;
    text-shadow: 2px 2px 0 #000;
}

#start-screen button {
    padding: 18px 40px;
    font-size: 12px;
    background: #4ecdc4;
    border: 4px solid #3aa89d;
    border-radius: 0;
    color: #1a1a2e;
    font-family: 'Press Start 2P', cursive;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 4px 4px 0 #000;
}

#start-screen button:hover {
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 #000;
    background: #5fe8d8;
}

#start-screen button:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #000;
}

#credits {
    position: absolute;
    bottom: 25px;
    right: 25px;
    font-size: 10px;
    color: #888;
    text-shadow: 2px 2px 0 #000;
}

#credits .author-name {
    color: #4ecdc4;
    font-size: 12px;
    text-shadow: 2px 2px 0 #000, 0 0 10px rgba(78, 205, 196, 0.3);
}

/* Cursor styles */
#game-canvas.pointer {
    cursor: pointer;
}

#game-canvas.attack {
    cursor: crosshair;
}

/* Scrollbar styling */
.panel::-webkit-scrollbar {
    width: 8px;
}

.panel::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.panel::-webkit-scrollbar-thumb {
    background: #4ecdc4;
    border-radius: 4px;
}
