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

body {
    font-family: 'Comic Sans MS', 'Arial', sans-serif;
    background: linear-gradient(135deg, #a8e6cf 0%, #ffd3b6 100%);
    min-height: 100vh;
    padding: 20px;
}

.app-header {
    text-align: center;
    margin-bottom: 20px;
    color: #2c3e50;
}

.app-title {
    font-size: 32px;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.app-subtitle {
    font-size: 16px;
    opacity: 0.8;
}

.game-container {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    border-radius: 30px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    max-width: 800px;
    margin: 0 auto;
}

.screen {
    background: #1a1a2e;
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    border: 3px solid #16213e;
    position: relative;
    min-height: 400px;
}

.character-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 250px;
    position: relative;
}

.character {
    width: 150px;
    height: 180px;
    position: relative;
    transition: all 0.5s ease;
}

.character-body {
    width: 100px;
    height: 120px;
    background: linear-gradient(145deg, #ffb6b9, #ffa0a4);
    border-radius: 50% 50% 40% 40%;
    margin: 0 auto;
    position: relative;
    border: 3px solid #ff8a8d;
}

.character-head {
    width: 80px;
    height: 80px;
    background: linear-gradient(145deg, #ffe5b4, #ffd89b);
    border-radius: 50%;
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    border: 3px solid #ffcc80;
}

.character-eyes {
    display: flex;
    justify-content: space-around;
    width: 50px;
    margin: 25px auto 0;
}

.eye {
    width: 12px;
    height: 12px;
    background: #333;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.character-mouth {
    width: 30px;
    height: 15px;
    border: 2px solid #333;
    border-top: none;
    border-radius: 0 0 30px 30px;
    margin: 8px auto 0;
    transition: all 0.3s ease;
}

.character-arms {
    display: flex;
    justify-content: space-between;
    width: 140px;
    position: absolute;
    top: 40px;
    left: -20px;
}

.arm {
    width: 25px;
    height: 60px;
    background: linear-gradient(145deg, #ffe5b4, #ffd89b);
    border-radius: 30px;
    border: 2px solid #ffcc80;
}

.arm.left {
    transform: rotate(-20deg);
}

.arm.right {
    transform: rotate(20deg);
}

.character-legs {
    display: flex;
    justify-content: space-around;
    width: 60px;
    margin: -5px auto 0;
}

.leg {
    width: 22px;
    height: 50px;
    background: linear-gradient(145deg, #6c9bd1, #5a8ac6);
    border-radius: 0 0 15px 15px;
    border: 2px solid #4a7ab6;
}

.health-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 40px;
    transition: all 0.3s ease;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.stat-card {
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    border: 2px solid rgba(255,255,255,0.2);
}

.stat-label {
    color: #bbb;
    font-size: 12px;
    margin-bottom: 5px;
}

.stat-value {
    color: white;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-bar {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
}

.stat-fill {
    height: 100%;
    border-radius: 4px;
    transition: all 0.5s ease;
}

.stat-fill.blood-sugar {
    background: linear-gradient(90deg, #e74c3c, #c0392b);
}

.stat-fill.energy {
    background: linear-gradient(90deg, #f39c12, #e67e22);
}

.stat-fill.health {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.stat-fill.happiness {
    background: linear-gradient(90deg, #9b59b6, #8e44ad);
}

.blood-sugar-status {
    text-align: center;
    padding: 10px;
    border-radius: 10px;
    margin: 10px 0;
    font-weight: bold;
    font-size: 14px;
}

.status-normal {
    background: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
    border: 2px solid #2ecc71;
}

.status-high {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
    border: 2px solid #e74c3c;
}

.status-low {
    background: rgba(241, 196, 15, 0.3);
    color: #f1c40f;
    border: 2px solid #f1c40f;
}

.food-selection {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 15px;
    margin-top: 15px;
}

.food-selection h3 {
    color: #4ecdc4;
    margin-bottom: 15px;
    text-align: center;
}

.food-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}

.food-item {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.food-item:hover {
    transform: translateY(-5px);
    background: rgba(78, 205, 196, 0.2);
    border-color: #4ecdc4;
}

.food-item.good {
    border-color: rgba(46, 204, 113, 0.5);
}

.food-item.bad {
    border-color: rgba(231, 76, 60, 0.5);
}

.food-item.neutral {
    border-color: rgba(241, 196, 15, 0.5);
}

.food-icon {
    font-size: 32px;
    margin-bottom: 5px;
}

.food-name {
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.message-box {
    background: rgba(78, 205, 196, 0.2);
    border: 2px solid #4ecdc4;
    border-radius: 15px;
    padding: 15px;
    margin: 15px 0;
    color: white;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.message-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #4ecdc4;
}

.message-text {
    font-size: 13px;
    line-height: 1.4;
}

.education-panel {
    background: rgba(52, 152, 219, 0.2);
    border: 2px solid #3498db;
    border-radius: 15px;
    padding: 15px;
    margin-top: 15px;
    color: white;
}

.education-panel h4 {
    color: #3498db;
    margin-bottom: 10px;
}

.education-panel p {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 8px;
}

.controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.btn {
    background: linear-gradient(145deg, #4ecdc4, #45b7b8);
    border: none;
    border-radius: 12px;
    padding: 12px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.4);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.6);
}

.btn.danger {
    background: linear-gradient(145deg, #e74c3c, #c0392b);
}

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

.character.sick {
    animation: shake 0.5s ease-in-out;
}

.character.happy {
    animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@media (max-width: 768px) {
    .food-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.warning-icon {
    color: #f1c40f;
    font-size: 20px;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(145deg, #2c3e50, #34495e);
    border-radius: 20px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(231, 76, 60, 0.8);
    border: none;
    color: white;
    font-size: 24px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.modal-close:hover {
    background: #e74c3c;
    transform: rotate(90deg);
}

.modal-content h2 {
    color: #4ecdc4;
    margin-bottom: 20px;
    font-size: 28px;
    padding-right: 40px;
}

.modal-body {
    color: white;
}

.modal-intro {
    font-size: 16px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(78, 205, 196, 0.2);
    border-radius: 10px;
    border-left: 4px solid #4ecdc4;
}

.modal-section {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.modal-section h3 {
    color: #4ecdc4;
    margin-bottom: 10px;
    font-size: 18px;
}

.modal-section ul {
    list-style: none;
    padding-left: 0;
}

.modal-section ul li {
    padding: 5px 0;
    padding-left: 25px;
    position: relative;
}

.modal-section ul li:before {
    content: "•";
    position: absolute;
    left: 10px;
    color: #4ecdc4;
}

.modal-section.highlight {
    background: rgba(241, 196, 15, 0.1);
    border-left: 4px solid #f1c40f;
}

.modal-section.highlight h3 {
    color: #f1c40f;
}

.modal-section.goal {
    background: rgba(46, 204, 113, 0.1);
    border-left: 4px solid #2ecc71;
}

.modal-section.goal h3 {
    color: #2ecc71;
}

.modal-section p {
    line-height: 1.6;
    margin: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Custom scrollbar for modal */
.modal-content::-webkit-scrollbar {
    width: 8px;
}

.modal-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(78, 205, 196, 0.5);
    border-radius: 4px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(78, 205, 196, 0.8);
}

@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        max-width: 95%;
    }
    
    .modal-content h2 {
        font-size: 24px;
    }
    
    .modal-section h3 {
        font-size: 16px;
    }
}
