:root {
    --player-a-color: #e67e22;
    --player-a-border: #d35400;
    --player-b-color: #e91e63;
    --player-b-border: #c2185b;
}

body {
    background-color: #2c3e50;
    background-image: url('https://coresg-normal.trae.ai/api/ide/v1/text_to_image?prompt=Cute%20puzzle%20game%20background%2C%20minimalist%20art%20style%2C%20pastel%20colors%2C%20maze%20pattern%2C%20orange%20and%20pink%20theme%2C%20cozy%20atmosphere%2C%20no%20text&image_size=landscape_16_9');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.game-container {
    text-align: center;
    background-color: rgba(52, 73, 94, 0.9); /* More transparent to see background */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    position: relative;
    width: 600px; /* Fixed width to accommodate modal */
    min-height: 600px;
    backdrop-filter: blur(5px);
}

/* Modal Styles */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(44, 62, 80, 0.85); /* More transparent */
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    z-index: 100;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: rgba(236, 240, 241, 0.95);
    color: #2c3e50;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    width: 80%;
    max-width: 500px;
    border: 1px solid #bdc3c7;
    text-align: center;
}

.modal-content h2 {
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 30px;
    color: #e67e22;
    text-shadow: 1px 1px 0px #d35400;
}

.color-selection-group {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
}

.player-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.color-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s;
}

.color-option:hover {
    transform: scale(1.1);
}

.color-option.selected {
    border-color: #2c3e50;
    transform: scale(1.2);
    box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.start-btn {
    background-color: #3498db;
    font-size: 18px;
    padding: 12px 30px;
    margin-top: 10px;
}

.start-btn:hover {
    background-color: #2980b9;
}

/* Game Board */
#game-board {
    display: grid;
    grid-template-columns: repeat(10, 40px);
    grid-template-rows: repeat(10, 40px);
    gap: 2px;
    background-color: #7f8c8d;
    padding: 5px;
    border-radius: 5px;
    margin: 20px auto;
}

.cell {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 20px;
}

.wall {
    background-color: #95a5a6;
    border: 2px solid #7f8c8d;
}

.floor {
    background-color: #bdc3c7;
}

/* Character Faces */
.face {
    position: relative;
    width: 100%;
    height: 100%;
}

.eye {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #333;
    border-radius: 50%;
    top: 12px;
}

.eye.left {
    left: 8px;
}

.eye.right {
    right: 8px;
}

.eye.wink {
    height: 2px;
    top: 14px;
    width: 8px;
    border-radius: 2px;
}

.mouth {
    position: absolute;
    width: 12px;
    height: 4px;
    background: #333;
    border-radius: 0 0 4px 4px;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
}

.mouth.smile {
    height: 6px;
    border-radius: 0 0 6px 6px;
}

.player-a {
    background-color: var(--player-a-color);
    box-shadow: inset -2px -2px 10px rgba(0,0,0,0.2), inset 2px 2px 10px rgba(255,255,255,0.3);
    border: 2px solid var(--player-a-border);
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    transition: border-radius 0.5s ease-in-out;
    animation: blobA 3s infinite ease-in-out alternate;
}

.player-b {
    background-color: var(--player-b-color);
    box-shadow: inset -2px -2px 10px rgba(0,0,0,0.2), inset 2px 2px 10px rgba(255,255,255,0.3);
    border: 2px solid var(--player-b-border);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    transition: border-radius 0.5s ease-in-out;
    animation: blobB 4s infinite ease-in-out alternate;
}

@keyframes blobA {
    0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    100% { border-radius: 50% 50% 50% 50% / 50% 50% 50% 50%; }
}

@keyframes blobB {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    100% { border-radius: 70% 30% 30% 70% / 70% 30% 30% 70%; }
}

.goal {
    background-color: #f1c40f;
    border: 2px dashed #f39c12;
}

.controls {
    margin-top: 20px;
}

button {
    background-color: #2ecc71;
    border: none;
    color: white;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #27ae60;
}

.back-btn {
    display: inline-block;
    background-color: #e74c3c;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 4px;
    margin-left: 10px;
    transition: background-color 0.3s;
}

.back-btn:hover {
    background-color: #c0392b;
}

.win-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(46, 204, 113, 0.95);
    color: white;
    padding: 30px 50px;
    border-radius: 15px;
    font-size: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    border: 2px solid #27ae60;
    text-align: center;
    z-index: 200;
    animation: popIn 0.3s ease-out;
    min-width: 300px;
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
