.collection-grid{
    display:flex;
    flex-wrap:wrap;
    gap:12px;
    align-items:flex-start;
}

/* Shared tile */
.collection{
    position:relative;
    width:100px;
    height:120px;             /* room for bottom input */
    flex:0 0 100px;
    display:flex;
    flex-direction:column;
    justify-content:flex-end;  /* input at bottom */
    align-items:stretch;
    border:1px solid #e5e7eb;
    border-radius:10px;
    background:#fff;           /* color tiles can override via inline bg */
    overflow:hidden;
    cursor:pointer;
    transition:border-color .2s, box-shadow .2s;
}

/* Hide only radios (keep text inputs visible) */
.collection input[type="radio"]{ display:none; }

/* Remove (X) */
.collection .remove-btn{
    position:absolute; top:6px; right:8px;
    background:transparent; border:0; color:#9ca3af;
    font-size:14px; cursor:pointer; line-height:1; z-index:2;
}
.collection .remove-btn:hover{ color:#111827; }

/* Centered preview area (used by fonts; optional for colors) */
.collection .preview{
    flex:1 1 auto;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:32px;            /* preview size for “Abc” */
    line-height:1;
    padding:6px;
    color:#111;
}

/* Bottom name input (shared) */
.collection .name-input{
    width:100%;
    box-sizing:border-box;
    border:0;
    border-top:1px solid rgba(0,0,0,.1);
    padding:6px 8px;
    font-size:12px;
    text-align:center;
    border-radius:0 0 10px 10px;
    background:rgba(255,255,255,.9);
}
.collection .name-input:focus{
    outline:none; background:#fff; border-top-color:#2563eb;
}

/* When selected via JS */
.collection.selected {
    border-color: #2563eb; /* blue */
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

/* Checkmark indicator */
.collection.selected::after {
    content: "✔";
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 10px;
    color: #2563eb;
    background: white;
    border-radius: 50%;
    padding: 2px;
}
