/* General Reset and Retro Font */
body {
    background-color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    font-family: 'Press Start 2P', monospace; /* Use a retro pixel font for best effect */
    color: #ff0073; /* Neon pink/red inspired by the image */
    text-shadow: 0 0 5px rgba(255, 0, 115, 0.7);
}

/* --- Arcade Cabinet Structure --- */

.arcade-cabinet {
    background-color: #000;
    border: 15px solid #111;
    border-radius: 10px;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
    padding: 20px;
    width: 650px; /* Adjust size as needed */
    box-sizing: border-box;
}

.screen-frame {
    background-color: #555;
    border: 5px solid #222;
    border-radius: 5px;
    padding: 10px;
}

.screen {
    background-color: #111;
    border: 3px solid #333;
    height: 500px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* --- Screen Elements --- */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-bottom: 20px;
}

.player-tag {
    background-color: #ff0073;
    color: #000;
    padding: 2px 5px;
    border-radius: 2px;
}

.press-start {
    font-size: 10px;
    color: #555;
}

/* --- Character Grid --- */

.character-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
    position: relative;
    padding: 10px;
    margin: auto;
    width: 90%;
}

.character-icon {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    border: 3px solid transparent;
    transition: border-color 0.1s;
}

.character-icon img {
    width: 100%;
    height: auto;
    display: block;
    /* Crucial for the retro pixel look */
    image-rendering: pixelated; 
    filter: brightness(0.7); /* Dim the unselected ones */
    transition: filter 0.2s;
}

.character-icon.selected {
    border-color: #ff0073;
}

.character-icon.selected img {
    filter: brightness(1); /* Brighten the selected one */
}

/* Selection Pointer (P1 icon) */
.pointer {
    position: absolute;
    top: 0;
    left: 0;
    background-color: #ff5533;
    color: white;
    padding: 3px 5px;
    font-size: 10px;
    z-index: 10;
    transition: transform 0.2s ease-out; /* Animate the move */
    border: 2px solid #000;
    box-shadow: 0 0 5px rgba(255, 85, 51, 0.8);
}

/* --- Footer --- */

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-top: 20px;
}

.flame-heart {
    font-size: 24px;
    margin-right: 5px;
}

.status-message {
    font-size: 10px;
    color: #ff0073;
    text-align: right;
}

/* --- Control Panel --- */

.control-panel {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 20px 0;
    background-color: #111;
    border-top: 5px solid #333;
}

.button {
    width: 120px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 0 #000;
    position: relative;
    transition: transform 0.05s;
    user-select: none;
    text-align: center;
}

.button.red {
    background-color: #a00000;
    border: 3px solid #ff0000;
    color: white;
    text-shadow: 1px 1px #000;
}

.button.blue {
    background-color: #0000a0;
    border: 3px solid #0000ff;
    color: white;
    text-shadow: 1px 1px #000;
}

/* Pressed state for buttons */
.button:active, .button.pressed {
    transform: translateY(3px);
    box-shadow: 0 2px 0 #000;
}

/* --- Joystick --- */

.joystick-base {
    width: 100px;
    height: 100px;
    background-color: #333;
    border: 5px solid #000;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.joystick-handle {
    width: 50px;
    height: 50px;
    background-color: #ff0000; /* Red ball */
    border-radius: 50%;
    position: absolute;
    box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.5), 0 0 10px rgba(255, 0, 0, 0.7);
    transition: transform 0.1s ease-out; /* Animation for the tilt */
}

/* Joystick Tilt Animations */
.joystick-handle.lean-left {
    transform: translateX(-10px) rotate(-10deg);
}

.joystick-handle.lean-right {
    transform: translateX(10px) rotate(10deg);
}