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

body {
    font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 40px;
    max-width: 1400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease-out;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 3em;
    color: #5a67d8;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.subtitle {
    font-size: 1.3em;
    color: #718096;
    font-weight: 500;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.game-container {
    display: flex;
    gap: 40px;
    width: 100%;
    align-items: flex-start;
    justify-content: center;
}

.chart-wrapper {
    position: relative;
    width: 700px;
    height: 700px;
    background: white;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.center-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    pointer-events: none;
}

.score-label {
    display: block;
    font-size: 1.2em;
    color: #718096;
    margin-bottom: 5px;
}

.score-value {
    font-size: 3em;
    font-weight: bold;
    color: #5a67d8;
}

.score-max {
    font-size: 1.5em;
    color: #a0aec0;
}

#nutrientChart {
    width: 100%;
    height: 100%;
}

.food-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-width: 320px;
    max-height: 700px;
    overflow-y: auto;
}

.food-title {
    text-align: center;
    color: #5a67d8;
    font-size: 1.4em;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e2e8f0;
}

.food-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.food-item:hover {
    transform: translateX(5px) scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
    background: linear-gradient(135deg, #eef2ff, #ffffff);
}

.food-item:active {
    transform: scale(0.98);
}

.food-icon {
    font-size: 3em;
    text-align: center;
    display: block;
}

.food-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1em;
    text-align: center;
}

.food-nutrients {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.nutrient-tag {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 500;
}

.reset-button {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.reset-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.reset-button:active {
    transform: translateY(0);
}

.celebration-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

.celebration-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 30px;
    padding: 60px;
    text-align: center;
    animation: zoomIn 0.5s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes zoomIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-content h2 {
    font-size: 3em;
    color: #667eea;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.modal-content p {
    font-size: 1.5em;
    color: #4a5568;
    margin-bottom: 15px;
}

.modal-button {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    margin-top: 20px;
}

.modal-button:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.6);
}

.food-container::-webkit-scrollbar {
    width: 8px;
}

.food-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.food-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

.food-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a67d8, #68519f);
}

@media (max-width: 1200px) {
    .game-container {
        flex-direction: column;
        align-items: center;
    }

    .chart-wrapper {
        width: 100%;
        max-width: 600px;
        height: 600px;
    }

    .food-container {
        width: 100%;
        max-width: 600px;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        max-height: none;
    }

    .food-title {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }

    .chart-wrapper {
        width: 100%;
        height: 400px;
    }

    .food-container {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .modal-content {
        padding: 40px;
    }

    .food-item {
        padding: 12px;
    }

    .food-icon {
        font-size: 2.5em;
    }

    .food-name {
        font-size: 1em;
    }
}