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

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    max-width: 500px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.instruction {
    background-color: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

#instruction-text {
    color: #0c5460;
    font-weight: bold;
}

.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.puzzle-item {
    position: relative;
    aspect-ratio: 1;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.puzzle-item:hover {
    border-color: #007bff;
    transform: scale(1.02);
}

.puzzle-item.selected {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.puzzle-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.puzzle-item::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.puzzle-item.selected::after {
    opacity: 1;
}

.puzzle-item.selected::before {
    content: '✓';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 1;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.verify-button, .refresh-button {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.verify-button {
    background-color: #007bff;
    color: white;
}

.verify-button:hover {
    background-color: #0056b3;
}

.refresh-button {
    background-color: #6c757d;
    color: white;
}

.refresh-button:hover {
    background-color: #545b62;
}

.result {
    text-align: center;
    padding: 15px;
    border-radius: 4px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.result.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.result.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.result.hidden {
    display: none;
}

@media (max-width: 480px) {
    .container {
        padding: 20px;
    }
    
    .puzzle-grid {
        gap: 5px;
    }
    
    .controls {
        flex-direction: column;
    }
}

/* styles.css に追加 */
@keyframes pulse {
    0% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}

.lazy-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease-in-out;
}

.lazy-image.loaded {
    display: block !important;
    opacity: 1;
}

.lazy-loading {
    animation: pulse 1.5s ease-in-out infinite alternate;
}