* {
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    background: #f8f9fa;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
}

header .hint {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}

.store-section {
    margin-bottom: 2.5rem;
}

.store-section h2 {
    font-size: 1.25rem;
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #dee2e6;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.image-card {
    cursor: pointer;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s, transform 0.2s;
}

.image-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.image-wrapper {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    max-width: 250px;
    max-height: 250px;
    display: block;
}

.purchased-badge {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: #198754;
    color: white;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    padding: 0.4rem;
}

.image-card[data-purchased="1"] .image-wrapper img {
    opacity: 0.7;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal[hidden] {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 360px;
}

.modal-content p {
    margin: 0 0 1.25rem;
    font-size: 1.05rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
}

.btn-cancel {
    background: #e9ecef;
    color: #495057;
}

.btn-cancel:hover {
    background: #dee2e6;
}

.btn-confirm {
    background: #198754;
    color: white;
}

.btn-confirm:hover {
    background: #157347;
}
