* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

#game-container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    max-width: 1200px;
    width: 100%;
    min-height: 700px;
}

.screen {
    display: none;
    height: 100%;
}

.screen.active {
    display: block;
}

/* Ensure game screen is completely hidden during selection */
#selection-screen.active ~ #game-screen {
    display: none !important;
}

/* Selection Screen */
#selection-screen {
    padding: 30px;
    text-align: center;
}

.logo-container {
    margin-bottom: 20px;
    text-align: center;
}

.main-logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    object-fit: contain;
}

#selection-screen p {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #666;
}

.character-options {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-top: 30px;
}

.character-option {
    cursor: pointer;
    padding: 20px;
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.character-option:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.2);
}

.character-option.selected {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.character-option img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 10px;
}

.character-option h3 {
    font-size: 1.3em;
    color: #333;
}

/* Game Screen */
#game-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

/* Top UI */
.top-ui {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#pet-name {
    font-size: 1.8em;
    margin: 0;
}

.health-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.health-label {
    font-weight: bold;
    font-size: 1.1em;
}

.health-bar {
    width: 200px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.health-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* Main Game Area */
.game-area {
    display: flex;
    flex: 1;
    min-height: 500px;
}

/* Left UI */
.left-ui {
    width: 250px;
    background: #f8f9fa;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-panel, .status-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.stat-panel h3, .status-panel h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.stat {
    margin-bottom: 15px;
}

.stat-label {
    display: block;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}

.stat-bar {
    height: 12px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #ffa500);
    transition: width 0.3s ease;
    border-radius: 6px;
}

.status-message {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    font-style: italic;
    color: #666;
    text-align: center;
}

/* Central Pet Area */
.pet-area {
    flex: 1;
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.pet-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('mat.png');
    background-size: 25%;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.85;
    z-index: 1;
    pointer-events: none;
}

#pet-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.moving-pet {
    width: 120px;
    height: 120px;
    object-fit: contain;
    position: absolute;
    transition: all 0.5s ease;
    cursor: pointer;
}

.action-display {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 25px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1em;
    text-align: center;
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.action-display.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Speech Bubble */
.speech-bubble {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    max-width: 300px;
    max-height: 60vh;
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
    transition: all 0.5s ease;
    z-index: 10;
    overflow-y: auto;
    overflow-x: hidden;
}

.speech-bubble.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

.bubble-content p {
    margin-bottom: 15px;
    color: #333;
    line-height: 1.5;
    font-size: 1em;
}

.bubble-btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .bubble-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
    }



/* Right UI */
.right-ui {
    width: 250px;
    background: #f8f9fa;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.actions-panel, .info-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.actions-panel h3, .info-panel h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.info-panel p {
    color: #666;
    line-height: 1.5;
}

/* Footer Link */
.footer-link {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.footer-link a {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-link a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease;
}

.modal-content h3 {
    color: #ff6b6b;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.modal-content p {
    margin-bottom: 20px;
    color: #666;
    font-size: 1.1em;
}

.death-content {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
}

.death-content h3 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.death-content p {
    color: #ecf0f1;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.death-image {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin: 0 auto 20px;
    display: block;
    filter: grayscale(50%);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes petMove {
    0% { transform: translate(0, 0); }
    25% { transform: translate(100px, 50px); }
    50% { transform: translate(50px, -50px); }
    75% { transform: translate(-100px, 30px); }
    100% { transform: translate(0, 0); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    #game-container {
        max-width: 900px;
        min-height: 600px;
    }
    
    .left-ui, .right-ui {
        width: 200px;
    }
    
    .moving-pet {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 768px) {
    #game-container {
        margin: 15px;
        border-radius: 15px;
        min-height: 500px;
    }
    
    .game-area {
        flex-direction: column;
    }
    
    .left-ui, .right-ui {
        width: 100%;
        padding: 15px;
    }
    
    .left-ui {
        order: 1;
    }
    
    .pet-area {
        order: 2;
        min-height: 300px;
    }
    
    .right-ui {
        order: 3;
    }
    
    .top-ui {
        padding: 10px 15px;
    }
    
    #pet-name {
        font-size: 1.4em;
    }
    
    .health-bar {
        width: 150px;
    }
    
    .moving-pet {
        width: 80px;
        height: 80px;
    }
    
    .actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .action-btn {
        flex: 1;
        min-width: 80px;
        padding: 10px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    #game-container {
        margin: 10px;
        min-height: 450px;
    }
    
    .top-ui {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .health-bar {
        width: 200px;
    }
    
    .moving-pet {
        width: 70px;
        height: 70px;
    }
    
    .action-btn {
        font-size: 0.8em;
        padding: 8px;
    }
    
    .action-display {
        font-size: 0.9em;
        padding: 10px 20px;
    }
    
    .speech-bubble {
        max-width: 250px;
        max-height: 50vh;
        padding: 15px;
        top: 10px;
    }
    
    .bubble-content p {
        font-size: 0.9em;
        line-height: 1.4;
    }
    
    .bubble-btn {
        padding: 6px 12px;
        font-size: 0.8em;
    }
    
    .speech-bubble {
        max-width: 200px;
        max-height: 40vh;
        padding: 12px;
        top: 5px;
    }
    
    .bubble-content p {
        font-size: 0.8em;
        line-height: 1.3;
    }
    
    .bubble-btn {
        padding: 5px 10px;
        font-size: 0.7em;
    }
    
} 