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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#game-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.screen {
    width: 100%;
    padding: 20px;
}

.hidden {
    display: none;
}

#menu-screen {
    background: rgba(0, 0, 0, 0.8);
    border: 4px solid #fff;
    border-radius: 10px;
    color: #fff;
    text-align: center;
    padding: 40px;
}

#game-logo {
    max-width: 100%;
    height: auto;
    margin-bottom: 30px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: drop-shadow(3px 3px 0px #000);
}

#customization-panel {
    max-width: 600px;
    margin: 0 auto;
}

#customization-panel h2 {
    font-size: 1.5em;
    margin-bottom: 20px;
    color: #ffd700;
}

.upload-section {
    margin: 30px 0;
}

.upload-button {
    display: inline-block;
    padding: 15px 30px;
    background: #4CAF50;
    color: white;
    border: 3px solid #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s;
    text-transform: uppercase;
}

.upload-button:hover {
    background: #45a049;
    transform: scale(1.05);
}

.preview-container {
    margin: 20px auto;
    width: 200px;
    height: 200px;
    border: 3px solid #fff;
    border-radius: 8px;
    overflow: hidden;
    background: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.status-message {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
}

.action-button {
    padding: 15px 40px;
    margin: 10px;
    background: #ff6b6b;
    color: white;
    border: 3px solid #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    text-transform: uppercase;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
}

.action-button:hover:not(:disabled) {
    background: #ee5a5a;
    transform: scale(1.05);
}

.action-button:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

.api-key-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 2px solid #555;
}

.api-key-status {
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #ffd700;
}

.debug-indicator {
    background: #ffd700;
    color: #000;
    padding: 8px 12px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    border: 2px solid #000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.debug-indicator-game {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10000;
    background: #ffd700;
    color: #000;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid #000;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    font-family: 'Courier New', monospace;
}

.clear-button {
    padding: 8px 20px;
    margin: 5px;
    background: #ff6b6b;
    color: white;
    border: 2px solid #fff;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: bold;
    text-transform: uppercase;
    font-family: 'Courier New', monospace;
    transition: all 0.3s;
}

.clear-button:hover {
    background: #ee5a5a;
    transform: scale(1.05);
}

.clear-button:active {
    transform: scale(0.95);
}

#game-screen {
    position: relative;
    width: 1024px;
    height: 1024px;
    margin: 0 auto;
}

#phaser-game {
    border: 4px solid #fff;
    border-radius: 8px;
    background: #000;
    margin: 0 auto;
    display: block;
}

#game-ui {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 2px 2px 0px #000;
    z-index: 1000;
    display: flex;
    gap: 20px;
    align-items: center;
}

.ui-button {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid #fff;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 1em;
    font-weight: bold;
}

.ui-button:hover {
    background: rgba(0, 0, 0, 0.9);
}

/* Retro 16-bit styling */
@keyframes pixelate {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.pixelated {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* Loader */
.loader {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 10px;
}

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