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

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#game-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    max-width: 800px;
    width: 100%;
}

#header {
    background: linear-gradient(135deg, #7c4dff 0%, #536dfe 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#header h1 {
    font-family: 'Fredoka One', cursive;
    color: white;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

#score-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
}

#game-area {
    position: relative;
    width: 100%;
    height: 500px;
    background: linear-gradient(180deg, #fff8e1 0%, #ffecb3 100%);
    border-bottom: 3px solid #e0e0e0;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.character {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    transition: opacity 0.3s;
    cursor: pointer;
}

.character:hover .character-icon {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.character span {
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 5px;
    background: white;
    padding: 2px 8px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.character-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.girl-icon {
    background: linear-gradient(135deg, #f48fb1 0%, #ec407a 100%);
    border: 3px solid #c2185b;
}

.girl-icon::after {
    content: "";
    width: 30px;
    height: 30px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C9.24 2 7 4.24 7 7c0 2.76 2.24 5 5 5s5-2.24 5-5c0-2.76-2.24-5-5-5zm0 8c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.boy-icon {
    background: linear-gradient(135deg, #64b5f6 0%, #1e88e5 100%);
    border: 3px solid #1565c0;
}

.boy-icon::after {
    content: "";
    width: 30px;
    height: 30px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C9.24 2 7 4.24 7 7c0 2.76 2.24 5 5 5s5-2.24 5-5c0-2.76-2.24-5-5-5zm0 8c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E") center/contain no-repeat;
}

#girl {
    top: 30px;
    right: 50px;
}

#boy {
    top: 30px;
    left: 50px;
}

.toilet {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
}

.toilet img {
    width: 70px;
    height: 70px;
}

.toilet span {
    font-size: 0.8rem;
    font-weight: bold;
    margin-top: 5px;
    padding: 2px 8px;
    border-radius: 10px;
}

#girl-toilet {
    bottom: 30px;
    left: 50px;
}

#girl-toilet span {
    background: #f48fb1;
    color: white;
}

#boy-toilet {
    bottom: 30px;
    right: 50px;
}

#boy-toilet span {
    background: #64b5f6;
    color: white;
}

#controls {
    padding: 20px;
    background: #fafafa;
}

#instructions {
    text-align: center;
    margin-bottom: 15px;
}

#instruction-text {
    color: #616161;
    font-size: 1rem;
}

#buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

button {
    font-family: 'Fredoka One', cursive;
    font-size: 1.1rem;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
}

#start-btn {
    background: linear-gradient(135deg, #81c784 0%, #4caf50 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

#start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5);
}

#start-btn:disabled {
    background: #bdbdbd;
    box-shadow: none;
    cursor: not-allowed;
}

#timer-display {
    text-align: center;
    margin-top: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #7c4dff;
}

#timer-value {
    font-family: 'Fredoka One', cursive;
    font-size: 2rem;
}

/* Game states */
.game-over #instruction-text {
    color: #f44336;
    font-weight: bold;
}

.game-won #instruction-text {
    color: #4caf50;
    font-weight: bold;
}

/* Path drawing indicator */
.drawing-girl #game-canvas {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='8' fill='%23ec407a' stroke='white' stroke-width='2'/%3E%3C/svg%3E") 12 12, crosshair;
}

.drawing-boy #game-canvas {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='8' fill='%231e88e5' stroke='white' stroke-width='2'/%3E%3C/svg%3E") 12 12, crosshair;
}

/* Animation for characters moving */
.character.moving {
    transition: none;
}

/* Collision effect */
.collision {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Victory animation */
.victory {
    animation: bounce 0.5s ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
