main.merge-main {
    padding: 2rem 1rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#merge-app {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

/* Header */

#merge-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#spawn-btn {
    background: var(--fg);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.1rem;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.15s;
}

#spawn-btn:hover:not(:disabled) { opacity: 0.75; }

#spawn-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

#best-label {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 500;
}

/* Board */

#merge-board {
    position: relative;
    width: 100%;
    aspect-ratio: 6 / 5;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 0.4rem;
    background: #f0f0f0;
    border-radius: 10px;
    padding: 0.4rem;
    box-sizing: border-box;
}

.merge-cell {
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.2rem, 5vw, 1.6rem);
    touch-action: none;
    user-select: none;
}

.merge-cell.filled {
    cursor: grab;
    background: #fff;
}

.merge-cell.dragging-source {
    opacity: 0.35;
}

#merge-message {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(250, 250, 250, 0);
    color: var(--fg);
    font-weight: 600;
    font-size: 0.95rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s;
}

#merge-message.show {
    opacity: 1;
    background: rgba(250, 250, 250, 0.9);
}

#drag-ghost {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    pointer-events: none;
    z-index: 1000;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

/* Collection */

#collection {
    width: 100%;
}

#collection-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.5rem;
}

#collection-strip {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0.35rem;
}

.collection-slot {
    aspect-ratio: 1;
    background: #f0f0f0;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(0.8rem, 3vw, 1.1rem);
    color: var(--muted);
}

.collection-slot.unlocked {
    background: #fff;
    border: 1px solid var(--border);
}

/* Reset */

#reset-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.8rem;
    color: var(--muted);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

#reset-btn:hover { color: var(--fg); }

@media (max-width: 480px) {
    #collection-strip { grid-template-columns: repeat(5, 1fr); }
}
