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

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* Make navbar and footer full width */
.navbar,
.footer {
    align-self: stretch;
}

/* Main content area */
#main-menu, #game-container {
    margin-top: 20px;
    padding: 20px;
    font-family: 'Courier New', monospace;
}

#game-container {
    background: #2a2a2a;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

#ui {
    margin-bottom: 10px;
}

#stats {
    display: flex;
    gap: 20px;
    font-size: 18px;
    margin-bottom: 10px;
    align-items: center;
}

#stats span {
    background: #3a3a3a;
    padding: 5px 10px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    height: 28px;
    line-height: 1;
}

#stats span span {
    display: inline;
    vertical-align: middle;
}

#inventory {
    display: flex;
    gap: 5px;
    height: 34px;
    font-size: 24px;
    align-items: center;
}

#gameCanvas {
    border: 2px solid #4a4a4a;
    display: block;
    background: #1a1a1a;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#message {
    margin-top: 10px;
    min-height: 24px;
    font-size: 14px;
    color: #ffd700;
    text-align: center;
}

#game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #2a2a2a;
    padding: 40px;
    border-radius: 8px;
    border: 3px solid #ff4444;
    text-align: center;
    z-index: 10;
}

#game-over h2 {
    color: #ff4444;
    margin-bottom: 20px;
    font-size: 32px;
}

#game-over p {
    margin-bottom: 20px;
    font-size: 18px;
}

#game-over button {
    background: #4a4a4a;
    color: #fff;
    border: none;
    padding: 10px 30px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border-radius: 4px;
}

#game-over button:hover {
    background: #5a5a5a;
}

.hidden {
    display: none;
}

#controls {
    margin-top: 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

#controls p {
    margin: 5px 0;
}

/* Character Select Screen */
#character-select {
    text-align: center;
    max-width: 800px;
}

#character-select h1 {
    font-size: 48px;
    margin-bottom: 10px;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#character-select h2 {
    font-size: 24px;
    margin-bottom: 40px;
    color: #ccc;
}

#character-options {
    display: flex;
    gap: 30px;
    justify-content: center;
}

.character-card {
    background: #2a2a2a;
    padding: 30px;
    border-radius: 12px;
    border: 3px solid #4a4a4a;
    width: 250px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.character-card:hover {
    border-color: #6a6a6a;
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.character-icon {
    font-size: 80px;
    margin-bottom: 15px;
}

.character-card h3 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #fff;
}

.character-desc {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 20px;
    min-height: 40px;
}

.character-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.character-stats span {
    background: #3a3a3a;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

.select-btn {
    background: #4CAF50;
    color: #fff;
    border: none;
    padding: 12px 30px;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border-radius: 6px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.select-btn:hover {
    background: #45a049;
}

/* Main Menu Screen */
#main-menu {
    text-align: center;
    max-width: 900px;
}

#main-menu h1 {
    font-size: 64px;
    margin-bottom: 10px;
    color: #ffd700;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
}

.tagline {
    font-size: 18px;
    color: #aaa;
    margin-bottom: 30px;
    font-style: italic;
}

#start-btn {
    background: #4CAF50;
    color: #fff;
    border: none;
    padding: 15px 50px;
    font-size: 24px;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-bottom: 40px;
}

#start-btn:hover {
    background: #45a049;
    transform: scale(1.05);
}

#emoji-legend {
    background: #2a2a2a;
    padding: 30px;
    border-radius: 12px;
    border: 2px solid #4a4a4a;
}

#emoji-legend h3 {
    font-size: 28px;
    color: #ffd700;
    margin-bottom: 25px;
}

.legend-section {
    margin-bottom: 25px;
}

.legend-section:last-child {
    margin-bottom: 0;
}

.legend-section h4 {
    font-size: 20px;
    color: #fff;
    margin-bottom: 15px;
    text-align: left;
    border-bottom: 1px solid #4a4a4a;
    padding-bottom: 8px;
}

.legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    text-align: left;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #3a3a3a;
    padding: 10px 15px;
    border-radius: 6px;
}

.legend-emoji {
    font-size: 28px;
    min-width: 35px;
    text-align: center;
}

.legend-text {
    font-size: 14px;
    color: #ccc;
}
