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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #A8E6CF, #FFB3BA);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #B8B8FF;
    padding: 10px 20px;
    color: #333;
}

#player-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

#player-avatar {
    width: 32px;
    height: 32px;
    background: #FDBCB4;
    border-radius: 50%;
    border: 2px solid #333;
}

#player-name {
    font-weight: bold;
    font-size: 16px;
}

#time-weather {
    display: flex;
    align-items: center;
    gap: 15px;
}

#game-time {
    background: rgba(255,255,255,0.3);
    padding: 5px 10px;
    border-radius: 15px;
}

#weather-display {
    font-size: 24px;
}

#canvas {
    display: block;
    background: #A8E6CF;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#bottom-hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FFB3BA;
    padding: 15px 20px;
}

#inventory-bar {
    display: flex;
    gap: 8px;
}

.inventory-slot {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.7);
    border: 2px solid #333;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inventory-slot:hover {
    background: rgba(255,255,255,0.9);
    transform: translateY(-2px);
}

#tool-wheel {
    display: flex;
    gap: 10px;
}

.tool-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.8);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tool-btn:hover, .tool-btn.selected {
    background: #FFD700;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

#menu-btn {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 8px;
    background: #B8B8FF;
    color: white;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#menu-btn:hover {
    background: #9999FF;
    transform: scale(1.05);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.modal.visible {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: linear-gradient(135deg, #FFB3BA, #B8B8FF);
    padding: 30px;
    border-radius: 20px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
}

#character-preview {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

#preview-canvas {
    border: 3px solid #333;
    border-radius: 15px;
    background: #A8E6CF;
    image-rendering: pixelated;
}

.customization-panel {
    text-align: left;
    margin: 20px 0;
}

.option-group {
    margin: 15px 0;
}

.option-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.hair-styles {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hair-style {
    padding: 8px 15px;
    border: 2px solid #333;
    background: rgba(255,255,255,0.8);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.hair-style:hover, .hair-style.selected {
    background: #FFD700;
    transform: scale(1.05);
}

.color-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-option {
    width: 35px;
    height: 35px;
    border: 3px solid #333;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.color-option.selected {
    border-width: 4px;
    border-color: #FFD700;
}

.pastel-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    margin-top: 20px;
}

.pastel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0,0,0,0.3);
    background: linear-gradient(135deg, #FFED4E, #FF8C00);
}

/* Dialogue System */
#dialogue-box {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.95);
    border: 3px solid #333;
    border-radius: 20px;
    padding: 20px;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

#dialogue-box.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(20px);
}

.dialogue-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

#villager-portrait {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #DDA0DD;
    border: 2px solid #333;
    flex-shrink: 0;
}

#dialogue-text {
    flex: 1;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
}

#dialogue-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.dialogue-option {
    background: #B8B8FF;
    border: 2px solid #333;
    border-radius: 15px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
    font-size: 14px;
}

.dialogue-option:hover {
    background: #9999FF;
    transform: translateY(-1px);
}

/* Activity Panel */
#activity-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.95);
    border: 3px solid #333;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    min-width: 300px;
}

#activity-panel.hidden {
    display: none;
}

#activity-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

#fishing-game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#casting-meter {
    position: relative;
    width: 200px;
    height: 20px;
    background: #ddd;
    border: 2px solid #333;
    border-radius: 10px;
    overflow: hidden;
}

#power-bar {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #00ff00, #ffff00, #ff0000);
    opacity: 0.3;
}

#power-indicator {
    position: absolute;
    left: 0;
    top: -2px;
    width: 4px;
    height: 24px;
    background: #333;
    border-radius: 2px;
    transition: left 0.1s ease;
}

#cast-button {
    background: #4CAF50;
    border: none;
    padding: 12px 25px;
    font-size: 16px;
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

#cast-button:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.95);
    border: 2px solid #333;
    border-radius: 15px;
    padding: 15px 20px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
    z-index: 1001;
}

.notification.fade-out {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(300px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Responsive Design */
@media (max-width: 900px) {
    #game-container {
        margin: 10px;
        border-radius: 15px;
    }
    
    #canvas {
        width: 100%;
        max-width: 800px;
        height: auto;
    }
    
    #bottom-hud {
        flex-direction: column;
        gap: 15px;
        padding: 10px;
    }
    
    .modal-content {
        margin: 20px;
        padding: 20px;
        max-width: 90%;
    }
    
    #dialogue-box {
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
    }
    
    #dialogue-box.hidden {
        transform: translateY(20px);
    }
}

@media (max-width: 480px) {
    .hair-styles, .color-picker {
        justify-content: center;
    }
    
    .inventory-slot {
        width: 35px;
        height: 35px;
    }
    
    .tool-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    #game-header {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    #player-name {
        font-size: 14px;
    }
}